Skip to content

Commit

Permalink
Merge branch 'Jesse205-feat_menu_group_line'
Browse files Browse the repository at this point in the history
  • Loading branch information
aistra0528 committed Feb 19, 2024
2 parents a1c611d + f151016 commit a1c8487
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 79 deletions.
7 changes: 7 additions & 0 deletions app/src/main/kotlin/com/aistra/hail/ui/main/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package com.aistra.hail.ui.main

import android.os.Bundle
import android.view.Menu
import androidx.appcompat.app.AppCompatActivity
import androidx.biometric.BiometricManager
import androidx.biometric.BiometricManager.Authenticators.BIOMETRIC_STRONG
import androidx.biometric.BiometricManager.Authenticators.DEVICE_CREDENTIAL
import androidx.biometric.BiometricPrompt
import androidx.core.content.ContextCompat
import androidx.core.view.MenuCompat
import androidx.core.view.WindowCompat
import androidx.core.view.isVisible
import androidx.navigation.NavController
Expand Down Expand Up @@ -90,6 +92,11 @@ class MainActivity : AppCompatActivity(), NavController.OnDestinationChangedList
fab.applyInsetsMargin(end = true, bottom = isLandscape)
}

override fun onCreateOptionsMenu(menu: Menu?): Boolean {
menu?.let { MenuCompat.setGroupDividerEnabled(it, true) }
return super.onCreateOptionsMenu(menu)
}

