我有一个活动,它从支持库托管DrawerLayout和NavigationView.我正在为导航视图设置标题布局,我希望导航标题高度为"wrap_content".因此,当我将高度设置为"wrap_content"时,标题布局会位于状态栏后面.
我想要的结果是导航抽屉应该在状态栏后面绘制,但导航标题应该按状态栏高度向下推.
下面是我得到的截图.请注意状态栏后面的"SIGN IN"按钮.
活动布局
<android.support.v4.widget.DrawerLayout
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:id="@+id/nav_drawer"
android:fitsSystemWindows="true">
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.view.ViewPager
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="@string/appbar_scrolling_view_behavior"></android.support.v4.view.ViewPager>
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include layout="@layout/include_toolbar"/>
<android.support.design.widget.TabLayout
app:theme="@style/ThemeOverlay.AppCompat.Dark"
style="@style/MyCustomTabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/tabs"
/>
</android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>
<android.support.design.widget.NavigationView
android:id="@+id/navigation_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
app:headerLayout="@layout/nav_header"
app:menu="@menu/menu_navigation"
android:fitsSystemWindows="true"
android:layout_gravity="start"/>
</android.support.v4.widget.DrawerLayout>
Run Code Online (Sandbox Code Playgroud)
导航视图标题布局
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimaryDark"
android:padding="16dp"
android:theme="@style/ThemeOverlay.AppCompat.Dark"
android:orientation="vertical"
android:fitsSystemWindows="true"
android:gravity="bottom">
<TextView
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/text_user_name"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"/>
<TextView
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/text_email"
android:textAppearance="@style/TextAppearance.AppCompat.Body2"/>
<Button
android:id="@+id/button_sign_in"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Sign In"/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
我通过StackOverflow搜索了一个解决方案,但找不到它.所以有人请说清楚.提前致谢.
android navigation-drawer material-design navigationview androiddesignsupport
我在Google Play上有一款安卓游戏.现在我正在努力使其与Android TV兼容.我没有任何Android TV硬件.所以我在模拟器中测试.我能够使用Android 5.0为Android TV启动Android Emulator.我的游戏正在使用Google Play游戏服务.因此,要测试它,我需要在模拟器中使用Google API.但是,如果我尝试使用Google API创建Android TV模拟器,我看不到带有Google API的Android TV的系统图像.
这是我缺少的东西,或者模拟器不支持"使用Google API的Android TV"
这方面的任何信息都会有所帮助.
编辑
我发现Android TV系统图像默认使用Google API.但是当我在模拟器上运行我的应用程序(使用Google Play服务)时,我会在警报对话框中收到以下消息
google play services which some of your applications rely on is not supported by your device
Run Code Online (Sandbox Code Playgroud)
此外,我在日志中的某处看到了以下内容.
google play services not available due to error 9
Run Code Online (Sandbox Code Playgroud)
google play services is invalid. cannot recover"
Run Code Online (Sandbox Code Playgroud) android android-emulator google-play-services google-play-games android-tv
我正在开发一款集成了Google Play游戏服务的游戏.它在物理设备上运行良好.但是当我在模拟器上运行应用程序时,它会显示"安装Play游戏服务",如下所示.
我正在使用x86_64 Android 6.0(带有Google API)图像进行模拟.我也尝试了其他图像,但都有相同的结果.模拟器具有Google Play Services 8.4.89.
我已经尝试将模拟器图像更新到最新版本.但它没有帮助.
部分工作的一件事是将Play Games apk加载到模拟器.它适用于一些模拟器,很难找到对应于每个模拟器配置的apk.此外,我觉得这不是解决这个问题的真正/官方方式,因为它是一个hacky解决方法.
所以我正在寻找一个官方建议解决这个问题的解决方案.
请不要建议单击"安装"按钮,因为它仅适用于真实设备.
android android-emulator google-play-services google-play-games
我知道这将与此重复 - > 如何在SW2更新后修复索尼SmartWatch 2上的自定义手表时间
但是发帖是因为原始问题由于我不清楚的原因而被关闭了.
背景
我在谷歌的Play应用程式(https://play.google.com/store/apps/details?id=com.epix.smartextension.watchfaces),它提供定制手表面临着索尼的SmartWatch 2,它已经有在商店接近一年,表现不错.
问题
最近索尼推出了SW2的固件更新.在此更新后,它确实带来了一些欢迎功能.但随之而来的是严重的错误.主要问题是它使所有第三方定制表面(包括我的)无意义.这是在此更新后,自定义表盘开始显示错误的时间,日期等.
我尝试了什么
我用Sony的最新文档和示例代码仔细检查了我的代码.我确定问题不在于我的代码,因为它在固件更新之前的这几个月都运行良好.此外,我找不到任何官方信息表面API是否有任何新的变化或类似的东西.我还通过电子邮件与索尼开发人员的支持联系.他们已经确定已经向他们的团队报告了该问题,并指示我在stackoverflow中发布有关相同内容的查询.因此我发布了这个.
题
这方面的任何信息都会有很大帮助.我的应用程序最近开始在商店中得到不好的评论,并且发现很难让用户相信这个问题.
我希望在我的应用程序中使用新的体系结构组件“分页库” https://developer.android.com/topic/libraries/architecture/paging.html,该组件从服务器中获取数据并在recyclerview中显示。
分页库是一个很好的补充,有助于管理内容分页。我检查了所有样本,它们工作正常。但是我有一个要求,那就是当我们滚动到recyclerview的末尾并且下一页开始加载时(由分页库管理),我需要在底部显示一个进度条行。
我知道如何使用recyclerview滚动侦听器和2种视图类型执行此操作。但是我正在寻找的解决方案是如何使用“分页库”来做到这一点。它具有启用占位符的选项,这不是我想要的。
对此,我们将给予任何帮助。
android android-architecture-lifecycle android-architecture-components android-paging
我能够设置一个 DataTable 来显示一堆数据。但是想要在点击一行时导航到另一个屏幕。
不幸的是,DataRow 没有 onTap 回调。
我最终为每个 DataCell 添加了 onTap,这看起来像是一个笨拙的解决方案。有没有其他方法可以处理这个问题?
自Google Play Services 4.1发布至今已近一周.我对这里引入的基于回合制的多人游戏功能非常感兴趣.
但我找不到任何官方文档或实施指南.有人有这方面的任何信息吗?
android ×5
android-architecture-components ×1
android-architecture-lifecycle ×1
android-tv ×1
dart ×1
datatable ×1
flutter ×1
sony ×1