11
11
*
12
12
*/
13
13
public class AndroidBug5497Workaround {
14
- public static void assistActivity (Activity activity ) {
15
- new AndroidBug5497Workaround (activity );
16
- }
17
14
private View mChildOfContent ;
18
15
private int usableHeightPrevious ;
19
16
private FrameLayout .LayoutParams frameLayoutParams ;
20
17
private int contentHeight ;
21
18
private boolean isfirst = true ;
22
19
private Activity activity ;
23
20
private int statusBarHeight ;
24
-
25
21
private AndroidBug5497Workaround (Activity activity ) {
26
22
//获取状态栏的高度
27
23
int resourceId = activity .getResources ().getIdentifier ("status_bar_height" , "dimen" , "android" );
@@ -45,6 +41,10 @@ public void onGlobalLayout() {
45
41
mChildOfContent .getLayoutParams ();
46
42
}
47
43
44
+ public static void assistActivity (Activity activity ) {
45
+ new AndroidBug5497Workaround (activity );
46
+ }
47
+
48
48
//重新调整跟布局的高度
49
49
private void possiblyResizeChildOfContent () {
50
50
@@ -71,7 +71,12 @@ private void possiblyResizeChildOfContent() {
71
71
usableHeightPrevious = usableHeightNow ;
72
72
}
73
73
}
74
- /** * 计算mChildOfContent可见高度 ** @return */
74
+
75
+ /**
76
+ * 计算mChildOfContent可见高度
77
+ *
78
+ * @return
79
+ */
75
80
private int computeUsableHeight () {
76
81
Rect r = new Rect ();
77
82
mChildOfContent .getWindowVisibleDisplayFrame (r );
0 commit comments