[AND] iOS-like UI

This commit is contained in:
Dmitry Kunin 2013-12-05 19:44:08 +03:00 committed by Alex Zolotarev
parent d056b5f918
commit 98e541c862
21 changed files with 51 additions and 42 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 901 B

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 965 B

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 630 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 671 B

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

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="@drawable/btn_buypro_pressed" android:state_pressed="true"/>
<item android:drawable="@drawable/btn_buypro_normal"/>
</selector>

View file

@ -1,17 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:left="@dimen/drawer_grad_left">
<item>
<shape android:shape="rectangle" >
<gradient
android:endColor="@color/drawer_text_disabled"
android:startColor="@color/drawer_green"
android:type="linear" />
</shape>
</item>
<item android:right="3dp">
<shape android:shape="rectangle" >
<solid android:color="@color/drawer_back" />
<gradient
android:angle="90"
android:startColor="#23355D"
android:endColor="#2D2643"/>
</shape>
</item>

View file

@ -28,14 +28,19 @@
android:id="@+id/left_drawer"
android:layout_width="@dimen/drawer_width"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="@drawable/drawer_back"
android:paddingTop="@dimen/drawer_top_padding" >
android:layout_gravity="end"
android:background="@drawable/drawer_back" >
<include
android:layout_width="match_parent"
android:layout_height="match_parent"
layout="@layout/drawer_main" />
<View
android:layout_width="3dp"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:background="#000033" />
</RelativeLayout>
</android.support.v4.widget.DrawerLayout>

View file

@ -2,6 +2,7 @@
<merge xmlns:android="http://schemas.android.com/apk/res/android" >
<ScrollView
android:id="@+id/scroll_up"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/buy_pro"
@ -22,8 +23,8 @@
android:background="@drawable/drawer_item_back_selector" >
<TextView
android:id="@+id/map_button_search"
style="@style/Widget.MapButtonDrawer"
android:id="@+id/map_button_search"
android:contentDescription="@string/menu_search"
android:drawableLeft="@drawable/ic_search_selector"
android:drawableRight="@drawable/ic_probadge"
@ -37,8 +38,8 @@
android:background="@drawable/drawer_item_back_selector" >
<TextView
android:id="@+id/map_button_download"
style="@style/Widget.MapButtonDrawer"
android:id="@+id/map_button_download"
android:contentDescription="@string/download_maps"
android:drawableLeft="@drawable/ic_map_selector"
android:text="@string/download_maps" />
@ -51,8 +52,8 @@
android:background="@drawable/drawer_item_back_selector" >
<TextView
android:id="@+id/map_button_bookmarks"
style="@style/Widget.MapButtonDrawer"
android:id="@+id/map_button_bookmarks"
android:contentDescription="@string/bookmarks"
android:drawableLeft="@drawable/ic_bookmarks_selector"
android:drawableRight="@drawable/ic_probadge"
@ -89,17 +90,18 @@
<Button
android:id="@+id/buy_pro"
android:textColor="@android:color/white"
android:background="@drawable/btn_buypro_normal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginRight="@dimen/dp_x_8"
android:layout_marginLeft="@dimen/dp_x_8"
android:layout_marginBottom="@dimen/dp_x_8"
android:layout_margin="@dimen/dp_x_8"
android:layout_marginTop="@dimen/dp_x_6"
android:padding="@dimen/dp_x_2"
android:text="@string/become_a_pro" />
android:background="@drawable/buy_pro_selector"
android:paddingBottom="@dimen/dp_x_2"
android:paddingLeft="@dimen/dp_x_6"
android:paddingRight="@dimen/dp_x_6"
android:paddingTop="@dimen/dp_x_2"
android:text="@string/become_a_pro"
android:textColor="@android:color/white" />
</merge>

View file

