diff options
-rw-r--r-- | AndroidManifest.xml | 6 | ||||
-rw-r--r-- | project.properties | 2 | ||||
-rw-r--r-- | src/org/fox/ttcomics/ComicFragment.java | 2 | ||||
-rw-r--r-- | src/org/fox/ttcomics/ComicPager.java | 7 | ||||
-rw-r--r-- | src/org/fox/ttcomics/CommonActivity.java | 45 | ||||
-rw-r--r-- | src/org/fox/ttcomics/ViewComicActivity.java | 13 |
6 files changed, 60 insertions, 15 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 521ce2e..c916a26 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,11 +1,11 @@ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.fox.ttcomics"
- android:versionCode="40"
- android:versionName="1.7" >
+ android:versionCode="41"
+ android:versionName="1.8" >
<uses-sdk
android:minSdkVersion="8"
- android:targetSdkVersion="17" />
+ android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
diff --git a/project.properties b/project.properties index e166ee0..31c82dd 100644 --- a/project.properties +++ b/project.properties @@ -11,5 +11,5 @@ #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt # Project target. -target=android-17 +target=android-19 android.library.reference.1=../ActionBarSherlock/actionbarsherlock diff --git a/src/org/fox/ttcomics/ComicFragment.java b/src/org/fox/ttcomics/ComicFragment.java index 43bf77f..1523726 100644 --- a/src/org/fox/ttcomics/ComicFragment.java +++ b/src/org/fox/ttcomics/ComicFragment.java @@ -319,7 +319,9 @@ public class ComicFragment extends Fragment implements GestureDetector.OnDoubleT if (bar.isShowing()) {
bar.hide();
+ m_activity.hideSystemUiIfNecessary();
} else {
+ m_activity.showSystemUiIfNecessary();
bar.show();
}
}
diff --git a/src/org/fox/ttcomics/ComicPager.java b/src/org/fox/ttcomics/ComicPager.java index 55b71d1..260194c 100644 --- a/src/org/fox/ttcomics/ComicPager.java +++ b/src/org/fox/ttcomics/ComicPager.java @@ -115,6 +115,7 @@ public class ComicPager extends Fragment { m_activity.onComicSelected(m_fileName, position);
m_activity.setProgress(Math.round(((float)position / (float)(m_archive.getCount()-1)) * 10000));
+ m_activity.hideSystemUiIfNecessary();
} catch (IOException e) {
m_activity.toast(R.string.error_could_not_open_comic_archive);
@@ -129,10 +130,8 @@ public class ComicPager extends Fragment { m_activity.onComicSelected(m_fileName, position);
m_activity.setProgress(Math.round(((float)position / (float)(m_archive.getCount()-1)) * 10000));
-
- if (!CommonActivity.isCompatMode() && m_prefs.getBoolean("dim_status_bar", false)) {
- view.setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
- }
+
+ m_activity.hideSystemUiIfNecessary();
}
public void onPageScrolled(int arg0, float arg1, int arg2) {
diff --git a/src/org/fox/ttcomics/CommonActivity.java b/src/org/fox/ttcomics/CommonActivity.java index 9069949..4df6de7 100644 --- a/src/org/fox/ttcomics/CommonActivity.java +++ b/src/org/fox/ttcomics/CommonActivity.java @@ -21,6 +21,8 @@ import android.preference.PreferenceManager; import android.provider.BaseColumns;
import android.util.Log;
import android.view.Display;
+import android.view.View;
+import android.view.WindowManager;
import android.widget.Toast;
import com.actionbarsherlock.app.SherlockFragmentActivity;
@@ -531,4 +533,47 @@ public class CommonActivity extends SherlockFragmentActivity { c.close();
}
+ public void showSystemUiIfNecessary() {
+ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
+ getWindow().getDecorView().setSystemUiVisibility(
+ View.SYSTEM_UI_FLAG_LAYOUT_STABLE
+ | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
+ | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
+ }
+ }
+
+ public void hideSystemUiIfNecessary() {
+ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
+ if (m_prefs.getBoolean("use_full_screen", false)) {
+
+ getWindow().getDecorView().setSystemUiVisibility(
+ View.SYSTEM_UI_FLAG_LAYOUT_STABLE
+ | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
+ | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+ | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
+ | View.SYSTEM_UI_FLAG_FULLSCREEN
+ | View.SYSTEM_UI_FLAG_IMMERSIVE);
+
+ } else if (m_prefs.getBoolean("dim_status_bar", false)) {
+ getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
+ }
+
+ } else {
+
+ if (!isCompatMode()) {
+ if (m_prefs.getBoolean("dim_status_bar", false)) {
+ getWindow().getDecorView().setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
+ }
+ }
+
+ if (m_prefs.getBoolean("use_full_screen", false)) {
+ getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
+ WindowManager.LayoutParams.FLAG_FULLSCREEN);
+ getSupportActionBar().hide();
+ }
+
+ }
+
+
+ }
}
diff --git a/src/org/fox/ttcomics/ViewComicActivity.java b/src/org/fox/ttcomics/ViewComicActivity.java index e38d54d..3b8f8c9 100644 --- a/src/org/fox/ttcomics/ViewComicActivity.java +++ b/src/org/fox/ttcomics/ViewComicActivity.java @@ -64,13 +64,12 @@ public class ViewComicActivity extends CommonActivity { setTitle(new File(m_fileName).getName());
- if (m_prefs.getBoolean("use_full_screen", false)) {
- getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
- WindowManager.LayoutParams.FLAG_FULLSCREEN);
-
- getSupportActionBar().hide();
- }
-
+ /* if (m_prefs.getBoolean("use_full_screen", false)) {
+ //getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
+ // WindowManager.LayoutParams.FLAG_FULLSCREEN);
+
+ //getSupportActionBar().hide();
+ } */
}
@Override
|