mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-01-22 23:30:24 +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 androidx.appcompat.app.AlertDialog
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentManager
|
||||
import androidx.fragment.app.FragmentOnAttachListener
|
||||
import com.airbnb.mvrx.MvRx
|
||||
import com.airbnb.mvrx.viewModel
|
||||
import im.vector.app.R
|
||||
@ -38,7 +40,10 @@ import kotlinx.android.synthetic.main.activity.*
|
||||
import javax.inject.Inject
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
class SharedSecureStorageActivity : SimpleFragmentActivity(), VectorBaseBottomSheetDialogFragment.ResultListener {
|
||||
class SharedSecureStorageActivity :
|
||||
SimpleFragmentActivity(),
|
||||
VectorBaseBottomSheetDialogFragment.ResultListener,
|
||||
FragmentOnAttachListener {
|
||||
|
||||
@Parcelize
|
||||
data class Args(
|
||||
@ -58,6 +63,8 @@ class SharedSecureStorageActivity : SimpleFragmentActivity(), VectorBaseBottomSh
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
supportFragmentManager.addFragmentOnAttachListener(this)
|
||||
|
||||
toolbar.visibility = View.GONE
|
||||
|
||||
viewModel.observeViewEvents { observeViewEvents(it) }
|
||||
@ -65,6 +72,11 @@ class SharedSecureStorageActivity : SimpleFragmentActivity(), VectorBaseBottomSh
|
||||
viewModel.subscribe(this) { renderState(it) }
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
supportFragmentManager.removeFragmentOnAttachListener(this)
|
||||
}
|
||||
|
||||
override fun onBackPressed() {
|
||||
viewModel.handle(SharedSecureStorageAction.Back)
|
||||
}
|
||||
@ -119,8 +131,7 @@ class SharedSecureStorageActivity : SimpleFragmentActivity(), VectorBaseBottomSh
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAttachFragment(fragment: Fragment) {
|
||||
super.onAttachFragment(fragment)
|
||||
override fun onAttachFragment(fragmentManager: FragmentManager, fragment: Fragment) {
|
||||
if (fragment is VectorBaseBottomSheetDialogFragment) {
|
||||
fragment.resultListener = this
|
||||
}
|
||||
|
@ -107,7 +107,8 @@ class VectorSettingsActivity : VectorBaseActivity(),
|
||||
}
|
||||
|
||||
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
|
||||
supportFragmentManager.beginTransaction()
|
||||
.setCustomAnimations(R.anim.right_in, R.anim.fade_out, R.anim.fade_in, R.anim.right_out)
|
||||
|
Loading…
Reference in New Issue
Block a user