Skip to content

Commit

Permalink
android: UI fixes (#1860)
Browse files Browse the repository at this point in the history
* fix system bars on samsung

* change icon

* light mode fix

* add delay
  • Loading branch information
zaneschepke authored Jan 7, 2025
1 parent 682e736 commit 6ae8f1f
Show file tree
Hide file tree
Showing 36 changed files with 32 additions and 17 deletions.
Binary file modified fastlane/metadata/android/en-US/images/featureGraphic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
8 changes: 3 additions & 5 deletions nym-vpn-android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,23 @@
android:supportsRtl="true"
android:theme="@style/Theme.NymVPN"
tools:node="merge"
tools:targetApi="33">
tools:targetApi="tiramisu">
<activity
android:name="com.journeyapps.barcodescanner.CaptureActivity"
android:screenOrientation="portrait"
tools:replace="screenOrientation" />
<activity
android:name=".ui.MainActivity"
android:exported="true"
android:theme="@style/Theme.NymVPN.Starting"
android:screenOrientation="portrait"
android:theme="@style/Theme.NymVPN.Starting"
android:windowSoftInputMode="adjustResize"
android:configChanges="orientation|screenSize|keyboardHidden|locale"
android:configChanges="orientation|screenSize|keyboardHidden"
>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.service.quicksettings.action.QS_TILE_PREFERENCES" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
Expand Down
Binary file modified nym-vpn-android/app/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
package net.nymtech.nymvpn.ui

import android.content.Intent
import android.graphics.Color.TRANSPARENT
import android.os.Build
import android.os.Bundle
import androidx.activity.SystemBarStyle
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.activity.viewModels
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.animation.core.tween
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.foundation.layout.ExperimentalLayoutApi
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
Expand Down Expand Up @@ -80,18 +85,27 @@ class MainActivity : AppCompatActivity() {
@Inject
lateinit var settingsRepository: SettingsRepository

@OptIn(ExperimentalLayoutApi::class)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

val appViewModel by viewModels<AppViewModel>()

installSplashScreen().apply {
setKeepOnScreenCondition {
!appViewModel.isAppReady.value
}
}

this.resetTile()
enableEdgeToEdge(
statusBarStyle = SystemBarStyle.auto(TRANSPARENT, TRANSPARENT),
navigationBarStyle = SystemBarStyle.auto(TRANSPARENT, TRANSPARENT),
)

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
window.isNavigationBarContrastEnforced = false
}

super.onCreate(savedInstanceState)

resetTile()

setContent {
val appState by appViewModel.uiState.collectAsStateWithLifecycle(lifecycle)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ sealed class ThemeColors(
secondary = secondary,
onBackground = Color(0xFF1C1B1F),
onSurface = Color(0xFF1C1B1F),
onPrimary = Color(0xFFEBEEF4),
onPrimary = Color(0xFF1C1B1F),
onSurfaceVariant = Color(0xFF79747E),
onSecondary = Color(0xFFA4A4A4),
surfaceContainer = Color(0xFFFFFFFF),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,12 @@ fun NymVPNTheme(theme: Theme, content: @Composable () -> Unit) {
SideEffect {
val window = (view.context as Activity).window
WindowCompat.setDecorFitsSystemWindows(window, false)
window.statusBarColor = Color.Transparent.toArgb()
window.navigationBarColor = Color.Transparent.toArgb()
WindowCompat.getInsetsController(window, window.decorView).isAppearanceLightStatusBars = !isDark
window.statusBarColor = Color.Transparent.toArgb()
WindowCompat.getInsetsController(window, window.decorView).apply {
isAppearanceLightStatusBars = !isDark
isAppearanceLightNavigationBars = !isDark
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
Binary file modified nym-vpn-android/app/src/main/res/mipmap-hdpi/ic_launcher.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified nym-vpn-android/app/src/main/res/mipmap-mdpi/ic_launcher.webp
Binary file not shown.
Binary file not shown.
Binary file modified nym-vpn-android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
Binary file not shown.
Binary file modified nym-vpn-android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified nym-vpn-android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified nym-vpn-android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 1 addition & 3 deletions nym-vpn-android/app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<resources>

<style name="Theme.NymVPN" parent="Theme.AppCompat.NoActionBar">
<item name="android:fontFamily">@font/lato</item>
<item name="android:windowIsTranslucent">true</item>
</style>

<style name="Theme.NymVPN.Starting" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">@color/dark_background</item>
<item name="windowSplashScreenIconBackgroundColor">@color/dark_background</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_launcher_foreground</item>
<!-- Set the theme of the Activity that follows your splash screen. -->
<item name="postSplashScreenTheme">@style/Theme.NymVPN</item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ class NymBackend private constructor(val context: Context) : Backend, TunnelStat
override suspend fun isMnemonicStored(): Boolean {
return withContext(ioDispatcher) {
waitForInit()
// TODO temporary until bug is fixed
delay(2000L)
isAccountMnemonicStored()
}
}
Expand Down

0 comments on commit 6ae8f1f

Please sign in to comment.