Commit 2251d58e authored by Massimiliano's avatar Massimiliano
Browse files

Added Disroot purple light notification

parent 6a0285df
...@@ -1913,7 +1913,7 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL ...@@ -1913,7 +1913,7 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
checkDate.edit().putString( "storeDate", stateDate).apply(); checkDate.edit().putString( "storeDate", stateDate).apply();
//return null; //return null;
} }
else if (!stateDate.equals( dateStored )&& !stateDate.equals( "" ))//dateStored else if (!stateDate.equals( "2" )&& !stateDate.equals( "" ))//dateStored
{ {
checkDate.edit().putString( "storeDate", stateDate).apply(); checkDate.edit().putString( "storeDate", stateDate).apply();
Log.e(TAG, "date: " + dateStored); Log.e(TAG, "date: " + dateStored);
...@@ -1946,7 +1946,7 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL ...@@ -1946,7 +1946,7 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
//Notification //Notification
private void sendNotification() throws JSONException { private void sendNotification() throws JSONException {
String CHANNEL_ID = "316865431"; String CHANNEL_ID = "3168654312";
String CHANNEL_NAME = "StateNotification"; String CHANNEL_NAME = "StateNotification";
HttpHandler sh = new HttpHandler(); HttpHandler sh = new HttpHandler();
String jsonStrincidents0 = sh.makeServiceCall(incidenturl0); String jsonStrincidents0 = sh.makeServiceCall(incidenturl0);
...@@ -1972,7 +1972,7 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL ...@@ -1972,7 +1972,7 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
// I would suggest that you use IMPORTANCE_DEFAULT instead of IMPORTANCE_HIGH // I would suggest that you use IMPORTANCE_DEFAULT instead of IMPORTANCE_HIGH
NotificationChannel channel = new NotificationChannel(CHANNEL_ID, CHANNEL_NAME, NotificationManager.IMPORTANCE_HIGH); NotificationChannel channel = new NotificationChannel(CHANNEL_ID, CHANNEL_NAME, NotificationManager.IMPORTANCE_HIGH);
channel.enableVibration(true); channel.enableVibration(true);
channel.setLightColor(Color.MAGENTA); channel.setLightColor(Color.rgb( 80,22,45 ));
channel.enableLights(true); channel.enableLights(true);
channel.setVibrationPattern(new long[]{50,500,100,300,50,300}); channel.setVibrationPattern(new long[]{50,500,100,300,50,300});
notificationManager.createNotificationChannel(channel); notificationManager.createNotificationChannel(channel);
...@@ -1989,7 +1989,7 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL ...@@ -1989,7 +1989,7 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
Uri alarmSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); Uri alarmSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
notificationBuilder.setSound(alarmSound) notificationBuilder.setSound(alarmSound)
.setVibrate(new long[]{50,500,100,300,50,300}) .setVibrate(new long[]{50,500,100,300,50,300})
.setLights(Color.MAGENTA, 3000, 3000); .setLights(Color.BLUE, 3000, 3000);
NotificationManager mNotificationManager = NotificationManager mNotificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){ if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<changelog> <changelog>
<release version="1.1.5" versioncode="18" > <release version="1.1.5" versioncode="18" >
<change>Notifications works on Android 8 and higher now</change> <change>Notifications works on Android 8 and higher now</change>
<change>Added Disroot purple light notification</change>
<change>Updated Serbian translation</change> <change>Updated Serbian translation</change>
</release> </release>
<release version="1.1.4" versioncode="17" > <release version="1.1.4" versioncode="17" >
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment