Redesign login screen UI

This commit is contained in:
M M Arif 2023-10-14 21:23:38 +05:00
parent b0eae62855
commit 46d68cd971
4 changed files with 335 additions and 307 deletions

View File

@ -30,7 +30,7 @@ import org.mian.gitnex.databinding.ActivityLoginBinding;
import org.mian.gitnex.helpers.AppUtil;
import org.mian.gitnex.helpers.NetworkStatusObserver;
import org.mian.gitnex.helpers.PathsHelper;
import org.mian.gitnex.helpers.Toasty;
import org.mian.gitnex.helpers.SnackBar;
import org.mian.gitnex.helpers.UrlHelper;
import org.mian.gitnex.helpers.Version;
import org.mian.gitnex.structs.Protocol;
@ -88,7 +88,10 @@ public class LoginActivity extends BaseActivity {
selectedProtocol = String.valueOf(parent.getItemAtPosition(position));
if (selectedProtocol.equals(String.valueOf(Protocol.HTTP))) {
Toasty.warning(ctx, getResources().getString(R.string.protocolError));
SnackBar.warning(
ctx,
findViewById(android.R.id.content),
getString(R.string.protocolError));
}
});
@ -137,10 +140,10 @@ public class LoginActivity extends BaseActivity {
disableProcessButton();
loginButton.setText(
getResources().getString(R.string.btnLogin));
Toasty.error(
SnackBar.error(
ctx,
getResources()
.getString(R.string.checkNetConnection));
findViewById(android.R.id.content),
getString(R.string.checkNetConnection));
}
}));
@ -159,7 +162,10 @@ public class LoginActivity extends BaseActivity {
if (selectedProtocol == null) {
Toasty.error(ctx, getResources().getString(R.string.protocolEmptyError));
SnackBar.error(
ctx,
findViewById(android.R.id.content),
getString(R.string.protocolEmptyError));
enableProcessButton();
return;
}
@ -197,7 +203,8 @@ public class LoginActivity extends BaseActivity {
if (instanceUrlET.getText().toString().equals("")) {
Toasty.error(ctx, getResources().getString(R.string.emptyFieldURL));
SnackBar.error(
ctx, findViewById(android.R.id.content), getString(R.string.emptyFieldURL));
enableProcessButton();
return;
}
@ -206,19 +213,28 @@ public class LoginActivity extends BaseActivity {
if (otpCode.length() != 0 && otpCode.length() != 6) {
Toasty.warning(ctx, getResources().getString(R.string.loginOTPTypeError));
SnackBar.error(
ctx,
findViewById(android.R.id.content),
getString(R.string.loginOTPTypeError));
enableProcessButton();
return;
}
if (loginUid.equals("")) {
Toasty.error(ctx, getResources().getString(R.string.emptyFieldUsername));
SnackBar.error(
ctx,
findViewById(android.R.id.content),
getString(R.string.emptyFieldUsername));
enableProcessButton();
return;
}
if (loginPass.equals("")) {
Toasty.error(ctx, getResources().getString(R.string.emptyFieldPassword));
SnackBar.error(
ctx,
findViewById(android.R.id.content),
getString(R.string.emptyFieldPassword));
enableProcessButton();
return;
}
@ -234,7 +250,10 @@ public class LoginActivity extends BaseActivity {
if (loginToken.equals("")) {
Toasty.error(ctx, getResources().getString(R.string.loginTokenError));
SnackBar.error(
ctx,
findViewById(android.R.id.content),
getString(R.string.loginTokenError));
enableProcessButton();
return;
}
@ -245,7 +264,8 @@ public class LoginActivity extends BaseActivity {
} catch (Exception e) {
Toasty.error(ctx, getResources().getString(R.string.malformedUrl));
SnackBar.error(
ctx, findViewById(android.R.id.content), getString(R.string.malformedUrl));
enableProcessButton();
}
}
@ -331,8 +351,10 @@ public class LoginActivity extends BaseActivity {
if (!Version.valid(version.getVersion())) {
Toasty.error(
ctx, getResources().getString(R.string.versionUnknown));
SnackBar.error(
ctx,
findViewById(android.R.id.content),
getString(R.string.versionUnknown));
enableProcessButton();
return;
}
@ -376,9 +398,10 @@ public class LoginActivity extends BaseActivity {
login(loginType, loginUid, loginPass, loginOTP, loginToken);
} else {
Toasty.warning(
SnackBar.warning(
ctx,
getResources().getString(R.string.versionUnsupportedNew));
findViewById(android.R.id.content),
getString(R.string.versionUnsupportedNew));
login(loginType, loginUid, loginPass, loginOTP, loginToken);
}
@ -412,8 +435,10 @@ public class LoginActivity extends BaseActivity {
public void onFailure(
@NonNull Call<ServerVersion> callVersion, @NonNull Throwable t) {
Toasty.error(
ctx, getResources().getString(R.string.genericServerResponseError));
SnackBar.error(
ctx,
findViewById(android.R.id.content),
getString(R.string.genericServerResponseError));
enableProcessButton();
}
});
@ -475,17 +500,17 @@ public class LoginActivity extends BaseActivity {
finish();
break;
case 401:
Toasty.error(
SnackBar.error(
ctx,
getResources().getString(R.string.unauthorizedApiError));
findViewById(android.R.id.content),
getString(R.string.unauthorizedApiError));
enableProcessButton();
break;
default:
Toasty.error(
SnackBar.error(
ctx,
getResources()
.getString(
R.string.genericApiError, response.code()));
findViewById(android.R.id.content),
getString(R.string.genericApiError, response.code()));
enableProcessButton();
}
}
@ -493,7 +518,10 @@ public class LoginActivity extends BaseActivity {
@Override
public void onFailure(@NonNull Call<User> call, @NonNull Throwable t) {
Toasty.error(ctx, ctx.getString(R.string.genericServerResponseError));
SnackBar.error(
ctx,
findViewById(android.R.id.content),
getString(R.string.genericServerResponseError));
enableProcessButton();
}
});
@ -580,13 +608,12 @@ public class LoginActivity extends BaseActivity {
tokenName);
} else {
Toasty.error(
SnackBar.error(
ctx,
getResources()
.getString(
R.string
.genericApiError,
response.code()));
findViewById(android.R.id.content),
getString(
R.string.genericApiError,
response.code()));
enableProcessButton();
}
}
@ -596,12 +623,10 @@ public class LoginActivity extends BaseActivity {
@NonNull Call<Void> delToken,
@NonNull Throwable t) {
Toasty.error(
SnackBar.error(
ctx,
getResources()
.getString(
R.string
.malformedJson));
findViewById(android.R.id.content),
getString(R.string.malformedJson));
enableProcessButton();
}
});
@ -612,10 +637,10 @@ public class LoginActivity extends BaseActivity {
setupToken(loginUid, loginPass, loginOTP, tokenName);
} else {
Toasty.error(
SnackBar.error(
ctx,
getResources()
.getString(R.string.genericApiError, response.code()));
findViewById(android.R.id.content),
getString(R.string.genericApiError, response.code()));
enableProcessButton();
}
}
@ -624,7 +649,10 @@ public class LoginActivity extends BaseActivity {
public void onFailure(
@NonNull Call<List<AccessToken>> call, @NonNull Throwable t) {
Toasty.error(ctx, getResources().getString(R.string.malformedJson));
SnackBar.error(
ctx,
findViewById(android.R.id.content),
getString(R.string.malformedJson));
enableProcessButton();
}
});
@ -750,22 +778,21 @@ public class LoginActivity extends BaseActivity {
finish();
break;
case 401:
Toasty.error(
SnackBar.error(
ctx,
getResources()
.getString(
R.string
.unauthorizedApiError));
findViewById(android.R.id.content),
getString(
R.string
.unauthorizedApiError));
enableProcessButton();
break;
default:
Toasty.error(
SnackBar.error(
ctx,
getResources()
.getString(
R.string
.genericApiError,
response.code()));
findViewById(android.R.id.content),
getString(
R.string.genericApiError,
response.code()));
enableProcessButton();
}
}
@ -775,22 +802,20 @@ public class LoginActivity extends BaseActivity {
@NonNull Call<User> call,
@NonNull Throwable t) {
Toasty.error(
SnackBar.error(
ctx,
getResources()
.getString(R.string.genericError));
findViewById(android.R.id.content),
getString(R.string.genericError));
enableProcessButton();
}
});
}
} else if (responseCreate.code() == 500) {
Toasty.error(
SnackBar.error(
ctx,
getResources()
.getString(
R.string.genericApiError,
responseCreate.code()));
findViewById(android.R.id.content),
getString(R.string.genericApiError, responseCreate.code()));
enableProcessButton();
}
}
@ -799,7 +824,10 @@ public class LoginActivity extends BaseActivity {
public void onFailure(
@NonNull Call<AccessToken> createUserToken, @NonNull Throwable t) {
Toasty.error(ctx, ctx.getString(R.string.genericServerResponseError));
SnackBar.error(
ctx,
findViewById(android.R.id.content),
getString(R.string.genericServerResponseError));
}
});
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 KiB

