Fix: Fixed the navigation well adding hidden apps to swipes
Signed-off-by: HeCodes2Much <wayne6324@gmail.com>
This commit is contained in:
@@ -152,7 +152,7 @@ class DrawFragment : Fragment(),
|
|||||||
|
|
||||||
@SuppressLint("ClickableViewAccessibility")
|
@SuppressLint("ClickableViewAccessibility")
|
||||||
private fun observeSwipeTouchListener() {
|
private fun observeSwipeTouchListener() {
|
||||||
binding.touchArea.setOnTouchListener(getSwipeGestureListener(context))
|
binding.mainView.setOnTouchListener(getSwipeGestureListener(context))
|
||||||
binding.drawAdapter.setOnTouchListener(getSwipeGestureListener(context))
|
binding.drawAdapter.setOnTouchListener(getSwipeGestureListener(context))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ class HiddenFragment : Fragment(),
|
|||||||
|
|
||||||
@SuppressLint("ClickableViewAccessibility")
|
@SuppressLint("ClickableViewAccessibility")
|
||||||
private fun observeSwipeTouchListener() {
|
private fun observeSwipeTouchListener() {
|
||||||
binding.touchArea.setOnTouchListener(getSwipeGestureListener(context))
|
binding.fragmentContainer.setOnTouchListener(getSwipeGestureListener(context))
|
||||||
binding.hiddenAdapter.setOnTouchListener(getSwipeGestureListener(context))
|
binding.hiddenAdapter.setOnTouchListener(getSwipeGestureListener(context))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.github.droidworksstudio.launcher.ui.hidden
|
package com.github.droidworksstudio.launcher.ui.hidden
|
||||||
|
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
|
import android.view.Gravity
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.appcompat.widget.LinearLayoutCompat
|
import androidx.appcompat.widget.LinearLayoutCompat
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
@@ -19,11 +20,14 @@ class HiddenViewHolder(
|
|||||||
fun bind(appInfo: AppInfo) {
|
fun bind(appInfo: AppInfo) {
|
||||||
binding.apply {
|
binding.apply {
|
||||||
// Get the current LayoutParams of appFavoriteName
|
// Get the current LayoutParams of appFavoriteName
|
||||||
val layoutParams = appHiddenName.layoutParams as LinearLayoutCompat.LayoutParams
|
val layoutParams = LinearLayoutCompat.LayoutParams(
|
||||||
|
LinearLayoutCompat.LayoutParams.WRAP_CONTENT,
|
||||||
// Set the margins
|
LinearLayoutCompat.LayoutParams.WRAP_CONTENT
|
||||||
layoutParams.topMargin = preferenceHelper.homeAppPadding.toInt()
|
).apply {
|
||||||
layoutParams.bottomMargin = preferenceHelper.homeAppPadding.toInt()
|
gravity = Gravity.START
|
||||||
|
topMargin = preferenceHelper.homeAppPadding.toInt()
|
||||||
|
bottomMargin = preferenceHelper.homeAppPadding.toInt()
|
||||||
|
}
|
||||||
|
|
||||||
appHiddenName.layoutParams = layoutParams
|
appHiddenName.layoutParams = layoutParams
|
||||||
appHiddenName.text = appInfo.appName
|
appHiddenName.text = appInfo.appName
|
||||||
|
|||||||
@@ -364,6 +364,17 @@ class HomeFragment : Fragment(),
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Constants.Action.ShowHiddenList -> {
|
||||||
|
val actionTypeNavOptions: NavOptions = appHelper.getActionType(actionType)
|
||||||
|
Handler(Looper.getMainLooper()).post {
|
||||||
|
findNavController().navigate(
|
||||||
|
R.id.action_HomeFragment_to_HiddenFragment,
|
||||||
|
null,
|
||||||
|
actionTypeNavOptions
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Constants.Action.OpenQuickSettings -> {
|
Constants.Action.OpenQuickSettings -> {
|
||||||
appHelper.expandQuickSettings(context)
|
appHelper.expandQuickSettings(context)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,6 +113,7 @@ object Constants {
|
|||||||
ShowNotification,
|
ShowNotification,
|
||||||
ShowAppList,
|
ShowAppList,
|
||||||
ShowFavoriteList,
|
ShowFavoriteList,
|
||||||
|
ShowHiddenList,
|
||||||
OpenQuickSettings,
|
OpenQuickSettings,
|
||||||
ShowRecents,
|
ShowRecents,
|
||||||
ShowWidgets,
|
ShowWidgets,
|
||||||
@@ -127,6 +128,7 @@ object Constants {
|
|||||||
ShowNotification -> context.getString(R.string.settings_actions_show_notifications)
|
ShowNotification -> context.getString(R.string.settings_actions_show_notifications)
|
||||||
ShowAppList -> context.getString(R.string.settings_actions_show_app_list)
|
ShowAppList -> context.getString(R.string.settings_actions_show_app_list)
|
||||||
ShowFavoriteList -> context.getString(R.string.settings_actions_show_favorite_list)
|
ShowFavoriteList -> context.getString(R.string.settings_actions_show_favorite_list)
|
||||||
|
ShowHiddenList -> context.getString(R.string.settings_actions_show_hidden_list)
|
||||||
OpenQuickSettings -> context.getString(R.string.settings_actions_open_quick_settings)
|
OpenQuickSettings -> context.getString(R.string.settings_actions_open_quick_settings)
|
||||||
ShowRecents -> context.getString(R.string.settings_actions_show_recents)
|
ShowRecents -> context.getString(R.string.settings_actions_show_recents)
|
||||||
ShowWidgets -> context.getString(R.string.settings_actions_show_widgets)
|
ShowWidgets -> context.getString(R.string.settings_actions_show_widgets)
|
||||||
|
|||||||
@@ -7,12 +7,6 @@
|
|||||||
android:id="@+id/draw_background"
|
android:id="@+id/draw_background"
|
||||||
tools:context=".ui.drawer.DrawFragment">
|
tools:context=".ui.drawer.DrawFragment">
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:id="@+id/touchArea"
|
|
||||||
android:layout_marginVertical="20dp"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.LinearLayoutCompat
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
android:id="@+id/mainView"
|
android:id="@+id/mainView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|||||||
@@ -7,12 +7,6 @@
|
|||||||
android:id="@+id/hidden_view"
|
android:id="@+id/hidden_view"
|
||||||
tools:context=".ui.hidden.HiddenFragment">
|
tools:context=".ui.hidden.HiddenFragment">
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:id="@+id/touchArea"
|
|
||||||
android:layout_marginVertical="20dp"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent" />
|
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/fragment_container"
|
android:id="@+id/fragment_container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -32,11 +26,12 @@
|
|||||||
android:textSize="@dimen/text_super_large"
|
android:textSize="@dimen/text_super_large"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent" />
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
style="@style/TextDefaultStyle" />
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/hiddenAdapter"
|
android:id="@+id/hiddenAdapter"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="20dp"
|
android:layout_marginHorizontal="20dp"
|
||||||
android:layout_marginTop="92dp"
|
android:layout_marginTop="92dp"
|
||||||
|
|||||||
@@ -19,6 +19,9 @@
|
|||||||
<action
|
<action
|
||||||
android:id="@+id/action_HomeFragment_to_FavoriteFragment"
|
android:id="@+id/action_HomeFragment_to_FavoriteFragment"
|
||||||
app:destination="@id/FavoriteFragment" />
|
app:destination="@id/FavoriteFragment" />
|
||||||
|
<action
|
||||||
|
android:id="@+id/action_HomeFragment_to_HiddenFragment"
|
||||||
|
app:destination="@id/HiddenFragment" />
|
||||||
<action
|
<action
|
||||||
android:id="@+id/action_HomeFragment_to_WidgetsFragment"
|
android:id="@+id/action_HomeFragment_to_WidgetsFragment"
|
||||||
app:destination="@id/WidgetsFragment" />
|
app:destination="@id/WidgetsFragment" />
|
||||||
@@ -35,6 +38,9 @@
|
|||||||
<action
|
<action
|
||||||
android:id="@+id/action_SettingsFragment_to_HiddenFragment"
|
android:id="@+id/action_SettingsFragment_to_HiddenFragment"
|
||||||
app:destination="@id/HiddenFragment" />
|
app:destination="@id/HiddenFragment" />
|
||||||
|
<action
|
||||||
|
android:id="@+id/action_SettingsFragment_to_WidgetsSettingsFragment"
|
||||||
|
app:destination="@id/WidgetsSettingsFragment" />
|
||||||
</fragment>
|
</fragment>
|
||||||
|
|
||||||
<fragment
|
<fragment
|
||||||
|
|||||||
@@ -102,6 +102,7 @@
|
|||||||
<string name="settings_actions_show_notifications">Show Notifications</string>
|
<string name="settings_actions_show_notifications">Show Notifications</string>
|
||||||
<string name="settings_actions_show_app_list">Show Apps List</string>
|
<string name="settings_actions_show_app_list">Show Apps List</string>
|
||||||
<string name="settings_actions_show_favorite_list">Show Favorites List</string>
|
<string name="settings_actions_show_favorite_list">Show Favorites List</string>
|
||||||
|
<string name="settings_actions_show_hidden_list">Show Hidden List</string>
|
||||||
<string name="settings_actions_open_quick_settings">Open Quick Settings</string>
|
<string name="settings_actions_open_quick_settings">Open Quick Settings</string>
|
||||||
<string name="settings_actions_show_recents">Show Recents</string>
|
<string name="settings_actions_show_recents">Show Recents</string>
|
||||||
<string name="settings_actions_show_widgets">Show Widgets</string>
|
<string name="settings_actions_show_widgets">Show Widgets</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user