mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-27 19:22:14 -05:00
Drawer nav method cleanup
This commit is contained in:
parent
30978384af
commit
59f32c4fca
@ -30,7 +30,7 @@ public class AppsListActivity extends DrawerActivity {
|
|||||||
|
|
||||||
setContentView(R.layout.api_apps_list_activity);
|
setContentView(R.layout.api_apps_list_activity);
|
||||||
|
|
||||||
setupDrawerNavigation(savedInstanceState);
|
activateDrawerNavigation(savedInstanceState);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ public class DecryptActivity extends DrawerActivity {
|
|||||||
|
|
||||||
initView();
|
initView();
|
||||||
|
|
||||||
setupDrawerNavigation(savedInstanceState);
|
activateDrawerNavigation(savedInstanceState);
|
||||||
|
|
||||||
// Handle intent actions, maybe changes the bundles
|
// Handle intent actions, maybe changes the bundles
|
||||||
handleActions(getIntent());
|
handleActions(getIntent());
|
||||||
|
@ -56,7 +56,11 @@ public class DrawerActivity extends ActionBarActivity {
|
|||||||
private static final int MENU_ID_PREFERENCE = 222;
|
private static final int MENU_ID_PREFERENCE = 222;
|
||||||
private static final int MENU_ID_HELP = 223;
|
private static final int MENU_ID_HELP = 223;
|
||||||
|
|
||||||
protected void setupDrawerNavigation(Bundle savedInstanceState) {
|
protected void deactivateDrawerNavigation() {
|
||||||
|
((DrawerLayout) findViewById(R.id.drawer_layout)).setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void activateDrawerNavigation(Bundle savedInstanceState) {
|
||||||
mDrawerTitle = getString(R.string.app_name);
|
mDrawerTitle = getString(R.string.app_name);
|
||||||
mDrawerLayout = (FixedDrawerLayout) findViewById(R.id.drawer_layout);
|
mDrawerLayout = (FixedDrawerLayout) findViewById(R.id.drawer_layout);
|
||||||
mDrawerList = (ListView) findViewById(R.id.left_drawer);
|
mDrawerList = (ListView) findViewById(R.id.left_drawer);
|
||||||
|
@ -26,7 +26,6 @@ import android.os.Handler;
|
|||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.os.Messenger;
|
import android.os.Messenger;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
import android.support.v4.widget.DrawerLayout;
|
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
|
||||||
@ -428,10 +427,10 @@ public class EncryptFileActivity extends DrawerActivity implements EncryptActivi
|
|||||||
// if called with an intent action, do not init drawer navigation
|
// if called with an intent action, do not init drawer navigation
|
||||||
if (ACTION_ENCRYPT_FILE.equals(getIntent().getAction())) {
|
if (ACTION_ENCRYPT_FILE.equals(getIntent().getAction())) {
|
||||||
// lock drawer
|
// lock drawer
|
||||||
((DrawerLayout) findViewById(R.id.drawer_layout)).setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
|
deactivateDrawerNavigation();
|
||||||
// TODO: back button to key?
|
// TODO: back button to key?
|
||||||
} else {
|
} else {
|
||||||
setupDrawerNavigation(savedInstanceState);
|
activateDrawerNavigation(savedInstanceState);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle intent actions
|
// Handle intent actions
|
||||||
|
@ -26,7 +26,6 @@ import android.os.Handler;
|
|||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.os.Messenger;
|
import android.os.Messenger;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
import android.support.v4.widget.DrawerLayout;
|
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
|
||||||
@ -396,10 +395,10 @@ public class EncryptTextActivity extends DrawerActivity implements EncryptActivi
|
|||||||
// if called with an intent action, do not init drawer navigation
|
// if called with an intent action, do not init drawer navigation
|
||||||
if (ACTION_ENCRYPT_TEXT.equals(getIntent().getAction())) {
|
if (ACTION_ENCRYPT_TEXT.equals(getIntent().getAction())) {
|
||||||
// lock drawer
|
// lock drawer
|
||||||
((DrawerLayout) findViewById(R.id.drawer_layout)).setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
|
deactivateDrawerNavigation();
|
||||||
// TODO: back button to key?
|
// TODO: back button to key?
|
||||||
} else {
|
} else {
|
||||||
setupDrawerNavigation(savedInstanceState);
|
activateDrawerNavigation(savedInstanceState);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle intent actions
|
// Handle intent actions
|
||||||
|
@ -19,15 +19,12 @@
|
|||||||
package org.sufficientlysecure.keychain.ui;
|
package org.sufficientlysecure.keychain.ui;
|
||||||
|
|
||||||
import android.app.ProgressDialog;
|
import android.app.ProgressDialog;
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.os.Messenger;
|
import android.os.Messenger;
|
||||||
import android.util.AttributeSet;
|
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
@ -65,7 +62,7 @@ public class KeyListActivity extends DrawerActivity {
|
|||||||
setContentView(R.layout.key_list_activity);
|
setContentView(R.layout.key_list_activity);
|
||||||
|
|
||||||
// now setup navigation drawer in DrawerActivity...
|
// now setup navigation drawer in DrawerActivity...
|
||||||
setupDrawerNavigation(savedInstanceState);
|
activateDrawerNavigation(savedInstanceState);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user