Fix outh login appearance

This commit is contained in:
androiddevkkotlin 2020-11-16 11:24:08 +02:00
parent 38699980ea
commit 755a181d1d
3 changed files with 19 additions and 1 deletions

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:alpha="0.3" android:color="#CCCCCC"/>
</selector>

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/text_color_secondary_light"/>
</selector>

View file

@ -3,11 +3,13 @@ package net.osmand.plus.settings.bottomsheets;
import android.content.Context;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
@ -40,10 +42,13 @@ public class OsmLoginDataBottomSheet extends BasePreferenceBottomSheet {
}
OsmandApplication app = requiredMyApplication();
View view = UiUtilities.getInflater(context, nightMode).inflate(R.layout.osm_login_data, null);
LayoutInflater themedInflater = UiUtilities.getInflater(requireContext(), nightMode);
View view = themedInflater.inflate(R.layout.osm_login_data, null);
userNameEditText = view.findViewById(R.id.name_edit_text);
passwordEditText = view.findViewById(R.id.password_edit_text);
userNameEditText.setBackgroundColor(getResolvedColor(R.color.background_field));
passwordEditText.setBackgroundColor(getResolvedColor(R.color.background_field));
String name = app.getSettings().USER_NAME.get();
String password = app.getSettings().USER_PASSWORD.get();
@ -59,6 +64,11 @@ public class OsmLoginDataBottomSheet extends BasePreferenceBottomSheet {
TextInputLayout loginBox = view.findViewById(R.id.name_text_box);
TextInputLayout passwordBox = view.findViewById(R.id.password_text_box);
loginBox.setBoxStrokeColor(getResolvedColor(R.color.osmand_orange));
loginBox.setHintTextColor(AppCompatResources.getColorStateList(getContext(),R.color.hint_label));
passwordBox.setBoxStrokeColor(getResolvedColor(R.color.osmand_orange));
passwordBox.setHintTextColor(AppCompatResources.getColorStateList(getContext(),R.color.hint_label));
passwordBox.setStartIconDrawable(R.drawable.ic_action_lock);
loginBox.setStartIconDrawable(R.drawable.ic_action_user_account);
loginBox.setEndIconMode(TextInputLayout.END_ICON_CLEAR_TEXT);