Skip to content

Commit

Permalink
removed: Removed Clutter from settings
Browse files Browse the repository at this point in the history
  • Loading branch information
HeCodes2Much committed Apr 29, 2024
1 parent 6e9cbb6 commit c60bc9a
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 82 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ private const val CLICK_USAGE = "CLICK_USAGE"
private const val CLICK_DATE = "CLICK_DATE"
private const val DOUBLE_TAP = "DOUBLE_TAP"
private const val CUSTOM_FONT = "CUSTOM_FONT"
private const val FEATURE_PHONE = "FEATURE_PHONE"
private const val ALL_APPS_TEXT = "ALL_APPS_TEXT"

private const val TEXT_SIZE_LAUNCHER = "TEXT_SIZE_LAUNCHER"
Expand Down Expand Up @@ -238,10 +237,6 @@ class Prefs(val context: Context) {
get() = prefs.getBoolean(CUSTOM_FONT, false)
set(value) = prefs.edit().putBoolean(CUSTOM_FONT, value).apply()

var usingFeaturePhone: Boolean
get() = prefs.getBoolean(FEATURE_PHONE, false)
set(value) = prefs.edit().putBoolean(FEATURE_PHONE, value).apply()

var useAllAppsText: Boolean
get() = prefs.getBoolean(ALL_APPS_TEXT, true)
set(value) = prefs.edit().putBoolean(ALL_APPS_TEXT, value).apply()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,6 @@ class HomeFragment : Fragment(), View.OnClickListener, View.OnLongClickListener
// Add parentLinearLayout to homeAppsLayout
binding.homeAppsLayout.addView(parentLinearLayout)
}
addFeaturePhoneSettings()
} else if (diff < 0) {
// Remove extra apps
binding.homeAppsLayout.removeViews(oldAppsNum + diff, -diff)
Expand Down Expand Up @@ -847,7 +846,6 @@ class HomeFragment : Fragment(), View.OnClickListener, View.OnLongClickListener
// Add the view to the layout
binding.homeAppsLayout.addView(view)
}
addFeaturePhoneSettings()
} else if (diff < 0) {
// Remove extra apps
binding.homeAppsLayout.removeViews(oldAppsNum + diff, -diff)
Expand All @@ -857,59 +855,6 @@ class HomeFragment : Fragment(), View.OnClickListener, View.OnLongClickListener
updatePagesAndAppsPerPage(prefs.homeAppsNum, prefs.homePagesNum)
}

@RequiresApi(Build.VERSION_CODES.Q)
private fun addFeaturePhoneSettings() {
if (prefs.usingFeaturePhone) {
// Create and configure the first TextView
val showAppsText = TextView(context)
showAppsText.apply {
layoutParams = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT
)
textSize = prefs.textSizeLauncher.toFloat() / 1.2f
text = getString(R.string.show_app_list)
isFocusable = true
isFocusableInTouchMode = true
setTextColor(colors.accents(requireContext(), prefs, 3))
setOnClickListener {
showAppList(AppDrawerFlag.LaunchApp, includeHiddenApps = false)
}
}
binding.homeButtons.addView(showAppsText)

// Add a space between existingAppView and newAppView
val space = Space(context)
space.apply {
layoutParams = LinearLayout.LayoutParams(
0,
ViewGroup.LayoutParams.WRAP_CONTENT,
1f // Weight to fill available space
)
}

binding.homeButtons.addView(space)

// Create and configure the second TextView
val settingsText = TextView(context)
settingsText.apply {
layoutParams = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT
)
textSize = prefs.textSizeLauncher.toFloat() / 1.2f
text = getString(R.string.settings)
isFocusable = true
isFocusableInTouchMode = true
setTextColor(colors.accents(requireContext(), prefs, 3))
setOnClickListener {
trySettings()
}
}
binding.homeButtons.addView(settingsText)
}
}

// updates number of apps visible on home screen
// does nothing if number has not changed
private var currentPage = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,14 +363,6 @@ class SettingsFragment : Fragment() {
state = remember { mutableStateOf(prefs.useCustomIconFont) },
) { toggleCustomIconFont() }
},
{ _, onChange ->
SettingsToggle(
title = stringResource(R.string.using_feature_phone),
fontSize = iconFs,
onChange = onChange,
state = remember { mutableStateOf(prefs.usingFeaturePhone) },
) { toggleFeaturePhone() }
},
)
)
SettingsArea(
Expand Down Expand Up @@ -818,11 +810,6 @@ class SettingsFragment : Fragment() {
prefs.useCustomIconFont = !prefs.useCustomIconFont
}

private fun toggleFeaturePhone() {
prefs.usingFeaturePhone = !prefs.usingFeaturePhone
}


private fun toggleAllAppsText() {
prefs.useAllAppsText = !prefs.useAllAppsText
}
Expand Down
9 changes: 0 additions & 9 deletions app/src/main/res/layout/fragment_home.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,6 @@
android:paddingBottom="80dp"
android:paddingTop="112dp" />

<LinearLayout
android:id="@+id/homeButtons"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom|center_horizontal"
android:orientation="horizontal"
android:paddingHorizontal="20dp"
android:paddingBottom="20dp"/>

<TextView
android:id="@+id/homeScreenPager"
style="@style/TextSmall"
Expand Down

0 comments on commit c60bc9a

Please sign in to comment.