Fix: Fixed the way the app is navigated.
Signed-off-by: HeCodes2Much <wayne6324@gmail.com>
This commit is contained in:
@@ -35,7 +35,7 @@ import androidx.navigation.NavController
|
||||
import androidx.navigation.findNavController
|
||||
import androidx.navigation.fragment.NavHostFragment
|
||||
import androidx.navigation.ui.AppBarConfiguration
|
||||
import androidx.navigation.ui.popBackStack
|
||||
import androidx.navigation.ui.navigateUp
|
||||
import com.github.droidworksstudio.common.hasInternetPermission
|
||||
import com.github.droidworksstudio.common.isTablet
|
||||
import com.github.droidworksstudio.common.showLongToast
|
||||
@@ -275,10 +275,10 @@ class MainActivity : AppCompatActivity(), LocationListener {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSupportpopBackStack(): Boolean {
|
||||
override fun onSupportNavigateUp(): Boolean {
|
||||
val navController = findNavController(R.id.nav_host_fragment_content_main)
|
||||
return navController.popBackStack(appBarConfiguration)
|
||||
|| super.onSupportpopBackStack()
|
||||
return navController.navigateUp(appBarConfiguration)
|
||||
|| super.onSupportNavigateUp()
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.R)
|
||||
|
||||
@@ -160,12 +160,12 @@ class DrawFragment : Fragment(),
|
||||
return object : OnSwipeTouchListener(context) {
|
||||
override fun onSwipeLeft() {
|
||||
super.onSwipeLeft()
|
||||
findNavController().popBackStack()
|
||||
findNavController().navigateUp()
|
||||
}
|
||||
|
||||
override fun onSwipeRight() {
|
||||
super.onSwipeRight()
|
||||
findNavController().popBackStack()
|
||||
findNavController().navigateUp()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,12 +189,12 @@ class FavoriteFragment : Fragment(),
|
||||
return object : OnSwipeTouchListener(context) {
|
||||
override fun onSwipeLeft() {
|
||||
super.onSwipeLeft()
|
||||
findNavController().popBackStack()
|
||||
findNavController().navigateUp()
|
||||
}
|
||||
|
||||
override fun onSwipeRight() {
|
||||
super.onSwipeRight()
|
||||
findNavController().popBackStack()
|
||||
findNavController().navigateUp()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,12 +106,12 @@ class HiddenFragment : Fragment(),
|
||||
return object : OnSwipeTouchListener(context) {
|
||||
override fun onSwipeLeft() {
|
||||
super.onSwipeLeft()
|
||||
findNavController().popBackStack()
|
||||
findNavController().navigateUp()
|
||||
}
|
||||
|
||||
override fun onSwipeRight() {
|
||||
super.onSwipeRight()
|
||||
findNavController().popBackStack()
|
||||
findNavController().navigateUp()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,12 +240,12 @@ class SettingsFragment : Fragment(),
|
||||
return object : OnSwipeTouchListener(context) {
|
||||
override fun onSwipeLeft() {
|
||||
super.onSwipeLeft()
|
||||
findNavController().popBackStack()
|
||||
findNavController().navigateUp()
|
||||
}
|
||||
|
||||
override fun onSwipeRight() {
|
||||
super.onSwipeRight()
|
||||
findNavController().popBackStack()
|
||||
findNavController().navigateUp()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -369,12 +369,12 @@ class WidgetFragment : Fragment(),
|
||||
|
||||
override fun onSwipeLeft() {
|
||||
super.onSwipeLeft()
|
||||
findNavController().popBackStack()
|
||||
findNavController().navigateUp()
|
||||
}
|
||||
|
||||
override fun onSwipeRight() {
|
||||
super.onSwipeRight()
|
||||
findNavController().popBackStack()
|
||||
findNavController().navigateUp()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,12 +123,12 @@ class SettingsFragment : Fragment(),
|
||||
return object : OnSwipeTouchListener(context) {
|
||||
override fun onSwipeLeft() {
|
||||
super.onSwipeLeft()
|
||||
findNavController().popBackStack()
|
||||
findNavController().navigateUp()
|
||||
}
|
||||
|
||||
override fun onSwipeRight() {
|
||||
super.onSwipeRight()
|
||||
findNavController().popBackStack()
|
||||
findNavController().navigateUp()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user