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
This commit is contained in:
parent
2d2fb7b21f
commit
cb56291dee
3 changed files with 164 additions and 154 deletions
|
@ -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,167 +26,176 @@
|
||||||
app:behavior_peekHeight="132dp"
|
app:behavior_peekHeight="132dp"
|
||||||
app:layout_behavior="android.support.design.widget.BottomSheetBehavior">
|
app:layout_behavior="android.support.design.widget.BottomSheetBehavior">
|
||||||
|
|
||||||
<LinearLayout
|
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
android:paddingTop="@dimen/activity_vertical_margin"
|
|
||||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
|
||||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
|
||||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
|
||||||
android:scrollbars="vertical">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:paddingTop="@dimen/activity_vertical_margin"
|
||||||
android:layout_marginBottom="8dp">
|
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||||
<TextView
|
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||||
android:id="@+id/statistics_view"
|
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||||
android:layout_width="0dp"
|
android:scrollbars="vertical">
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:textAppearance="@android:style/TextAppearance.Large.Inverse"
|
<LinearLayout
|
||||||
android:layout_weight="1"
|
android:layout_width="match_parent"
|
||||||
android:gravity="start|center"
|
android:layout_height="wrap_content"
|
||||||
android:textStyle="bold"
|
android:orientation="horizontal"
|
||||||
android:textAllCaps="true"
|
android:layout_marginBottom="8dp">
|
||||||
android:text="@string/statistics_sheet_h1_statistics"
|
<TextView
|
||||||
android:contentDescription="@string/descr_statistics_sheet_headline" />
|
android:id="@+id/statistics_view"
|
||||||
<ImageView
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:textAppearance="@android:style/TextAppearance.Large.Inverse"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="start|center"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textAllCaps="true"
|
||||||
|
android:text="@string/statistics_sheet_h1_statistics"
|
||||||
|
android:contentDescription="@string/descr_statistics_sheet_headline" />
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="end|center"
|
||||||
|
android:background="@drawable/ic_statistics_white_48dp"
|
||||||
|
android:contentDescription="@string/descr_statistics_sheet_icon" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="end|center"
|
android:orientation="horizontal"
|
||||||
android:background="@drawable/ic_statistics_white_48dp"
|
android:layout_marginTop="12dp">
|
||||||
android:contentDescription="@string/descr_statistics_sheet_icon" />
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="4dp"
|
||||||
|
android:text="@string/statistics_sheet_p_distance"
|
||||||
|
android:textAppearance="@android:style/TextAppearance.Small.Inverse"
|
||||||
|
android:contentDescription="@string/descr_statistics_sheet_p_distance" />
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/statistics_data_distance"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/statistics_sheet_p_default_data"
|
||||||
|
android:textAppearance="@android:style/TextAppearance.Medium.Inverse"
|
||||||
|
android:contentDescription="@string/descr_statistics_sheet_p_distance_value" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_marginTop="4dp">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="4dp"
|
||||||
|
android:text="@string/statistics_sheet_p_steps"
|
||||||
|
android:textAppearance="@android:style/TextAppearance.Small.Inverse"
|
||||||
|
android:contentDescription="@string/descr_statistics_sheet_p_steps" />
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/statistics_data_steps"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/statistics_sheet_p_default_data"
|
||||||
|
android:textAppearance="@android:style/TextAppearance.Medium.Inverse"
|
||||||
|
android:contentDescription="@string/descr_statistics_sheet_p_steps_value" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_marginTop="4dp">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="4dp"
|
||||||
|
android:text="@string/statistics_sheet_p_waypoints"
|
||||||
|
android:textAppearance="@android:style/TextAppearance.Small.Inverse"
|
||||||
|
android:contentDescription="@string/descr_statistics_sheet_p_waypoints" />
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/statistics_data_waypoints"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/statistics_sheet_p_default_data"
|
||||||
|
android:textAppearance="@android:style/TextAppearance.Medium.Inverse"
|
||||||
|
android:contentDescription="@string/descr_statistics_sheet_p_waypoints_value" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_marginTop="8dp">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="4dp"
|
||||||
|
android:text="@string/statistics_sheet_p_duration"
|
||||||
|
android:textAppearance="@android:style/TextAppearance.Small.Inverse"
|
||||||
|
android:contentDescription="@string/descr_statistics_sheet_p_duration" />
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/statistics_data_duration"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/statistics_sheet_p_default_data"
|
||||||
|
android:textAppearance="@android:style/TextAppearance.Medium.Inverse"
|
||||||
|
android:contentDescription="@string/descr_statistics_sheet_p_duration_value" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_marginTop="4dp">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="4dp"
|
||||||
|
android:text="@string/statistics_sheet_p_recording_start"
|
||||||
|
android:textAppearance="@android:style/TextAppearance.Small.Inverse"
|
||||||
|
android:contentDescription="@string/descr_statistics_sheet_p_recording_start" />
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/statistics_data_recording_start"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/statistics_sheet_p_default_data"
|
||||||
|
android:textAppearance="@android:style/TextAppearance.Medium.Inverse"
|
||||||
|
android:contentDescription="@string/descr_statistics_sheet_p_recording_start_value" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:layout_marginBottom="48dp">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="4dp"
|
||||||
|
android:text="@string/statistics_sheet_p_recording_stop"
|
||||||
|
android:textAppearance="@android:style/TextAppearance.Small.Inverse"
|
||||||
|
android:contentDescription="@string/descr_statistics_sheet_p_recording_end" />
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/statistics_data_recording_stop"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/statistics_sheet_p_default_data"
|
||||||
|
android:textAppearance="@android:style/TextAppearance.Medium.Inverse"
|
||||||
|
android:contentDescription="@string/descr_statistics_sheet_p_recording_end_value" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
</ScrollView>
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_marginTop="12dp">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginEnd="4dp"
|
|
||||||
android:text="@string/statistics_sheet_p_distance"
|
|
||||||
android:textAppearance="@android:style/TextAppearance.Small.Inverse"
|
|
||||||
android:contentDescription="@string/descr_statistics_sheet_p_distance" />
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/statistics_data_distance"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/statistics_sheet_p_default_data"
|
|
||||||
android:textAppearance="@android:style/TextAppearance.Medium.Inverse"
|
|
||||||
android:contentDescription="@string/descr_statistics_sheet_p_distance_value" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_marginTop="4dp">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginEnd="4dp"
|
|
||||||
android:text="@string/statistics_sheet_p_steps"
|
|
||||||
android:textAppearance="@android:style/TextAppearance.Small.Inverse"
|
|
||||||
android:contentDescription="@string/descr_statistics_sheet_p_steps" />
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/statistics_data_steps"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/statistics_sheet_p_default_data"
|
|
||||||
android:textAppearance="@android:style/TextAppearance.Medium.Inverse"
|
|
||||||
android:contentDescription="@string/descr_statistics_sheet_p_steps_value" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_marginTop="4dp">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginEnd="4dp"
|
|
||||||
android:text="@string/statistics_sheet_p_waypoints"
|
|
||||||
android:textAppearance="@android:style/TextAppearance.Small.Inverse"
|
|
||||||
android:contentDescription="@string/descr_statistics_sheet_p_waypoints" />
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/statistics_data_waypoints"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/statistics_sheet_p_default_data"
|
|
||||||
android:textAppearance="@android:style/TextAppearance.Medium.Inverse"
|
|
||||||
android:contentDescription="@string/descr_statistics_sheet_p_waypoints_value" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_marginTop="8dp">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginEnd="4dp"
|
|
||||||
android:text="@string/statistics_sheet_p_duration"
|
|
||||||
android:textAppearance="@android:style/TextAppearance.Small.Inverse"
|
|
||||||
android:contentDescription="@string/descr_statistics_sheet_p_duration" />
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/statistics_data_duration"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/statistics_sheet_p_default_data"
|
|
||||||
android:textAppearance="@android:style/TextAppearance.Medium.Inverse"
|
|
||||||
android:contentDescription="@string/descr_statistics_sheet_p_duration_value" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_marginTop="4dp">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginEnd="4dp"
|
|
||||||
android:text="@string/statistics_sheet_p_recording_start"
|
|
||||||
android:textAppearance="@android:style/TextAppearance.Small.Inverse"
|
|
||||||
android:contentDescription="@string/descr_statistics_sheet_p_recording_start" />
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/statistics_data_recording_start"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/statistics_sheet_p_default_data"
|
|
||||||
android:textAppearance="@android:style/TextAppearance.Medium.Inverse"
|
|
||||||
android:contentDescription="@string/descr_statistics_sheet_p_recording_start_value" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_marginTop="4dp">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginEnd="4dp"
|
|
||||||
android:text="@string/statistics_sheet_p_recording_stop"
|
|
||||||
android:textAppearance="@android:style/TextAppearance.Small.Inverse"
|
|
||||||
android:contentDescription="@string/descr_statistics_sheet_p_recording_end" />
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/statistics_data_recording_stop"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/statistics_sheet_p_default_data"
|
|
||||||
android:textAppearance="@android:style/TextAppearance.Medium.Inverse"
|
|
||||||
android:contentDescription="@string/descr_statistics_sheet_p_recording_end_value" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</android.support.v4.widget.NestedScrollView>
|
</android.support.v4.widget.NestedScrollView>
|
||||||
|
|
||||||
|
|
|
@ -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 a new issue