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

Android: do not hide ActionBar + fixes

parent 183680d7
No related branches found
No related tags found
No related merge requests found
...@@ -264,7 +264,7 @@ public class MainActivity extends Activity{ ...@@ -264,7 +264,7 @@ public class MainActivity extends Activity{
notifyEndComputing("The computing had to stop because your device ran out of memory"); notifyEndComputing("The computing had to stop because your device ran out of memory");
_notify = false; _notify = false;
} }
else if(level == Activity.TRIM_MEMORY_COMPLETE) { else if(level == Activity.TRIM_MEMORY_MODERATE) {
notifyComputing("Computing in progress - low memory", true); notifyComputing("Computing in progress - low memory", true);
} }
super.onTrimMemory(level); super.onTrimMemory(level);
......
...@@ -171,7 +171,7 @@ public class ModelFragment extends Fragment{ ...@@ -171,7 +171,7 @@ public class ModelFragment extends Fragment{
public void showControlBar() { public void showControlBar() {
if(getActivity() == null) return; if(getActivity() == null) return;
this.postDelay(); this.postDelay();
getActivity().getActionBar().show(); //getActivity().getActionBar().show();
Animation bottomUp = AnimationUtils.loadAnimation(getActivity(), android.R.anim.fade_in); Animation bottomUp = AnimationUtils.loadAnimation(getActivity(), android.R.anim.fade_in);
_controlBarLayout.setVisibility(View.VISIBLE); _controlBarLayout.setVisibility(View.VISIBLE);
_controlBarLayout.startAnimation(bottomUp); _controlBarLayout.startAnimation(bottomUp);
...@@ -179,7 +179,7 @@ public class ModelFragment extends Fragment{ ...@@ -179,7 +179,7 @@ public class ModelFragment extends Fragment{
public void hideControlBar() { public void hideControlBar() {
if(getActivity() == null) return; if(getActivity() == null) return;
_hideDelay.removeCallbacks(hideControlsRunnable); _hideDelay.removeCallbacks(hideControlsRunnable);
getActivity().getActionBar().hide(); //getActivity().getActionBar().hide();
Animation bottomDown = AnimationUtils.loadAnimation(getActivity(), android.R.anim.fade_out); Animation bottomDown = AnimationUtils.loadAnimation(getActivity(), android.R.anim.fade_out);
_controlBarLayout.startAnimation(bottomDown); _controlBarLayout.startAnimation(bottomDown);
_controlBarLayout.setVisibility(View.INVISIBLE); _controlBarLayout.setVisibility(View.INVISIBLE);
......
...@@ -10,6 +10,7 @@ import org.xmlpull.v1.XmlPullParserException; ...@@ -10,6 +10,7 @@ import org.xmlpull.v1.XmlPullParserException;
import android.app.Activity; import android.app.Activity;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.content.ActivityNotFoundException;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.database.Cursor; import android.database.Cursor;
...@@ -24,6 +25,7 @@ import android.view.View; ...@@ -24,6 +25,7 @@ import android.view.View;
import android.widget.AdapterView; import android.widget.AdapterView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.ListView; import android.widget.ListView;
import android.widget.Toast;
public class ModelList extends Activity { public class ModelList extends Activity {
...@@ -113,8 +115,13 @@ public class ModelList extends Activity { ...@@ -113,8 +115,13 @@ public class ModelList extends Activity {
Intent fileBrowserIntent = new Intent(); Intent fileBrowserIntent = new Intent();
fileBrowserIntent.setAction(Intent.ACTION_GET_CONTENT); fileBrowserIntent.setAction(Intent.ACTION_GET_CONTENT);
fileBrowserIntent.setType("file/*"); fileBrowserIntent.setType("file/*");
try {
startActivityForResult(fileBrowserIntent, 1); startActivityForResult(fileBrowserIntent, 1);
} }
catch(ActivityNotFoundException e) {
Toast.makeText(this, "No application found on your device to open the files.", Toast.LENGTH_LONG).show();
}
}
return super.onMenuItemSelected(featureId, item); return super.onMenuItemSelected(featureId, item);
} }
......
...@@ -131,7 +131,7 @@ public class OptionsDisplayFragment extends Fragment{ ...@@ -131,7 +131,7 @@ public class OptionsDisplayFragment extends Fragment{
if(mListener != null) mListener.OnModelOptionsChanged(); 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.WRAP_CONTENT));
button.setBackgroundColor(Color.TRANSPARENT); button.setBackgroundColor(Color.TRANSPARENT);
button.setGravity(Gravity.RIGHT); button.setGravity(Gravity.RIGHT);
layout.addView(checkbox); layout.addView(checkbox);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment