最近我在 google play 控制台中崩溃了。
java.lang.NullPointerException:
at android.widget.Editor$SelectionModifierCursorController.access$300 (Editor.java:6696)
at android.widget.Editor.getEmailPopupWindow (Editor.java:1469)
at android.widget.Editor.showEmailPopupWindow (Editor.java:1477)
at android.widget.Editor.handleEmailPopup (Editor.java:1456)
at android.widget.Editor.updateCursorPosition (Editor.java:2099)
at android.widget.TextView.getUpdatedHighlightPath (TextView.java:7813)
at android.widget.TextView.onDraw (TextView.java:7998)
at android.view.View.draw (View.java:21472)
at android.view.View.updateDisplayListIfDirty (View.java:20349)
at android.view.View.draw (View.java:21204)
at android.view.ViewGroup.drawChild (ViewGroup.java:4412)
at android.view.ViewGroup.dispatchDraw (ViewGroup.java:4171)
at android.view.View.updateDisplayListIfDirty (View.java:20340)
at android.view.View.draw (View.java:21204)
at android.view.ViewGroup.drawChild (ViewGroup.java:4412)
at android.view.ViewGroup.dispatchDraw (ViewGroup.java:4171)
at android.view.View.updateDisplayListIfDirty (View.java:20340)
at android.view.View.draw (View.java:21204)
at android.view.ViewGroup.drawChild (ViewGroup.java:4412)
at androidx.recyclerview.widget.RecyclerView.drawChild (RecyclerView.java:4820)
at android.view.ViewGroup.dispatchDraw (ViewGroup.java:4171)
at android.view.View.updateDisplayListIfDirty (View.java:20340)
at android.view.View.draw (View.java:21204)
at android.view.ViewGroup.drawChild (ViewGroup.java:4412)
at android.view.ViewGroup.dispatchDraw (ViewGroup.java:4171) …Run Code Online (Sandbox Code Playgroud) 我有两个小部件的 MotionLayout,一个在 MotionLayout 中描述,第二个 - 在场景文件中。
布局文件:
<android.support.constraint.motion.MotionLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/motion_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layoutDescription="@xml/scene_test">
<View
android:id="@+id/test_view_static"
android:layout_width="40dp"
android:layout_height="40dp"
android:background="#ff0000"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/test_view_dynamic"
android:layout_width="40dp"
android:layout_height="40dp"
android:background="#00ff11" />
</android.support.constraint.motion.MotionLayout>
Run Code Online (Sandbox Code Playgroud)
场景文件:
<MotionScene xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">
<Transition
app:constraintSetStart="@+id/start"
app:constraintSetEnd="@+id/end"/>
<ConstraintSet android:id="@id/start">
<Constraint
android:id="@+id/test_view_dynamic"
android:layout_width="40dp"
android:layout_height="40dp"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</ConstraintSet>
<ConstraintSet android:id="@id/end">
<Constraint
android:id="@id/test_view_dynamic"
android:layout_width="40dp"
android:layout_height="40dp"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />
</ConstraintSet>
</MotionScene>
Run Code Online (Sandbox Code Playgroud)
然后在活动中我设置了进度:
//onCreate, etc..
MotionLayout motionLayout = findViewById(R.id.motion_layout);
motionLayout.setProgress(0.5f);
Run Code Online (Sandbox Code Playgroud)
动态的观点是右边的位置,但静态视图失去了所有的限制,但它不是由现场的影响,如所描述这里,只有在场景文件中描述的小部件应受到影响。
另一方面,假设您有一个包含十几个小部件的布局,但只有一个您正在制作动画?-?MotionScene 中的 ConstraintSet 只需要包含该小部件的约束。
库版本:
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:2.0.0-alpha2'
Run Code Online (Sandbox Code Playgroud)
示例项目在这里: …
我在项目(版本1.0.0)中安装了Android Room Persistence库,并将编译选项设置为1.8.当项目构建完成时,我收到此警告:
警告:注释处理器'android.arch.persistence.room.RoomProcessor'支持的源版本'RELEASE_7'小于-source'1.8'
一切正常,但这个警告让我很烦.如何删除它?
添加此依赖项不会删除警告,我不使用其他架构组件.
"android.arch.lifecycle:common-java8:1.0.0"
Run Code Online (Sandbox Code Playgroud)