mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-02 12:16:55 +01:00
Fix the latest warning \o/
This commit is contained in:
parent
e224ae62b4
commit
e67fe1476c
@ -24,6 +24,8 @@ import android.os.Parcelable
|
|||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
|
import androidx.fragment.app.FragmentManager
|
||||||
|
import androidx.fragment.app.FragmentOnAttachListener
|
||||||
import com.airbnb.mvrx.MvRx
|
import com.airbnb.mvrx.MvRx
|
||||||
import com.airbnb.mvrx.viewModel
|
import com.airbnb.mvrx.viewModel
|
||||||
import im.vector.app.R
|
import im.vector.app.R
|
||||||
@ -38,7 +40,10 @@ import kotlinx.android.synthetic.main.activity.*
|
|||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
import kotlin.reflect.KClass
|
import kotlin.reflect.KClass
|
||||||
|
|
||||||
class SharedSecureStorageActivity : SimpleFragmentActivity(), VectorBaseBottomSheetDialogFragment.ResultListener {
|
class SharedSecureStorageActivity :
|
||||||
|
SimpleFragmentActivity(),
|
||||||
|
VectorBaseBottomSheetDialogFragment.ResultListener,
|
||||||
|
FragmentOnAttachListener {
|
||||||
|
|
||||||
@Parcelize
|
@Parcelize
|
||||||
data class Args(
|
data class Args(
|
||||||
@ -58,6 +63,8 @@ class SharedSecureStorageActivity : SimpleFragmentActivity(), VectorBaseBottomSh
|
|||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
supportFragmentManager.addFragmentOnAttachListener(this)
|
||||||
|
|
||||||
toolbar.visibility = View.GONE
|
toolbar.visibility = View.GONE
|
||||||
|
|
||||||
viewModel.observeViewEvents { observeViewEvents(it) }
|
viewModel.observeViewEvents { observeViewEvents(it) }
|
||||||
@ -65,6 +72,11 @@ class SharedSecureStorageActivity : SimpleFragmentActivity(), VectorBaseBottomSh
|
|||||||
viewModel.subscribe(this) { renderState(it) }
|
viewModel.subscribe(this) { renderState(it) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onDestroy() {
|
||||||
|
super.onDestroy()
|
||||||
|
supportFragmentManager.removeFragmentOnAttachListener(this)
|
||||||
|
}
|
||||||
|
|
||||||
override fun onBackPressed() {
|
override fun onBackPressed() {
|
||||||
viewModel.handle(SharedSecureStorageAction.Back)
|
viewModel.handle(SharedSecureStorageAction.Back)
|
||||||
}
|
}
|
||||||
@ -119,8 +131,7 @@ class SharedSecureStorageActivity : SimpleFragmentActivity(), VectorBaseBottomSh
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onAttachFragment(fragment: Fragment) {
|
override fun onAttachFragment(fragmentManager: FragmentManager, fragment: Fragment) {
|
||||||
super.onAttachFragment(fragment)
|
|
||||||
if (fragment is VectorBaseBottomSheetDialogFragment) {
|
if (fragment is VectorBaseBottomSheetDialogFragment) {
|
||||||
fragment.resultListener = this
|
fragment.resultListener = this
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,8 @@ class VectorSettingsActivity : VectorBaseActivity(),
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (oFragment != null) {
|
if (oFragment != null) {
|
||||||
oFragment.setTargetFragment(caller, 0)
|
// Deprecated, I comment it, I think it is useless
|
||||||
|
// oFragment.setTargetFragment(caller, 0)
|
||||||
// Replace the existing Fragment with the new Fragment
|
// Replace the existing Fragment with the new Fragment
|
||||||
supportFragmentManager.beginTransaction()
|
supportFragmentManager.beginTransaction()
|
||||||
.setCustomAnimations(R.anim.right_in, R.anim.fade_out, R.anim.fade_in, R.anim.right_out)
|
.setCustomAnimations(R.anim.right_in, R.anim.fade_out, R.anim.fade_in, R.anim.right_out)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user