Fix: Fixed navigation and click issues.

This commit is contained in:
HeCodes2Much
2024-05-24 08:39:44 +01:00
parent c5b8ab37f6
commit b297fb2460
14 changed files with 142 additions and 194 deletions

View File

@@ -24,14 +24,11 @@ import android.view.WindowManager
import android.widget.TextView
import android.widget.Toast
import androidx.appcompat.widget.LinearLayoutCompat
import androidx.fragment.app.Fragment
import androidx.navigation.fragment.findNavController
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.github.droidworksstudio.launcher.Constants
import com.github.droidworksstudio.launcher.R
import com.github.droidworksstudio.launcher.accessibility.MyAccessibilityService
import com.github.droidworksstudio.launcher.data.entities.AppInfo
import com.github.droidworksstudio.launcher.listener.OnSwipeTouchListener
import com.github.droidworksstudio.launcher.ui.activities.FakeHomeActivity
import java.util.Calendar
import java.util.Date
@@ -42,6 +39,14 @@ import kotlin.math.sqrt
class AppHelper @Inject constructor() {
fun resetDefaultLauncher(context: Context) {
val manufacturer = Build.MANUFACTURER.lowercase()
when (manufacturer) {
"google", "essential" -> runningStockAndroid(context)
else -> notRunningStockAndroid(context)
}
}
private fun runningStockAndroid(context: Context) {
try {
val packageManager = context.packageManager
val componentName = ComponentName(context, FakeHomeActivity::class.java)
@@ -63,18 +68,20 @@ class AppHelper @Inject constructor() {
)
} catch (e: Exception) {
e.printStackTrace()
// Additional step to open the launcher settings if the first method fails
}
}
private fun notRunningStockAndroid(context: Context) {
try {
val intent = Intent("android.settings.HOME_SETTINGS")
context.startActivity(intent)
} catch (e: ActivityNotFoundException) {
// Fallback to general settings if specific launcher settings are not found
try {
val intent = Intent("android.settings.HOME_SETTINGS")
val intent = Intent(Settings.ACTION_SETTINGS)
context.startActivity(intent)
} catch (e: ActivityNotFoundException) {
// Fallback to general settings if specific launcher settings are not found
try {
val intent = Intent(Settings.ACTION_SETTINGS)
context.startActivity(intent)
} catch (e: Exception) {
e.printStackTrace()
}
} catch (e: Exception) {
e.printStackTrace()
}
}
}
@@ -119,11 +126,21 @@ class AppHelper @Inject constructor() {
fun dayNightMod(context: Context, view: View) {
when (context.resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK) {
Configuration.UI_MODE_NIGHT_YES -> {
view.setBackgroundColor(context.resources.getColor(R.color.blackTrans25, context.theme))
view.setBackgroundColor(
context.resources.getColor(
R.color.blackTrans25,
context.theme
)
)
}
Configuration.UI_MODE_NIGHT_NO -> {
view.setBackgroundColor(context.resources.getColor(R.color.whiteTrans25, context.theme))
view.setBackgroundColor(
context.resources.getColor(
R.color.whiteTrans25,
context.theme
)
)
}
}
}
@@ -149,6 +166,7 @@ class AppHelper @Inject constructor() {
showToast(context, "Failed to open the application")
}
}
fun launchClock(context: Context) {
try {
val intent = Intent(AlarmClock.ACTION_SHOW_ALARMS)
@@ -190,7 +208,7 @@ class AppHelper @Inject constructor() {
} catch (e: ActivityNotFoundException) {
// Digital Wellbeing app is not installed or cannot be opened
// Handle this case as needed
showToast(context,"Digital Wellbeing is not available on this device.")
showToast(context, "Digital Wellbeing is not available on this device.")
}
}
@@ -239,7 +257,7 @@ class AppHelper @Inject constructor() {
}
fun showToast(context: Context,message: String) {
fun showToast(context: Context, message: String) {
Toast.makeText(context, message, Toast.LENGTH_SHORT).show()
}
@@ -273,33 +291,39 @@ class AppHelper @Inject constructor() {
windowManager.defaultDisplay.getMetrics(metrics)
val widthInches = metrics.widthPixels / metrics.xdpi
val heightInches = metrics.heightPixels / metrics.ydpi
val diagonalInches = sqrt(widthInches.toDouble().pow(2.0) + heightInches.toDouble().pow(2.0))
val diagonalInches =
sqrt(widthInches.toDouble().pow(2.0) + heightInches.toDouble().pow(2.0))
if (diagonalInches >= 7.0) return true
return false
}
fun wordOfTheDay(resources: Resources): String {
val dailyWordsArray = resources.getStringArray(R.array.settings_appearance_daily_word_default)
val dailyWordsArray =
resources.getStringArray(R.array.settings_appearance_daily_word_default)
val dayOfYear = Calendar.getInstance().get(Calendar.DAY_OF_YEAR)
val wordIndex = (dayOfYear - 1) % dailyWordsArray.size // Subtracting 1 to align with array indexing
val wordIndex =
(dayOfYear - 1) % dailyWordsArray.size // Subtracting 1 to align with array indexing
return dailyWordsArray[wordIndex]
}
fun shareAppButton(context: Context){
fun shareAppButton(context: Context) {
val shareIntent = Intent(Intent.ACTION_SEND)
shareIntent.type = "text/plain"
shareIntent.putExtra(Intent.EXTRA_SUBJECT, "Share Application")
shareIntent.putExtra(Intent.EXTRA_TEXT, "https://f-droid.org/packages/" + context.packageName)
shareIntent.putExtra(
Intent.EXTRA_TEXT,
"https://f-droid.org/packages/" + context.packageName
)
context.startActivity(Intent.createChooser(shareIntent, "Share Application"))
}
fun githubButton(context: Context){
fun githubButton(context: Context) {
val uri = Uri.parse("https://github.com/DroidWorksStudio/EasyLauncher")
val intent = Intent(Intent.ACTION_VIEW, uri)
context.startActivity(intent)
}
fun feedbackButton(context: Context){
fun feedbackButton(context: Context) {
val emailIntent = Intent(Intent.ACTION_SENDTO)
emailIntent.data = Uri.parse("mailto:droidworksstuido@063240.xyz")
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Easy Launcher")
@@ -336,6 +360,7 @@ class AppHelper @Inject constructor() {
}
builder.show()
}
else -> {
return
}

View File

@@ -143,7 +143,7 @@ class DrawFragment : Fragment(), OnItemClickedListener.OnAppsClickedListener,
@SuppressLint("ClickableViewAccessibility")
private fun observeSwipeTouchListener() {
binding.touchArea.setOnTouchListener(getSwipeGestureListener(context))
binding.mainView.setOnTouchListener(getSwipeGestureListener(context))
}
private fun getSwipeGestureListener(context: Context): View.OnTouchListener {

View File

@@ -13,7 +13,6 @@ import androidx.annotation.RequiresApi
import androidx.fragment.app.Fragment
import androidx.fragment.app.viewModels
import androidx.lifecycle.lifecycleScope
import androidx.navigation.fragment.findNavController
import androidx.recyclerview.widget.ItemTouchHelper
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.StaggeredGridLayoutManager
@@ -25,7 +24,6 @@ import com.github.droidworksstudio.launcher.helper.FingerprintHelper
import com.github.droidworksstudio.launcher.helper.PreferenceHelper
import com.github.droidworksstudio.launcher.listener.OnItemClickedListener
import com.github.droidworksstudio.launcher.listener.OnItemMoveListener
import com.github.droidworksstudio.launcher.listener.OnSwipeTouchListener
import com.github.droidworksstudio.launcher.viewmodel.AppViewModel
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.launch
@@ -77,7 +75,6 @@ class FavoriteFragment : Fragment(), OnItemClickedListener.OnAppsClickedListener
context = requireContext()
setupRecyclerView()
observeSwipeTouchListener()
observeFavorite()
observeHomeAppOrder()
}
@@ -91,20 +88,6 @@ class FavoriteFragment : Fragment(), OnItemClickedListener.OnAppsClickedListener
}
}
@SuppressLint("ClickableViewAccessibility")
private fun observeSwipeTouchListener() {
binding.touchArea.setOnTouchListener(getSwipeGestureListener(context))
}
private fun getSwipeGestureListener(context: Context): View.OnTouchListener {
return object : OnSwipeTouchListener(context) {
override fun onSwipeLeft() {
super.onSwipeLeft()
findNavController().popBackStack()
}
}
}
private fun handleDragAndDrop(oldPosition: Int, newPosition: Int) {
val items = favoriteAdapter.currentList.toMutableList()
Collections.swap(items, oldPosition, newPosition)

View File

@@ -12,7 +12,6 @@ import androidx.annotation.RequiresApi
import androidx.fragment.app.Fragment
import androidx.fragment.app.viewModels
import androidx.lifecycle.lifecycleScope
import androidx.navigation.fragment.findNavController
import androidx.recyclerview.widget.StaggeredGridLayoutManager
import com.github.droidworksstudio.launcher.R
import com.github.droidworksstudio.launcher.data.entities.AppInfo
@@ -20,7 +19,6 @@ import com.github.droidworksstudio.launcher.databinding.FragmentHiddenBinding
import com.github.droidworksstudio.launcher.helper.AppHelper
import com.github.droidworksstudio.launcher.helper.FingerprintHelper
import com.github.droidworksstudio.launcher.listener.OnItemClickedListener
import com.github.droidworksstudio.launcher.listener.OnSwipeTouchListener
import com.github.droidworksstudio.launcher.ui.bottomsheetdialog.AppInfoBottomSheetFragment
import com.github.droidworksstudio.launcher.viewmodel.AppViewModel
import dagger.hilt.android.AndroidEntryPoint
@@ -66,7 +64,6 @@ class HiddenFragment : Fragment(), OnItemClickedListener.OnAppsClickedListener,
context = requireContext()
setupRecyclerView()
observeSwipeTouchListener()
observeHiddenApps()
}
@@ -79,20 +76,6 @@ class HiddenFragment : Fragment(), OnItemClickedListener.OnAppsClickedListener,
}
@SuppressLint("ClickableViewAccessibility")
private fun observeSwipeTouchListener() {
binding.touchArea.setOnTouchListener(getSwipeGestureListener(context))
}
private fun getSwipeGestureListener(context: Context): View.OnTouchListener {
return object : OnSwipeTouchListener(context) {
override fun onSwipeLeft() {
super.onSwipeLeft()
findNavController().popBackStack()
}
}
}
private fun observeHiddenApps() {
viewModel.compareInstalledAppInfo()
@Suppress("DEPRECATION")

View File

@@ -113,7 +113,7 @@ class HomeFragment : Fragment(), OnItemClickedListener.OnAppsClickedListener,
@SuppressLint("ClickableViewAccessibility")
private fun initSwipeTouchListener() {
binding.touchArea.setOnTouchListener(getSwipeGestureListener(context))
binding.nestScrollView.setOnTouchListener(getSwipeGestureListener(context))
binding.clock.setOnClickListener { appHelper.launchClock(context) }
binding.date.setOnClickListener { appHelper.launchCalendar(context) }

View File

@@ -3,7 +3,6 @@ package com.github.droidworksstudio.launcher.ui.settings
import android.annotation.SuppressLint
import android.content.Intent
import android.os.Bundle
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
@@ -63,8 +62,13 @@ class SettingsFragment : Fragment(), ScrollEventListener {
initializeInjectedDependencies()
observeClickListener()
val packageInfo = requireContext().packageManager.getPackageInfo(requireContext().packageName, 0)
binding.versionInfo.text = getString(R.string.settings_version, getString(R.string.app_name), packageInfo.versionName)
val packageInfo =
requireContext().packageManager.getPackageInfo(requireContext().packageName, 0)
binding.versionInfo.text = getString(
R.string.settings_version,
getString(R.string.app_name),
packageInfo.versionName
)
}
@SuppressLint("SetTextI18n")
@@ -142,12 +146,20 @@ class SettingsFragment : Fragment(), ScrollEventListener {
binding.backupView.setOnClickListener {
appHelper.backupSharedPreferences(requireContext())
Toast.makeText(requireContext(), getString(R.string.settings_reload_app_backup), Toast.LENGTH_SHORT).show()
Toast.makeText(
requireContext(),
getString(R.string.settings_reload_app_backup),
Toast.LENGTH_SHORT
).show()
}
binding.restoreView.setOnClickListener {
appHelper.restoreSharedPreferences(requireContext())
Toast.makeText(requireContext(), getString(R.string.settings_reload_app_restore), Toast.LENGTH_SHORT).show()
Toast.makeText(
requireContext(),
getString(R.string.settings_reload_app_restore),
Toast.LENGTH_SHORT
).show()
restartApp()
}
}
@@ -178,7 +190,10 @@ class SettingsFragment : Fragment(), ScrollEventListener {
}
binding.gesturesLockSwitchCompat.setOnCheckedChangeListener { _, isChecked ->
appHelper.enableAppAsAccessibilityService(requireContext(), preferenceHelper.tapLockScreen)
appHelper.enableAppAsAccessibilityService(
requireContext(),
preferenceHelper.tapLockScreen
)
preferenceViewModel.setDoubleTapLock(isChecked)
}

View File

@@ -15,6 +15,6 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:navGraph="@navigation/settings_graph" />
app:navGraph="@navigation/nav_graph" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -40,7 +40,7 @@
app:queryBackground="@null"
app:searchIcon="@null"
app:queryHint="@string/search"
tools:ignore="VisualLintTextFieldSize"/>
tools:ignore="VisualLintTextFieldSize" />
</androidx.appcompat.widget.LinearLayoutCompat>
@@ -51,13 +51,6 @@
</androidx.appcompat.widget.LinearLayoutCompat>
<FrameLayout
android:id="@+id/touchArea"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/draw_search_button"
style="@style/Widget.MaterialComponents.FloatingActionButton"

View File

@@ -38,11 +38,4 @@
android:layout_marginTop="92dp"
app:layout_constraintTop_toBottomOf="@id/topTextView" />
</FrameLayout>
<FrameLayout
android:id="@+id/touchArea"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -37,11 +37,4 @@
android:layout_marginTop="92dp"
app:layout_constraintTop_toBottomOf="@id/topTextView" />
</FrameLayout>
<FrameLayout
android:id="@+id/touchArea"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -1,18 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
<FrameLayout 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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animateLayoutChanges="true"
android:orientation="vertical"
android:longClickable="true"
tools:context=".ui.home.HomeFragment">
<com.github.droidworksstudio.launcher.view.GestureNestedScrollView
android:id="@+id/nestScrollView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_height="match_parent"
android:fillViewport="true"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
app:layout_constraintBottom_toBottomOf="parent"
@@ -45,7 +42,7 @@
android:layout_gravity="end"
android:text="@string/battery_level"
android:textSize="16sp"
style="@style/TextDefaultStyle"/>
style="@style/TextDefaultStyle" />
<TextClock
android:id="@+id/clock"
@@ -57,7 +54,7 @@
android:format12Hour="h:mm"
android:textSize="48sp"
tools:text="02:34"
style="@style/TextDefaultStyle"/>
style="@style/TextDefaultStyle" />
<TextClock
android:id="@+id/date"
@@ -70,7 +67,7 @@
android:paddingHorizontal="2dp"
android:textSize="32sp"
tools:text="Thu, 30 Dec"
style="@style/TextDefaultStyle"/>
style="@style/TextDefaultStyle" />
<TextView
android:id="@+id/word"
@@ -85,18 +82,10 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/appListAdapter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
android:layout_height="wrap_content" />
</androidx.appcompat.widget.LinearLayoutCompat>
</com.github.droidworksstudio.launcher.view.GestureNestedScrollView>
<FrameLayout
android:id="@+id/touchArea"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>

View File

@@ -32,7 +32,7 @@
android:layout_marginTop="48dp"
android:text="@string/settings_name"
android:textSize="@dimen/text_super_large"
style="@style/TextDefaultStyle"/>
style="@style/TextDefaultStyle" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/version_info"
@@ -42,7 +42,7 @@
android:layout_marginTop="18dp"
android:text="@string/settings_version"
android:textSize="@dimen/text_large"
style="@style/TextDefaultStyle"/>
style="@style/TextDefaultStyle" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/set_launcher_selector"
@@ -52,7 +52,7 @@
android:layout_marginTop="18dp"
android:text="@string/action_settings_default"
android:textSize="@dimen/text_large"
style="@style/TextDefaultStyle"/>
style="@style/TextDefaultStyle" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
@@ -66,7 +66,7 @@
android:layout_margin="20dp"
android:text="@string/settings_title_app_manager"
android:textSize="@dimen/text_super_large"
style="@style/TextDefaultStyle"/>
style="@style/TextDefaultStyle" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
@@ -86,7 +86,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle"/>
style="@style/TextDefaultStyle" />
</androidx.appcompat.widget.LinearLayoutCompat>
@@ -125,7 +125,7 @@
android:layout_margin="20dp"
android:text="@string/settings_title_home_behavior_preferences"
android:textSize="@dimen/text_super_large"
style="@style/TextDefaultStyle"/>
style="@style/TextDefaultStyle" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
@@ -145,7 +145,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle"/>
style="@style/TextDefaultStyle" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/automaticKeyboard_switchCompat"
@@ -177,7 +177,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle"/>
style="@style/TextDefaultStyle" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/automaticOpenApp_switchCompat"
@@ -209,7 +209,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle"/>
style="@style/TextDefaultStyle" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/lockSettings_switchCompat"
@@ -236,7 +236,7 @@
android:layout_margin="20dp"
android:text="@string/settings_title_home_display_preferences"
android:textSize="@dimen/text_super_large"
style="@style/TextDefaultStyle"/>
style="@style/TextDefaultStyle" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
@@ -256,7 +256,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle"/>
style="@style/TextDefaultStyle" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/statue_bar_switchCompat"
@@ -288,7 +288,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle"/>
style="@style/TextDefaultStyle" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/date_switchCompat"
@@ -320,7 +320,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle"/>
style="@style/TextDefaultStyle" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/time_switchCompat"
@@ -352,7 +352,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle"/>
style="@style/TextDefaultStyle" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/battery_switchCompat"
@@ -384,7 +384,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle"/>
style="@style/TextDefaultStyle" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/dailyWord_switchCompat"
@@ -416,7 +416,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle"/>
style="@style/TextDefaultStyle" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/appIcons_switchCompat"
@@ -443,7 +443,7 @@
android:layout_margin="20dp"
android:text="@string/settings_title_home_appearance_preferences"
android:textSize="@dimen/text_super_large"
style="@style/TextDefaultStyle"/>
style="@style/TextDefaultStyle" />
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/select_appearance_text_size"
@@ -464,7 +464,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle"/>
style="@style/TextDefaultStyle" />
</androidx.appcompat.widget.LinearLayoutCompat>
@@ -487,7 +487,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle"/>
style="@style/TextDefaultStyle" />
</androidx.appcompat.widget.LinearLayoutCompat>
@@ -576,7 +576,7 @@
android:layout_margin="20dp"
android:text="@string/settings_title_gestures"
android:textSize="@dimen/text_super_large"
style="@style/TextDefaultStyle"/>
style="@style/TextDefaultStyle" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
@@ -596,7 +596,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle"/>
style="@style/TextDefaultStyle" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/gestures_lock_switchCompat"
@@ -605,7 +605,7 @@
android:thumb="@drawable/shape_switch_thumb"
app:track="@drawable/selector_switch"
android:scaleY="0.8"
android:scaleX="0.7"/>
android:scaleX="0.7" />
</androidx.appcompat.widget.LinearLayoutCompat>
@@ -627,7 +627,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle"/>
style="@style/TextDefaultStyle" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/gestures_notification_switchCompat"
@@ -636,7 +636,7 @@
android:thumb="@drawable/shape_switch_thumb"
app:track="@drawable/selector_switch"
android:scaleY="0.8"
android:scaleX="0.7"/>
android:scaleX="0.7" />
</androidx.appcompat.widget.LinearLayoutCompat>
@@ -658,7 +658,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle"/>
style="@style/TextDefaultStyle" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/gestures_search_switchCompat"
@@ -667,7 +667,7 @@
android:thumb="@drawable/shape_switch_thumb"
app:track="@drawable/selector_switch"
android:scaleY="0.8"
android:scaleX="0.7"/>
android:scaleX="0.7" />
</androidx.appcompat.widget.LinearLayoutCompat>
@@ -685,7 +685,7 @@
android:layout_margin="20dp"
android:text="@string/settings_title_backups"
android:textSize="@dimen/text_super_large"
style="@style/TextDefaultStyle"/>
style="@style/TextDefaultStyle" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
@@ -701,7 +701,7 @@
android:text="@string/settings_backups_backup"
android:textSize="@dimen/text_large"
android:layout_marginVertical="10dp"
style="@style/TextDefaultStyle"/>
style="@style/TextDefaultStyle" />
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
@@ -710,17 +710,17 @@
android:text="@string/settings_backups_restore"
android:textSize="@dimen/text_large"
android:layout_marginVertical="10dp"
style="@style/TextDefaultStyle"/>
style="@style/TextDefaultStyle" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:ignore="MissingConstraints">
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:ignore="MissingConstraints">
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="match_parent"
@@ -728,7 +728,7 @@
android:layout_margin="20dp"
android:text="@string/settings_title_others"
android:textSize="@dimen/text_super_large"
style="@style/TextDefaultStyle"/>
style="@style/TextDefaultStyle" />
<androidx.appcompat.widget.LinearLayoutCompat
@@ -748,7 +748,7 @@
android:text="@string/settings_others_share"
android:textSize="@dimen/text_large"
android:layout_marginHorizontal="10dp"
style="@style/TextDefaultStyle"/>
style="@style/TextDefaultStyle" />
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
@@ -757,7 +757,7 @@
android:text="@string/settings_others_github"
android:textSize="@dimen/text_large"
android:layout_marginHorizontal="10dp"
style="@style/TextDefaultStyle"/>
style="@style/TextDefaultStyle" />
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
@@ -766,7 +766,7 @@
android:text="@string/settings_others_feedback"
android:textSize="@dimen/text_large"
android:layout_marginHorizontal="10dp"
style="@style/TextDefaultStyle"/>
style="@style/TextDefaultStyle" />
</androidx.appcompat.widget.LinearLayoutCompat>
@@ -777,11 +777,4 @@
</androidx.appcompat.widget.LinearLayoutCompat>
</com.github.droidworksstudio.launcher.view.GestureNestedScrollView>
<FrameLayout
android:id="@+id/touchArea"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</FrameLayout>

View File

@@ -44,8 +44,23 @@
<fragment
android:id="@+id/SettingsFragment"
android:name="com.github.droidworksstudio.launcher.ui.settings.SettingsFragment"
android:label="@string/settings_fragment_label"
tools:layout="@layout/fragment_settings" />
android:label="@string/home_fragment_label"
tools:layout="@layout/fragment_settings">
<action
android:id="@+id/action_SettingsFragment_to_FavoriteFragment"
app:destination="@id/FavoriteFragment"
app:enterAnim="@anim/slide_in_right"
app:exitAnim="@anim/slide_out_left"
app:popEnterAnim="@anim/slide_in_left"
app:popExitAnim="@anim/slide_out_right" />
<action
android:id="@+id/action_SettingsFragment_to_HiddenFragment"
app:destination="@id/HiddenFragment"
app:enterAnim="@anim/slide_in_right"
app:exitAnim="@anim/slide_out_left"
app:popEnterAnim="@anim/slide_in_left"
app:popExitAnim="@anim/slide_out_right" />
</fragment>
<fragment
android:id="@+id/WidgetsFragment"
@@ -65,4 +80,10 @@
android:label="@string/favorite_fragment_label"
tools:layout="@layout/fragment_favorite" />
<fragment
android:id="@+id/HiddenFragment"
android:name="com.github.droidworksstudio.launcher.ui.hidden.HiddenFragment"
android:label="@string/hidden_fragment_label"
tools:layout="@layout/fragment_hidden" />
</navigation>

View File

@@ -1,40 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<navigation 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"
app:startDestination="@id/SettingsFragment">
<fragment
android:id="@+id/SettingsFragment"
android:name="com.github.droidworksstudio.launcher.ui.settings.SettingsFragment"
android:label="@string/home_fragment_label"
tools:layout="@layout/fragment_settings">
<action
android:id="@+id/action_SettingsFragment_to_FavoriteFragment"
app:destination="@id/FavoriteFragment"
app:enterAnim="@anim/slide_in_right"
app:exitAnim="@anim/slide_out_left"
app:popEnterAnim="@anim/slide_in_left"
app:popExitAnim="@anim/slide_out_right" />
<action
android:id="@+id/action_SettingsFragment_to_HiddenFragment"
app:destination="@id/HiddenFragment"
app:enterAnim="@anim/slide_in_right"
app:exitAnim="@anim/slide_out_left"
app:popEnterAnim="@anim/slide_in_left"
app:popExitAnim="@anim/slide_out_right" />
</fragment>
<fragment
android:id="@+id/FavoriteFragment"
android:name="com.github.droidworksstudio.launcher.ui.favorite.FavoriteFragment"
android:label="@string/favorite_fragment_label"
tools:layout="@layout/fragment_favorite" />
<fragment
android:id="@+id/HiddenFragment"
android:name="com.github.droidworksstudio.launcher.ui.hidden.HiddenFragment"
android:label="@string/hidden_fragment_label"
tools:layout="@layout/fragment_favorite" />
</navigation>