使用新的Android工作室与新的3.0.0 Gradle插件.
当发生一些警告时:
registerResGeneratingTask is deprecated, use
registerGeneratedFolders(FileCollection)
Run Code Online (Sandbox Code Playgroud) 我在android中执行gradle时收到以下警告:
Configuration 'compile' in project ':app' is deprecated.
Run Code Online (Sandbox Code Playgroud)
但是我的所有依赖项都包含在实现配置中.(还有模块)gradle中是否存在"隐形"依赖关系?
这是我的主要构建gradle文件:https://pastebin.com/ZJe7zrwn
我让我的TabLayout用动画的android:animateLayoutChanges ="真"的AppBarLayout.但是当我设置TabLayout.setVisibility(View.GONE)时,我的片段的容器立即上升到ActionBar几毫秒.然后它返回到TabLayout的末尾并将其上升到ActionBar.我在下面的gif上解释了这个.
由于某些原因,TabLayout背后的理论和实践按钮,但是当隐藏TabLayout动画时,启动FrameContainer,将我的视图固定在TabLayout的底部.
我录制了一段视频来说明这种行为.Dropbox视频播放器跳过一些帧和动画似乎很好.这就是为什么,要注意这个错误,你可以在电脑上加载视频,并以高质量观看5秒和11秒.视频
我的LayoutXML:
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<SurfaceView
android:layout_width="0px"
android:layout_height="0px"/>
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:animateLayoutChanges="true">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/>
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:visibility="gone"
app:tabGravity="fill"
app:tabIndicatorColor="@android:color/white"
app:tabMode="fixed"/>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.DrawerLayout
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<!--
This FrameLayout holds my fragments.
-->
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/outer_background">
<ProgressBar
android:id="@+id/main_load_progress"
android:layout_width="wrap_content" …
Run Code Online (Sandbox Code Playgroud) android android-animation android-fragments material-design android-appbarlayout