fun ownerRemoveDialog() {
MaterialAlertDialogBuilder(this).setTitle(R.string.title_remove_owner)
.setMessage(R.string.msg_remove_owner)
Expand Down
64 changes: 34 additions & 30 deletions app/src/main/res/menu/menu_apps.xml
Original file line number Diff line number Diff line change
@@ -1,51 +1,55 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<item
android:id="@+id/action_search"
android:icon="@drawable/ic_outline_search"
android:title="@string/action_search"
app:actionViewClass="androidx.appcompat.widget.SearchView"
app:showAsAction="always|collapseActionView"
tools:ignore="AlwaysShowAction" />
android:id="@+id/action_search"
android:icon="@drawable/ic_outline_search"
android:title="@string/action_search"
app:actionViewClass="androidx.appcompat.widget.SearchView"
app:showAsAction="always|collapseActionView"
tools:ignore="AlwaysShowAction"/>
<item
android:icon="@drawable/ic_outline_filter"
android:title="@string/filter_by"
app:showAsAction="ifRoom">
android:icon="@drawable/ic_outline_filter"
android:title="@string/filter_by"
app:showAsAction="ifRoom">
<menu>
<group android:checkableBehavior="single">
<group
android:id="@+id/group_filter_apps"
android:checkableBehavior="single">
<item
android:id="@+id/filter_user_apps"
android:title="@string/filter_user_apps" />
android:id="@+id/filter_user_apps"
android:title="@string/filter_user_apps"/>
<item
android:id="@+id/filter_system_apps"
android:title="@string/filter_system_apps" />
android:id="@+id/filter_system_apps"
android:title="@string/filter_system_apps"/>
</group>
<group android:checkableBehavior="all">
<group
android:id="@+id/group_filter_frozen"
android:checkableBehavior="all">
<item
android:id="@+id/filter_frozen_apps"
android:title="@string/filter_frozen_apps" />
android:id="@+id/filter_frozen_apps"
android:title="@string/filter_frozen_apps"/>
<item
android:id="@+id/filter_unfrozen_apps"
android:title="@string/filter_unfrozen_apps" />
android:id="@+id/filter_unfrozen_apps"
android:title="@string/filter_unfrozen_apps"/>
</group>
</menu>
</item>
<item
android:icon="@drawable/ic_outline_sort"
android:title="@string/sort_by"
app:showAsAction="ifRoom">
android:icon="@drawable/ic_outline_sort"
android:title="@string/sort_by"
app:showAsAction="ifRoom">
<menu>
<group android:checkableBehavior="single">
<item
android:id="@+id/sort_by_name"
android:title="@string/sort_name" />
android:id="@+id/sort_by_name"
android:title="@string/sort_name"/>
<item
android:id="@+id/sort_by_install"
android:title="@string/sort_install" />
android:id="@+id/sort_by_install"
android:title="@string/sort_install"/>
<item
android:id="@+id/sort_by_update"
android:title="@string/sort_update" />
android:id="@+id/sort_by_update"
android:title="@string/sort_update"/>
</group>
</menu>
</item>
Expand Down
102 changes: 53 additions & 49 deletions app/src/main/res/menu/menu_home.xml
Original file line number Diff line number Diff line change
@@ -1,68 +1,72 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<item
android:id="@+id/action_search"
android:icon="@drawable/ic_outline_search"
android:title="@string/action_search"
app:actionViewClass="androidx.appcompat.widget.SearchView"
app:showAsAction="always|collapseActionView"
tools:ignore="AlwaysShowAction" />
android:id="@+id/action_search"
android:icon="@drawable/ic_outline_search"
android:title="@string/action_search"
app:actionViewClass="androidx.appcompat.widget.SearchView"
app:showAsAction="always|collapseActionView"
tools:ignore="AlwaysShowAction"/>
<item
android:id="@+id/action_multiselect"
android:icon="@drawable/ic_outline_select_all"
android:title="@string/tap_to_select"
app:showAsAction="always"
tools:ignore="AlwaysShowAction" />
android:id="@+id/action_multiselect"
android:icon="@drawable/ic_outline_select_all"
android:title="@string/tap_to_select"
app:showAsAction="always"
tools:ignore="AlwaysShowAction"/>
<group android:id="@+id/group_freeze_current">
<item
android:id="@+id/action_freeze_current"
android:title="@string/action_freeze_current"
app:showAsAction="never"/>
<item
android:id="@+id/action_unfreeze_current"
android:title="@string/action_unfreeze_current"
app:showAsAction="never"/>
</group>
<group android:id="@+id/group_freeze_all">
<item
android:id="@+id/action_freeze_all"
android:title="@string/action_freeze_all"
app:showAsAction="never"/>
<item
android:id="@+id/action_unfreeze_all"
android:title="@string/action_unfreeze_all"
app:showAsAction="never"/>
<item
android:id="@+id/action_freeze_non_whitelisted"
android:title="@string/action_freeze_non_whitelisted"
app:showAsAction="never"/>
</group>
<item
android:id="@+id/action_freeze_current"
android:title="@string/action_freeze_current"
app:showAsAction="never" />
<item
android:id="@+id/action_unfreeze_current"
android:title="@string/action_unfreeze_current"
app:showAsAction="never" />
<item
android:id="@+id/action_freeze_all"
android:title="@string/action_freeze_all"
app:showAsAction="never" />
<item
android:id="@+id/action_unfreeze_all"
android:title="@string/action_unfreeze_all"
app:showAsAction="never" />
<item
android:id="@+id/action_freeze_non_whitelisted"
android:title="@string/action_freeze_non_whitelisted"
app:showAsAction="never" />
<item
android:title="@string/action_import_app"
app:showAsAction="never">
android:title="@string/action_import_app"
app:showAsAction="never">
<menu>
<group>
<item
android:id="@+id/action_import_clipboard"
android:title="@string/action_import_clipboard"
app:showAsAction="never" />
android:id="@+id/action_import_clipboard"
android:title="@string/action_import_clipboard"
app:showAsAction="never"/>
<item
android:id="@+id/action_import_frozen"
android:title="@string/action_import_frozen"
app:showAsAction="never" />
android:id="@+id/action_import_frozen"
android:title="@string/action_import_frozen"
app:showAsAction="never"/>
</group>
</menu>
</item>
<item
android:title="@string/action_export_clipboard"
app:showAsAction="never">
android:title="@string/action_export_clipboard"
app:showAsAction="never">
<menu>
<group>
<item
android:id="@+id/action_export_current"
android:title="@string/action_export_current"
app:showAsAction="never" />
android:id="@+id/action_export_current"
android:title="@string/action_export_current"
app:showAsAction="never"/>
<item
android:id="@+id/action_export_all"
android:title="@string/action_export_all"
app:showAsAction="never" />
android:id="@+id/action_export_all"
android:title="@string/action_export_all"
app:showAsAction="never"/>
</group>
</menu>
</item>
Expand Down

0 comments on commit a1c8487

Please sign in to comment.