6 Commits

Author SHA1 Message Date
741c09b1e4 fixed TabLayout animation 2018-11-23 19:35:22 +01:00
0c0d7d181f enable light in notification channel (android-oreo) + shorter vibrate 2018-11-23 18:48:46 +01:00
9304da9422 fix NPE in SettingsFrame 2018-11-23 18:42:10 +01:00
jenkins
d7afdd00f2 [Jenkins] Increment version 2018-11-19 18:43:36 +01:00
b780ccea1c wrong notification channel name 2018-11-19 18:41:56 +01:00
jenkins
5d8e871871 [Jenkins] Increment version 2018-11-19 12:31:22 +01:00
5 changed files with 28 additions and 20 deletions

View File

@@ -98,5 +98,3 @@ public class SCNApp extends Application implements LifecycleObserver
isBackground = false; isBackground = false;
} }
} }
//TODO TabLayout indicator does not corretly animate when directly clicking on tabs

View File

@@ -65,7 +65,8 @@ public class NotificationService
channel0.setDescription("Push notifications from the server with low priority.\nGo to the in-app settings to configure ringtone, volume and vibrations"); channel0.setDescription("Push notifications from the server with low priority.\nGo to the in-app settings to configure ringtone, volume and vibrations");
channel0.setSound(null, null); channel0.setSound(null, null);
channel0.setVibrationPattern(null); channel0.setVibrationPattern(null);
channel0.setLightColor(Color.BLUE); channel0.setLightColor(Color.CYAN);
channel0.enableLights(true);
notifman.createNotificationChannel(channel0); notifman.createNotificationChannel(channel0);
} }
} }
@@ -77,7 +78,8 @@ public class NotificationService
channel1.setDescription("Push notifications from the server with low priority.\nGo to the in-app settings to configure ringtone, volume and vibrations"); channel1.setDescription("Push notifications from the server with low priority.\nGo to the in-app settings to configure ringtone, volume and vibrations");
channel1.setSound(null, null); channel1.setSound(null, null);
channel1.setVibrationPattern(null); channel1.setVibrationPattern(null);
channel1.setLightColor(Color.BLUE); channel1.setLightColor(Color.CYAN);
channel1.enableLights(true);
notifman.createNotificationChannel(channel1); notifman.createNotificationChannel(channel1);
} }
} }
@@ -85,11 +87,13 @@ public class NotificationService
NotificationChannel channel2 = notifman.getNotificationChannel(CHANNEL_P2_ID); NotificationChannel channel2 = notifman.getNotificationChannel(CHANNEL_P2_ID);
if (channel2 == null) if (channel2 == null)
{ {
channel2 = new NotificationChannel(CHANNEL_P1_ID, "Push notifications (high priority)", NotificationManager.IMPORTANCE_DEFAULT); channel2 = new NotificationChannel(CHANNEL_P2_ID, "Push notifications (high priority)", NotificationManager.IMPORTANCE_DEFAULT);
channel2.setDescription("Push notifications from the server with low priority.\nGo to the in-app settings to configure ringtone, volume and vibrations"); channel2.setDescription("Push notifications from the server with low priority.\nGo to the in-app settings to configure ringtone, volume and vibrations");
channel2.setSound(null, null); channel2.setSound(null, null);
channel2.setVibrationPattern(null); channel2.setVibrationPattern(null);
channel2.setLightColor(Color.BLUE); channel2.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
channel2.setLightColor(Color.CYAN);
channel2.enableLights(true);
notifman.createNotificationChannel(channel2); notifman.createNotificationChannel(channel2);
} }
} }
@@ -115,9 +119,9 @@ public class NotificationService
{ {
Vibrator v = (Vibrator) SCNApp.getContext().getSystemService(Context.VIBRATOR_SERVICE); Vibrator v = (Vibrator) SCNApp.getContext().getSystemService(Context.VIBRATOR_SERVICE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
v.vibrate(VibrationEffect.createOneShot(1500, VibrationEffect.DEFAULT_AMPLITUDE)); v.vibrate(VibrationEffect.createOneShot(500, VibrationEffect.DEFAULT_AMPLITUDE));
} else { } else {
v.vibrate(1500); v.vibrate(500);
} }
} }
} }
@@ -254,7 +258,7 @@ public class NotificationService
if (ns.EnableVibration) if (ns.EnableVibration)
{ {
Vibrator v = (Vibrator) SCNApp.getContext().getSystemService(Context.VIBRATOR_SERVICE); Vibrator v = (Vibrator) SCNApp.getContext().getSystemService(Context.VIBRATOR_SERVICE);
v.vibrate(VibrationEffect.createOneShot(1500, VibrationEffect.DEFAULT_AMPLITUDE)); v.vibrate(VibrationEffect.createOneShot(500, VibrationEffect.DEFAULT_AMPLITUDE));
} }
//if (ns.EnableLED) { } // no LED in Android-O -- configure via Channel //if (ns.EnableLED) { } // no LED in Android-O -- configure via Channel

