Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

Commit

Permalink
Fixed two notification related bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
hexadec committed Aug 22, 2018
1 parent 7a2a6a7 commit 7af7e07
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {
minSdkVersion 16
targetSdkVersion 26
versionCode 10202
versionName "1.2.beta2"
versionName "1.2.gamma2"
}
buildTypes {
release {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/hu/kfg/naplo/ChangeListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,6 @@ static void setUpNotificationChannels(Context context) {
notificationChannel.enableVibration(true);
notificationChannel.setVibrationPattern(VIBR_PATTERN);
notificationChannel.setLockscreenVisibility(Notification.VISIBILITY_PUBLIC);
notificationChannel.setSound(null, null);
notificationManager.createNotificationChannel(notificationChannel);

//Setup grades channel
Expand All @@ -655,6 +654,7 @@ static void setUpNotificationChannels(Context context) {
//Setup nightmode channel
notificationChannel =
new NotificationChannel(CHANNEL_NIGHT, context.getString(R.string.night_notifications), NotificationManager.IMPORTANCE_LOW);
notificationChannel.setLightColor(LED_COLOR);
notificationChannel.enableLights(false);
notificationChannel.enableVibration(false);
notificationChannel.setVibrationPattern(new long[]{0, 0});
Expand Down
6 changes: 5 additions & 1 deletion app/src/main/java/hu/kfg/naplo/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ protected void onCreate(Bundle savedInstanceState) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
cat.removePreference(vibrate);
cat.removePreference(flash);
ChangeListener.setUpNotificationChannels(this);
try {
ChangeListener.setUpNotificationChannels(this);
} catch (Exception e) {
e.printStackTrace();
}
ngrades.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
Expand Down

0 comments on commit 7af7e07

Please sign in to comment.