Update colors

This commit is contained in:
Victor Shcherb 2015-03-26 00:58:08 +01:00
parent 8c01331c57
commit 665b9fde17
3 changed files with 12 additions and 2 deletions

View file

@ -5,6 +5,7 @@
android:orientation="horizontal">
<TextView
android:layout_marginLeft="5dp"
android:id="@+id/header"
android:layout_width="0dp"
android:layout_height="wrap_content"

View file

@ -68,6 +68,7 @@ public class DashNavigationFragment extends DashBaseFragment {
);
play.setImageDrawable(getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_action_play_dark)
);
favorites.addView(view);
}
}

View file

@ -156,7 +156,6 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks {
paddingView.setOnClickListener(listener);
listView.addHeaderView(paddingView);
listBackgroundView = mapActivity.findViewById(R.id.dash_list_background);
updateTopButton(0);
}
dashboardView.findViewById(R.id.animateContent).setOnClickListener(listener);
dashboardView.findViewById(R.id.map_part_dashboard).setOnClickListener(listener);
@ -401,9 +400,13 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks {
addOrUpdateDashboardFragments();
scrollView.setVisibility(View.VISIBLE);
listViewLayout.setVisibility(View.GONE);
updateTopButton(scrollView.getScrollY());
} else {
scrollView.setVisibility(View.GONE);
listViewLayout.setVisibility(View.VISIBLE);
if(listView instanceof ObservableListView) {
updateTopButton(((ObservableListView)listView).getScrollY());
}
if(refresh) {
refreshContent(false);
} else {
@ -766,10 +769,15 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks {
float sh = mFlexibleSpaceImageHeight - mFlexibleBlurSpaceHeight;
float t = sh == 0 ? 1 : (1 - Math.max(0, -scrollY + sh) / sh);
int clr = (((int) (t * 255)) << 24) | 0xff8f00;
paddingView.setBackgroundColor(clr);
if(t == 1) {
paddingView.setBackgroundColor(Color.TRANSPARENT);
} else {
paddingView.setBackgroundColor(clr);
}
if (listBackgroundView != null) {
dashboardView.findViewById(R.id.map_part_dashboard).setBackgroundColor(clr);
}
gradientToolbar.setAlpha((int) ((1 - t) * 255));
if (t < 1) {
((Toolbar) dashboardView.findViewById(R.id.toolbar)).setBackgroundDrawable(gradientToolbar);
} else {