mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-05-16 15:02:54 +00:00
Add a lock button to the menu bar
This commit is contained in:
parent
bfe7a1bde0
commit
1ae9364c5e
3 changed files with 21 additions and 6 deletions
|
@ -317,14 +317,19 @@ public class MainActivity extends AppCompatActivity {
|
|||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
if (item.getItemId() == R.id.action_settings) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_settings:
|
||||
Intent preferencesActivity = new Intent(this, PreferencesActivity.class);
|
||||
startActivity(preferencesActivity);
|
||||
return true;
|
||||
}
|
||||
|
||||
case R.id.action_lock:
|
||||
// TODO: properly close the database
|
||||
recreate();
|
||||
return true;
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
|
||||
private void initializeAppShortcuts()
|
||||
{
|
||||
|
|
5
app/src/main/res/drawable/ic_lock.xml
Normal file
5
app/src/main/res/drawable/ic_lock.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<!-- licensed under CC BY-SA 3.0 by WPZOOM (http://www.wpzoom.com/) -->
|
||||
<vector android:height="24dp" android:viewportHeight="500.0"
|
||||
android:viewportWidth="500.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FFFFFF" android:pathData="M131.9,150.1v63.6h-27.3c-20.1,0 -36.3,16.3 -36.3,36.3v181.7c0,20.1 16.3,36.3 36.3,36.3h290.7c20.1,0 36.3,-16.3 36.3,-36.3V250c0,-20.1 -16.3,-36.3 -36.3,-36.3h-27.3v-63.6c0,-65.2 -52.9,-118.1 -118.1,-118.1S131.9,84.8 131.9,150.1zM177.3,213.7v-63.6c0,-40.2 32.5,-72.7 72.7,-72.7c40.2,0 72.7,32.5 72.7,72.7v63.6H177.3zM213.7,313.6c0,-20.1 16.3,-36.3 36.3,-36.3s36.3,16.3 36.3,36.3c0,12.8 -6.6,24.1 -16.6,30.5c0,0 3.5,21.4 7.5,46.7c0,7.5 -6.1,13.6 -13.6,13.6h-27.3c-7.5,0 -13.6,-6.1 -13.6,-13.6l7.5,-46.7C220.3,337.7 213.7,326.4 213.7,313.6z"/>
|
||||
</vector>
|
|
@ -2,6 +2,11 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:context="me.impy.aegis.MainActivity">
|
||||
<item
|
||||
android:id="@+id/action_lock"
|
||||
android:icon="@drawable/ic_lock"
|
||||
app:showAsAction="ifRoom"
|
||||
android:title=""/>
|
||||
<item
|
||||
android:id="@+id/action_settings"
|
||||
android:orderInCategory="100"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue