UI fix: POI/OSM Note, Send GPX , Login/Password.

TextFields Background color make the same for all textfields.
Textfield top right and left rounded corners are missing.
Account block, check text styles and sizes and size in Figma.
 If the text filed not empty, put the cursor at the end of the text.
This commit is contained in:
androiddevkkotlin 2020-11-17 01:34:24 +02:00
parent 0c449093df
commit 06edbffb5d
7 changed files with 301 additions and 288 deletions

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:osmand="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -29,7 +30,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/bottom_sheet_content_margin"
android:hint="@string/user_login">
android:hint="@string/user_login"
app:boxBackgroundColor="?attr/text_input_background"
app:boxStrokeColor="@color/osmand_orange"
app:hintTextColor="@color/text_color_secondary_light">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/name_edit_text"
@ -43,7 +47,10 @@
android:id="@+id/password_text_box"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/user_password">
android:hint="@string/user_password"
app:boxBackgroundColor="?attr/text_input_background"
app:boxStrokeColor="@color/osmand_orange"
app:hintTextColor="@color/text_color_secondary_light">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/password_edit_text"

View file

@ -33,13 +33,13 @@
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/bottom_sheet_content_margin"
android:hint="@string/shared_string_description"
app:boxBackgroundColor="?attr/text_input_background"
app:boxStrokeColor="@color/osmand_orange"
app:hintTextColor="@color/text_color_secondary_light">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/message_field"
android:layout_width="match_parent"
android:background = "?attr/text_input_background"
android:layout_height="wrap_content"
android:imeOptions="actionDone" />
@ -51,6 +51,7 @@
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/bottom_sheet_content_margin"
android:hint="@string/gpx_tags_txt"
app:boxBackgroundColor="?attr/text_input_background"
app:boxStrokeColor="@color/osmand_orange"
app:helperText="@string/enter_text_separated"
app:helperTextEnabled="true"
@ -62,7 +63,6 @@
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/subHeaderPadding"
android:imeOptions="actionDone"
android:background = "?attr/text_input_background"
android:text="osmand" />
</com.google.android.material.textfield.TextInputLayout>
@ -144,45 +144,41 @@
android:background="?attr/dashboard_divider" />
<LinearLayout
android:id="@+id/account_block"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_width="360dp"
android:layout_height="48dp"
android:layout_marginTop="9dp"
android:minHeight="@dimen/context_menu_buttons_bottom_height"
tools:background="?android:attr/selectableItemBackground">
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatImageView
android:id="@android:id/icon"
android:layout_width="@dimen/standard_icon_size"
android:layout_height="@dimen/standard_icon_size"
android:layout_width="@dimen/route_info_buttons_padding_left_right"
android:layout_height="@dimen/route_info_buttons_padding_left_right"
android:layout_gravity="center"
android:layout_marginStart="@dimen/content_padding"
android:layout_marginLeft="@dimen/content_padding"
android:layout_marginTop="@dimen/bottom_sheet_icon_margin"
android:layout_marginEnd="@dimen/content_padding"
android:layout_marginRight="@dimen/bottom_sheet_icon_margin_large"
android:layout_marginBottom="@dimen/bottom_sheet_icon_margin"
android:tint="@color/active_buttons_and_links_text_disabled_light"
osmand:srcCompat="@drawable/ic_action_user_account" />
<RelativeLayout
android:id="@+id/padding_ver"
android:layout_width="32dp"
android:layout_height="36dp"
android:layout_marginTop="6dp"
android:alpha="0.01" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:orientation="vertical"
android:paddingStart="@dimen/content_padding"
android:paddingLeft="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding"
android:paddingRight="@dimen/content_padding">
android:layout_width="216dp"
android:layout_height="@dimen/bottom_sheet_descr_height"
android:gravity="center_vertical"
android:orientation="vertical">
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/account_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:letterSpacing="@dimen/description_letter_spacing"
android:id="@+id/account_title"
android:layout_width="216dp"
android:layout_height="@dimen/context_menu_padding_margin_large"
android:layout_marginTop="@dimen/subHeaderPadding"
android:gravity="center_vertical"
android:lineSpacingExtra="@dimen/map_widget_text_small_bottom_margin"
android:singleLine="true"
android:text="@string/login_account"
android:textColor="?android:textColorSecondary"
android:textSize="@dimen/default_desc_text_size"
@ -190,17 +186,18 @@
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/user_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:letterSpacing="@dimen/text_button_letter_spacing"
android:lineSpacingExtra="5dp"
android:maxLines="4"
android:layout_width="216dp"
android:layout_height="@dimen/context_menu_sub_info_height"
android:layout_marginBottom="@dimen/subHeaderPadding"
android:gravity="center_vertical"
android:letterSpacing="@dimen/description_letter_spacing"
android:lineSpacingExtra="5sp"
android:text="@string/login_account"
android:textColor="?android:textColorPrimary"
android:textSize="@dimen/default_desc_text_size"
android:textSize="@dimen/default_list_text_size"
osmand:typeface="@string/font_roboto_regular" />
</LinearLayout>
</LinearLayout>
</LinearLayout>

