adding a Manage Hidden Icons button in the app settings

This commit is contained in:
tibbi 2022-10-25 18:29:24 +02:00
parent 1190c5de2b
commit 397415ec99
5 changed files with 92 additions and 7 deletions

View file

@ -76,6 +76,12 @@
android:label="@string/customize_colors"
android:parentActivityName=".activities.SettingsActivity" />
<activity
android:name=".activities.HiddenIconsActivity"
android:exported="false"
android:label="@string/hidden_icons"
android:parentActivityName=".activities.SettingsActivity" />
<activity-alias
android:name=".activities.SplashActivity.Red"
android:clearTaskOnLaunch="true"

View file

@ -0,0 +1,18 @@
package com.simplemobiletools.launcher.activities
import android.os.Bundle
import com.simplemobiletools.commons.helpers.NavigationIcon
import com.simplemobiletools.launcher.R
import kotlinx.android.synthetic.main.activity_hidden_icons.*
class HiddenIconsActivity : SimpleActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_hidden_icons)
}
override fun onResume() {
super.onResume()
setupToolbar(manage_hidden_icons_toolbar, NavigationIcon.Arrow)
}
}

View file

@ -1,5 +1,6 @@
package com.simplemobiletools.launcher.activities
import android.content.Intent
import android.os.Bundle
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.NavigationIcon
@ -27,6 +28,7 @@ class SettingsActivity : SimpleActivity() {
setupCustomizeColors()
setupUseEnglish()
setupLanguage()
setupManageHiddenIcons()
updateTextColors(settings_holder)
arrayOf(settings_color_customization_label, settings_general_settings_label).forEach {
@ -84,18 +86,23 @@ class SettingsActivity : SimpleActivity() {
private fun setupLanguage() {
settings_language.text = Locale.getDefault().displayLanguage
settings_language_holder.beVisibleIf(isTiramisuPlus())
if (settings_purchase_thank_you_holder.isGone() && settings_use_english_holder.isGone() && settings_language_holder.isGone()) {
settings_general_settings_label.beGone()
} else {
settings_general_settings_label.beVisible()
}
settings_language_holder.setOnClickListener {
launchChangeAppLanguageIntent()
}
}
private fun setupManageHiddenIcons() {
if (settings_purchase_thank_you_holder.isGone() && settings_use_english_holder.isGone() && settings_language_holder.isGone()) {
settings_manage_hidden_icons_holder.background = resources.getDrawable(R.drawable.ripple_all_corners, theme)
} else {
settings_manage_hidden_icons_holder.background = resources.getDrawable(R.drawable.ripple_bottom_corners, theme)
}
settings_manage_hidden_icons_holder.setOnClickListener {
startActivity(Intent(this, HiddenIconsActivity::class.java))
}
}
private fun launchAbout() {
val licenses = 0L
val faqItems = ArrayList<FAQItem>()

View file

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/manage_hidden_icons_coordinator"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/manage_hidden_icons_app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/manage_hidden_icons_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/color_primary"
app:title="@string/manage_hidden_icons"
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
</com.google.android.material.appbar.AppBarLayout>
<RelativeLayout
android:id="@+id/manage_hidden_icons_wrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<com.simplemobiletools.commons.views.MyRecyclerView
android:id="@+id/manage_hidden_icons_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:scrollbars="vertical"
app:layoutManager="com.simplemobiletools.commons.views.MyLinearLayoutManager" />
</RelativeLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -139,6 +139,22 @@
tools:text="English" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_manage_hidden_icons_holder"
style="@style/SettingsHolderTextViewOneLinerStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ripple_bottom_corners">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/settings_manage_hidden_icons"
style="@style/SettingsTextLabelStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/manage_hidden_icons" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>