Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
react-native-picker
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Jira
Jira
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ym
react-native-picker
Commits
1fa64518
Commit
1fa64518
authored
Sep 21, 2017
by
travelgeezer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try compatible miui
parent
64860d7c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
103 additions
and
1 deletion
+103
-1
android/src/main/java/com/beefe/picker/PickerViewModule.java
android/src/main/java/com/beefe/picker/PickerViewModule.java
+6
-1
android/src/main/java/com/beefe/picker/util/BuildProperties.java
.../src/main/java/com/beefe/picker/util/BuildProperties.java
+72
-0
android/src/main/java/com/beefe/picker/util/MIUIUtils.java
android/src/main/java/com/beefe/picker/util/MIUIUtils.java
+25
-0
No files found.
android/src/main/java/com/beefe/picker/PickerViewModule.java
View file @
1fa64518
...
...
@@ -13,6 +13,7 @@ import android.view.WindowManager;
import
android.widget.RelativeLayout
;
import
android.widget.TextView
;
import
com.beefe.picker.util.MIUIUtils
;
import
com.beefe.picker.view.OnSelectedListener
;
import
com.beefe.picker.view.PickerViewAlone
;
import
com.beefe.picker.view.PickerViewLinkage
;
...
...
@@ -349,8 +350,12 @@ public class PickerViewModule extends ReactContextBaseJavaModule implements Life
WindowManager
.
LayoutParams
layoutParams
=
new
WindowManager
.
LayoutParams
();
Window
window
=
dialog
.
getWindow
();
if
(
window
!=
null
)
{
layoutParams
.
flags
=
WindowManager
.
LayoutParams
.
FLAG_NOT_FOCUSABLE
;
if
(
MIUIUtils
.
isMIUI
())
{
layoutParams
.
type
=
WindowManager
.
LayoutParams
.
TYPE_APPLICATION
;
}
else
{
layoutParams
.
type
=
WindowManager
.
LayoutParams
.
TYPE_TOAST
;
}
layoutParams
.
flags
=
WindowManager
.
LayoutParams
.
FLAG_NOT_FOCUSABLE
;
layoutParams
.
format
=
PixelFormat
.
TRANSPARENT
;
layoutParams
.
windowAnimations
=
R
.
style
.
PickerAnim
;
layoutParams
.
width
=
WindowManager
.
LayoutParams
.
MATCH_PARENT
;
...
...
android/src/main/java/com/beefe/picker/util/BuildProperties.java
0 → 100644
View file @
1fa64518
package
com.beefe.picker.util
;
/**
* Created by geezer. on 2017/9/21.
*/
import
android.os.Environment
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.util.Collection
;
import
java.util.Enumeration
;
import
java.util.Map.Entry
;
import
java.util.Properties
;
import
java.util.Set
;
public
class
BuildProperties
{
private
final
Properties
properties
;
private
BuildProperties
()
throws
IOException
{
properties
=
new
Properties
();
properties
.
load
(
new
FileInputStream
(
new
File
(
Environment
.
getRootDirectory
(),
"build.prop"
)));
}
public
boolean
containsKey
(
final
Object
key
)
{
return
properties
.
containsKey
(
key
);
}
public
boolean
containsValue
(
final
Object
value
)
{
return
properties
.
containsValue
(
value
);
}
public
Set
<
Entry
<
Object
,
Object
>>
entrySet
()
{
return
properties
.
entrySet
();
}
public
String
getProperty
(
final
String
name
)
{
return
properties
.
getProperty
(
name
);
}
public
String
getProperty
(
final
String
name
,
final
String
defaultValue
)
{
return
properties
.
getProperty
(
name
,
defaultValue
);
}
public
boolean
isEmpty
()
{
return
properties
.
isEmpty
();
}
public
Enumeration
<
Object
>
keys
()
{
return
properties
.
keys
();
}
public
Set
<
Object
>
keySet
()
{
return
properties
.
keySet
();
}
public
int
size
()
{
return
properties
.
size
();
}
public
Collection
<
Object
>
values
()
{
return
properties
.
values
();
}
public
static
BuildProperties
newInstance
()
throws
IOException
{
return
new
BuildProperties
();
}
}
android/src/main/java/com/beefe/picker/util/MIUIUtils.java
0 → 100644
View file @
1fa64518
package
com.beefe.picker.util
;
import
java.io.IOException
;
/**
* Created by geezer. on 2017/9/21.
*/
public
final
class
MIUIUtils
{
private
static
final
String
KEY_MIUI_VERSION_CODE
=
"ro.miui.ui.version.code"
;
private
static
final
String
KEY_MIUI_VERSION_NAME
=
"ro.miui.ui.version.name"
;
private
static
final
String
KEY_MIUI_INTERNAL_STORAGE
=
"ro.miui.internal.storage"
;
public
static
boolean
isMIUI
()
{
try
{
final
BuildProperties
prop
=
BuildProperties
.
newInstance
();
return
prop
.
getProperty
(
KEY_MIUI_VERSION_CODE
,
null
)
!=
null
||
prop
.
getProperty
(
KEY_MIUI_VERSION_NAME
,
null
)
!=
null
||
prop
.
getProperty
(
KEY_MIUI_INTERNAL_STORAGE
,
null
)
!=
null
;
}
catch
(
final
IOException
e
)
{
return
false
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment