3 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -2,20 +2,18 @@ apply plugin: 'com.android.application'
2
2
3
3
4
4
android {
5
- signingConfigs {
6
-
7
- }
8
5
compileSdkVersion 24
9
6
buildToolsVersion " 24.0.1"
10
7
defaultConfig {
11
8
applicationId " info.dvkr.screenstream"
12
9
minSdkVersion 21
13
10
targetSdkVersion 24
14
- versionCode 7
15
- versionName " 1.1.0 "
11
+ versionCode 8
12
+ versionName " 1.1.1 "
16
13
17
14
resConfigs " en" , " ru"
18
15
}
16
+
19
17
buildTypes {
20
18
release {
21
19
minifyEnabled true
@@ -28,6 +26,11 @@ android {
28
26
proguardFiles getDefaultProguardFile(' proguard-android-optimize.txt' ), ' proguard-rules.pro'
29
27
}
30
28
}
29
+
30
+ dataBinding {
31
+ enabled = true
32
+ }
33
+
31
34
aaptOptions {
32
35
cruncherEnabled = false
33
36
}
@@ -37,7 +40,6 @@ dependencies {
37
40
compile fileTree(include : [' *.jar' ], dir : ' libs' )
38
41
compile ' com.android.support:design:24.2.0'
39
42
compile ' com.google.firebase:firebase-crash:9.4.0'
40
- // compile "com.androidplot:androidplot-core:0.9.8"
41
43
}
42
44
43
45
apply plugin : ' com.google.gms.google-services'
Original file line number Diff line number Diff line change @@ -240,6 +240,7 @@ private Notification getNotificationStart() {
240
240
final PendingIntent pendingMainActivityIntent = PendingIntent .getActivity (this , 0 , mainActivityIntent , 0 );
241
241
242
242
final NotificationCompat .Builder startNotificationBuilder = new NotificationCompat .Builder (this );
243
+ startNotificationBuilder .setVisibility (NotificationCompat .VISIBILITY_PUBLIC );
243
244
startNotificationBuilder .setSmallIcon (R .drawable .ic_cast_http_24dp );
244
245
startNotificationBuilder .setColor (ContextCompat .getColor (this , R .color .colorPrimaryDark ));
245
246
startNotificationBuilder .setContentTitle (getResources ().getString (R .string .ready_to_stream ));
@@ -256,6 +257,7 @@ private Notification getNotificationStop() {
256
257
final PendingIntent pendingMainActivityIntent = PendingIntent .getActivity (this , 0 , mainActivityIntent , 0 );
257
258
258
259
final NotificationCompat .Builder stopNotificationBuilder = new NotificationCompat .Builder (this );
260
+ stopNotificationBuilder .setVisibility (NotificationCompat .VISIBILITY_PUBLIC );
259
261
stopNotificationBuilder .setSmallIcon (R .drawable .ic_cast_http_24dp );
260
262
stopNotificationBuilder .setColor (ContextCompat .getColor (this , R .color .colorPrimaryDark ));
261
263
stopNotificationBuilder .setContentTitle (getResources ().getString (R .string .stream ));
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ public boolean onPreferenceChange(Preference preference, Object data) {
54
54
pinNumberTextPreference .setOnPreferenceChangeListener (new Preference .OnPreferenceChangeListener () {
55
55
@ Override
56
56
public boolean onPreferenceChange (Preference preference , Object data ) {
57
- final int pinStringLength = (( String ) data ).length ();
57
+ final int pinStringLength = data . toString ( ).length ();
58
58
if (pinStringLength != PIN_DIGITS_COUNT ) {
59
59
Toast .makeText (getActivity ().getApplicationContext (), getResources ().getString (R .string .pin_digits_count ), Toast .LENGTH_LONG ).show ();
60
60
return false ;
@@ -72,7 +72,12 @@ public boolean onPreferenceChange(Preference preference, Object data) {
72
72
portNumberTextPreference .setOnPreferenceChangeListener (new Preference .OnPreferenceChangeListener () {
73
73
@ Override
74
74
public boolean onPreferenceChange (Preference preference , Object data ) {
75
- final int portNumber = Integer .parseInt ((String ) data );
75
+ final String portString = data .toString ();
76
+ if (portString == null || portString .length () == 0 || portString .length () > 5 || portString .length () < 4 ) {
77
+ Toast .makeText (getActivity ().getApplicationContext (), portRange , Toast .LENGTH_LONG ).show ();
78
+ return false ;
79
+ }
80
+ final int portNumber = Integer .parseInt (portString );
76
81
if ((portNumber < MIN_PORT_NUMBER ) || (portNumber > MAX_PORT_NUMBER )) {
77
82
Toast .makeText (getActivity ().getApplicationContext (), portRange , Toast .LENGTH_LONG ).show ();
78
83
return false ;
0 commit comments