Android CoordinatorLayout滚动整个视图

时间:2018-02-13 03:51:19

标签: java android android-layout android-fragments android-coordinatorlayout

我有ViewPager个活动,使用CoordinatorLayout和几个标签。在每个标签中,我都有这些非常大的Fragment,它们不能一直适合用户的屏幕。我希望用户能够向上和向下滚动以查看整个Fragment。我显然也希望CoordinatorLayout选择滚动事件,这将隐藏Toolbar。我有Toolbar隐藏在滚动工作中,但在Toolbar滚动隐藏CoordinatorLayout之后,我无法滚动以查看下面的其余视图。

我怎样才能得到这种行为?

这是我简单的ViewPager活动布局

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.cryptobuddy.ryanbridges.cryptobuddy.currencylist.CurrencyListTabsActivity"
android:orientation="vertical">

<android.support.design.widget.AppBarLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/appBarLayout"
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar_currency_details"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
        app:layout_scrollFlags="scroll|enterAlways|snap"/>

    <android.support.design.widget.TabLayout
        android:id="@+id/tabs"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

</android.support.design.widget.AppBarLayout>

<android.support.v4.view.ViewPager
    android:id="@+id/currencyTabsViewPager"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="0dp"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

这是我的Fragment布局,在我的生活中我无法滚动:

<?xml version="1.0" encoding="utf-8"?>

