Updated on 2026-08-14

This commit is contained in:
Tangem 2020-09-23 11:32:54 +03:00
parent 6e14ad22a8
commit 3366b1ef75
17 changed files with 167 additions and 81 deletions

View file

@ -1,10 +1,7 @@
package com.tangem.tap
import android.app.Activity
import android.content.pm.ActivityInfo
import android.os.Build
import android.os.Bundle
import android.view.WindowManager
import androidx.appcompat.app.AppCompatActivity
import com.tangem.CardFilter
import com.tangem.Config
@ -67,7 +64,8 @@ class MainActivity : AppCompatActivity() {
override fun onResume() {
super.onResume()
notificationsHandler = NotificationsHandler(fragment_container)
if (supportFragmentManager.backStackEntryCount == 0) {
if (supportFragmentManager.backStackEntryCount == 0 ||
store.state.globalState.scanNoteResponse == null) {
store.dispatch(HomeAction.CheckIfFirstLaunch)
store.dispatch(NavigationAction.NavigateTo(AppScreen.Home))
}
@ -82,15 +80,4 @@ class MainActivity : AppCompatActivity() {
store.dispatch(NavigationAction.ActivityDestroyed)
super.onDestroy()
}
}
fun setTranslucent(activity: Activity, translucent: Boolean) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
val w = activity.getWindow();
if (translucent) {
w.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
} else {
w.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
}
}
}