View file

@ -1,8 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:osmand="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
xmlns:osmand="http://schemas.android.com/apk/res-auto"
android:orientation="vertical">
<LinearLayout
@ -19,29 +20,33 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/bottom_sheet_content_margin"
android:hint="@string/osn_bug_name">
android:hint="@string/osn_bug_name"
app:boxBackgroundColor="?attr/text_input_background"
app:boxStrokeColor="@color/osmand_orange"
app:hintTextColor="@color/text_color_secondary_light">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/note_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="actionDone" />
android:imeOptions="actionDone"
android:lineSpacingExtra="5sp"/>
</com.google.android.material.textfield.TextInputLayout>
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/upload_anonymously_switch"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:minHeight="@dimen/context_menu_buttons_bottom_height"
android:layout_marginBottom="@dimen/content_padding_small"
android:paddingBottom="@dimen/content_padding_small"
android:paddingTop="@dimen/content_padding_small"
android:letterSpacing="@dimen/text_button_letter_spacing"
android:minHeight="@dimen/context_menu_buttons_bottom_height"
android:paddingLeft="@dimen/content_padding_small"
android:paddingTop="@dimen/content_padding_small"
android:paddingRight="@dimen/content_padding_small"
android:paddingBottom="@dimen/content_padding_small"
android:text="@string/upload_anonymously"
android:textColor="?android:textColorPrimary"
android:textSize="@dimen/default_list_text_size"
android:letterSpacing="@dimen/text_button_letter_spacing"
osmand:typeface="@string/font_roboto_regular" />
</LinearLayout>
@ -50,79 +55,81 @@
android:id="@+id/account_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/text_margin_small"
android:minHeight="@dimen/context_menu_buttons_bottom_height"
android:orientation="vertical">
android:orientation="vertical"
android:paddingTop="@dimen/text_margin_small">
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/dashboard_divider" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/content_padding_half"
android:minHeight="@dimen/context_menu_buttons_bottom_height">
android:layout_width="360dp"
android:layout_height="48dp"
android:layout_marginTop="9dp"
android:minHeight="@dimen/context_menu_buttons_bottom_height"
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatImageView
android:id="@android:id/icon"
android:layout_width="@dimen/standard_icon_size"
android:layout_height="@dimen/standard_icon_size"
android:layout_width="@dimen/route_info_buttons_padding_left_right"
android:layout_height="@dimen/route_info_buttons_padding_left_right"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/content_padding"
android:layout_marginRight="@dimen/content_padding"
osmand:srcCompat="@drawable/ic_action_user_account"
android:tint="@color/active_buttons_and_links_text_disabled_light"
android:layout_marginEnd="@dimen/content_padding"
android:layout_marginStart="@dimen/content_padding" />
osmand:srcCompat="@drawable/ic_action_user_account" />
<RelativeLayout
android:id="@+id/padding_ver"
android:layout_width="32dp"
android:layout_height="36dp"
android:layout_marginTop="6dp"
android:alpha="0.01" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:orientation="vertical"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:paddingStart="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding">
android:layout_width="216dp"
android:layout_height="@dimen/bottom_sheet_descr_height"
android:gravity="center_vertical"
android:orientation="vertical">
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/account_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:letterSpacing="@dimen/text_button_letter_spacing"
android:singleLine="true"
android:layout_width="216dp"
android:layout_height="@dimen/context_menu_padding_margin_large"
android:layout_marginTop="@dimen/subHeaderPadding"
android:gravity="center_vertical"
android:lineSpacingExtra="@dimen/map_widget_text_small_bottom_margin"
android:text="@string/login_account"
android:textColor="?android:textColorSecondary"
android:textSize="@dimen/default_list_text_size"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_regular" />
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/user_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_width="216dp"
android:layout_height="@dimen/context_menu_sub_info_height"
android:layout_marginBottom="@dimen/subHeaderPadding"
android:gravity="center_vertical"
android:letterSpacing="@dimen/description_letter_spacing"
android:maxLines="4"
android:lineSpacingExtra="5sp"
android:text="@string/login_account"
android:textColor="?android:textColorPrimary"
android:textSize="@dimen/default_desc_text_size"
android:textSize="@dimen/default_list_text_size"
osmand:typeface="@string/font_roboto_regular" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/sign_in_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/text_margin_small"
android:minHeight="@dimen/context_menu_buttons_bottom_height"
android:orientation="vertical">
android:orientation="vertical"
android:paddingTop="@dimen/text_margin_small">
<View
android:layout_width="match_parent"
@ -134,35 +141,37 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:lineSpacingMultiplier="@dimen/bottom_sheet_text_spacing_multiplier"
android:textColor="?android:textColorPrimary"
android:paddingTop="@dimen/content_padding_small"
android:paddingLeft="@dimen/content_padding"
android:paddingStart="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:paddingLeft="@dimen/content_padding"
android:paddingTop="@dimen/content_padding_small"
android:paddingEnd="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:paddingBottom="@dimen/content_padding_small"
android:text="@string/osm_login_descr"
android:textColor="?android:textColorPrimary"
android:textSize="@dimen/default_list_text_size"
osmand:typeface="@string/font_roboto_regular"
android:text="@string/osm_login_descr" />
osmand:typeface="@string/font_roboto_regular" />
<include
android:id="@+id/sign_in_button"
layout="@layout/bottom_sheet_dialog_button"
android:layout_marginBottom="@dimen/content_padding_half"
android:layout_width="match_parent"
android:layout_height="@dimen/dialog_button_height"
android:layout_marginLeft="@dimen/content_padding"
android:layout_marginRight="@dimen/content_padding"
android:layout_width="match_parent"
android:layout_height="@dimen/dialog_button_height" />
android:layout_marginBottom="@dimen/content_padding_half" />
<include
android:id="@+id/login_button"
layout="@layout/bottom_sheet_dialog_button"
android:layout_marginTop="@dimen/content_padding_small"
android:layout_marginBottom="@dimen/content_padding"
android:layout_marginLeft="@dimen/content_padding"
android:layout_marginRight="@dimen/content_padding"
android:layout_width="match_parent"
android:layout_height="@dimen/dialog_button_height" />
android:layout_height="@dimen/dialog_button_height"
android:layout_marginLeft="@dimen/content_padding"
android:layout_marginTop="@dimen/content_padding_small"
android:layout_marginRight="@dimen/content_padding"
android:layout_marginBottom="@dimen/content_padding" />
</LinearLayout>
</LinearLayout>

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:osmand="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
xmlns:osmand="http://schemas.android.com/apk/res-auto"
android:orientation="vertical">
<LinearLayout
@ -21,10 +21,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:letterSpacing="@dimen/text_button_letter_spacing"
android:text="@string/upload_poi"
android:textSize="@dimen/default_list_text_size"
osmand:typeface="@string/font_roboto_medium"
android:letterSpacing="@dimen/text_button_letter_spacing"/>
osmand:typeface="@string/font_roboto_medium" />
<com.google.android.material.textfield.TextInputLayout
@ -32,13 +32,17 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/bottom_sheet_content_margin"
android:hint="@string/shared_string_message">
android:hint="@string/shared_string_message"
app:boxBackgroundColor="?attr/text_input_background"
app:boxStrokeColor="@color/osmand_orange"
app:hintTextColor="@color/text_color_secondary_light">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/message_field"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="actionDone" />
android:imeOptions="actionDone"
android:lineSpacingExtra="5sp"/>
</com.google.android.material.textfield.TextInputLayout>
<androidx.appcompat.widget.SwitchCompat
@ -46,14 +50,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/content_padding"
android:letterSpacing="@dimen/text_button_letter_spacing"
android:minHeight="@dimen/context_menu_buttons_bottom_height"
android:text="@string/close_changeset"
android:paddingLeft="@dimen/content_padding_small"
android:paddingRight="@dimen/content_padding_small"
android:text="@string/close_changeset"
android:textColor="?android:textColorPrimary"
android:textSize="@dimen/default_list_text_size"
osmand:typeface="@string/font_roboto_regular"
android:letterSpacing="@dimen/text_button_letter_spacing" />
osmand:typeface="@string/font_roboto_regular" />
</LinearLayout>
@ -63,59 +67,59 @@
android:background="?attr/dashboard_divider" />
<LinearLayout
android:id="@+id/account_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_width="360dp"
android:layout_height="48dp"
android:layout_marginTop="9dp"
android:minHeight="@dimen/context_menu_buttons_bottom_height"
tools:background="?android:attr/selectableItemBackground">
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatImageView
android:id="@android:id/icon"
android:layout_width="@dimen/standard_icon_size"
android:layout_height="@dimen/standard_icon_size"
android:layout_width="@dimen/route_info_buttons_padding_left_right"
android:layout_height="@dimen/route_info_buttons_padding_left_right"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/content_padding"
android:layout_marginTop="@dimen/bottom_sheet_icon_margin"
android:layout_marginRight="@dimen/bottom_sheet_icon_margin_large"
android:layout_marginBottom="@dimen/bottom_sheet_icon_margin"
osmand:srcCompat="@drawable/ic_action_user_account"
android:tint="@color/active_buttons_and_links_text_disabled_light"
android:layout_marginEnd="@dimen/content_padding"
android:layout_marginStart="@dimen/content_padding" />
osmand:srcCompat="@drawable/ic_action_user_account" />
<RelativeLayout
android:id="@+id/padding_ver"
android:layout_width="32dp"
android:layout_height="36dp"
android:layout_marginTop="6dp"
android:alpha="0.01" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:orientation="vertical"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:paddingStart="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding">
android:layout_width="216dp"
android:layout_height="@dimen/bottom_sheet_descr_height"
android:gravity="center_vertical"
android:orientation="vertical">
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/account_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:singleLine="true"
android:letterSpacing="@dimen/text_button_letter_spacing"
android:id="@+id/account_title"
android:layout_width="216dp"
android:layout_height="@dimen/context_menu_padding_margin_large"
android:layout_marginTop="@dimen/subHeaderPadding"
android:gravity="center_vertical"
android:lineSpacingExtra="@dimen/map_widget_text_small_bottom_margin"
android:text="@string/login_account"
android:textColor="?android:textColorSecondary"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_regular" />
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/user_name"
android:layout_width="216dp"
android:layout_height="@dimen/context_menu_sub_info_height"
android:layout_marginBottom="@dimen/subHeaderPadding"
android:gravity="center_vertical"
android:letterSpacing="@dimen/description_letter_spacing"
android:lineSpacingExtra="5sp"
android:text="@string/login_account"
android:textColor="?android:textColorPrimary"
android:textSize="@dimen/default_list_text_size"
osmand:typeface="@string/font_roboto_regular" />
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/user_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:letterSpacing="@dimen/description_letter_spacing"
android:maxLines="4"
android:textColor="?android:textColorSecondary"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_regular" />
</LinearLayout>
</LinearLayout>

