Skip to content

Commit c2dc88b

Browse files
committed
refactor: rebuild menu and settings
1 parent 519edc8 commit c2dc88b

File tree

7 files changed

+29
-24
lines changed

7 files changed

+29
-24
lines changed

app/src/main/kotlin/de/cyb3rko/pincredible/fragments/HomeFragment.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import android.view.ViewGroup
2626
import androidx.activity.result.contract.ActivityResultContracts.StartActivityForResult
2727
import androidx.fragment.app.viewModels
2828
import androidx.lifecycle.lifecycleScope
29-
import androidx.navigation.NavDirections
3029
import androidx.navigation.fragment.findNavController
3130
import androidx.recyclerview.widget.LinearLayoutManager
3231
import de.cyb3rko.backpack.data.BuildInfo
@@ -162,10 +161,6 @@ class HomeFragment : BackpackMainFragment(), BackpackMainView {
162161
return Intent(myContext, SettingsActivity::class.java)
163162
}
164163

165-
override fun getAnalysisNavigation(): NavDirections {
166-
return HomeFragmentDirections.homeToAnalysis()
167-
}
168-
169164
override fun getGithubLink(): Int {
170165
return R.string.github_link
171166
}

app/src/main/kotlin/de/cyb3rko/pincredible/fragments/SettingsFragment.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package de.cyb3rko.pincredible.fragments
1919
import android.graphics.drawable.Drawable
2020
import android.os.Bundle
2121
import androidx.core.content.res.ResourcesCompat
22+
import de.cyb3rko.backpack.fragments.BackpackAnalysisFragment
2223
import de.cyb3rko.backpack.fragments.BackpackSettingsFragment
2324
import de.cyb3rko.backpack.interfaces.BackpackSettingsView
2425
import de.cyb3rko.pincredible.R
@@ -44,4 +45,8 @@ internal class SettingsFragment : BackpackSettingsFragment(), BackpackSettingsVi
4445
override fun getAppIcon(): Drawable {
4546
return ResourcesCompat.getDrawable(resources, R.mipmap.ic_launcher, null)!!
4647
}
48+
49+
override fun getAnalysisFragment(): BackpackAnalysisFragment {
50+
return AnalysisFragment()
51+
}
4752
}
96.6 KB
Loading

app/src/main/res/navigation/nav_graph.xml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@
2424
app:enterAnim="@anim/shrink_in"
2525
app:popExitAnim="@anim/shrink_out" />
2626

27-
<action
28-
android:id="@+id/home_to_analysis"
29-
app:destination="@id/AnalysisFragment"
30-
app:enterAnim="@anim/shrink_in"
31-
app:popExitAnim="@anim/shrink_out" />
32-
3327
</fragment>
3428

3529
<fragment
@@ -65,16 +59,4 @@
6559

6660
</fragment>
6761

68-
<fragment
69-
android:id="@+id/AnalysisFragment"
70-
android:label="@string/menu_home_analysis"
71-
android:name="de.cyb3rko.pincredible.fragments.AnalysisFragment"
72-
tools:layout="@layout/fragment_analysis">
73-
74-
<action
75-
android:id="@+id/analysis_to_home"
76-
app:destination="@id/HomeFragment" />
77-
78-
</fragment>
79-
8062
</navigation>

app/src/main/res/values/strings.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
<string name="toast_stacktrace">Stracktrace copied</string>
6363

6464
<!-- Preferences -->
65+
<string name="preference_about">by Cyb3rKo</string>
6566
<string name="preference_category_security">Security</string>
6667
<string name="preference_item_button_randomizer">Digit Button Randomizer</string>
6768
<string name="preference_item_button_randomizer_summary">Shuffle digit buttons for protection against touch location logging</string>
@@ -74,6 +75,9 @@
7475
<string name="preference_item_coordinate_frame">Coordinate Frame</string>
7576
<string name="preference_item_app_icon">App Icon</string>
7677
<string name="preference_item_app_icon_summary">Change the app\'s icon and label</string>
78+
<string name="preference_category_other">Other</string>
79+
<string name="preference_item_analysis">App analysis</string>
80+
<string name="preference_item_analysis_summary">Access different checks related to security features</string>
7781
<string name="dialog_restart_title">Restart required</string>
7882
<string name="dialog_restart_message">The change will be visible on next app start.\n\nDo you want to restart now?</string>
7983
<string name="dialog_restart_button2">Later</string>

app/src/main/res/xml/preferences.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,20 @@
22
<PreferenceScreen
33
xmlns:app="http://schemas.android.com/apk/res-auto">
44

5+
<Preference
6+
app:key="about"
7+
app:title="@string/app_name"
8+
app:summary="@string/preference_about"
9+
app:icon="@drawable/avatar" />
10+
511
<PreferenceCategory
612
app:title="@string/preference_category_security">
713

814
<SwitchPreferenceCompat
915
app:key="app_lock"
1016
app:defaultValue="false"
1117
app:singleLineTitle="false"
18+
app:enabled="false"
1219
app:title="@string/preference_item_app_lock"
1320
app:summary="@string/preference_item_app_lock_summary"
1421
app:icon="@drawable/colored_ic_biometry" />
@@ -63,4 +70,16 @@
6370

6471
</PreferenceCategory>
6572

73+
<PreferenceCategory
74+
app:title="@string/preference_category_other">
75+
76+
<Preference
77+
app:key="analysis"
78+
app:singleLineTitle="false"
79+
app:title="@string/preference_item_analysis"
80+
app:summary="@string/preference_item_analysis_summary"
81+
app:useSimpleSummaryProvider="true" />
82+
83+
</PreferenceCategory>
84+
6685
</PreferenceScreen>

0 commit comments

Comments
 (0)