TOSSheet: Migrate to navigation components
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -58,14 +58,12 @@ import com.aurora.store.util.Log
|
||||
import com.aurora.store.util.Preferences
|
||||
import com.aurora.store.view.ui.sheets.NetworkDialogSheet
|
||||
import com.aurora.store.view.ui.sheets.SelfUpdateSheet
|
||||
import com.aurora.store.view.ui.sheets.TOSSheet
|
||||
import com.aurora.store.viewmodel.MainViewModel
|
||||
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
|
||||
import com.google.android.material.bottomnavigation.BottomNavigationView
|
||||
import com.google.android.material.elevation.SurfaceColors
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.GsonBuilder
|
||||
import kotlinx.coroutines.flow.drop
|
||||
import kotlinx.coroutines.launch
|
||||
import java.lang.reflect.Modifier
|
||||
|
||||
@@ -159,16 +157,6 @@ class MainActivity : AppCompatActivity(), NetworkProvider.NetworkListener {
|
||||
attachDrawer()
|
||||
attachSearch()
|
||||
|
||||
if (!Preferences.getBoolean(this, Preferences.PREFERENCE_TOS_READ)) {
|
||||
runOnUiThread {
|
||||
if (!supportFragmentManager.isDestroyed) {
|
||||
val sheet = TOSSheet.newInstance()
|
||||
sheet.isCancelable = false
|
||||
sheet.show(supportFragmentManager, TOSSheet.TAG)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*Check only if download to external storage is enabled*/
|
||||
if (Preferences.getBoolean(this, Preferences.PREFERENCE_DOWNLOAD_EXTERNAL)) {
|
||||
if (isRAndAbove()) {
|
||||
|
||||
@@ -75,6 +75,10 @@ class OnboardingFragment : Fragment(R.layout.fragment_onboarding) {
|
||||
binding.btnBackward.setOnClickListener {
|
||||
moveBackward()
|
||||
}
|
||||
|
||||
if (!Preferences.getBoolean(view.context, Preferences.PREFERENCE_TOS_READ)) {
|
||||
findNavController().navigate(R.id.TOSSheet)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
|
||||
@@ -34,18 +34,9 @@ class TOSSheet : BaseBottomSheet() {
|
||||
|
||||
private lateinit var B: SheetTosBinding
|
||||
|
||||
companion object {
|
||||
|
||||
const val TAG = "TOSSheet"
|
||||
|
||||
@JvmStatic
|
||||
fun newInstance(): TOSSheet {
|
||||
return TOSSheet().apply {
|
||||
arguments = Bundle().apply {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
isCancelable = false
|
||||
}
|
||||
|
||||
override fun onCreateContentView(
|
||||
|
||||
@@ -336,4 +336,9 @@
|
||||
app:popUpTo="@id/mobile_navigation"
|
||||
app:popUpToInclusive="true" />
|
||||
</fragment>
|
||||
<dialog
|
||||
android:id="@+id/TOSSheet"
|
||||
android:name="com.aurora.store.view.ui.sheets.TOSSheet"
|
||||
android:label="TOSSheet"
|
||||
tools:layout="@layout/sheet_tos" />
|
||||
</navigation>
|
||||
|
||||
Reference in New Issue
Block a user