Android styles.xml
<resources>
<style name="Widget.EditText">
<item name="focusable">true</item>
<item name="focusableInTouchMode">true</item>
<item name="clickable">true</item>
<item name="background">?attr/editTextBackground</item>
<item name="textAppearance">?attr/textAppearanceMediumInverse</item>
<item name="textColor">?attr/editTextColor</item>
<item name="gravity">center_vertical</item>
<item name="breakStrategy">simple</item>
<item name="hyphenationFrequency">@dimen/config_preferredHyphenationFrequency</item>
<item name="defaultFocusHighlightEnabled">false</item>
</style>
</resources>
themes.xml
<resources>
<style name="Theme">
<item name="editTextStyle">@style/Widget.EditText</item>
...
</style>
</rsources>
TextView handleTextChanged 最先接收到文本改变信息
TextView invalidateRegion 重绘某个区域
- Handler :负责将任务添加到队列,执行结束后在主线程执行UI操作
- Looper :未绑定的线程开启循环消息队列,并获取消息
- MessageQueue :任务队列,保存发送的消息
Activity onclick View performClick
调试 TraceView Android Log MethodTracing HProf SamplingProfile monkey am traceview apktool androguard flowdroid doxygen Graphviz Bouml
"main@15761" prio=5 tid=0x2 nid=NA runnable
java.lang.Thread.State: RUNNABLE
at android.widget.TextView.onDraw(TextView.java:7879)
at android.view.View.draw(View.java:22342)
at android.view.View.updateDisplayListIfDirty(View.java:21218)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4428)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4401)
at android.view.View.updateDisplayListIfDirty(View.java:21178)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4428)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4401)
at android.view.View.updateDisplayListIfDirty(View.java:21178)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4428)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4401)
at android.view.View.updateDisplayListIfDirty(View.java:21178)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4428)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4401)
at android.view.View.updateDisplayListIfDirty(View.java:21178)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4428)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4401)
at android.view.View.updateDisplayListIfDirty(View.java:21178)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4428)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4401)
at android.view.View.updateDisplayListIfDirty(View.java:21178)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:559)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:565)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:642)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:4079)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3806)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3077)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1943)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8151)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:972)
at android.view.Choreographer.doCallbacks(Choreographer.java:796)
at android.view.Choreographer.doFrame(Choreographer.java:731)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:957)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Method.java:-1)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
onDraw RecordingCanvas DynamicLayout
Written with StackEdit.