diff --git a/OsmAnd/res/drawable-hdpi/tab_icon_panel.png b/OsmAnd/res/drawable-hdpi/tab_icon_panel.png index 9159703f82..51fe490516 100644 Binary files a/OsmAnd/res/drawable-hdpi/tab_icon_panel.png and b/OsmAnd/res/drawable-hdpi/tab_icon_panel.png differ diff --git a/OsmAnd/res/drawable-hdpi/tab_icon_panel_pushed.9.png b/OsmAnd/res/drawable-hdpi/tab_icon_panel_pushed.9.png new file mode 100644 index 0000000000..198dc986fd Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/tab_icon_panel_pushed.9.png differ diff --git a/OsmAnd/res/drawable-hdpi/tab_icon_panel_pushed.png b/OsmAnd/res/drawable-hdpi/tab_icon_panel_pushed.png deleted file mode 100644 index c3aa61b765..0000000000 Binary files a/OsmAnd/res/drawable-hdpi/tab_icon_panel_pushed.png and /dev/null differ diff --git a/OsmAnd/res/drawable-large/tab_icon_panel_pushed.png b/OsmAnd/res/drawable-large/tab_icon_panel_pushed.png deleted file mode 100644 index c3aa61b765..0000000000 Binary files a/OsmAnd/res/drawable-large/tab_icon_panel_pushed.png and /dev/null differ diff --git a/OsmAnd/res/drawable-large/tab_search_screen_icon.png b/OsmAnd/res/drawable-large/tab_search_screen_icon.png new file mode 100644 index 0000000000..cdc6786718 Binary files /dev/null and b/OsmAnd/res/drawable-large/tab_search_screen_icon.png differ diff --git a/OsmAnd/res/drawable-mdpi/tab_icon_panel.png b/OsmAnd/res/drawable-mdpi/tab_icon_panel.png new file mode 100644 index 0000000000..9159703f82 Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/tab_icon_panel.png differ diff --git a/OsmAnd/res/drawable-mdpi/tab_icon_panel_pushed.9.png b/OsmAnd/res/drawable-mdpi/tab_icon_panel_pushed.9.png new file mode 100644 index 0000000000..198dc986fd Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/tab_icon_panel_pushed.9.png differ diff --git a/OsmAnd/res/drawable/tab_search_screen_icon.png b/OsmAnd/res/drawable-mdpi/tab_search_screen_icon.png similarity index 100% rename from OsmAnd/res/drawable/tab_search_screen_icon.png rename to OsmAnd/res/drawable-mdpi/tab_search_screen_icon.png diff --git a/OsmAnd/res/drawable/tab_icon_background.xml b/OsmAnd/res/drawable/tab_icon_background.xml index 8be7eb2c62..5801a34f60 100644 --- a/OsmAnd/res/drawable/tab_icon_background.xml +++ b/OsmAnd/res/drawable/tab_icon_background.xml @@ -1,7 +1,8 @@ - + + \ No newline at end of file diff --git a/OsmAnd/res/drawable/tab_icon_panel_background.xml b/OsmAnd/res/drawable/tab_icon_panel_background.xml index ab1894b7a0..a90e744e48 100644 --- a/OsmAnd/res/drawable/tab_icon_panel_background.xml +++ b/OsmAnd/res/drawable/tab_icon_panel_background.xml @@ -7,5 +7,4 @@ - \ No newline at end of file diff --git a/OsmAnd/res/layout/search_address.xml b/OsmAnd/res/layout/search_address.xml index 36f867a7df..a0d0e5c061 100644 --- a/OsmAnd/res/layout/search_address.xml +++ b/OsmAnd/res/layout/search_address.xml @@ -1,58 +1,54 @@ - - - + + - + - + - + - + - - + + + + - - - - diff --git a/OsmAnd/res/layout/search_main.xml b/OsmAnd/res/layout/search_main.xml index 3b6261090d..b9c970034a 100644 --- a/OsmAnd/res/layout/search_main.xml +++ b/OsmAnd/res/layout/search_main.xml @@ -25,6 +25,7 @@ android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="5dp" + android:layout_marginTop="4dp" android:background="@drawable/tab_search_panel_selector" /> diff --git a/OsmAnd/res/values/attrs.xml b/OsmAnd/res/values/attrs.xml new file mode 100644 index 0000000000..dbcd735780 --- /dev/null +++ b/OsmAnd/res/values/attrs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressActivity.java index 4acf679f5a..43c5e43f49 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressActivity.java @@ -350,6 +350,7 @@ public class SearchAddressActivity extends Activity { } else { selectAddressMode = false; } + findViewById(R.id.TopTextView).setVisibility(selectAddressMode? View.VISIBLE : View.GONE); region = null; postcode = null; diff --git a/OsmAnd/src/net/osmand/view/ExpandableButton.java b/OsmAnd/src/net/osmand/view/ExpandableButton.java new file mode 100644 index 0000000000..3c009fb58e --- /dev/null +++ b/OsmAnd/src/net/osmand/view/ExpandableButton.java @@ -0,0 +1,49 @@ +package net.osmand.view; + +import net.osmand.plus.R; +import android.content.Context; +import android.content.res.TypedArray; +import android.util.AttributeSet; +import android.widget.Button; + +public class ExpandableButton extends Button { + + private float maxWidth; + + public ExpandableButton(Context context, AttributeSet attrs) { + super(context, attrs); + if(attrs != null) { + TypedArray ar = context.obtainStyledAttributes(attrs, R.styleable.ExpandableView); + maxWidth = ar.getDimension(R.styleable.ExpandableView_maxVisibleWidth, 0); + } + } + + public ExpandableButton(Context context, AttributeSet attrs, int defStyle) { + super(context, attrs, defStyle); + if(attrs != null) { + TypedArray ar = context.obtainStyledAttributes(attrs, R.styleable.ExpandableView); + maxWidth = ar.getDimension(R.styleable.ExpandableView_maxVisibleWidth, 0); + } + } + + public ExpandableButton(Context context) { + this(context, null); + } + + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + if(MeasureSpec.getMode(widthMeasureSpec) == MeasureSpec.UNSPECIFIED) { + widthMeasureSpec = MeasureSpec.makeMeasureSpec((int) maxWidth, MeasureSpec.AT_MOST); + } else if(MeasureSpec.getMode(widthMeasureSpec) == MeasureSpec.AT_MOST && (MeasureSpec.getSize(widthMeasureSpec)) > maxWidth){ + widthMeasureSpec = MeasureSpec.makeMeasureSpec((int) maxWidth, MeasureSpec.AT_MOST); + } else if(MeasureSpec.getMode(widthMeasureSpec) == MeasureSpec.EXACTLY && (MeasureSpec.getSize(widthMeasureSpec)) > maxWidth){ + widthMeasureSpec = MeasureSpec.makeMeasureSpec((int) maxWidth, MeasureSpec.EXACTLY); + } + super.onMeasure(widthMeasureSpec, heightMeasureSpec); +// if(maxWidth != 0 && getMeasuredWidth() > maxWidth) { +// setMeasuredDimension((int) maxWidth, getMeasuredHeight()); +// } + } + +}