@ -58,18 +58,19 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginBottom="0dp"
android:layout_marginRight="@dimen/zoom_margin_right"
android:gravity="bottom|right"
android:orientation="horizontal"
android:padding="0dp" >
android:layout_margin="0dp"
android:padding="0dp"
android:gravity="bottom|left"
android:orientation="horizontal" >
<ImageButton
android:id="@+id/map_button_myposition"
style="@style/Widget.MapButtonBottom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|center_vertical"
android:layout_gravity="left|bottom"
android:layout_marginBottom="@dimen/dp_x_2"
android:layout_marginLeft="@dimen/dp_x_2"
android:contentDescription="@string/my_position"
android:onClick="onMyPositionClicked"
android:src="@drawable/btn_map_controls_location_normal" />
@ -78,13 +79,11 @@
android:id="@+id/map_button_toggle_drawer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left|center_vertical"
android:layout_marginLeft="0dp"
android:layout_gravity="right|center_vertical"
android:layout_marginBottom="@dimen/dp_x_2"
android:background="@null"
android:contentDescription="@string/my_position"
android:paddingBottom="@dimen/dp_x_4"
android:paddingLeft="0dp"
android:paddingRight="@dimen/dp_x_1"
android:paddingLeft="@dimen/dp_x_2"
android:paddingTop="@dimen/dp_x_6"
android:src="@drawable/btn_menu_tail_selector" />
</FrameLayout>

View file

@ -5,12 +5,11 @@
<color name="text_primary">#333333</color>
<color name="text_seconadary">#999999</color>
<color name="drawer_back">#F3F3F3</color>
<color name="drawer_green">#4CD964</color>
<color name="drawer_back_inv">#AEEE</color>
<color name="drawer_text_active">#FFF</color>
<color name="drawer_text_inacative">#333333</color>
<color name="drawer_text_inacative">#FFF</color>
<color name="drawer_text_disabled">#999999</color>
<drawable name="semitransparent_white">#30FFFFFF</drawable>

View file

@ -34,6 +34,6 @@
<dimen name="dialog_max_height">320dp</dimen>
<dimen name="zoom_plus_top_margin">10dp</dimen>
<dimen name="zoom_margin">5dp</dimen>
<dimen name="zoom_margin_right">8dp</dimen>
<dimen name="zoom_margin_right">4dp</dimen>
</resources>

View file

@ -12,8 +12,6 @@
<style name="Widget.MapButtonBottom" parent="android:Widget.Holo.ImageButton">
<item name="android:background">@drawable/btn_map_control_bg_selector</item>
<item name="android:layout_margin">0dp</item>
<item name="android:padding">0dp</item>
</style>
<style name="tagGreenText" parent="@style/Holo.TextAppearance.Medium.Light">
@ -121,6 +119,7 @@
<item name="android:paddingTop">@dimen/dp_x_1</item>
<item name="android:paddingBottom">@dimen/dp_x_1</item>
<item name="android:gravity">left|center_vertical</item>
<item name="android:fontFamily">@string/robotoLight</item>
</style>
</resources>

View file

@ -638,13 +638,16 @@ public class MWMActivity extends NvEventQueueActivity implements LocationService
@Override
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY)
{
if (mDrawerLayout.isDrawerOpen(mMainDrawer))
return false;
final float dX = e2.getX() - e1.getX();
if (dX > 0) // scroll is right
if (dX < 0) // scroll is left
{
final float dY = e2.getY() - e1.getY();
if (Math.abs(dX) > Math.abs(dY)) // is closer to horizontal
{
toggleDrawer();
mDrawerLayout.openDrawer(mMainDrawer);
return true;
}
}
@ -786,7 +789,7 @@ public class MWMActivity extends NvEventQueueActivity implements LocationService
final int marginTop = (int) getResources().getDimension(R.dimen.zoom_plus_top_margin);
lp.setMargins(margin, marginTop, margin, margin);
mMainDrawer.setPadding(0, (int) getResources().getDimension(R.dimen.drawer_top_padding), 0, 0);
findViewById(R.id.scroll_up).setPadding(0, (int) getResources().getDimension(R.dimen.drawer_top_padding), 0, 0);
}
/// @name From Location interface