View file

@ -6,6 +6,7 @@ import android.view.ContextThemeWrapper;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
@ -71,8 +72,9 @@ public class SendOsmNoteBottomSheetFragment extends MenuBottomSheetDialogFragmen
final View sendOsmNoteView = View.inflate(new ContextThemeWrapper(getContext(), themeRes),
R.layout.send_osm_note_fragment, null);
TextView noteText = sendOsmNoteView.findViewById(R.id.note_text);
EditText noteText = sendOsmNoteView.findViewById(R.id.note_text);
noteText.setText(((OsmNotesPoint) poi[0]).getText());
noteText.setSelection(noteText.getText().length());
TextInputLayout noteHint = sendOsmNoteView.findViewById(R.id.note_hint);
noteHint.setHint(AndroidUtils.addColon(app, R.string.osn_bug_name));
accountBlockView = sendOsmNoteView.findViewById(R.id.account_container);

View file

@ -60,6 +60,7 @@ public class SendPoiBottomSheetFragment extends MenuBottomSheetDialogFragment {
messageEditText = sendOsmPoiView.findViewById(R.id.message_field);
String defaultChangeSet = createDefaultChangeSet(app);
messageEditText.setText(defaultChangeSet);
messageEditText.setSelection(messageEditText.getText().length());
final TextView accountName = sendOsmPoiView.findViewById(R.id.user_name);
OsmandSettings settings = app.getSettings();
String userNameOAuth = settings.USER_DISPLAY_NAME.get();

View file

@ -47,8 +47,6 @@ public class OsmLoginDataBottomSheet extends BasePreferenceBottomSheet {
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();
@ -64,11 +62,6 @@ 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);