diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index ce16d47d..9cf0aeff 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -59,7 +59,8 @@ - + diff --git a/app/src/main/java/com/beemdevelopment/aegis/ui/AuthActivity.java b/app/src/main/java/com/beemdevelopment/aegis/ui/AuthActivity.java index fb4c3c1a..475c4a96 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/ui/AuthActivity.java +++ b/app/src/main/java/com/beemdevelopment/aegis/ui/AuthActivity.java @@ -2,6 +2,7 @@ package com.beemdevelopment.aegis.ui; import android.content.Context; import android.content.Intent; +import android.content.res.Configuration; import android.os.Build; import android.os.Bundle; import android.view.KeyEvent; @@ -14,6 +15,7 @@ import android.widget.Button; import android.widget.EditText; import android.widget.LinearLayout; import android.widget.PopupWindow; +import android.widget.TextView; import android.widget.Toast; import androidx.annotation.NonNull; @@ -24,6 +26,7 @@ import com.beemdevelopment.aegis.AegisApplication; import com.beemdevelopment.aegis.CancelAction; import com.beemdevelopment.aegis.Preferences; import com.beemdevelopment.aegis.R; +import com.beemdevelopment.aegis.Theme; import com.beemdevelopment.aegis.crypto.KeyStoreHandle; import com.beemdevelopment.aegis.crypto.KeyStoreHandleException; import com.beemdevelopment.aegis.crypto.MasterKey; @@ -68,7 +71,7 @@ public class AuthActivity extends AegisActivity { _textPassword = findViewById(R.id.text_password); LinearLayout boxBiometricInfo = findViewById(R.id.box_biometric_info); Button decryptButton = findViewById(R.id.button_decrypt); - Button biometricsButton = findViewById(R.id.button_biometrics); + TextView biometricsButton = findViewById(R.id.button_biometrics); _textPassword.setOnEditorActionListener((v, actionId, event) -> { if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_DONE)) { @@ -126,6 +129,7 @@ public class AuthActivity extends AegisActivity { // display a help message if a matching invalidated keystore entry was found if (invalidated) { boxBiometricInfo.setVisibility(View.VISIBLE); + biometricsButton.setVisibility(View.GONE); } } @@ -144,6 +148,34 @@ public class AuthActivity extends AegisActivity { }); } + @Override + protected void setPreferredTheme(Theme theme) { + if (theme == Theme.SYSTEM || theme == Theme.SYSTEM_AMOLED) { + // set the theme based on the system theme + int currentNightMode = getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK; + switch (currentNightMode) { + case Configuration.UI_MODE_NIGHT_NO: + theme = Theme.LIGHT; + break; + case Configuration.UI_MODE_NIGHT_YES: + theme = theme == Theme.SYSTEM_AMOLED ? Theme.AMOLED : Theme.DARK; + break; + } + } + + switch (theme) { + case LIGHT: + setTheme(R.style.AppTheme_Light_NoActionBar); + break; + case DARK: + setTheme(R.style.AppTheme_Dark_NoActionBar); + break; + case AMOLED: + setTheme(R.style.AppTheme_TrueBlack_NoActionBar); + break; + } + } + private void selectPassword() { _textPassword.selectAll(); diff --git a/app/src/main/res/drawable/button_rounded_corners.xml b/app/src/main/res/drawable/button_rounded_corners.xml new file mode 100644 index 00000000..20b385ab --- /dev/null +++ b/app/src/main/res/drawable/button_rounded_corners.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_aegis_iconx.png b/app/src/main/res/drawable/ic_aegis_iconx.png new file mode 100644 index 00000000..4924a55d Binary files /dev/null and b/app/src/main/res/drawable/ic_aegis_iconx.png differ diff --git a/app/src/main/res/layout/activity_auth.xml b/app/src/main/res/layout/activity_auth.xml index e9a7745e..b725c792 100644 --- a/app/src/main/res/layout/activity_auth.xml +++ b/app/src/main/res/layout/activity_auth.xml @@ -7,37 +7,44 @@ android:fitsSystemWindows="true" android:background="?attr/background" tools:context="com.beemdevelopment.aegis.ui.AuthActivity"> + + android:layout_height="match_parent" + android:layout_margin="48dp" + android:orientation="vertical" + tools:layout_editor_absoluteX="8dp" + tools:layout_editor_absoluteY="8dp"> + + + + android:fontFamily="sans-serif-light" + android:singleLine="false" + android:text="@string/authentication_multiline" + android:textColor="?attr/authText" + android:textFontWeight="500" + android:textSize="46sp" /> + - - + android:layout_marginTop="12dp" + android:orientation="vertical"> @@ -46,48 +53,72 @@ android:id="@+id/text_password" android:layout_width="match_parent" android:layout_height="wrap_content" - android:inputType="textPassword" /> + android:hint="@string/password" + android:inputType="textPassword" + android:textColor="?attr/primaryText" + android:textColorHint="?attr/authText" + app:backgroundTint="?attr/authText" /> + android:layout_height="wrap_content" + android:orientation="horizontal" + android:paddingBottom="25dp"> +