<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.cryptobuddy.ryanbridges.cryptobuddy.chartandprice.CurrencyDetailsTabsActivity"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:fillViewport="true">

    <android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:id="@+id/swipe_refresh_layout"
        android:layout_gravity="center|bottom"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <ScrollView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:fillViewport="true"
            app:layout_behavior="@string/appbar_scrolling_view_behavior">

        <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/graph_fragment_horizontal_margin"
        android:paddingRight="@dimen/graph_fragment_horizontal_margin"
        android:paddingTop="@dimen/activity_vertical_margin"
        tools:context="com.cryptobuddy.ryanbridges.cryptobuddy.chartandprice.CurrencyDetailsTabsActivity">

        <TextView
            android:id="@+id/current_price"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginEnd="8dp"
            android:layout_marginStart="8dp"
            android:textSize="16sp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <TextView
            android:id="@+id/graphFragmentDateTextView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginEnd="8dp"
            android:layout_marginStart="8dp"
            android:textSize="12sp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.501"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/current_price" />


        <TextView
            android:id="@+id/percent_change"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginEnd="8dp"
            android:layout_marginStart="8dp"
            android:textSize="12sp"
            android:textStyle="bold"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/graphFragmentDateTextView" />

        <com.github.mikephil.charting.charts.LineChart
            android:id="@+id/chart"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:layout_marginBottom="8dp"
            android:layout_marginEnd="2dp"
            android:layout_marginStart="2dp"
            android:focusableInTouchMode="true"
            android:padding="0dp"
            app:layout_constraintBottom_toTopOf="@+id/guideline5"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="@+id/guideline6" />

        <com.nex3z.togglebuttongroup.SingleSelectToggleGroup
            android:id="@+id/chart_interval_button_grp"
            android:layout_width="384dp"
            android:layout_height="wrap_content"
            android:layout_marginEnd="8dp"
            android:layout_marginStart="8dp"
            android:layout_marginTop="8dp"
            app:layout_constraintBottom_toTopOf="@+id/guideline6"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/percent_change"
            app:tbgCheckedButton="@+id/dayButton"
            app:tbgChildSpacing="auto">

            <com.nex3z.togglebuttongroup.button.CircularToggle
                android:id="@+id/dayButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/oneDay"
                android:textSize="16sp"
                app:tbgMarkerColor="@color/colorAccent" />

            <com.nex3z.togglebuttongroup.button.CircularToggle
                android:id="@+id/weekButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/Week"
                android:textSize="16sp"
                app:tbgMarkerColor="@color/colorAccent" />

            <com.nex3z.togglebuttongroup.button.CircularToggle
                android:id="@+id/monthButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/Month"
                android:textSize="16sp"
                app:tbgMarkerColor="@color/colorAccent" />

            <com.nex3z.togglebuttongroup.button.CircularToggle
                android:id="@+id/threeMonthButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/threeMonth"
                android:textSize="16sp"
                app:tbgMarkerColor="@color/colorAccent" />

            <com.nex3z.togglebuttongroup.button.CircularToggle
                android:id="@+id/yearButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/Year"
                android:textSize="16sp"
                app:tbgMarkerColor="@color/colorAccent" />

            <com.nex3z.togglebuttongroup.button.CircularToggle
                android:id="@+id/allTimeButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/All"
                android:textSize="16sp"
                app:tbgMarkerColor="@color/colorAccent" />

        </com.nex3z.togglebuttongroup.SingleSelectToggleGroup>

        <android.support.constraint.Guideline
            android:id="@+id/guideline5"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            app:layout_constraintGuide_percent="0.5" />

        <android.support.constraint.Guideline
            android:id="@+id/guideline6"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            app:layout_constraintGuide_percent="0.15" />

            <TableLayout
                android:layout_width="0dp"
                android:layout_height="0dp"
                android:layout_marginEnd="8dp"
                android:layout_marginStart="8dp"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/guideline5">

                <TableRow
                    android:id="@+id/nameTableRow"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                    <TextView
                        android:id="@+id/tableNameTitleTextView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:text="Name" />

                    <TextView
                        android:id="@+id/tableNameDataTextView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="2"
                        android:text="TextView"
                        android:textAlignment="textEnd" />
                </TableRow>

                <TableRow
                    android:id="@+id/symbolTableRow"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                    <TextView
                        android:id="@+id/tableSymbolTitleTextView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:text="Symbol" />

                    <TextView
                        android:id="@+id/tableSymbolDataTextView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="2"
                        android:text="TextView"
                        android:textAlignment="textEnd" />
                </TableRow>

                <TableRow
                    android:id="@+id/priceUSDTableRow"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                    <TextView
                        android:id="@+id/tablePriceUSDTitleTextView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:text="Price (USD)" />

                    <TextView
                        android:id="@+id/tablePriceUSDDataTextView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="2"
                        android:text="TextView"
                        android:textAlignment="textEnd" />
                </TableRow>

                <TableRow
                    android:id="@+id/priceBTCTableRow"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                    <TextView
                        android:id="@+id/tablePriceBTCTitleTextView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:text="Price (BTC)" />

                    <TextView
                        android:id="@+id/tablePriceBTCDataTextView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="2"
                        android:text="TextView"
                        android:textAlignment="textEnd" />

                </TableRow>

                <TableRow
                    android:id="@+id/volUSDTableRow"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                    <TextView
                        android:id="@+id/tableVolUSDTitleTextView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:text="24h Volume" />

                    <TextView
                        android:id="@+id/tableVolUSDDataTextView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="2"
                        android:text="TextView"
                        android:textAlignment="textEnd" />
                </TableRow>

                <TableRow
                    android:id="@+id/mktCapUSDTableRow"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                    <TextView
                        android:id="@+id/tableMktCapTitleTextView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:text="Market Cap" />

                    <TextView
                        android:id="@+id/tableMktCapDataTextView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="2"
                        android:text="TextView"
                        android:textAlignment="textEnd" />
                </TableRow>

                <TableRow
                    android:id="@+id/availableSupplyTableRow"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                    <TextView
                        android:id="@+id/tableAvailableSupplyTitleTextView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:text="Available Supply" />

                    <TextView
                        android:id="@+id/tableAvailableSupplyDataTextView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="2"
                        android:text="TextView"
                        android:textAlignment="textEnd" />
                </TableRow>

                <TableRow
                    android:id="@+id/totalSupplyTableRow"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                    <TextView
                        android:id="@+id/tableTotalSupplyTextView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:text="Total Supply" />

                    <TextView
                        android:id="@+id/tableTotalSupplyDataTextView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="2"
                        android:text="TextView"
                        android:textAlignment="textEnd" />
                </TableRow>

                <TableRow
                    android:id="@+id/maxSupplyTableRow"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                    <TextView
                        android:id="@+id/tableMaxSupplyTitleTextView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:text="Max Supply" />

                    <TextView
                        android:id="@+id/tableMaxSupplyDataTextView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="2"
                        android:text="TextView"
                        android:textAlignment="textEnd" />
                </TableRow>

                <TableRow
                    android:id="@+id/changeTitlesTableRow"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                    <TextView
                        android:id="@+id/table1hrChangeTitleTextView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:text="Change 1hr"
                        android:textAlignment="center" />

                    <TextView
                        android:id="@+id/table24hrChangeTitleTextView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="2"
                        android:text="Change 24hr"
                        android:textAlignment="center" />

                    <TextView
                        android:id="@+id/tableWeekChangeTitleTextView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="3"
                        android:text="Change 7d"
                        android:textAlignment="center" />

                </TableRow>

                <TableRow
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                    <TextView
                        android:id="@+id/table1hrChangeDataTextView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:text="TextView"
                        android:textAlignment="center" />

                    <TextView
                        android:id="@+id/table24hrChangeDataTextView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="2"
                        android:text="TextView"
                        android:textAlignment="center" />

                    <TextView
                        android:id="@+id/table7dChangeDataTextView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="3"
                        android:text="TextView"
                        android:textAlignment="center" />
                </TableRow>
            </TableLayout>

    </android.support.constraint.ConstraintLayout>
        </ScrollView>

    </android.support.v4.widget.SwipeRefreshLayout>

