Replace more input fields, Update version

This commit is contained in:
MrLetsplay 2023-10-07 20:55:49 +02:00
parent b0fe65f76b
commit 9b1a750642
Signed by: mr
SSH Key Fingerprint: SHA256:92jBH80vpXyaZHjaIl47pjRq+Yt7XGTArqQg1V7hSqg
7 changed files with 106 additions and 88 deletions

View File

@ -11,8 +11,8 @@ android {
applicationId "com.cringe_studios.code_guard"
minSdk 21
targetSdk 34
versionCode 1
versionName "1.0.0"
versionCode 2
versionName "1.0.0_alpha1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

View File

@ -107,16 +107,12 @@ public class EditOTPFragment extends NamedFragment {
OTPType newType = OTPType.values()[position];
switch(newType) {
case HOTP:
binding.textPeriod.setVisibility(View.GONE);
binding.inputPeriod.setVisibility(View.GONE);
binding.textCounter.setVisibility(View.VISIBLE);
binding.inputCounter.setVisibility(View.VISIBLE);
binding.layoutPeriod.setVisibility(View.GONE);
binding.layoutCounter.setVisibility(View.VISIBLE);
break;
case TOTP:
binding.textCounter.setVisibility(View.GONE);
binding.inputCounter.setVisibility(View.GONE);
binding.textPeriod.setVisibility(View.VISIBLE);
binding.inputPeriod.setVisibility(View.VISIBLE);
binding.layoutPeriod.setVisibility(View.VISIBLE);
binding.layoutCounter.setVisibility(View.GONE);
break;
}
}

View File

@ -100,6 +100,8 @@ public class OTPListAdapter extends RecyclerView.Adapter<OTPListItem> {
holder.getBinding().getRoot().setOnClickListener(view -> {
if(!editing) {
if(!SettingsUtil.isHideCodes(context)) return;
if(!holder.isCodeShown()) {
showCode(holder);
}else {

View File

@ -1,20 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp">
<EditText
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/create_group_name"
android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:ems="10"
android:inputType="text"
android:text="@string/name"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
android:hint="@string/name"
android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>

View File

@ -33,50 +33,51 @@
android:paddingTop="10dp"
android:paddingBottom="10dp" />
<TextView
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="@string/otp_add_name" />
android:layout_marginTop="10dp">
<EditText
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/input_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="text"
android:hint="@string/otp_add_name"
android:autofillHints="" />
android:inputType="text" />
<TextView
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="@string/otp_add_issuer" />
android:layout_marginTop="10dp">
<EditText
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/input_issuer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="text"
android:hint="@string/otp_add_issuer"
android:autofillHints="" />
android:inputType="text" />
<TextView
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="@string/otp_add_secret" />
app:passwordToggleEnabled="true"
android:layout_marginTop="10dp">
<EditText
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/input_secret"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="text"
android:hint="@string/otp_add_secret"
android:autofillHints="" />
android:inputType="textPassword" />
</com.google.android.material.textfield.TextInputLayout>
<TextView
android:layout_width="match_parent"
@ -110,37 +111,37 @@
android:layout_height="wrap_content"
android:text="@string/otp_add_checksum" />
<TextView
android:id="@+id/text_period"
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/layout_period"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="@string/otp_add_period" />
android:layout_marginTop="10dp">
<EditText
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/input_period"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="number"
android:hint="@string/otp_add_period"
android:autofillHints="" />
android:inputType="number" />
<TextView
android:id="@+id/text_counter"
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/layout_counter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="@string/otp_add_counter" />
android:layout_marginTop="10dp">
<EditText
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/input_counter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="number"
android:hint="@string/otp_add_counter"
android:autofillHints="" />
android:inputType="number" />
</com.google.android.material.textfield.TextInputLayout>
<Space
android:layout_width="match_parent"

View File

@ -7,12 +7,19 @@
android:orientation="vertical"
android:padding="16dp">
<EditText
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/pick_icon_search"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autofillHints=""
android:hint="@string/search" />
android:ems="10"
android:hint="@string/search"
android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout>
<ExpandableListView
android:id="@+id/pick_icon_list"

View File

@ -16,6 +16,8 @@
<item name="buttonBackground">@drawable/button_themed</item>
<item name="actionMenuTextAppearance">@style/ActionMenuTextAppearance</item>
<item name="textInputStyle">@style/TextInputStyle</item>
</style>
<style name="Theme.CringeAuthenticator" parent="Base.Theme.CringeAuthenticator" />
@ -59,4 +61,11 @@
<style name="ActionMenuTextAppearance" parent="TextAppearance.AppCompat.Widget.ActionBar.Menu">
<item name="android:textAllCaps">false</item>
</style>
<style name="TextInputStyle" parent="Widget.Material3.TextInputLayout.OutlinedBox">
<item name="boxCornerRadiusTopStart">25dp</item>
<item name="boxCornerRadiusTopEnd">25dp</item>
<item name="boxCornerRadiusBottomStart">25dp</item>
<item name="boxCornerRadiusBottomEnd">25dp</item>
</style>
</resources>