在屏蔽

时间:2017-07-12 19:48:02

标签: android android-layout material-design

我正在开发一个计算器应用程序,其主要活动包括顶部,这是一个RecyclerView,包含从历史角度从底部堆叠的表达式列表。底部是数字键盘的GridLayout。 当我在Android或BottomSheet中向下滑动la通知窗格但是翻转时,我想让顶视图可扩展。 RecyclerView应该首先显示顶部隐藏部分并填充整个屏幕,如果有更多,则用户可以滚动它。

<小时/> 以下是我想要的插图。

[1]

<小时/> 这是我到目前为止尝试过的主要布局。

activity_calculator.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    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"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    tools:context="com.akmal02.calc.MainActivity"
    android:animateLayoutChanges="true">

    <!-- The keypad has multiple pane so I enclose them with a ViewPager -->
    <android.support.v4.view.ViewPager
        android:id="@+id/pad_pager"
        android:layout_width="match_parent"
        android:layout_height="280dp"
        android:layout_alignParentBottom="true">

        <include android:id="@+id/page1" layout="@layout/pad_number" />
        <include android:id="@+id/page2" layout="@layout/pad_advanced" />
        <include android:id="@+id/page3" layout="@layout/pad_advanced" />

    </android.support.v4.view.ViewPager>



    <android.support.v7.widget.RecyclerView
        android:id="@+id/display_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@id/pad_pager" />

</RelativeLayout>

我如何在Android中实现?我检查了SlidingDrawer但它现在已被弃用,它使用了两个视图,其中一个作为句柄,而我只需要一个。或者我需要外部库吗?

0 个答案:

没有答案