Create background for keyboard item

This commit is contained in:
PavelRatushnyi 2017-09-28 11:17:14 +03:00
parent 78085e71e2
commit 6bb5aa6ae2
4 changed files with 20 additions and 6 deletions

View file

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

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/map_widget_blue" android:state_pressed="true"/>
<item android:drawable="@color/bg_color_light"/>
</selector>

View file

@ -4,7 +4,6 @@
xmlns:osmand="http://schemas.android.com/apk/res-auto" xmlns:osmand="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="56dp" android:layout_height="56dp"
android:background="?attr/bg_color"
android:orientation="vertical"> android:orientation="vertical">
<net.osmand.plus.widgets.TextViewEx <net.osmand.plus.widgets.TextViewEx

View file

@ -249,13 +249,14 @@ public class CoordinateInputDialogFragment extends DialogFragment {
if (convertView == null) { if (convertView == null) {
convertView = LayoutInflater.from(getContext()).inflate(R.layout.input_coordinate_keyboard_item, parent, false); convertView = LayoutInflater.from(getContext()).inflate(R.layout.input_coordinate_keyboard_item, parent, false);
} }
convertView.setBackgroundResource(lightTheme ? R.drawable.keyboard_item_light_bg : R.drawable.keyboard_item_dark_bg);
TextViewEx keyboardItem = (TextViewEx) convertView.findViewById(R.id.keyboard_item); TextViewEx keyboardItem = (TextViewEx) convertView.findViewById(R.id.keyboard_item);
if (position == DELETE_BUTTON_POSITION || position == CLEAR_BUTTON_POSITION) { // if (position == DELETE_BUTTON_POSITION || position == CLEAR_BUTTON_POSITION) {
keyboardItem.setTextSize(getResources().getDimension(R.dimen.default_list_text_size)); // keyboardItem.setTextSize(getResources().getDimension(R.dimen.default_list_text_size));
} else { // } else {
keyboardItem.setTextSize(getResources().getDimension(R.dimen.map_button_text_size)); // keyboardItem.setTextSize(getResources().getDimension(R.dimen.map_button_text_size));
} // }
keyboardItem.setText(getItem(position)); keyboardItem.setText(getItem(position));