0
ボタンをスワイプするときにrecent_layoutを表示または非表示にしたいとします。 Androidのボタンでスワイプする方法を実装しますか?Androidでボタンをスワイプしてレイアウトを徐々に表示または非表示にする
<RelativeLayout
android:id="@+id/recent_layout"
android:layout_width="match_parent"
android:layout_below="@+id/img_layout"
android:background="@color/player_light_alpha"
android:visibility="invisible"
app:layout_behaviour="@string/appbar_scrolling_view_behavior"
app:layout_heightPercent="@fraction/recent_fraction">
<RelativeLayout
android:id="@+id/list_switcher_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.ibytecode.radioapp.view.LatoRegularTextView
android:id="@+id/recently_played_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_gravity="center"
android:layout_margin="@dimen/common_margin_8"
android:background="@drawable/selector_bg"
android:drawableLeft="@drawable/ic_recent"
android:gravity="center"
android:onClick="@{(view) -> presenter.onClick(view)}"
android:tag="@{tag.RECENTS}"
android:text="@string/recently_played"
android:textColor="@android:color/white"
android:textSize="@dimen/channel_name_size" />
<com.ibytecode.radioapp.view.LatoRegularTextView
android:id="@+id/favs_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:layout_margin="@dimen/common_margin_8"
android:background="@drawable/selector_bg"
android:drawableLeft="@drawable/ic_favourite"
android:gravity="center"
android:onClick="@{(view) -> presenter.onClick(view)}"
android:tag="@{tag.FAVOURITES}"
android:text="@string/favourites"
android:textColor="@android:color/white"
android:textSize="@dimen/channel_name_size" />
<com.ibytecode.radioapp.view.LatoRegularTextView
android:id="@+id/related_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_gravity="center"
android:layout_margin="@dimen/common_margin_8"
android:background="@drawable/selector_bg"
android:drawableLeft="@drawable/ic_favourite"
android:gravity="center"
android:onClick="@{(view) -> presenter.onClick(view)}"
android:tag="@{tag.RELATED}"
android:text="@string/related_items"
android:textColor="@android:color/white"
android:textSize="@dimen/channel_name_size" />
</RelativeLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/recent_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/list_switcher_layout"
android:layout_below="@+id/list_switcher_layout"
android:layout_marginTop="@dimen/recent_recyler_margin" />
<ImageView
android:id="@+id/no_content_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:visibility="gone" />
</RelativeLayout>
おかげで仲間が –
私の頭をscrotchingた。その後、onTouchEventをオーバーライドします。 –