我的应用程序有一个viewpager和4个选项卡,每个选项卡都有许多片段.但我只想在2个特定选项卡中滚动recyclerview时向上/向下滚动工具栏.但我不知道如何阻止工具栏滚动其他选项卡.我试图为每个片段导入工具栏,但似乎我不能这样做.有人有想法解决这个问题吗?
android android-fragments android-toolbar android-coordinatorlayout
像标题一样.我这样做了一个请求:
https://www.googleapis.com/youtube/v3/search?key=AIzaSyDuxczhyyvHWfxKuF3ygW9p0GWmKlvWLYc&part=id,snippet&publishedAfter=2014-12-09T00:00:00Z&publishedBefore=2014-12-11T00:00:00Z&videoCategoryId=GCSG93LXRvICYgRElZ&type=video&maxResults=50&pageToken=
Run Code Online (Sandbox Code Playgroud)
总结果是1000000.但我最多可以获得500个结果(10页,50个结果/页).在第10页,我没有看到nextPageToken属性转到下一页.??? 我不知道为什么.我怎样才能得到所有结果.
这是我的主要布局:
<LinearLayout 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="fill_parent"
android:animateLayoutChanges="true"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/top_con"
android:layout_width="match_parent"
android:layout_height="64dp"
android:background="#cc0000">
<TextView
android:id="@+id/close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:clickable="true"
android:text="Close"
android:textColor="#ffffff" />
</RelativeLayout>
<android.support.design.widget.CoordinatorLayout
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ffffff">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/blue"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
</android.support.design.widget.AppBarLayout>
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/green"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</android.support.design.widget.CoordinatorLayout>
Run Code Online (Sandbox Code Playgroud)
在事件onClick on TextView(id/close)之后,我将visibility for RelativeLayout(id/top_con)设置为GONE.但是FrameLayout(包含一个回收者视图)仍然是keep their height,并且在屏幕底部有一个白色空间(白色是CoordinatorLayout的背景颜色).什么是问题,如何解决?谢谢!
android android-layout android-design-library android-coordinatorlayout
作为标题.我正在编写一个支持多选模式的自定义RecyclerView.我需要跟踪每个项目的选定/未选择状态.因此,在RecyclerView的数据大小发生变化之后.我想更新跟踪状态列表的大小.但我不知道在哪里重写方法:notifyDataSetChanged,notifyItemChagned ....
像标题一样.我想在我的应用程序中通过编码删除Android的浏览器的cookie,缓存.(浏览器不是webview)谢谢!