Update scroll view

This commit is contained in:
Victor Shcherb 2015-03-26 01:53:49 +01:00
parent d8fff2a364
commit 914486a348
4 changed files with 10 additions and 14 deletions

View file

@ -24,7 +24,7 @@
<include layout="@layout/dashboard_toolbar" />
<net.osmand.plus.dashboard.NotifyingScrollView
<com.github.ksoichiro.android.observablescrollview.ObservableScrollView
android:id="@+id/main_scroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -42,7 +42,7 @@
android:layout_height="wrap_content"
android:orientation="vertical" />
</LinearLayout>
</net.osmand.plus.dashboard.NotifyingScrollView>
</com.github.ksoichiro.android.observablescrollview.ObservableScrollView>
<FrameLayout
android:id="@+id/dash_list_view_layout"

View file

@ -16,7 +16,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent" >
<net.osmand.plus.dashboard.NotifyingScrollView
<com.github.ksoichiro.android.observablescrollview.ObservableScrollView
android:id="@+id/main_scroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -47,7 +47,7 @@
android:layout_height="wrap_content"
android:orientation="vertical" />
</LinearLayout>
</net.osmand.plus.dashboard.NotifyingScrollView>
</com.github.ksoichiro.android.observablescrollview.ObservableScrollView>
<FrameLayout
android:id="@+id/dash_list_view_layout"

View file

@ -43,8 +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_toolbar">60dp</dimen>
<dimen name="dashboard_map_top_blur">65dp</dimen>
<dimen name="dashboard_map_toolbar">58dp</dimen>
<dimen name="dashboard_map_top_blur">60dp</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

@ -62,6 +62,7 @@ import android.widget.ScrollView;
import android.widget.TextView;
import com.github.ksoichiro.android.observablescrollview.ObservableListView;
import com.github.ksoichiro.android.observablescrollview.ObservableScrollView;
import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks;
import com.github.ksoichiro.android.observablescrollview.ScrollState;
import com.software.shell.fab.ActionButton;
@ -92,7 +93,6 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks {
private boolean mapLinkedToLocation;
private float mapRotation;
private boolean inLocationUpdate = false;
private NotifyingScrollView scrollView;
private ListView listView;
private View listBackgroundView;
private View paddingView;
@ -131,14 +131,9 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks {
hideDashboard();
}
};
scrollView = ((NotifyingScrollView) dashboardView.findViewById(R.id.main_scroll));
ObservableScrollView scrollView = ((ObservableScrollView) dashboardView.findViewById(R.id.main_scroll));
listView = (ListView) dashboardView.findViewById(R.id.dash_list_view);
scrollView.setOnScrollChangedListener(new NotifyingScrollView.OnScrollChangedListener() {
public void onScrollChanged(ScrollView who, int l, int t, int oldl, int oldt) {
int sy = who.getScrollY();
updateTopButton(sy);
}
});
scrollView.setScrollViewCallbacks(this);
gradientToolbar = mapActivity.getResources().getDrawable(R.drawable.gradient_toolbar).mutate();
if (ScreenOrientationHelper.isOrientationPortrait(mapActivity)) {
((ObservableListView) listView).setScrollViewCallbacks(this);
@ -396,6 +391,7 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks {
actionButton.show();
updateDownloadBtn();
View listViewLayout = dashboardView.findViewById(R.id.dash_list_view_layout);
ScrollView scrollView = (ScrollView) dashboardView.findViewById(R.id.main_scroll);
if(visibleType == DashboardType.DASHBOARD) {
addOrUpdateDashboardFragments();
scrollView.setVisibility(View.VISIBLE);