Material Design Drawer
@ -7,3 +7,10 @@ python copy OpenKeychain navigation white check 24
|
|||||||
python copy OpenKeychain navigation black expand_less 24
|
python copy OpenKeychain navigation black expand_less 24
|
||||||
python copy OpenKeychain navigation black expand_more 24
|
python copy OpenKeychain navigation black expand_more 24
|
||||||
python copy OpenKeychain navigation white refresh 24
|
python copy OpenKeychain navigation white refresh 24
|
||||||
|
|
||||||
|
# navigation drawer sections
|
||||||
|
python copy OpenKeychain communication black vpn_key 24
|
||||||
|
python copy OpenKeychain action black lock_open 24
|
||||||
|
python copy OpenKeychain action black lock_outline 24
|
||||||
|
python copy OpenKeychain navigation black apps 24
|
||||||
|
python copy OpenKeychain action black settings 24
|
@ -26,6 +26,7 @@ dependencies {
|
|||||||
compile 'com.journeyapps:zxing-android-integration:2.0.1@aar'
|
compile 'com.journeyapps:zxing-android-integration:2.0.1@aar'
|
||||||
compile 'com.google.zxing:core:3.0.1'
|
compile 'com.google.zxing:core:3.0.1'
|
||||||
compile 'com.jpardogo.materialtabstrip:library:1.0.8'
|
compile 'com.jpardogo.materialtabstrip:library:1.0.8'
|
||||||
|
compile 'it.neokree:MaterialNavigationDrawer:1.3'
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
@ -21,19 +21,27 @@ import android.os.Bundle;
|
|||||||
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
import org.sufficientlysecure.keychain.ui.DrawerActivity;
|
import org.sufficientlysecure.keychain.ui.DrawerActivity;
|
||||||
|
import org.sufficientlysecure.keychain.ui.NavDrawerActivity;
|
||||||
|
|
||||||
public class AppsListActivity extends DrawerActivity {
|
public class AppsListActivity extends NavDrawerActivity {
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
// super.onCreate(savedInstanceState);
|
||||||
|
//
|
||||||
|
// activateDrawerNavigation(savedInstanceState);
|
||||||
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
public void init(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.init(savedInstanceState);
|
||||||
|
|
||||||
activateDrawerNavigation(savedInstanceState);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void initLayout() {
|
|
||||||
setContentView(R.layout.api_apps_list_activity);
|
setContentView(R.layout.api_apps_list_activity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// protected void initLayout() {
|
||||||
|
// setContentView(R.layout.api_apps_list_activity);
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ import org.sufficientlysecure.keychain.operations.results.SignEncryptResult;
|
|||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
public abstract class EncryptActivity extends DrawerActivity {
|
public abstract class EncryptActivity extends NavDrawerActivity {
|
||||||
|
|
||||||
public static final int REQUEST_CODE_PASSPHRASE = 0x00008001;
|
public static final int REQUEST_CODE_PASSPHRASE = 0x00008001;
|
||||||
public static final int REQUEST_CODE_NFC = 0x00008002;
|
public static final int REQUEST_CODE_NFC = 0x00008002;
|
||||||
|
@ -312,10 +312,10 @@ public class EncryptFilesActivity extends EncryptActivity implements EncryptActi
|
|||||||
// 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_DATA.equals(getIntent().getAction())) {
|
if (ACTION_ENCRYPT_DATA.equals(getIntent().getAction())) {
|
||||||
// lock drawer
|
// lock drawer
|
||||||
deactivateDrawerNavigation();
|
// deactivateDrawerNavigation();
|
||||||
// TODO: back button to key?
|
// TODO: back button to key?
|
||||||
} else {
|
} else {
|
||||||
activateDrawerNavigation(savedInstanceState);
|
// activateDrawerNavigation(savedInstanceState);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle intent actions
|
// Handle intent actions
|
||||||
@ -325,10 +325,10 @@ public class EncryptFilesActivity extends EncryptActivity implements EncryptActi
|
|||||||
mUseArmor = Preferences.getPreferences(this).getDefaultAsciiArmor();
|
mUseArmor = Preferences.getPreferences(this).getDefaultAsciiArmor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
protected void initLayout() {
|
// protected void initLayout() {
|
||||||
setContentView(R.layout.encrypt_files_activity);
|
// setContentView(R.layout.encrypt_files_activity);
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
@ -292,10 +292,10 @@ public class EncryptTextActivity extends EncryptActivity implements EncryptActiv
|
|||||||
// 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
|
||||||
deactivateDrawerNavigation();
|
// deactivateDrawerNavigation();
|
||||||
// TODO: back button to key?
|
// TODO: back button to key?
|
||||||
} else {
|
} else {
|
||||||
activateDrawerNavigation(savedInstanceState);
|
// activateDrawerNavigation(savedInstanceState);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle intent actions
|
// Handle intent actions
|
||||||
@ -303,10 +303,10 @@ public class EncryptTextActivity extends EncryptActivity implements EncryptActiv
|
|||||||
updateModeFragment();
|
updateModeFragment();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
protected void initLayout() {
|
// protected void initLayout() {
|
||||||
setContentView(R.layout.encrypt_text_activity);
|
// setContentView(R.layout.encrypt_text_activity);
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
@ -41,15 +41,19 @@ import org.sufficientlysecure.keychain.util.Preferences;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
public class KeyListActivity extends DrawerActivity {
|
import it.neokree.materialnavigationdrawer.MaterialNavigationDrawer;
|
||||||
|
|
||||||
|
public class KeyListActivity extends NavDrawerActivity {
|
||||||
|
|
||||||
public static final int REQUEST_CODE_RESULT_TO_LIST = 1;
|
public static final int REQUEST_CODE_RESULT_TO_LIST = 1;
|
||||||
|
|
||||||
ExportHelper mExportHelper;
|
ExportHelper mExportHelper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
// public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
public void init(Bundle savedInstanceState) {
|
||||||
|
super.init(savedInstanceState);
|
||||||
|
// super.onCreate(savedInstanceState);
|
||||||
// setActionBarIcon(R.drawable.ic_ab_drawer);
|
// setActionBarIcon(R.drawable.ic_ab_drawer);
|
||||||
|
|
||||||
setTitle(R.string.nav_keys);
|
setTitle(R.string.nav_keys);
|
||||||
@ -72,13 +76,13 @@ public class KeyListActivity extends DrawerActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// now setup navigation drawer in DrawerActivity...
|
// now setup navigation drawer in DrawerActivity...
|
||||||
activateDrawerNavigation(savedInstanceState);
|
// activateDrawerNavigation(savedInstanceState);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
protected void initLayout() {
|
// protected void initLayout() {
|
||||||
setContentView(R.layout.key_list_activity);
|
// setContentView(R.layout.key_list_activity);
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
@ -0,0 +1,47 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2015 Dominik Schürmann <dominik@dominikschuermann.de>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.sufficientlysecure.keychain.ui;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.remote.ui.AppsListActivity;
|
||||||
|
|
||||||
|
import it.neokree.materialnavigationdrawer.MaterialNavigationDrawer;
|
||||||
|
|
||||||
|
public abstract class NavDrawerActivity extends MaterialNavigationDrawer {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(Bundle savedInstanceState) {
|
||||||
|
|
||||||
|
// set the header image
|
||||||
|
this.setDrawerHeaderImage(R.drawable.mat2);
|
||||||
|
|
||||||
|
// create sections
|
||||||
|
this.addSection(newSection(getString(R.string.app_name), 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)));
|
||||||
|
|
||||||
|
// create bottom section
|
||||||
|
this.addBottomSection(newSection(getString(R.string.menu_preferences), R.drawable.ic_settings_black_24dp, new Intent(this, SettingsActivity.class)));
|
||||||
|
}
|
||||||
|
}
|
BIN
OpenKeychain/src/main/res/drawable-hdpi/ic_apps_black_24dp.png
Normal file
After Width: | Height: | Size: 182 B |
After Width: | Height: | Size: 393 B |
After Width: | Height: | Size: 398 B |
After Width: | Height: | Size: 561 B |
After Width: | Height: | Size: 381 B |
BIN
OpenKeychain/src/main/res/drawable-mdpi/ic_apps_black_24dp.png
Normal file
After Width: | Height: | Size: 173 B |
After Width: | Height: | Size: 295 B |
After Width: | Height: | Size: 294 B |
After Width: | Height: | Size: 416 B |
After Width: | Height: | Size: 293 B |
BIN
OpenKeychain/src/main/res/drawable-xhdpi/ic_apps_black_24dp.png
Normal file
After Width: | Height: | Size: 193 B |
After Width: | Height: | Size: 450 B |
After Width: | Height: | Size: 484 B |
After Width: | Height: | Size: 691 B |
After Width: | Height: | Size: 446 B |
BIN
OpenKeychain/src/main/res/drawable-xxhdpi/ic_apps_black_24dp.png
Normal file
After Width: | Height: | Size: 213 B |
After Width: | Height: | Size: 615 B |
After Width: | Height: | Size: 675 B |
After Width: | Height: | Size: 969 B |
After Width: | Height: | Size: 622 B |
After Width: | Height: | Size: 236 B |
After Width: | Height: | Size: 881 B |
After Width: | Height: | Size: 883 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 789 B |
BIN
OpenKeychain/src/main/res/drawable/mat2.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
@ -9,6 +9,11 @@
|
|||||||
<item name="android:windowNoTitle">true</item>
|
<item name="android:windowNoTitle">true</item>
|
||||||
<item name="windowActionBar">false</item>
|
<item name="windowActionBar">false</item>
|
||||||
<item name="searchViewStyle">@style/MySearchViewStyle</item>
|
<item name="searchViewStyle">@style/MySearchViewStyle</item>
|
||||||
|
<item name="colorAccent">@color/accent</item>
|
||||||
|
|
||||||
|
<!-- Navigation Drawer library -->
|
||||||
|
<item name="drawerType">@integer/DRAWERTYPE_IMAGE</item>
|
||||||
|
<item name="multipaneSupport">true</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<!-- http://android-developers.blogspot.de/2014/10/appcompat-v21-material-design-for-pre.html -->
|
<!-- http://android-developers.blogspot.de/2014/10/appcompat-v21-material-design-for-pre.html -->
|
||||||
|