Update UI

This commit is contained in:
Victor Shcherb 2012-07-23 00:20:31 +02:00
parent 704786be63
commit 91e89169c5
15 changed files with 72 additions and 19 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 171 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

View file

@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/tab_icon_panel_pushed" android:state_selected="true"/>
<!-- <item android:drawable="@drawable/tab_icon_panel_pushed" android:state_selected="true"/> -->
<item android:drawable="@drawable/tab_icon_panel_pushed" android:state_selected="true"/>
<item android:drawable="@drawable/tab_icon_panel_background"/>
</selector>

View file

@ -7,5 +7,4 @@
<item>
<bitmap android:src="@drawable/tab_icon_panel_pushed_line" />
</item>
</layer-list>

View file

@ -1,58 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res/net.osmand.plus"
xmlns:custom2="http://schemas.android.com/apk/res/net.osmand.views"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:orientation="vertical">
<TextView android:id="@+id/TextView" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center_horizontal"
<TextView android:id="@+id/TopTextView" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center_horizontal"
android:layout_marginTop = "5dp" android:text="@string/search_address_top_text">
</TextView>
<TableLayout android:id="@+id/TableLayout" android:stretchColumns="1" android:layout_width="fill_parent" android:layout_height="wrap_content">
<LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_horizontal">
<TableLayout android:id="@+id/TableLayout" android:layout_width="fill_parent" android:stretchColumns="1" android:layout_height="wrap_content" android:gravity="center_horizontal">
<TableRow android:id="@+id/TableRow" android:layout_marginLeft = "5dp">
<TextView android:id="@+id/TextView" android:text="@string/search_address_region">
</TextView>
<Button android:id="@+id/CountryButton" android:text="@string/ChooseCountry">
</Button>
<net.osmand.view.ExpandableButton android:id="@+id/CountryButton" android:text="@string/ChooseCountry" custom:maxVisibleWidth="500dp"/>
<ImageButton android:id="@+id/ResetCountry" android:layout_marginRight = "5dp" android:background="@drawable/reset" android:contentDescription="@string/default_buttons_reset">
</ImageButton>
</TableRow>
<TableRow android:id="@+id/TableRow" android:layout_marginLeft = "5dp" >
<TextView android:id="@+id/TextView" android:text="@string/search_address_city">
</TextView>
<Button android:id="@+id/CityButton" android:text="@string/choose_city">
</Button>
<net.osmand.view.ExpandableButton android:id="@+id/CityButton" android:text="@string/choose_city" custom:maxVisibleWidth="500dp" />
<ImageButton android:id="@+id/ResetCity" android:layout_marginRight = "5dp" android:background="@drawable/reset" android:contentDescription="@string/default_buttons_reset">
</ImageButton>
</TableRow>
<TableRow android:id="@+id/TableRow" android:layout_marginLeft = "5dp">
<TextView android:id="@+id/TextView" android:text="@string/search_address_street">
</TextView>
<Button android:id="@+id/StreetButton" android:text="@string/choose_street">
</Button>
<net.osmand.view.ExpandableButton android:id="@+id/StreetButton" android:text="@string/choose_street" custom:maxVisibleWidth="500dp"/>
<ImageButton android:id="@+id/ResetStreet" android:layout_marginRight = "5dp" android:background="@drawable/reset" android:contentDescription="@string/default_buttons_reset">
</ImageButton>
</TableRow>
<TableRow android:id="@+id/TableRow" android:layout_marginLeft = "5dp">
<TextView android:id="@+id/BuildingText" android:text="@string/search_address_building">
</TextView>
<Button android:id="@+id/BuildingButton" android:text="@string/choose_building">
</Button>
<net.osmand.view.ExpandableButton android:id="@+id/BuildingButton" android:text="@string/choose_building" custom:maxVisibleWidth="500dp"/>
<ImageButton android:id="@+id/ResetBuilding" android:layout_marginRight = "5dp" android:background="@drawable/reset" android:contentDescription="@string/default_buttons_reset">
</ImageButton>
</TableRow>
<TableRow android:id="@+id/TableRow" android:layout_marginLeft = "5dp" >
<RadioGroup android:orientation="horizontal" android:layout_span="3" android:id="@+id/RadioGroup" >
</TableLayout>
</LinearLayout>
<RadioGroup android:orientation="horizontal" android:layout_span="3" android:id="@+id/RadioGroup" android:layout_marginLeft="5dp" android:layout_width="fill_parent" android:layout_height="wrap_content">
<RadioButton android:id="@+id/RadioBuilding" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/search_address_building_option"></RadioButton>
<RadioButton android:id="@+id/RadioIntersStreet" android:layout_width="wrap_content" android:layout_marginLeft = "5dp" android:layout_height="wrap_content" android:text="@string/search_address_street_option"></RadioButton>
</RadioGroup>
</TableRow>
</TableLayout>

View file

@ -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"
/>
</LinearLayout>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="ExpandableView">
<attr name="maxVisibleWidth" format="dimension"/>
</declare-styleable>
</resources>

View file

@ -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;

View file

@ -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());
// }
}
}