mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-12-25 00:18:51 -05:00
Temporary nav drawer fixes
This commit is contained in:
parent
fc786280fd
commit
fd29d27e61
@ -34,13 +34,13 @@ import org.sufficientlysecure.keychain.ui.util.SubtleAttentionSeeker;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
|
||||
public class DecryptActivity extends DrawerActivity {
|
||||
public class DecryptActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
activateDrawerNavigation(savedInstanceState);
|
||||
// activateDrawerNavigation(savedInstanceState);
|
||||
|
||||
View actionFile = findViewById(R.id.decrypt_files);
|
||||
View actionFromClipboard = findViewById(R.id.decrypt_from_clipboard);
|
||||
|
@ -14,7 +14,7 @@ import org.sufficientlysecure.keychain.operations.results.SignEncryptResult;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public abstract class EncryptActivity extends NavDrawerActivity {
|
||||
public abstract class EncryptActivity extends BaseActivity {
|
||||
|
||||
public static final int REQUEST_CODE_PASSPHRASE = 0x00008001;
|
||||
public static final int REQUEST_CODE_NFC = 0x00008002;
|
||||
|
@ -325,10 +325,10 @@ public class EncryptFilesActivity extends EncryptActivity implements EncryptActi
|
||||
mUseArmor = Preferences.getPreferences(this).getDefaultAsciiArmor();
|
||||
}
|
||||
|
||||
// @Override
|
||||
// protected void initLayout() {
|
||||
// setContentView(R.layout.encrypt_files_activity);
|
||||
// }
|
||||
@Override
|
||||
protected void initLayout() {
|
||||
setContentView(R.layout.encrypt_files_activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
|
@ -303,10 +303,10 @@ public class EncryptTextActivity extends EncryptActivity implements EncryptActiv
|
||||
updateModeFragment();
|
||||
}
|
||||
|
||||
// @Override
|
||||
// protected void initLayout() {
|
||||
// setContentView(R.layout.encrypt_text_activity);
|
||||
// }
|
||||
@Override
|
||||
protected void initLayout() {
|
||||
setContentView(R.layout.encrypt_text_activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
|
@ -19,9 +19,12 @@ package org.sufficientlysecure.keychain.ui;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
||||
import org.sufficientlysecure.keychain.R;
|
||||
import org.sufficientlysecure.keychain.remote.ui.AppsListActivity;
|
||||
import org.sufficientlysecure.keychain.remote.ui.AppsListFragment;
|
||||
|
||||
import it.neokree.materialnavigationdrawer.MaterialNavigationDrawer;
|
||||
|
||||
@ -29,19 +32,25 @@ public abstract class NavDrawerActivity extends MaterialNavigationDrawer {
|
||||
|
||||
@Override
|
||||
public void init(Bundle savedInstanceState) {
|
||||
// don't open drawer on first run
|
||||
disableLearningPattern();
|
||||
|
||||
// addMultiPaneSupport();
|
||||
|
||||
// set the header image
|
||||
this.setDrawerHeaderImage(R.drawable.mat2);
|
||||
// create and set the header
|
||||
View view = LayoutInflater.from(this).inflate(R.layout.custom_drawer, null);
|
||||
setDrawerHeaderCustom(view);
|
||||
|
||||
// create sections
|
||||
this.addSection(newSection(getString(R.string.app_name), R.drawable.ic_vpn_key_black_24dp, new KeyListFragment()));
|
||||
addSection(newSection(getString(R.string.title_keys), R.drawable.ic_vpn_key_black_24dp, new KeyListFragment()));
|
||||
|
||||
this.addSection(newSection(getString(R.string.title_encrypt_text), R.drawable.ic_lock_outline_black_24dp, new Intent(this, EncryptTextActivity.class)));
|
||||
this.addSection(newSection(getString(R.string.title_encrypt_files), R.drawable.ic_lock_outline_black_24dp, new Intent(this, EncryptFilesActivity.class)));
|
||||
this.addSection(newSection(getString(R.string.title_decrypt), R.drawable.ic_lock_open_black_24dp, new Intent(this, DecryptActivity.class)));
|
||||
this.addSection(newSection(getString(R.string.title_api_registered_apps), R.drawable.ic_apps_black_24dp, new Intent(this, AppsListActivity.class)));
|
||||
addSection(newSection(getString(R.string.title_encrypt_text), R.drawable.ic_lock_outline_black_24dp, new Intent(this, EncryptTextActivity.class)));
|
||||
addSection(newSection(getString(R.string.title_encrypt_files), R.drawable.ic_lock_outline_black_24dp, new Intent(this, EncryptFilesActivity.class)));
|
||||
addSection(newSection(getString(R.string.title_decrypt), R.drawable.ic_lock_open_black_24dp, new Intent(this, DecryptActivity.class)));
|
||||
addSection(newSection(getString(R.string.title_api_registered_apps), R.drawable.ic_apps_black_24dp, new AppsListFragment()));
|
||||
|
||||
// create bottom section
|
||||
this.addBottomSection(newSection(getString(R.string.menu_preferences), R.drawable.ic_settings_black_24dp, new Intent(this, SettingsActivity.class)));
|
||||
addBottomSection(newSection(getString(R.string.menu_preferences), R.drawable.ic_settings_black_24dp, new Intent(this, SettingsActivity.class)));
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 12 KiB |
16
OpenKeychain/src/main/res/layout/custom_drawer.xml
Normal file
16
OpenKeychain/src/main/res/layout/custom_drawer.xml
Normal file
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:background="@color/colorPrimary">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/white"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
</LinearLayout>
|
@ -41,6 +41,7 @@
|
||||
<string name="title_create_key">"Create Key"</string>
|
||||
<string name="title_exchange_keys">"Exchange Keys"</string>
|
||||
<string name="title_advanced_key_info">"Advanced Key Info"</string>
|
||||
<string name="title_keys">"Keys"</string>
|
||||
|
||||
<!-- section -->
|
||||
<string name="section_user_ids">"Identities"</string>
|
||||
|
@ -12,8 +12,16 @@
|
||||
<item name="colorAccent">@color/accent</item>
|
||||
|
||||
<!-- Navigation Drawer library -->
|
||||
<item name="drawerType">@integer/DRAWERTYPE_IMAGE</item>
|
||||
<item name="multipaneSupport">true</item>
|
||||
<item name="drawerType">@integer/DRAWERTYPE_CUSTOM</item>
|
||||
<item name="theme">@style/ThemeOverlay.AppCompat.Dark.ActionBar</item>
|
||||
<item name="popupTheme">@style/Base.V21.Theme.AppCompat.Light.Dialog</item>
|
||||
<item name="drawerColor">#fafafa</item>
|
||||
<item name="singleAccount">false</item>
|
||||
<item name="sectionStyle">@style/MaterialSectionTheme.Light</item>
|
||||
<item name="subheaderStyle">@style/MaterialSubheaderTheme.Light</item>
|
||||
<item name="multipaneSupport">false</item>
|
||||
<item name="rippleBackport">false</item>
|
||||
<item name="uniqueToolbarColor">false</item>
|
||||
</style>
|
||||
|
||||
<!-- http://android-developers.blogspot.de/2014/10/appcompat-v21-material-design-for-pre.html -->
|
||||
|
Loading…
Reference in New Issue
Block a user