2 个答案:

答案 0 :(得分:0)

来自您的片段代码:

  1. 移除最外面的NestedScrollView。你不需要它。
  2. app:layout_behavior="@string/appbar_scrolling_view_behavior"添加到已成为新父级的SwipeRefreshLayout
  3. 将内部ScrollView更改为NestedScrollView
  4. 告诉我们是否有效。

答案 1 :(得分:0)

我找到了解决方案。有两个问题:

  1. 我在ConstraintLayout中使用指南
  2. 我将ConstraintLayout中某些元素的高度/宽度设置为match_constraint
  3. 我删除了guidelines并在dp中提供了所有布局元素原始高度/宽度值。这似乎解决了这个问题。

    似乎滚动不能很好地适应指南中的元素

    现在是我的xml:

    <?xml version="1.0" encoding="utf-8"?>
    <android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/graphFragmentNestedScrollView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fillViewport="true"
    app:layout_behavior="@string/appbar_scrolling_view_behavior">
    
    <android.support.constraint.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingLeft="@dimen/graph_fragment_horizontal_margin"
        android:paddingRight="@dimen/graph_fragment_horizontal_margin"
        android:paddingTop="@dimen/activity_vertical_margin">
    
        <TextView
            android:id="@+id/current_price"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginEnd="8dp"
            android:layout_marginStart="8dp"
            android:textSize="16sp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />
    
        <TextView
            android:id="@+id/graphFragmentDateTextView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginEnd="8dp"
            android:layout_marginStart="8dp"
            android:textSize="12sp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/current_price" />
    
    
        <TextView
            android:id="@+id/percent_change"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginEnd="8dp"
            android:layout_marginStart="8dp"
            android:textSize="12sp"
            android:textStyle="bold"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/graphFragmentDateTextView" />
    
        <com.nex3z.togglebuttongroup.SingleSelectToggleGroup
            android:id="@+id/chart_interval_button_grp"
            android:layout_width="362dp"
            android:layout_height="wrap_content"
            android:layout_marginEnd="8dp"
            android:layout_marginStart="8dp"
            android:layout_marginTop="8dp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/percent_change"
            app:tbgCheckedButton="@+id/dayButton"
            app:tbgChildSpacing="auto">
    
            <com.nex3z.togglebuttongroup.button.CircularToggle
                android:id="@+id/dayButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/oneDay"
                android:textSize="16sp"
                app:tbgMarkerColor="@color/colorAccent" />
    
            <com.nex3z.togglebuttongroup.button.CircularToggle
                android:id="@+id/weekButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/Week"
                android:textSize="16sp"
                app:tbgMarkerColor="@color/colorAccent" />
    
            <com.nex3z.togglebuttongroup.button.CircularToggle
                android:id="@+id/monthButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/Month"
                android:textSize="16sp"
                app:tbgMarkerColor="@color/colorAccent" />
    
            <com.nex3z.togglebuttongroup.button.CircularToggle
                android:id="@+id/threeMonthButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/threeMonth"
                android:textSize="16sp"
                app:tbgMarkerColor="@color/colorAccent" />
    
            <com.nex3z.togglebuttongroup.button.CircularToggle
                android:id="@+id/yearButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/Year"
                android:textSize="16sp"
                app:tbgMarkerColor="@color/colorAccent" />
    
            <com.nex3z.togglebuttongroup.button.CircularToggle
                android:id="@+id/allTimeButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/All"
                android:textSize="16sp"
                app:tbgMarkerColor="@color/colorAccent" />
    
        </com.nex3z.togglebuttongroup.SingleSelectToggleGroup>
    
        <com.github.mikephil.charting.charts.LineChart
            android:id="@+id/chart"
            android:layout_width="match_parent"
            android:layout_height="275dp"
            android:layout_marginTop="8dp"
            android:focusableInTouchMode="true"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/chart_interval_button_grp" />
    
        <TableLayout
            android:id="@+id/tableLayoutGraphFragment"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="8dp"
            android:paddingBottom="8dp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/chart">
    
            <TableRow
                android:id="@+id/nameTableRow"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@color/lightGray">
    
                <TextView
                    android:id="@+id/tableNameTitleTextView"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:paddingStart="8dp"
                    android:text="Name" />
    
                <TextView
                    android:id="@+id/tableNameDataTextView"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="2"
                    android:paddingEnd="8dp"
                    android:textAlignment="textEnd" />
            </TableRow>
    
            <TableRow
                android:id="@+id/priceUSDTableRow"
                android:layout_width="match_parent"
                android:layout_height="match_parent">
    
                <TextView
                    android:id="@+id/tablePriceUSDTitleTextView"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:paddingStart="8dp"
                    android:text="Price (USD)" />
    
                <TextView
                    android:id="@+id/tablePriceUSDDataTextView"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="2"
                    android:paddingEnd="8dp"
                    android:textAlignment="textEnd" />
            </TableRow>
    
            <TableRow
                android:id="@+id/priceBTCTableRow"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@color/lightGray">
    
                <TextView
                    android:id="@+id/tablePriceBTCTitleTextView"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:paddingStart="8dp"
                    android:text="Price (BTC)" />
    
                <TextView
                    android:id="@+id/tablePriceBTCDataTextView"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="2"
                    android:paddingEnd="8dp"
                    android:textAlignment="textEnd" />
    
            </TableRow>
    
            <TableRow
                android:id="@+id/volUSDTableRow"
                android:layout_width="match_parent"
                android:layout_height="match_parent">
    
                <TextView
                    android:id="@+id/tableVolUSDTitleTextView"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:paddingStart="8dp"
                    android:text="24h Volume" />
    
                <TextView
                    android:id="@+id/tableVolUSDDataTextView"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="2"
                    android:paddingEnd="8dp"
                    android:textAlignment="textEnd" />
            </TableRow>
    
            <TableRow
                android:id="@+id/mktCapUSDTableRow"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@color/lightGray">
    
                <TextView
                    android:id="@+id/tableMktCapTitleTextView"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:paddingStart="8dp"
                    android:text="Market Cap" />
    
                <TextView
                    android:id="@+id/tableMktCapDataTextView"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="2"
                    android:paddingEnd="8dp"
                    android:textAlignment="textEnd" />
            </TableRow>
    
            <TableRow
                android:id="@+id/availableSupplyTableRow"
                android:layout_width="match_parent"
                android:layout_height="match_parent">
    
                <TextView
                    android:id="@+id/tableAvailableSupplyTitleTextView"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:paddingStart="8dp"
                    android:text="Available Supply" />
    
                <TextView
                    android:id="@+id/tableAvailableSupplyDataTextView"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="2"
                    android:paddingEnd="8dp"
                    android:textAlignment="textEnd" />
            </TableRow>
    
            <TableRow
                android:id="@+id/totalSupplyTableRow"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@color/lightGray">
    
                <TextView
                    android:id="@+id/tableTotalSupplyTextView"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:paddingStart="8dp"
                    android:text="Total Supply" />
    
                <TextView
                    android:id="@+id/tableTotalSupplyDataTextView"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="2"
                    android:paddingEnd="8dp"
                    android:textAlignment="textEnd" />
            </TableRow>
    
            <TableRow
                android:id="@+id/maxSupplyTableRow"
                android:layout_width="match_parent"
                android:layout_height="match_parent">
    
                <TextView
                    android:id="@+id/tableMaxSupplyTitleTextView"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:paddingStart="8dp"
                    android:text="Max Supply" />
    
                <TextView
                    android:id="@+id/tableMaxSupplyDataTextView"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="2"
                    android:paddingEnd="8dp"
                    android:textAlignment="textEnd" />
            </TableRow>
    
            <TableRow
                android:id="@+id/changeTitlesTableRow"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@color/lightGray">
    
                <TextView
                    android:id="@+id/table1hrChangeTitleTextView"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:paddingStart="8dp"
                    android:text="Change 1hr"
                    android:textAlignment="center" />
    
                <TextView
                    android:id="@+id/table24hrChangeTitleTextView"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="2"
                    android:paddingStart="8dp"
                    android:text="Change 24hr"
                    android:textAlignment="center" />
    
                <TextView
                    android:id="@+id/tableWeekChangeTitleTextView"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="3"
                    android:paddingStart="8dp"
                    android:text="Change 7d"
                    android:textAlignment="center" />
    
            </TableRow>
    
            <TableRow
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@color/lightGray">
    
                <TextView
                    android:id="@+id/table1hrChangeDataTextView"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:paddingEnd="8dp"
                    android:textAlignment="center"
                    android:textStyle="bold" />
    
                <TextView
                    android:id="@+id/table24hrChangeDataTextView"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="2"
                    android:paddingEnd="8dp"
                    android:textAlignment="center"
                    android:textStyle="bold" />
    
                <TextView
                    android:id="@+id/tableWeekChangeDataTextView"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="3"
                    android:paddingEnd="8dp"
                    android:textAlignment="center"
                    android:textStyle="bold" />
            </TableRow>
        </TableLayout>
    
    </android.support.constraint.ConstraintLayout>