Skip to content

Commit 5deec23

Browse files
committed
update android-tips
update android-tips
1 parent eb860f3 commit 5deec23

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

Diff for: README.md

+46-1
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ defaultConfig {
379379
//4.显示依旧报错,但编译可以通过。
380380
```
381381
* View类中的getDrawingCache()等一系列方法可以用于获取View显示的Bitmap对象。
382-
* ouchSlop,系统所能识别出的被认为是最小的滑动距离,ViewConfiguration.get(context).getScaledTouchSlop()。常用于自定义View。
382+
* TouchSlop,系统所能识别出的被认为是最小的滑动距离,ViewConfiguration.get(context).getScaledTouchSlop()。常用于自定义View。
383383
* Context的作用域</br>
384384
![](https://github.com/RealMoMo/Android-Tips/blob/master/img/context.png)
385385
* 修改Toast字体大小。
@@ -432,6 +432,51 @@ SparseBooleanArray 替代 HashMap<Integer,Boolean> </br>
432432
SparseIntArray 替代 HashMap<Integer,Integer> </br>
433433
SparseLongArray 替代 HashMap<Integer,Long> </br>
434434
LongSparseArray<V> 替代 HashMap<Long,V> </br>
435+
* UncaughtExceptionHandler接口,利用此接口可以对未捕获的异常善后。
436+
* ValueAnimator.reverse() 这个方法可以很顺利地取消正在运行的动画。
437+
* ViewParent.requestDisallowInterceptTouchEvent()——Android系统触摸事件机制大多时候能够默认处理,不过有时候你需要使用这个方法来剥夺父级控件的控制权。
438+
* 设置布局动画属性android:animateLayoutChanges="true",需要更炫的可以自定义动画添加android:layoutAnimation="@anim/your_animation"。
439+
```
440+
<!--Button点击事件只是对TextView.setVisibility-->
441+
<!--开启布局默认动画-->
442+
<LinearLayout
443+
android:animateLayoutChanges="true"
444+
android:layout_width="match_parent"
445+
android:layout_height="200dp">
446+
447+
<TextView
448+
android:text="666"
449+
android:id="@+id/tv1"
450+
android:layout_width="wrap_content"
451+
android:layout_height="wrap_content" />
452+
453+
<Button
454+
android:text="with Animation"
455+
android:onClick="one"
456+
android:layout_width="wrap_content"
457+
android:layout_height="wrap_content" />
458+
</LinearLayout>
459+
460+
461+
<LinearLayout
462+
463+
android:layout_width="match_parent"
464+
android:layout_height="200dp">
465+
466+
<TextView
467+
android:text="666"
468+
android:id="@+id/tv2"
469+
android:layout_width="wrap_content"
470+
android:layout_height="wrap_content" />
471+
472+
<Button
473+
android:text="none Animation"
474+
android:onClick="two"
475+
android:layout_width="wrap_content"
476+
android:layout_height="wrap_content" />
477+
</LinearLayout>
478+
```
479+
![](https://github.com/RealMoMo/Android-Tips/blob/master/img/animateLayoutChanges.gif)
435480

436481

437482
### Development tools

Diff for: img/animateLayoutChanges.gif

74.8 KB
Loading

0 commit comments

Comments
 (0)