View File

@ -1,268 +1,269 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/loginForm"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/primaryBackgroundColor"
android:gravity="center"
android:orientation="vertical">
android:background="@drawable/login_bg">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimary"
android:alpha="0.6" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="@dimen/dimen16dp">
android:gravity="center"
android:layout_above="@id/card_view">
<ImageView
android:layout_width="@dimen/dimen100dp"
android:layout_height="@dimen/dimen100dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/dimen20dp"
android:layout_marginBottom="@dimen/dimen20dp"
android:layout_width="@dimen/dimen80dp"
android:layout_height="@dimen/dimen80dp"
android:baselineAligned="false"
android:contentDescription="@string/appName"
android:src="@mipmap/app_logo"/>
android:src="@mipmap/app_logo" />
<TextView
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dimen10dp"
android:gravity="start"
android:text="@string/loginMethodText"
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/dimen12sp"/>
<RadioGroup
android:id="@+id/loginMethod"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen8dp"
android:layout_marginBottom="@dimen/dimen8dp"
android:orientation="vertical">
<RadioButton
android:id="@+id/loginToken"
android:layout_width="wrap_content"
android:layout_height="@dimen/dimen36dp"
android:checked="true"
android:text="@string/copyToken"
android:textColor="?attr/primaryTextColor"/>
<RadioButton
android:id="@+id/loginUsernamePassword"
android:layout_width="wrap_content"
android:layout_height="@dimen/dimen36dp"
android:text="@string/loginViaPassword"
android:textColor="?attr/primaryTextColor"/>
</RadioGroup>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/httpsSpinnerLayout"
style="@style/Widget.Material3.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen8dp"
android:layout_marginBottom="@dimen/dimen8dp"
android:hint="@string/protocol"
android:textColorHint="?attr/hintColor"
app:boxBackgroundColor="?attr/inputBackgroundColor"
app:endIconTint="?attr/iconsColor"
app:hintTextColor="?attr/hintColor">
<AutoCompleteTextView
android:id="@+id/httpsSpinner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="none"
android:labelFor="@+id/httpsSpinner"
android:textColor="?attr/inputTextColor"
android:textSize="@dimen/dimen16sp"/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/instance_urlLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen8dp"
android:layout_marginBottom="@dimen/dimen8dp"
android:hint="@string/instanceUrl"
android:textColorHint="?attr/hintColor"
app:boxBackgroundColor="?attr/inputBackgroundColor"
app:boxStrokeErrorColor="@color/darkRed"
app:endIconMode="clear_text"
app:endIconTint="?attr/iconsColor"
app:hintTextColor="?attr/hintColor"
app:startIconDrawable="@drawable/ic_link"
app:startIconTint="?attr/iconsColor"
app:helperText="@string/instanceHelperText">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/instance_url"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textUri"
android:singleLine="true"
android:textColor="?attr/inputTextColor"
android:textColorHighlight="?attr/hintColor"
android:textColorHint="?attr/hintColor"
android:textSize="@dimen/dimen16sp"/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/login_uidLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen8dp"
android:layout_marginBottom="@dimen/dimen8dp"
android:hint="@string/userName"
android:textColorHint="?attr/hintColor"
app:boxBackgroundColor="?attr/inputBackgroundColor"
app:boxStrokeErrorColor="@color/darkRed"
app:endIconMode="clear_text"
app:endIconTint="?attr/iconsColor"
app:hintTextColor="?attr/hintColor"
app:startIconDrawable="@drawable/ic_person"
app:startIconTint="?attr/iconsColor">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/login_uid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:textColor="?attr/inputTextColor"
android:textColorHighlight="?attr/hintColor"
android:textColorHint="?attr/hintColor"
android:textSize="@dimen/dimen16sp"/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/login_passwdLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen8dp"
android:layout_marginBottom="@dimen/dimen8dp"
android:hint="@string/passWord"
android:textColorHint="?attr/hintColor"
app:boxBackgroundColor="?attr/inputBackgroundColor"
app:boxStrokeErrorColor="@color/darkRed"
app:endIconMode="password_toggle"
app:endIconTint="?attr/iconsColor"
app:hintTextColor="?attr/hintColor"
app:startIconDrawable="@drawable/ic_lock"
app:startIconTint="?attr/iconsColor">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/login_passwd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:singleLine="true"
android:textColor="?attr/inputTextColor"
android:textColorHighlight="?attr/hintColor"
android:textColorHint="?attr/hintColor"
android:textSize="@dimen/dimen16sp"/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/otpCodeLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen8dp"
android:layout_marginBottom="@dimen/dimen8dp"
android:hint="@string/loginOTP"
android:textColorHint="?attr/hintColor"
app:boxBackgroundColor="?attr/inputBackgroundColor"
app:boxStrokeErrorColor="@color/darkRed"
app:endIconMode="clear_text"
app:endIconTint="?attr/iconsColor"
app:helperText="@string/otpMessage"
app:helperTextEnabled="true"
app:helperTextTextColor="?attr/inputTextColor"
app:hintTextColor="?attr/hintColor"
app:startIconDrawable="@drawable/ic_otp"
app:startIconTint="?attr/iconsColor">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/otpCode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number"
android:singleLine="true"
android:textColor="?attr/inputTextColor"
android:textColorHighlight="?attr/hintColor"
android:textColorHint="?attr/hintColor"
android:textSize="@dimen/dimen16sp"/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/loginTokenCodeLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen8dp"
android:layout_marginBottom="@dimen/dimen8dp"
android:hint="@string/copyToken"
android:textColorHint="?attr/hintColor"
app:boxBackgroundColor="?attr/inputBackgroundColor"
app:boxStrokeErrorColor="@color/darkRed"
app:endIconMode="clear_text"
app:endIconTint="?attr/iconsColor"
app:hintTextColor="?attr/hintColor"
app:startIconDrawable="@drawable/ic_lock"
app:startIconTint="?attr/iconsColor">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/loginTokenCode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:textColor="?attr/inputTextColor"
android:textColorHighlight="?attr/hintColor"
android:textColorHint="?attr/hintColor"
android:textSize="@dimen/dimen16sp"/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.button.MaterialButton
android:id="@+id/login_button"
android:layout_width="match_parent"
android:layout_height="@dimen/dimen54dp"
android:layout_marginTop="@dimen/dimen8dp"
android:text="@string/btnLogin"
android:textColor="?attr/materialCardBackgroundColor"
android:textStyle="bold"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dimen10dp"
android:layout_marginTop="@dimen/dimen20dp"
android:layout_marginEnd="@dimen/dimen10dp"
android:autoLink="web"
android:gravity="center"
android:text="@string/appRepoLink"
android:textColor="?attr/primaryTextColor"
android:textColorLink="@color/lightBlue"
android:textSize="@dimen/dimen14sp"/>
android:text="@string/appName"
android:textStyle="bold"
android:textSize="@dimen/dimen24sp"
android:textColor="@color/colorWhite"
android:layout_marginTop="@dimen/dimen8dp" />
<TextView
android:id="@+id/appVersion"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen6dp"
android:layout_weight="1"
android:maxLines="1"
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/dimen14sp"/>
android:textColor="@color/colorWhite"
android:textSize="@dimen/dimen12sp" />
</LinearLayout>
</ScrollView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="-28dp"
android:alpha="0.9"
app:cardCornerRadius="@dimen/dimen32dp"
app:strokeWidth="@dimen/dimen0dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/dimen28dp">
<RadioGroup
android:id="@+id/loginMethod"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen8dp"
android:layout_marginBottom="@dimen/dimen8dp"
android:orientation="horizontal">
<RadioButton
android:id="@+id/loginToken"
android:layout_width="wrap_content"
android:layout_height="@dimen/dimen36dp"
android:checked="true"
android:text="@string/copyToken"
android:layout_marginEnd="@dimen/dimen8dp"
android:textColor="?attr/inputTextColor" />
<RadioButton
android:id="@+id/loginUsernamePassword"
android:layout_width="wrap_content"
android:layout_height="@dimen/dimen36dp"
android:text="@string/loginViaPassword"
android:textColor="?attr/inputTextColor" />
</RadioGroup>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/httpsSpinnerLayout"
style="@style/Widget.Material3.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen8dp"
android:layout_marginBottom="@dimen/dimen8dp"
android:hint="@string/protocol"
android:textColorHint="?attr/hintColor"
app:endIconTint="?attr/iconsColor"
app:hintTextColor="?attr/hintColor">
<AutoCompleteTextView
android:id="@+id/httpsSpinner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="none"
android:labelFor="@+id/httpsSpinner"
android:textColor="?attr/inputTextColor"
android:textSize="@dimen/dimen16sp" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/instance_urlLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen8dp"
android:layout_marginBottom="@dimen/dimen8dp"
android:hint="@string/instanceUrl"
android:textColorHint="?attr/hintColor"
app:boxStrokeErrorColor="@color/darkRed"
app:endIconMode="clear_text"
app:endIconTint="?attr/iconsColor"
app:hintTextColor="?attr/hintColor"
app:startIconDrawable="@drawable/ic_link"
app:startIconTint="?attr/iconsColor"
app:helperText="@string/instanceHelperText">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/instance_url"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textUri"
android:singleLine="true"
android:textColor="?attr/inputTextColor"
android:textColorHighlight="?attr/hintColor"
android:textColorHint="?attr/hintColor"
android:textSize="@dimen/dimen16sp" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/login_uidLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen8dp"
android:layout_marginBottom="@dimen/dimen8dp"
android:hint="@string/userName"
android:textColorHint="?attr/hintColor"
app:boxStrokeErrorColor="@color/darkRed"
app:endIconMode="clear_text"
app:endIconTint="?attr/iconsColor"
app:hintTextColor="?attr/hintColor"
app:startIconDrawable="@drawable/ic_person"
app:startIconTint="?attr/iconsColor">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/login_uid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:textColor="?attr/inputTextColor"
android:textColorHighlight="?attr/hintColor"
android:textColorHint="?attr/hintColor"
android:textSize="@dimen/dimen16sp" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/login_passwdLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen8dp"
android:layout_marginBottom="@dimen/dimen8dp"
android:hint="@string/passWord"
android:textColorHint="?attr/hintColor"
app:boxStrokeErrorColor="@color/darkRed"
app:endIconMode="password_toggle"
app:endIconTint="?attr/iconsColor"
app:hintTextColor="?attr/hintColor"
app:startIconDrawable="@drawable/ic_lock"
app:startIconTint="?attr/iconsColor">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/login_passwd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:singleLine="true"
android:textColor="?attr/inputTextColor"
android:textColorHighlight="?attr/hintColor"
android:textColorHint="?attr/hintColor"
android:textSize="@dimen/dimen16sp" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/otpCodeLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen8dp"
android:layout_marginBottom="@dimen/dimen8dp"
android:hint="@string/loginOTP"
android:textColorHint="?attr/hintColor"
app:boxStrokeErrorColor="@color/darkRed"
app:endIconMode="clear_text"
app:endIconTint="?attr/iconsColor"
app:helperText="@string/otpMessage"
app:helperTextEnabled="true"
app:helperTextTextColor="?attr/inputTextColor"
app:hintTextColor="?attr/hintColor"
app:startIconDrawable="@drawable/ic_otp"
app:startIconTint="?attr/iconsColor">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/otpCode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number"
android:singleLine="true"
android:textColor="?attr/inputTextColor"
android:textColorHighlight="?attr/hintColor"
android:textColorHint="?attr/hintColor"
android:textSize="@dimen/dimen16sp" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/loginTokenCodeLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen8dp"
android:layout_marginBottom="@dimen/dimen8dp"
android:hint="@string/copyToken"
android:textColorHint="?attr/hintColor"
app:boxStrokeErrorColor="@color/darkRed"
app:endIconMode="clear_text"
app:endIconTint="?attr/iconsColor"
app:hintTextColor="?attr/hintColor"
app:startIconDrawable="@drawable/ic_lock"
app:startIconTint="?attr/iconsColor">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/loginTokenCode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:textColor="?attr/inputTextColor"
android:textColorHighlight="?attr/hintColor"
android:textColorHint="?attr/hintColor"
android:textSize="@dimen/dimen16sp" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.button.MaterialButton
android:id="@+id/login_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen8dp"
android:layout_marginBottom="@dimen/dimen16dp"
android:text="@string/btnLogin"
android:textColor="?attr/materialCardBackgroundColor"
android:letterSpacing="0.1"
android:textStyle="bold" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</RelativeLayout>

View File

@ -547,8 +547,7 @@
<string name="versionUnknown">No Gitea detected!</string>
<string name="versionAlertDialogHeader">Unsupported Version of Gitea</string>
<string name="loginViaPassword">Username / Password</string>
<string name="loginMethodText">Choose your preferred login method to access your account. Token is more secure!</string>
<string name="loginViaPassword">Basic Auth</string>
<string name="unauthorizedApiError">Instance has returned an error - Unauthorized. Check your credentials and try again</string>
<string name="loginTokenError">Token is required</string>