File tree Expand file tree Collapse file tree 7 files changed +29
-7
lines changed
app/src/main/java/com/werb/pickphotosample
java/com/werb/pickphotoview Expand file tree Collapse file tree 7 files changed +29
-7
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ protected void onCreate(Bundle savedInstanceState) {
43
43
public void onClick (View view ) {
44
44
new PickPhotoView .Builder (MainActivity .this )
45
45
.setPickPhotoSize (1 )
46
- .setClickSelectable (true )
46
+ .setClickSelectable (false )
47
47
.setShowCamera (true )
48
48
.setSpanCount (3 )
49
49
.setLightStatusBar (true )
Original file line number Diff line number Diff line change 1
1
package com.werb.pickphotoview
2
2
3
+ import android.graphics.Color
3
4
import android.os.Build
4
5
import android.os.Bundle
5
6
import android.support.v7.app.AppCompatActivity
6
7
import android.view.View
7
- import com.werb.pickphotoview.extensions.color
8
8
9
9
/* * Created by wanbo <[email protected] > on 2017/10/23. */
10
10
@@ -18,11 +18,14 @@ open class BasePickActivity : AppCompatActivity() {
18
18
private fun theme () {
19
19
GlobalData .model?.let {
20
20
if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .LOLLIPOP ) {
21
- window.statusBarColor = color(it.statusBarColor)
21
+ val decorView = window.decorView
22
+ val option = View .SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
23
+ decorView.systemUiVisibility = option
24
+ window.statusBarColor = Color .TRANSPARENT
22
25
}
23
26
if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .M ) {
24
27
if (it.lightStatusBar) {
25
- window.decorView.systemUiVisibility = View .SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
28
+ window.decorView.systemUiVisibility = View .SYSTEM_UI_FLAG_LIGHT_STATUS_BAR or View . SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
26
29
}
27
30
}
28
31
}
Original file line number Diff line number Diff line change @@ -63,7 +63,8 @@ class PickPhotoActivity : BasePickActivity() {
63
63
private fun initToolbar () {
64
64
val select = drawable(R .drawable.pick_svg_select)
65
65
GlobalData .model?.let {
66
- appbar.setBackgroundColor(color(it.toolbarColor))
66
+ toolbar.setBackgroundColor(color(it.toolbarColor))
67
+ statusBar.setBackgroundColor(color(it.statusBarColor))
67
68
midTitle.setTextColor(color(it.toolbarTextColor))
68
69
cancel.setTextColor(color(it.toolbarTextColor))
69
70
sure.setTextColor(alphaColor(color(it.toolbarTextColor)))
Original file line number Diff line number Diff line change @@ -55,7 +55,8 @@ class PickPhotoPreviewActivity : BasePickActivity() {
55
55
56
56
private fun initToolbar () {
57
57
GlobalData .model?.let {
58
- appbar.setBackgroundColor(color(it.toolbarColor))
58
+ toolbar.setBackgroundColor(color(it.toolbarColor))
59
+ statusBar.setBackgroundColor(color(it.statusBarColor))
59
60
midTitle.setTextColor(color(it.toolbarTextColor))
60
61
cancel.setTextColor(color(it.toolbarTextColor))
61
62
if (selectImages.size > 0 ) {
@@ -117,6 +118,13 @@ class PickPhotoPreviewActivity : BasePickActivity() {
117
118
window.decorView.systemUiVisibility = View .INVISIBLE
118
119
} else {
119
120
window.decorView.systemUiVisibility = View .VISIBLE
121
+ GlobalData .model?.let {
122
+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .M ) {
123
+ if (it.lightStatusBar) {
124
+ window.decorView.systemUiVisibility = View .SYSTEM_UI_FLAG_LIGHT_STATUS_BAR or View .SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
125
+ }
126
+ }
127
+ }
120
128
}
121
129
}
122
130
Original file line number Diff line number Diff line change 5
5
android : layout_width =" match_parent"
6
6
android : layout_height =" wrap_content" >
7
7
8
+ <View
9
+ android : id =" @+id/statusBar"
10
+ android : layout_width =" match_parent"
11
+ android : layout_height =" 24dp" />
12
+
8
13
<android .support.v7.widget.Toolbar
9
14
android : id =" @+id/toolbar"
10
15
android : layout_width =" match_parent"
Original file line number Diff line number Diff line change 2
2
<android .support.design.widget.AppBarLayout xmlns : android =" http://schemas.android.com/apk/res/android"
3
3
xmlns : app =" http://schemas.android.com/apk/res-auto"
4
4
android : id =" @+id/appbar"
5
- android : paddingTop =" 24dp"
6
5
android : layout_width =" match_parent"
7
6
android : layout_height =" wrap_content" >
8
7
8
+ <View
9
+ android : id =" @+id/statusBar"
10
+ android : layout_width =" match_parent"
11
+ android : layout_height =" 24dp" />
12
+
9
13
<android .support.v7.widget.Toolbar
10
14
android : id =" @+id/toolbar"
11
15
android : layout_width =" match_parent"
Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" utf-8" ?>
2
2
<resources xmlns : tools =" http://schemas.android.com/tools" >
3
3
<style name =" PickBaseTheme" parent =" Theme.AppCompat.Light.NoActionBar" >
4
+ <item name =" android:windowTranslucentStatus" tools : targetApi =" kitkat" >false</item >
4
5
</style >
5
6
6
7
<style name =" Full.Theme" parent =" Theme.AppCompat.Light.NoActionBar" >
You can’t perform that action at this time.
0 commit comments