mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
fix(login): hadle IME insets and make edge-to-edge backward compatible
This commit is contained in:
parent
7ec9866899
commit
afc94240e2
2 changed files with 11 additions and 0 deletions
|
|
@ -22,6 +22,7 @@ import androidx.appcompat.app.AlertDialog
|
||||||
import androidx.appcompat.app.AppCompatDelegate
|
import androidx.appcompat.app.AppCompatDelegate
|
||||||
import androidx.core.app.NavUtils
|
import androidx.core.app.NavUtils
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
|
import androidx.core.view.WindowCompat
|
||||||
import fr.free.nrw.commons.BuildConfig
|
import fr.free.nrw.commons.BuildConfig
|
||||||
import fr.free.nrw.commons.CommonsApplication
|
import fr.free.nrw.commons.CommonsApplication
|
||||||
import fr.free.nrw.commons.R
|
import fr.free.nrw.commons.R
|
||||||
|
|
@ -38,6 +39,7 @@ import fr.free.nrw.commons.utils.ActivityUtils.startActivityWithFlags
|
||||||
import fr.free.nrw.commons.utils.ConfigUtils.isBetaFlavour
|
import fr.free.nrw.commons.utils.ConfigUtils.isBetaFlavour
|
||||||
import fr.free.nrw.commons.utils.SystemThemeUtils
|
import fr.free.nrw.commons.utils.SystemThemeUtils
|
||||||
import fr.free.nrw.commons.utils.ViewUtil.hideKeyboard
|
import fr.free.nrw.commons.utils.ViewUtil.hideKeyboard
|
||||||
|
import fr.free.nrw.commons.utils.handleKeyboardInsets
|
||||||
import fr.free.nrw.commons.utils.handleWebUrl
|
import fr.free.nrw.commons.utils.handleWebUrl
|
||||||
import io.reactivex.disposables.CompositeDisposable
|
import io.reactivex.disposables.CompositeDisposable
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
|
|
@ -80,8 +82,14 @@ class LoginActivity : AccountAuthenticatorActivity() {
|
||||||
delegate.installViewFactory()
|
delegate.installViewFactory()
|
||||||
delegate.onCreate(savedInstanceState)
|
delegate.onCreate(savedInstanceState)
|
||||||
|
|
||||||
|
WindowCompat.getInsetsController(window, window.decorView)
|
||||||
|
.isAppearanceLightStatusBars = !isDarkTheme
|
||||||
|
|
||||||
|
WindowCompat.setDecorFitsSystemWindows(window, false)
|
||||||
|
|
||||||
binding = ActivityLoginBinding.inflate(layoutInflater)
|
binding = ActivityLoginBinding.inflate(layoutInflater)
|
||||||
applyEdgeToEdgeAllInsets(binding!!.root)
|
applyEdgeToEdgeAllInsets(binding!!.root)
|
||||||
|
binding?.aboutPrivacyPolicy?.handleKeyboardInsets()
|
||||||
with(binding!!) {
|
with(binding!!) {
|
||||||
setContentView(root)
|
setContentView(root)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -123,6 +123,9 @@
|
||||||
<item name="custom_selector_back">@drawable/ic_arrow_back_black</item>
|
<item name="custom_selector_back">@drawable/ic_arrow_back_black</item>
|
||||||
<item name="android:windowEnableSplitTouch">false</item>
|
<item name="android:windowEnableSplitTouch">false</item>
|
||||||
<item name="android:splitMotionEvents">false</item>
|
<item name="android:splitMotionEvents">false</item>
|
||||||
|
<!--For edge to edge backward compatibility-->
|
||||||
|
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||||
|
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="LightMoreBottomSheetStyle" parent="LightAppTheme">
|
<style name="LightMoreBottomSheetStyle" parent="LightAppTheme">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue