最近我收到了一个lint错误,我的使用android.support.v7.view.menu.MenuPopupHelper现在已被隐藏,并且仅限于在其库组中使用.
确切的消息:
MenuPopupHelper constructor can only be called from within the same library group (groupId=com.android.support)
摘自MenuPopupHelper.java班级:
/**
* Presents a menu as a small, simple popup anchored to another view.
*
* @hide
*/
@RestrictTo(LIBRARY_GROUP)
public class MenuPopupHelper implements MenuHelper {
Run Code Online (Sandbox Code Playgroud)
问题: 任何想法何时以及为何发生这种情况?或者我应该寻找的解决方法是什么?
10月26日,我的Travis CI构建突然失败,所提到的解决方法都没有为我工作(如https://github.com/travis-ci/travis-ci/issues/6193).我的皮棉报告中报告了确切的问题:
The SDK platform-tools version (23.0.1) is too old to check APIs compiled with API 25; please update
这是特拉维斯工作的日志:https://api.travis-ci.org/jobs/294869249/log.txt?deansi = true
我PR的链接:https://github.com/edx/edx-app-android/pull/1020
platform-tools revision 26.0.2最近发布了其下载完成错误的校验和,因此Travis正在使用后备platform-tools revision 23.0.1来运行我的项目上的lint导致问题.
以下是作业日志中的错误摘录(https://api.travis-ci.org/jobs/294869249/log.txt?deansi=true):
安装档案:
准备安装档案
下载Android SDK平台工具,修订版26.0.2
下载完成错误的校验和.预计b8130e7c390496cff12bf9355739bd41eed6a0a5,得到668ff8e319715175ff628ad52b124f154275fe2d.
完成.什么都没安装.
有什么想法修复?
continuous-integration android github travis-ci platform-tools
我想在一个主题中应用自定义样式TextInputLayout's hint并将error其全局应用,即在styles.xml中定义它,并以某种方式将其TextInputLayouts应用于整个应用程序中使用的所有内容,而无需像这样添加内联:
<android.support.design.widget.TextInputLayout
android:id="@+id/usernameWrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/email_username"
android:textColorHint="@color/grey_text"
app:theme="@style/my_custom_style">
<style name="my_custom_style" parent="Widget.Design.TextInputLayout">
<item name="android:textColorHint">@color/success_accent</item>
<item name="android:textSize">20sp</item>
</style>
Run Code Online (Sandbox Code Playgroud)
我们可以像这样做Button小部件:
styles.xml
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="buttonStyle">@style/my.Widget.Button</item>
<item name="android:buttonStyle">@style/my.Widget.Button</item>
</style>
<style name="my.Widget.Button" parent="@android:style/Widget.TextView">
<item name="android:gravity">center</item>
<item name="android:textSize">@dimen/some_dimen</item>
<item name="android:textAllCaps">false</item>
</style>
Run Code Online (Sandbox Code Playgroud)
注意:我目前正在考虑将子类化TextInputLayout作为最后的手段,因此,请在回答时牢记这一点.
谢谢 :)