2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-28 20:57:42 +00:00

Fixed snackbar background color when darkmode is off

This commit is contained in:
Ankit Bhardwaj 2019-11-17 23:06:50 +00:00 committed by Simon Redman
parent da074f9413
commit c78077a416

View File

@ -3,10 +3,12 @@ package org.kde.kdeconnect.UserInterface;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.text.TextUtils;
import android.view.View;
import com.google.android.material.snackbar.Snackbar;
@ -52,7 +54,12 @@ public class SettingsFragment extends PreferenceFragmentCompat {
if (TextUtils.isEmpty(name)) {
if (getView() != null) {
Snackbar.make(getView(), R.string.invalid_device_name, Snackbar.LENGTH_LONG).show();
Snackbar snackbar = Snackbar.make(getView(), R.string.invalid_device_name, Snackbar.LENGTH_LONG);
if (!prefs.getBoolean("darkTheme", false)) {
// white color is set to the background of snackbar if dark mode is off
snackbar.getView().setBackgroundColor(Color.WHITE);
}
snackbar.show();
}
return false;
}