From a15e060e254e390dad4ce8351c8e3ef12b62e59c Mon Sep 17 00:00:00 2001 From: Gregor Santner Date: Sun, 31 Jul 2016 15:16:22 +0200 Subject: [PATCH] Allow turning off toolbar intellihide --- .travis.yml | 2 +- CHANGELOG.md | 6 +- app/build.gradle | 8 +-- app/src/main/AndroidManifest.xml | 3 + .../activity/MainActivity.java | 11 ++- .../diaspora_android/data/AppSettings.java | 5 ++ app/src/main/res/values-de/strings.xml | 2 + app/src/main/res/values/strings.xml | 2 + app/src/main/res/xml/preferences.xml | 67 ++++++++++--------- 9 files changed, 68 insertions(+), 38 deletions(-) diff --git a/.travis.yml b/.travis.yml index 64b00d3f..1df6e7b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ android: - tools - tools # TODO https://github.com/travis-ci/travis-ci/issues/6193 - platform-tools - - build-tools-24.0.0 + - build-tools-24.0.1 - android-24 - extra-android-m2repository before_cache: diff --git a/CHANGELOG.md b/CHANGELOG.md index ce5ac3bf..5bf1a087 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ -# v0.1.4 (in progress) +# v0.1.4 (2016-07-31) - by @vanitasvitae, @gsantner, @di72nn +- Allow turning off toolbar intellihide +- Handle links from browseable intent filter #38 +- Intent filter for pods +- Update license infos of source files - Update license infos of source files - Localization lint; Translation; Readme - Add an option to clear WebView cache diff --git a/app/build.gradle b/app/build.gradle index 5768da63..0ed49b3c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -3,7 +3,7 @@ apply plugin: 'android-apt' android { compileSdkVersion 24 - buildToolsVersion "24.0.0" + buildToolsVersion "24.0.1" useLibrary 'org.apache.http.legacy' defaultConfig { @@ -34,9 +34,9 @@ dependencies { testCompile 'junit:junit:4.12' // Android standard libs - compile 'com.android.support:appcompat-v7:24.0.0' - compile 'com.android.support:design:24.0.0' - compile 'com.android.support:support-v4:24.0.0' + compile 'com.android.support:appcompat-v7:24.1.1' + compile 'com.android.support:design:24.1.1' + compile 'com.android.support:support-v4:24.1.1' // More libraries compile 'com.getbase:floatingactionbutton:1.9.1' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index a06a8126..d83592a3 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -137,6 +137,7 @@ + @@ -144,6 +145,7 @@ + @@ -196,6 +198,7 @@ + diff --git a/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java b/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java index 32de3c96..739c54b6 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java @@ -39,6 +39,7 @@ import android.os.Handler; import android.os.StrictMode; import android.provider.MediaStore; import android.support.annotation.NonNull; +import android.support.design.widget.AppBarLayout; import android.support.design.widget.CollapsingToolbarLayout; import android.support.design.widget.NavigationView; import android.support.design.widget.Snackbar; @@ -208,6 +209,7 @@ public class MainActivity extends AppCompatActivity .setAction(android.R.string.yes, new View.OnClickListener() { @Override public void onClick(View view) { + finish(); moveTaskToBack(true); } }); @@ -245,6 +247,11 @@ public class MainActivity extends AppCompatActivity } } + if (!appSettings.isIntellihideToolbars()) { + AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) toolbarTopCollapsing.getLayoutParams(); + params.setScrollFlags(0); // clear all scroll flags + } + handleIntent(getIntent()); } @@ -584,6 +591,7 @@ public class MainActivity extends AppCompatActivity case R.id.action_exit: { moveTaskToBack(true); + finish(); return true; } @@ -991,8 +999,7 @@ public class MainActivity extends AppCompatActivity break; } - DrawerLayout drawer = (DrawerLayout) findViewById(R.id.main__layout); - if (drawer != null) drawer.closeDrawer(GravityCompat.START); + navDrawer.closeDrawer(GravityCompat.START); return true; } diff --git a/app/src/main/java/com/github/dfa/diaspora_android/data/AppSettings.java b/app/src/main/java/com/github/dfa/diaspora_android/data/AppSettings.java index 097b23df..fd7c74a9 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/data/AppSettings.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/data/AppSettings.java @@ -94,6 +94,7 @@ public class AppSettings { public static final String PROXY_WAS_ENABLED = "wasProxyEnabled"; public static final String PROXY_HOST = "pref_key_proxy_host"; public static final String PROXY_PORT = "pref_key_proxy_port"; + public static final String UI_INTELLIHIDE_TOOLBARS ="pref_key_intellihide_toolbars"; } @@ -231,4 +232,8 @@ public class AppSettings { return 0; } } + + public boolean isIntellihideToolbars(){ + return prefApp.getBoolean(PREF.UI_INTELLIHIDE_TOOLBARS, true); + } } diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 658819f7..0cc381ef 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -160,5 +160,7 @@ along with this program. If not, see http://www.gnu.org/licenses.<br> <br Alle Tags WebView Cache leeren Cache leeren + Toolbars intelligent verstecken + Obere und untere Toolbar verstecken während des Scrollens von Inhalt diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 343a6a10..4d8f9ef3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -175,4 +175,6 @@ Warning: Could not set network proxy… All tags + Hide top and bottom toolbars automatically while scrolling + Intellihide Toolbars diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index 2f4d3d50..d59a5fd7 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -2,76 +2,83 @@ + android:key="pref_key_category_visuals" + android:title="@string/pref_category_visuals"> + android:entryValues="@array/pref_entry_values_font_size" + android:key="pref_key_font_size" + android:summary="%s" + android:title="@string/pref_title_font_size"/> + + + + android:key="pref_key_category_pod_settings" + android:title="@string/pref_category_pod_settings"> + android:summary="@string/pref_desc_personal_settings" + android:title="@string/pref_title_personal_settings"> + android:summary="@string/pref_desc_manage_tags" + android:title="@string/pref_title_manage_tags"> + android:summary="@string/pref_desc_manage_contacts" + android:title="@string/pref_title_manage_contacts"> + android:summary="@string/pref_desc_change_account" + android:title="@string/pref_title_change_account"> + android:key="pref_key_category_network" + android:title="@string/pref_category_network"> + android:title="@string/pref_title_load_images"/> + android:summary="@string/pref_desc_clear_cache" + android:title="@string/pref_title_clear_cache"> + android:title="@string/pref_title_proxy_enabled"/> + android:title="@string/pref_title_proxy_host"/> + android:inputType="number" + android:key="pref_key_proxy_port" + android:title="@string/pref_title_proxy_port"/> \ No newline at end of file