Allow turning off toolbar intellihide

This commit is contained in:
Gregor Santner 2016-07-31 15:16:22 +02:00
parent 1d2a428df6
commit a15e060e25
9 changed files with 68 additions and 38 deletions

View File

@ -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:

View File

@ -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

View File

@ -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'

View File

@ -137,6 +137,7 @@
<data android:host="diaspora.subsignal.org" android:scheme="https" />
<data android:host="diaspora.trash-talk.de" android:scheme="https" />
<data android:host="diaspora.undernet.uy" android:scheme="https" />
<data android:host="diaspora.unixcorn.org" android:scheme="https" />
<data android:host="diasporausa.com" android:scheme="https" />
<data android:host="diasp.org" android:scheme="https" />
<data android:host="espora.social" android:scheme="https" />
@ -144,6 +145,7 @@
<data android:host="flokk.no" android:scheme="https" />
<data android:host="framasphere.org" android:scheme="https" />
<data android:host="freehuman.fr" android:scheme="https" />
<data android:host="home.enslaver.net" android:scheme="https" />
<data android:host="idoru.pl" android:scheme="https" />
<data android:host="iliketoast.net" android:scheme="https" />
<data android:host="joindiaspora.com" android:scheme="https" />
@ -196,6 +198,7 @@
<data android:host="pod.ros-it.ch" android:scheme="https" />
<data android:host="pod.sccn.club" android:scheme="https" />
<data android:host="pod.sertelon.fr" android:scheme="https" />
<data android:host="pod.skisso.com" android:scheme="https" />
<data android:host="pod.storel.li" android:scheme="https" />
<data android:host="pod.tchncs.de" android:scheme="https" />
<data android:host="pod.thomasdalichow.de" android:scheme="https" />

View File

@ -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;
}

View File

@ -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);
}
}

View File

@ -160,5 +160,7 @@ along with this program. If not, see http://www.gnu.org/licenses.&lt;br> &lt;br
<string name="all_tags">Alle Tags</string>
<string name="pref_desc_clear_cache">WebView Cache leeren</string>
<string name="pref_title_clear_cache">Cache leeren</string>
<string name="pref_title_intellihide_toolbars">Toolbars intelligent verstecken</string>
<string name="pref_desc_intellihide_toolbars">Obere und untere Toolbar verstecken während des Scrollens von Inhalt</string>
</resources>

View File

@ -175,4 +175,6 @@
<string name="toast_set_proxy_failed">Warning: Could not set network proxy…</string>
<string name="all_tags">All tags</string>
<string name="pref_desc_intellihide_toolbars">Hide top and bottom toolbars automatically while scrolling</string>
<string name="pref_title_intellihide_toolbars">Intellihide Toolbars</string>
</resources>

View File

@ -2,76 +2,83 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Appearance -->
<PreferenceCategory
android:title="@string/pref_category_visuals"
android:key="pref_key_category_visuals">
android:key="pref_key_category_visuals"
android:title="@string/pref_category_visuals">
<ListPreference
android:title="@string/pref_title_font_size"
android:key="pref_key_font_size"
android:dialogTitle="@string/pref_title_font_size"
android:summary="%s"
android:entries="@array/pref_entries_font_size"
android:entryValues="@array/pref_entry_values_font_size" />
android:entryValues="@array/pref_entry_values_font_size"
android:key="pref_key_font_size"
android:summary="%s"
android:title="@string/pref_title_font_size"/>
<CheckBoxPreference
android:defaultValue="true"
android:key="pref_key_intellihide_toolbars"
android:summary="@string/pref_desc_intellihide_toolbars"
android:title="@string/pref_title_intellihide_toolbars"/>
</PreferenceCategory>
<!-- Diaspora Pod Settings -->
<PreferenceCategory
android:title="@string/pref_category_pod_settings"
android:key="pref_key_category_pod_settings">
android:key="pref_key_category_pod_settings"
android:title="@string/pref_category_pod_settings">
<Preference
android:title="@string/pref_title_personal_settings"
android:key="pref_key_personal_settings"
android:summary="@string/pref_desc_personal_settings">
android:summary="@string/pref_desc_personal_settings"
android:title="@string/pref_title_personal_settings">
</Preference>
<Preference
android:title="@string/pref_title_manage_tags"
android:key="pref_key_manage_tags"
android:summary="@string/pref_desc_manage_tags">
android:summary="@string/pref_desc_manage_tags"
android:title="@string/pref_title_manage_tags">
</Preference>
<Preference
android:title="@string/pref_title_manage_contacts"
android:key="pref_key_manage_contacts"
android:summary="@string/pref_desc_manage_contacts">
android:summary="@string/pref_desc_manage_contacts"
android:title="@string/pref_title_manage_contacts">
</Preference>
<Preference
android:title="@string/pref_title_change_account"
android:key="pref_key_change_account"
android:summary="@string/pref_desc_change_account">
android:summary="@string/pref_desc_change_account"
android:title="@string/pref_title_change_account">
</Preference>
</PreferenceCategory>
<!-- Networking -->
<PreferenceCategory
android:title="@string/pref_category_network"
android:key="pref_key_category_network">
android:key="pref_key_category_network"
android:title="@string/pref_category_network">
<CheckBoxPreference
android:title="@string/pref_title_load_images"
android:defaultValue="true"
android:key="pref_key_load_images"
android:summary="@string/pref_desc_load_images"
android:defaultValue="true" />
android:title="@string/pref_title_load_images"/>
<Preference
android:title="@string/pref_title_clear_cache"
android:key="pref_key_clear_cache"
android:summary="@string/pref_desc_clear_cache">
android:summary="@string/pref_desc_clear_cache"
android:title="@string/pref_title_clear_cache">
</Preference>
<CheckBoxPreference
android:title="@string/pref_title_proxy_enabled"
android:defaultValue="false"
android:key="pref_key_proxy_enabled"
android:summary="@string/pref_desc_proxy_enabled"
android:defaultValue="false" />
android:title="@string/pref_title_proxy_enabled"/>
<EditTextPreference
android:title="@string/pref_title_proxy_host"
android:dependency="pref_key_proxy_enabled"
android:inputType="textNoSuggestions"
android:key="pref_key_proxy_host"
android:dependency="pref_key_proxy_enabled"
android:inputType="textNoSuggestions"/>
android:title="@string/pref_title_proxy_host"/>
<EditTextPreference
android:title="@string/pref_title_proxy_port"
android:key="pref_key_proxy_port"
android:dependency="pref_key_proxy_enabled"
android:inputType="number" />
android:inputType="number"
android:key="pref_key_proxy_port"
android:title="@string/pref_title_proxy_port"/>
</PreferenceCategory>
</PreferenceScreen>