View File

@@ -77,4 +77,9 @@ public class NotificationsFragment extends Fragment implements MessageAdapterTou
snackbar.show(); snackbar.show();
} }
} }
public void updateDeleteSwipeEnabled()
{
if (touchHelper != null) touchHelper.updateEnabled();
}
} }

View File

@@ -153,6 +153,10 @@ public class SettingsFragment extends Fragment implements MusicPickerListener
prefMsgHighForceVolume = v.findViewById(R.id.prefMsgHighForceVolume); prefMsgHighForceVolume = v.findViewById(R.id.prefMsgHighForceVolume);
prefMsgHighVolume = v.findViewById(R.id.prefMsgHighVolume); prefMsgHighVolume = v.findViewById(R.id.prefMsgHighVolume);
prefMsgHighVolumeTest = v.findViewById(R.id.btnHighVolumeTest); prefMsgHighVolumeTest = v.findViewById(R.id.btnHighVolumeTest);
ArrayAdapter<Integer> plcsa = new ArrayAdapter<>(v.getContext(), android.R.layout.simple_spinner_item, SCNSettings.CHOOSABLE_CACHE_SIZES);
plcsa.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
prefLocalCacheSize.setAdapter(plcsa);
} }
private void updateUI() private void updateUI()
@@ -168,10 +172,7 @@ public class SettingsFragment extends Fragment implements MusicPickerListener
prefUpgradeAccount_info.setVisibility(SCNSettings.inst().promode_local ? View.GONE : View.VISIBLE); prefUpgradeAccount_info.setVisibility(SCNSettings.inst().promode_local ? View.GONE : View.VISIBLE);
prefUpgradeAccount_msg.setVisibility( SCNSettings.inst().promode_local ? View.VISIBLE : View.GONE ); prefUpgradeAccount_msg.setVisibility( SCNSettings.inst().promode_local ? View.VISIBLE : View.GONE );
ArrayAdapter<Integer> plcsa = new ArrayAdapter<>(c, android.R.layout.simple_spinner_item, SCNSettings.CHOOSABLE_CACHE_SIZES); if (prefLocalCacheSize.getSelectedItemPosition() != getCacheSizeIndex(s.LocalCacheSize)) prefLocalCacheSize.setSelection(getCacheSizeIndex(s.LocalCacheSize));
plcsa.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
prefLocalCacheSize.setAdapter(plcsa);
prefLocalCacheSize.setSelection(getCacheSizeIndex(s.LocalCacheSize));
if (prefMsgLowEnableSound.isChecked() != s.PriorityLow.EnableSound) prefMsgLowEnableSound.setChecked(s.PriorityLow.EnableSound); if (prefMsgLowEnableSound.isChecked() != s.PriorityLow.EnableSound) prefMsgLowEnableSound.setChecked(s.PriorityLow.EnableSound);
if (!prefMsgLowRingtone_value.getText().equals(s.PriorityLow.SoundName)) prefMsgLowRingtone_value.setText(s.PriorityLow.SoundName); if (!prefMsgLowRingtone_value.getText().equals(s.PriorityLow.SoundName)) prefMsgLowRingtone_value.setText(s.PriorityLow.SoundName);
@@ -341,7 +342,7 @@ public class SettingsFragment extends Fragment implements MusicPickerListener
{ {
SCNSettings.inst().save(); SCNSettings.inst().save();
updateUI(); updateUI();
SCNApp.getMainActivity().adpTabs.tab1.touchHelper.updateEnabled(); SCNApp.getMainActivity().adpTabs.tab1.updateDeleteSwipeEnabled();
} }
private void onUpgradeAccount() private void onUpgradeAccount()

View File

@@ -1,3 +1,3 @@
#Sun Nov 18 03:24:23 CET 2018 #Mon Nov 19 18:43:09 CET 2018
VERSION_NAME=0.0.13 VERSION_NAME=1.1.0
VERSION_CODE=13 VERSION_CODE=15