Update navigation

This commit is contained in:
Victor Shcherb 2015-03-26 01:21:30 +01:00
parent 665b9fde17
commit 437ae44f5e
4 changed files with 25 additions and 16 deletions

View file

@ -18,8 +18,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="@dimen/list_item_height"
android:paddingLeft="@dimen/list_content_padding" >
android:minHeight="@dimen/list_item_height">
<ImageView
android:id="@+id/icon"
@ -27,12 +26,11 @@
android:layout_height="@dimen/list_item_height"
android:layout_gravity="center_vertical"
android:scaleType="center"
android:layout_marginRight="@dimen/favorites_icon_right_margin"
android:src="@drawable/ic_action_start_navigation" />
<TextView
android:id="@+id/name"
style="@style/ListText.Small"
android:textSize="14sp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"

View file

@ -4,7 +4,7 @@
android:id="@+id/toolbar"
android:layout_width="fill_parent"
android:layout_height="65dp"
android:layout_height="@dimen/dashboard_map_toolbar"
app:contentInsetStart="4dp"
app:contentInsetLeft="4dp"
android:background="@color/actionbar_light_color" >

View file

@ -43,7 +43,8 @@
<dimen name="gpx_small_icon_margin">3dp</dimen>
<dimen name="gpx_small_text_margin">14dp</dimen>
<dimen name="gpx_text_top_margin">6dp</dimen>
<dimen name="dashboard_map_top_blur">70dp</dimen>
<dimen name="dashboard_map_toolbar">60dp</dimen>
<dimen name="dashboard_map_top_blur">65dp</dimen>
<dimen name="dashboard_map_top_padding">240dp</dimen>
<dimen name="dashboard_map_bottom_padding">90dp</dimen>
<dimen name="dashboard_parking_left_margin">16dp</dimen>

View file

@ -768,20 +768,21 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks {
if (listBackgroundView != null) {
float sh = mFlexibleSpaceImageHeight - mFlexibleBlurSpaceHeight;
float t = sh == 0 ? 1 : (1 - Math.max(0, -scrollY + sh) / sh);
int clr = (((int) (t * 255)) << 24) | 0xff8f00;
if(t == 1) {
paddingView.setBackgroundColor(Color.TRANSPARENT);
} else {
paddingView.setBackgroundColor(clr);
}
int baseColor = 0xff8f00;
int alpha = (int) (t * 255);
// in order to have proper fast scroll down
int malpha = t == 1 ? alpha = 0 : alpha;
paddingView.setBackgroundColor(baseColor);
setAlpha(paddingView, malpha, baseColor);
if (listBackgroundView != null) {
dashboardView.findViewById(R.id.map_part_dashboard).setBackgroundColor(clr);
dashboardView.findViewById(R.id.map_part_dashboard).setBackgroundColor(baseColor);
setAlpha(dashboardView.findViewById(R.id.map_part_dashboard), malpha, baseColor);
}
gradientToolbar.setAlpha((int) ((1 - t) * 255));
if (t < 1) {
((Toolbar) dashboardView.findViewById(R.id.toolbar)).setBackgroundDrawable(gradientToolbar);
} else {
((Toolbar) dashboardView.findViewById(R.id.toolbar)).setBackgroundColor(clr);
((Toolbar) dashboardView.findViewById(R.id.toolbar)).setBackgroundColor(0xff000000 | baseColor);
}
}
if (actionButton != null) {
@ -832,8 +833,17 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks {
v.startAnimation(anim);
}
}
@SuppressLint("NewApi")
private void setAlpha(View v, int alpha, int clr) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
v.setAlpha(alpha/255.f);
} else {
int colr = (((int) alpha ) << 24) | clr;
v.setBackgroundColor(colr);
}
}
@Override
public void onDownMotionEvent() {
}