1
0
mirror of https://github.com/TwidereProject/Twidere-Android synced 2025-02-17 04:00:48 +01:00

added option to show drawer toggle, close #478

This commit is contained in:
Mariotaku Lee 2016-03-23 14:46:12 +08:00
parent 33eecaf954
commit a95fce11e8
4 changed files with 18 additions and 0 deletions

View File

@ -326,4 +326,6 @@ public interface SharedPreferenceConstants {
String KEY_EMOJI_SUPPORT = "emoji_support";
@Preference(type = BOOLEAN, hasDefault = true, defaultBoolean = true)
String KEY_NEW_DOCUMENT_API = "new_document_api";
@Preference(type = BOOLEAN, hasDefault = true, defaultBoolean = false)
String KEY_DRAWER_TOGGLE = "drawer_toggle";
}

View File

@ -400,6 +400,12 @@ public class HomeActivity extends BaseActivity implements OnClickListener, OnPag
mTabIndicator.setDisplayBadge(mPreferences.getBoolean(KEY_UNREAD_COUNT, true));
mTabIndicator.updateAppearance();
if (mPreferences.getBoolean(KEY_DRAWER_TOGGLE)) {
mDrawerToggleButton.setVisibility(View.VISIBLE);
} else {
mDrawerToggleButton.setVisibility(View.GONE);
}
mHomeContent.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
@Override
public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {

View File

@ -770,4 +770,5 @@
<string name="provider_fanfou">Fanfou</string>
<string name="new_document_api">New Document API</string>
<string name="new_document_api_summary">Open profile and media in new task</string>
<string name="drawer_toggle">Drawer toggle</string>
</resources>

View File

@ -22,4 +22,13 @@
android:value="@xml/preferences_scrapyard" />
</Preference>
<SwitchPreferenceCompat
android:defaultValue="false"
android:key="drawer_toggle"
android:title="@string/drawer_toggle">
<extra
android:name="notify_change"
android:value="true"/>
</SwitchPreferenceCompat>
</PreferenceScreen>