Cleanup and log onResume and onPause for VectorAttachmentViewerActivity

This commit is contained in:
Benoit Marty 2020-10-13 14:44:04 +02:00
parent ca99a52545
commit ff56414695
5 changed files with 20 additions and 10 deletions

View file

@ -177,7 +177,7 @@ abstract class VectorBaseActivity : AppCompatActivity(), HasScreenInjector {
} }
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
Timber.i("onCreate Activity ${this.javaClass.simpleName}") Timber.i("onCreate Activity ${javaClass.simpleName}")
val vectorComponent = getVectorComponent() val vectorComponent = getVectorComponent()
screenComponent = DaggerScreenComponent.factory().create(vectorComponent, this) screenComponent = DaggerScreenComponent.factory().create(vectorComponent, this)
val timeForInjection = measureTimeMillis { val timeForInjection = measureTimeMillis {
@ -305,7 +305,7 @@ abstract class VectorBaseActivity : AppCompatActivity(), HasScreenInjector {
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
Timber.i("onDestroy Activity ${this.javaClass.simpleName}") Timber.i("onDestroy Activity ${javaClass.simpleName}")
unBinder?.unbind() unBinder?.unbind()
unBinder = null unBinder = null
@ -333,7 +333,7 @@ abstract class VectorBaseActivity : AppCompatActivity(), HasScreenInjector {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
Timber.i("onResume Activity ${this.javaClass.simpleName}") Timber.i("onResume Activity ${javaClass.simpleName}")
configurationViewModel.onActivityResumed() configurationViewModel.onActivityResumed()
@ -373,7 +373,7 @@ abstract class VectorBaseActivity : AppCompatActivity(), HasScreenInjector {
override fun onPause() { override fun onPause() {
super.onPause() super.onPause()
Timber.i("onPause Activity ${this.javaClass.simpleName}") Timber.i("onPause Activity ${javaClass.simpleName}")
rageShake.stop() rageShake.stop()

View file

@ -141,7 +141,7 @@ abstract class VectorBaseBottomSheetDialogFragment : BottomSheetDialogFragment()
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
Timber.i("onResume BottomSheet ${this.javaClass.simpleName}") Timber.i("onResume BottomSheet ${javaClass.simpleName}")
} }
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {

View file

@ -112,7 +112,7 @@ abstract class VectorBaseFragment : BaseMvRxFragment(), HasScreenInjector {
} }
final override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { final override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
Timber.i("onCreateView Fragment ${this.javaClass.simpleName}") Timber.i("onCreateView Fragment ${javaClass.simpleName}")
return inflater.inflate(getLayoutResId(), container, false) return inflater.inflate(getLayoutResId(), container, false)
} }
@ -122,7 +122,7 @@ abstract class VectorBaseFragment : BaseMvRxFragment(), HasScreenInjector {
@CallSuper @CallSuper
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
Timber.i("onResume Fragment ${this.javaClass.simpleName}") Timber.i("onResume Fragment ${javaClass.simpleName}")
} }
@CallSuper @CallSuper
@ -142,7 +142,7 @@ abstract class VectorBaseFragment : BaseMvRxFragment(), HasScreenInjector {
@CallSuper @CallSuper
override fun onDestroyView() { override fun onDestroyView() {
super.onDestroyView() super.onDestroyView()
Timber.i("onDestroyView Fragment ${this.javaClass.simpleName}") Timber.i("onDestroyView Fragment ${javaClass.simpleName}")
mUnBinder?.unbind() mUnBinder?.unbind()
mUnBinder = null mUnBinder = null
uiDisposables.clear() uiDisposables.clear()

View file

@ -74,7 +74,7 @@ class VectorAttachmentViewerActivity : AttachmentViewerActivity(), BaseAttachmen
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
Timber.i("onCreate Activity ${this.javaClass.simpleName}") Timber.i("onCreate Activity ${javaClass.simpleName}")
val vectorComponent = getVectorComponent() val vectorComponent = getVectorComponent()
screenComponent = DaggerScreenComponent.factory().create(vectorComponent, this) screenComponent = DaggerScreenComponent.factory().create(vectorComponent, this)
val timeForInjection = measureTimeMillis { val timeForInjection = measureTimeMillis {
@ -154,6 +154,16 @@ class VectorAttachmentViewerActivity : AttachmentViewerActivity(), BaseAttachmen
window.navigationBarColor = ContextCompat.getColor(this, R.color.black_alpha) window.navigationBarColor = ContextCompat.getColor(this, R.color.black_alpha)
} }
override fun onResume() {
super.onResume()
Timber.i("onResume Activity ${javaClass.simpleName}")
}
override fun onPause() {
super.onPause()
Timber.i("onPause Activity ${javaClass.simpleName}")
}
private fun getOtherThemes() = ActivityOtherThemes.VectorAttachmentsPreview private fun getOtherThemes() = ActivityOtherThemes.VectorAttachmentsPreview
override fun shouldAnimateDismiss(): Boolean { override fun shouldAnimateDismiss(): Boolean {

View file

@ -70,7 +70,7 @@ abstract class VectorSettingsBaseFragment : PreferenceFragmentCompat(), HasScree
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
Timber.i("onResume Fragment ${this.javaClass.simpleName}") Timber.i("onResume Fragment ${javaClass.simpleName}")
vectorActivity.supportActionBar?.setTitle(titleRes) vectorActivity.supportActionBar?.setTitle(titleRes)
// find the view from parent activity // find the view from parent activity
mLoadingView = vectorActivity.findViewById(R.id.vector_settings_spinner_views) mLoadingView = vectorActivity.findViewById(R.id.vector_settings_spinner_views)