Commit d397635 1 parent bb9a8f3 commit d397635 Copy full SHA for d397635
File tree 2 files changed +20
-0
lines changed
documentscanner/src/main/java/com/haotran/documentscanner/activity
2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 1
1
package com .haotran .documentscanner .activity ;
2
2
3
3
import android .content .Intent ;
4
+ import android .os .Build ;
4
5
import android .support .design .widget .TabLayout ;
5
6
import android .support .v4 .app .Fragment ;
6
7
import android .support .v4 .app .FragmentManager ;
13
14
import android .util .Log ;
14
15
import android .view .DragEvent ;
15
16
import android .view .View ;
17
+ import android .view .Window ;
18
+ import android .view .WindowManager ;
16
19
import android .widget .LinearLayout ;
17
20
import android .widget .TextView ;
18
21
import android .widget .Toast ;
@@ -87,6 +90,13 @@ public void onClick(View v) {
87
90
}
88
91
});
89
92
93
+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .LOLLIPOP ) {
94
+ Window window = getWindow ();
95
+ window .clearFlags (WindowManager .LayoutParams .FLAG_TRANSLUCENT_STATUS );
96
+ window .addFlags (WindowManager .LayoutParams .FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS );
97
+ window .setStatusBarColor (ContextCompat .getColor (this , R .color .colorPrimaryDark ));
98
+ }
99
+
90
100
}
91
101
92
102
private void setupViewPager (ViewPager viewPager , String groupName ) {
Original file line number Diff line number Diff line change 2
2
3
3
import android .content .DialogInterface ;
4
4
import android .content .Intent ;
5
+ import android .os .Build ;
5
6
import android .support .v4 .content .ContextCompat ;
6
7
import android .support .v4 .view .ViewPager ;
7
8
import android .support .v7 .app .AlertDialog ;
14
15
import android .util .Log ;
15
16
import android .view .LayoutInflater ;
16
17
import android .view .View ;
18
+ import android .view .Window ;
19
+ import android .view .WindowManager ;
17
20
import android .widget .EditText ;
18
21
import android .widget .LinearLayout ;
19
22
import android .widget .TextView ;
@@ -212,6 +215,13 @@ public boolean accept(File pathname) {
212
215
initDataset (); // for testing
213
216
// mAdapter = new CustomAdapter(mDataset);
214
217
218
+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .LOLLIPOP ) {
219
+ Window window = getWindow ();
220
+ window .clearFlags (WindowManager .LayoutParams .FLAG_TRANSLUCENT_STATUS );
221
+ window .addFlags (WindowManager .LayoutParams .FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS );
222
+ window .setStatusBarColor (ContextCompat .getColor (this , R .color .colorPrimaryDark ));
223
+ }
224
+
215
225
}
216
226
217
227
public String getElementByIndex (int index ){
You can’t perform that action at this time.
0 commit comments