mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-29 05:07:40 +00:00
Fixed snackbar background color when darkmode is off
This commit is contained in:
parent
da074f9413
commit
c78077a416
@ -3,10 +3,12 @@ package org.kde.kdeconnect.UserInterface;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
import android.graphics.Color;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
import com.google.android.material.snackbar.Snackbar;
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
|
|
||||||
@ -52,7 +54,12 @@ public class SettingsFragment extends PreferenceFragmentCompat {
|
|||||||
|
|
||||||
if (TextUtils.isEmpty(name)) {
|
if (TextUtils.isEmpty(name)) {
|
||||||
if (getView() != null) {
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user