The statistics sheet is now scrollable if necessary - for example in landscape view (see issue #8). On larger screen (e.g. tablets) the sheet now has maximum width
parent
2d2fb7b21f
commit
cb56291dee
|
@ -141,7 +141,7 @@ public class MainActivityTrackFragment extends Fragment implements TrackbookKeys
|
||||||
|
|
||||||
|
|
||||||
// get views
|
// get views
|
||||||
View mStatisticsView = mRootView.findViewById(R.id.statistics_view);
|
View statisticsView = mRootView.findViewById(R.id.statistics_view);
|
||||||
mDistanceView = (TextView) mRootView.findViewById(R.id.statistics_data_distance);
|
mDistanceView = (TextView) mRootView.findViewById(R.id.statistics_data_distance);
|
||||||
mStepsView = (TextView) mRootView.findViewById(R.id.statistics_data_steps);
|
mStepsView = (TextView) mRootView.findViewById(R.id.statistics_data_steps);
|
||||||
mWaypointsView = (TextView) mRootView.findViewById(R.id.statistics_data_waypoints);
|
mWaypointsView = (TextView) mRootView.findViewById(R.id.statistics_data_waypoints);
|
||||||
|
@ -193,7 +193,7 @@ public class MainActivityTrackFragment extends Fragment implements TrackbookKeys
|
||||||
});
|
});
|
||||||
|
|
||||||
// react to tap on sheet heading
|
// react to tap on sheet heading
|
||||||
mStatisticsView.setOnClickListener(new View.OnClickListener() {
|
statisticsView.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
LogHelper.v(LOG_TAG,"Statistics view tapped");
|
LogHelper.v(LOG_TAG,"Statistics view tapped");
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
<!-- BOTTOM SHEET -->
|
<!-- BOTTOM SHEET -->
|
||||||
<android.support.v4.widget.NestedScrollView
|
<android.support.v4.widget.NestedScrollView
|
||||||
android:id="@+id/statistics_sheet"
|
android:id="@+id/statistics_sheet"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="@dimen/bottom_sheet_width"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="bottom"
|
android:layout_gravity="bottom"
|
||||||
android:background="@color/trackbook_blue_85percent"
|
android:background="@color/trackbook_blue_85percent"
|
||||||
|
@ -26,10 +26,14 @@
|
||||||
app:behavior_peekHeight="132dp"
|
app:behavior_peekHeight="132dp"
|
||||||
app:layout_behavior="android.support.design.widget.BottomSheetBehavior">
|
app:layout_behavior="android.support.design.widget.BottomSheetBehavior">
|
||||||
|
|
||||||
|
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="@dimen/activity_vertical_margin"
|
android:paddingTop="@dimen/activity_vertical_margin"
|
||||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||||
|
@ -169,7 +173,8 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_marginTop="4dp">
|
android:layout_marginTop="4dp"
|
||||||
|
android:layout_marginBottom="48dp">
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@ -188,6 +193,10 @@
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</android.support.v4.widget.NestedScrollView>
|
</android.support.v4.widget.NestedScrollView>
|
||||||
|
|
||||||
</android.support.design.widget.CoordinatorLayout>
|
</android.support.design.widget.CoordinatorLayout>
|
|
@ -1,8 +1,9 @@
|
||||||
<resources>
|
<resources>
|
||||||
<!-- Default screen margins, per the Android Design guidelines. -->
|
<!-- Default screen margins, per the Android Design guidelines. -->
|
||||||
|
<item name="custom_match_parent" type="dimen">-1</item> <!-- CUSTOM MATCH_PARENT - see https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#MATCH_PARENT -->
|
||||||
<dimen name="activity_horizontal_margin">16dp</dimen>
|
<dimen name="activity_horizontal_margin">16dp</dimen>
|
||||||
<dimen name="activity_vertical_margin">16dp</dimen>
|
<dimen name="activity_vertical_margin">16dp</dimen>
|
||||||
<dimen name="fab_margin">16dp</dimen>
|
<dimen name="fab_margin">16dp</dimen>
|
||||||
<dimen name="appbar_padding_top">8dp</dimen>
|
<dimen name="appbar_padding_top">8dp</dimen>
|
||||||
<dimen name="bottom_sheet_width">0dp</dimen> <!-- MATCH_PARENT -->
|
<dimen name="bottom_sheet_width">@dimen/custom_match_parent</dimen>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Loading…
Reference in New Issue