Skip to content
Snippets Groups Projects
Commit 77bd3bd8 authored by Maxime Graulich's avatar Maxime Graulich
Browse files

Android: uncheck Post-processing checkbox (when compute)

parent d4cb22a9
No related branches found
No related tags found
No related merge requests found
...@@ -204,6 +204,9 @@ public class MainActivity extends Activity{ ...@@ -204,6 +204,9 @@ public class MainActivity extends Activity{
@Override @Override
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
NotificationManager mNotificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
mNotificationManager.cancel(1337);
_notify = false; _notify = false;
} }
......
...@@ -94,7 +94,18 @@ public class OptionsDisplayFragment extends Fragment{ ...@@ -94,7 +94,18 @@ public class OptionsDisplayFragment extends Fragment{
public void refresh() { public void refresh() {
if(_gmsh == null) return; if(_gmsh == null) return;
String[] PViews = _gmsh.getPView(); String[] PViews = _gmsh.getPView();
for(int i=_listView.itemsCountInSection("Result"); i < PViews.length;i++){ for(int i=0; i<_listView.itemsCountInSection("Result"); i++) {
View v = (View)_listView.getItemAtPosition(7+i);
if(!v.getClass().equals(LinearLayout.class)) continue;
for(int j=0; j<((LinearLayout)v).getChildCount(); j++) {
View sv = ((LinearLayout)v).getChildAt(j);
if(sv.getClass().equals(CheckBox.class)){
String[] infos = PViews[i].split("\n");
((CheckBox)sv).setChecked(infos[2].equals("1"));
}
}
}
for(int i=_listView.itemsCountInSection("Result"); i < PViews.length;i++) {
String[] infos = PViews[i].split("\n"); // name / IntervalsType (1=Iso 2=Continous 3=Discrete 4=Numeric) String[] infos = PViews[i].split("\n"); // name / IntervalsType (1=Iso 2=Continous 3=Discrete 4=Numeric)
final int myID = i; final int myID = i;
LinearLayout layout = new LinearLayout(_listView.getContext()); LinearLayout layout = new LinearLayout(_listView.getContext());
...@@ -117,6 +128,7 @@ public class OptionsDisplayFragment extends Fragment{ ...@@ -117,6 +128,7 @@ public class OptionsDisplayFragment extends Fragment{
intent.putExtra("Gmsh", (Parcelable)_gmsh); intent.putExtra("Gmsh", (Parcelable)_gmsh);
intent.putExtra("PView", myID); intent.putExtra("PView", myID);
startActivity(intent); startActivity(intent);
if(mListener != null) mListener.OnModelOptionsChanged();
} }
}); });
button.setLayoutParams(new AbsListView.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); button.setLayoutParams(new AbsListView.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
......
...@@ -42,12 +42,16 @@ public class OptionsFragment extends Fragment{ ...@@ -42,12 +42,16 @@ public class OptionsFragment extends Fragment{
LinearLayout rootView = (LinearLayout)inflater.inflate(R.layout.fragment_options, container, false); LinearLayout rootView = (LinearLayout)inflater.inflate(R.layout.fragment_options, container, false);
_optionModelFragment = OptionsModelFragment.newInstance(_gmsh); _optionModelFragment = OptionsModelFragment.newInstance(_gmsh);
_optionModelFragment.setOnModelOptionsChangedListener(new OptionsModelFragment.OnModelOptionsChangedListener() { _optionModelFragment.setOnModelOptionsChangedListener(new OptionsModelFragment.OnModelOptionsChangedListener() {
public void OnModelOptionsChanged() { public void OnModelOptionsChanged() {
if(mListener != null) mListener.OnOptionsChanged(); if(mListener != null) mListener.OnOptionsChanged();
} }
}); });
_optionDisplayFragment = OptionsDisplayFragment.newInstance(_gmsh); _optionDisplayFragment = OptionsDisplayFragment.newInstance(_gmsh);
_optionDisplayFragment.setOnModelOptionsChangedListener(new OptionsDisplayFragment.OnModelOptionsChangedListener() {
public void OnModelOptionsChanged() {
if(mListener != null) mListener.OnOptionsChanged();
}
});
final Button optionModel = (Button) rootView.findViewById(R.id.goto_options_model); final Button optionModel = (Button) rootView.findViewById(R.id.goto_options_model);
final Button optionDisplay = (Button) rootView.findViewById(R.id.goto_options_display); final Button optionDisplay = (Button) rootView.findViewById(R.id.goto_options_display);
if(_viewN == 0) { if(_viewN == 0) {
......
...@@ -116,7 +116,19 @@ public class SeparatedListView extends ListView{ ...@@ -116,7 +116,19 @@ public class SeparatedListView extends ListView{
} }
//@Override //@Override
public Object getItem(int position) { public Object getItem(int position) {
// UNUSED Auto-generated method stub int section = -1,
lastPosition = -1;
while(lastPosition<position){
int itemsCount = sections.get(section+1).getItemsCount();
if(lastPosition+1 == position)// this is a section
return titles.get(section+1);
else if(lastPosition+1+itemsCount >= position){ // the view is in this section
if(section<0) return sections.get(section+1).getItem(position-1);
return sections.get(section+1).getItem(position-lastPosition-2);
}
lastPosition+= 1 + itemsCount;
section++;
}
return null; return null;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment