Skip to content

Commit

Permalink
prefs file improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
queuejw committed Aug 10, 2024
1 parent eb18128 commit 425b7e8
Show file tree
Hide file tree
Showing 16 changed files with 205 additions and 246 deletions.
14 changes: 7 additions & 7 deletions app/src/main/java/ru/dimon6018/metrolauncher/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class Main : AppCompatActivity() {
false
) && PREFS!!.versionCode == VERSION_CODE
) {
PREFS!!.setUpdateState(3)
PREFS!!.updateState = 3
}
}

Expand All @@ -155,12 +155,12 @@ class Main : AppCompatActivity() {

private fun disableAnims() {
PREFS!!.apply {
setAllAppsAnim(false)
setAlphabetAnim(false)
setTransitionAnim(false)
setLiveTilesAnim(false)
setTilesScreenAnim(false)
setTilesAnim(false)
isAAllAppsAnimEnabled = false
isAlphabetAnimEnabled = false
isTransitionAnimEnabled = false
isLiveTilesAnimEnabled = false
isTilesScreenAnimEnabled = false
isTilesAnimEnabled = false
}
}

Expand Down
15 changes: 13 additions & 2 deletions app/src/main/java/ru/dimon6018/metrolauncher/content/NewAllApps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.inputmethod.InputMethodManager
import android.widget.AutoCompleteTextView
import android.widget.LinearLayout
import android.widget.PopupWindow
Expand Down Expand Up @@ -367,17 +368,18 @@ class NewAllApps: Fragment() {
binding.searchBtn.visibility = View.GONE
binding.settingsBtn.visibility = View.GONE
binding.search.visibility = View.VISIBLE
binding.search.isFocusable = true
binding.searchBackBtn.visibility = View.VISIBLE
setRecyclerPadding(0)
if(PREFS!!.showKeyboardWhenSearching) {
showKeyboard(binding.search.editText as? AutoCompleteTextView)
}
viewLifecycleOwner.lifecycleScope.launch(defaultDispatcher) {
removeHeaders()
(binding.search.editText as? AutoCompleteTextView)?.addTextChangedListener(object :
TextWatcher {
override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {
filterText(s.toString())
}

override fun beforeTextChanged(
s: CharSequence,
start: Int,
Expand All @@ -390,6 +392,15 @@ class NewAllApps: Fragment() {
})
}
}
private fun showKeyboard(view: View?) {
if (view != null) {
if (view.requestFocus()) {
val input =
ContextCompat.getSystemService(requireContext(), InputMethodManager::class.java)
input?.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT)
}
}
}
private fun filterText(text: String) {
val filteredList: ArrayList<App> = ArrayList()
val locale = getDefaultLocale()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,7 @@ class NewStart: Fragment(), OnStartDragListener {
strokeWidth = if (PREFS!!.isWallpaperUsed && !PREFS!!.isTilesTransparent) context?.resources?.getDimensionPixelSize(R.dimen.tileStrokeWidthDisabled)!! else context.resources?.getDimensionPixelSize(R.dimen.tileStrokeWidth)!!
}
binding.container.apply {
alpha = PREFS!!.getTilesTransparency
alpha = PREFS!!.tilesTransparency
setOnTouchListener { view, event ->
val x = event.x
val y = event.y
Expand Down
Loading

0 comments on commit 425b7e8

Please sign in to comment.