This commit is contained in:
madwasp79 2019-06-17 19:12:59 +03:00
parent f2b88dc73b
commit 61a4b5b604
4 changed files with 111 additions and 37 deletions

View file

@ -155,33 +155,6 @@
</net.osmand.plus.widgets.OsmandTextFieldBoxes>
<LinearLayout
android:id="@+id/profile_icon_layout"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_marginEnd="@dimen/list_content_padding"
android:layout_marginRight="@dimen/list_content_padding"
android:clickable="true"
android:focusable="true"
android:gravity="center"
android:orientation="vertical"
>
<TextView
android:id="@+id/select_icon_btn_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="2dp"
android:text="Icon"
android:textSize="12sp"/>
<ImageView
android:id="@+id/select_icon_btn_img"
android:layout_width="@dimen/standard_icon_size"
android:layout_height="@dimen/standard_icon_size"
tools:src="@drawable/ic_action_car_dark"/>
</LinearLayout>
</LinearLayout>
@ -238,6 +211,102 @@
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/context_menu_action_buttons_h"
android:layout_marginTop="8dp"
android:layout_marginBottom="@dimen/list_content_padding"
android:layout_marginLeft="@dimen/list_content_padding"
android:layout_marginRight="@dimen/list_content_padding"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/divider_light"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal"
android:layout_gravity="center_vertical">
<LinearLayout
android:id="@+id/select_icon_button"
android:layout_width="0dp"
android:layout_height="match_parent"
android:background="?attr/selectableItemBackground"
android:layout_weight="1"
android:clickable="true"
android:focusable="true"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:layout_weight="1"
android:textSize="@dimen/default_list_text_size"
android:text="@string/shared_string_icon"
android:textColor="?attr/main_font_color_basic"/>
<ImageView
android:id="@+id/profile_icon_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/list_content_padding"
tools:src="@drawable/ic_action_horse"
tools:tint="@color/A400red"/>
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:paddingBottom="8dp"
android:paddingTop="8dp"
android:background="@color/divider_light"/>
<LinearLayout
android:id="@+id/select_icon_color_button"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:paddingLeft="@dimen/list_content_padding"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:textSize="@dimen/default_list_text_size"
android:text="@string/shared_string_color"
android:textColor="?attr/main_font_color_basic"/>
<ImageView
android:id="@+id/color_sample_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/list_content_padding"
tools:src = "@drawable/h_blue_ellipse_1_road_shield"
tools:tint="@color/A400red"/>
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/divider_light"/>
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"

View file

@ -89,7 +89,7 @@
android:id="@+id/divider_bottom"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/settings_divider" />
android:background="?attr/list_divider" />
</LinearLayout>

View file

@ -11,6 +11,7 @@
Thx - Hardy
-->
<string name="shared_string_icon">Icon</string>
<string name="app_profile_custom_nav_subtitle"></string>
<string name="rate_dialog_descr">Please give us 30 seconds, share feedback and rate our work on Google Play.</string>
<string name="button_rate">Rate</string>

View file

@ -88,6 +88,8 @@ public class EditProfileFragment extends BaseOsmAndFragment {
private ImageView profileIcon;
private LinearLayout profileIconBtn;
private ImageView colorSample;
private LinearLayout selectColorBtn;
private ExtendedEditText profileNameEt;
private OsmandTextFieldBoxes profileNameTextBox;
private ExtendedEditText navTypeEt;
@ -130,8 +132,10 @@ public class EditProfileFragment extends BaseOsmAndFragment {
final View view = inflater.inflate(R.layout.fragment_selected_profile, container, false);
profileIcon = view.findViewById(R.id.select_icon_btn_img);
profileIconBtn = view.findViewById(R.id.profile_icon_layout);
profileIcon = view.findViewById(R.id.profile_icon_img);
profileIconBtn = view.findViewById(R.id.select_icon_button);
colorSample = view.findViewById(R.id.color_sample_img);
selectColorBtn = view.findViewById(R.id.select_icon_color_button);
profileNameEt = view.findViewById(R.id.profile_name_et);
profileNameTextBox = view.findViewById(R.id.profile_name_otfb);
navTypeEt = view.findViewById(R.id.navigation_type_et);
@ -154,13 +158,13 @@ public class EditProfileFragment extends BaseOsmAndFragment {
profileNameEt.setFocusable(true);
profileNameEt.setSelectAllOnFocus(true);
profileIconBtn.setBackgroundResource(R.drawable.rounded_background_3dp);
GradientDrawable selectIconBtnBackground = (GradientDrawable) profileIconBtn.getBackground();
if (nightMode) {
selectIconBtnBackground.setColor(ContextCompat.getColor(app, R.color.text_field_box_dark));
} else {
selectIconBtnBackground.setColor(ContextCompat.getColor(app, R.color.text_field_box_light));
}
// profileIconBtn.setBackgroundResource(R.drawable.rounded_background_3dp);
// GradientDrawable selectIconBtnBackground = (GradientDrawable) profileIconBtn.getBackground();
// if (nightMode) {
// selectIconBtnBackground.setColor(ContextCompat.getColor(app, R.color.text_field_box_dark));
// } else {
// selectIconBtnBackground.setColor(ContextCompat.getColor(app, R.color.text_field_box_light));
// }
String title = "New Profile";