// Path: src/org/kde/kdeconnect/UserInterface/ThemeUtil.java
// public class ThemeUtil {
// 
//     public static final String LIGHT_MODE = "light";
//     public static final String DARK_MODE = "dark";
//     public static final String DEFAULT_MODE = "default";
// 
//     public static void applyTheme(@NonNull String themePref) {
//         switch (themePref) {
//             case LIGHT_MODE: {
//                 AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
//                 break;
//             }
//             case DARK_MODE: {
//                 AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
//                 break;
//             }
//             default: {
//                 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
//                     AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
//                 } else {
//                     AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY);
//                 }
//                 break;
//             }
//         }
//     }
// 
//     /**
//     * Called when an activity is created for the first time to reliably load correct theme.
//     **/
//     public static void setUserPreferredTheme(Activity activity) {
//         String appTheme = PreferenceManager.getDefaultSharedPreferences(activity)
//                 .getString("theme_pref", DEFAULT_MODE);
//         applyTheme(appTheme);
//     }
// }


import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.BaseAdapter;
import android.widget.CheckBox;
import android.widget.CheckedTextView;
import android.widget.CompoundButton;
import android.widget.ListView;
import org.kde.kdeconnect.UserInterface.ThemeUtil;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.widget.TextViewCompat;
import com.google.android.material.switchmaterial.SwitchMaterial;
import org.kde.kdeconnect_tp.R;
import org.kde.kdeconnect_tp.databinding.ActivityNotificationFilterBinding;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
        }

        @Override
        public long getItemId(int position) {
            return position - 1;
        }

        public View getView(int position, View view, ViewGroup parent) {
            if (view == null) {
                LayoutInflater inflater = getLayoutInflater();
                view = inflater.inflate(android.R.layout.simple_list_item_multiple_choice, null, true);
            }
            CheckedTextView checkedTextView = (CheckedTextView) view;
            if (position == 0) {
                checkedTextView.setText(R.string.all);
                TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds(checkedTextView, null, null, null, null);
            } else {
                checkedTextView.setText(apps[position - 1].name);
                TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds(checkedTextView, apps[position - 1].icon, null, null, null);
                checkedTextView.setCompoundDrawablePadding((int) (8 * getResources().getDisplayMetrics().density));
            }

            return view;
        }

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
// Path: src/org/kde/kdeconnect/UserInterface/ThemeUtil.java
// public class ThemeUtil {
// 
//     public static final String LIGHT_MODE = "light";
//     public static final String DARK_MODE = "dark";
//     public static final String DEFAULT_MODE = "default";
// 
//     public static void applyTheme(@NonNull String themePref) {
//         switch (themePref) {
//             case LIGHT_MODE: {
//                 AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
//                 break;
//             }
//             case DARK_MODE: {
//                 AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
//                 break;
//             }
//             default: {
//                 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
//                     AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
//                 } else {
//                     AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY);
//                 }
//                 break;
//             }
//         }
//     }
// 
//     /**
//     * Called when an activity is created for the first time to reliably load correct theme.
//     **/
//     public static void setUserPreferredTheme(Activity activity) {
//         String appTheme = PreferenceManager.getDefaultSharedPreferences(activity)
//                 .getString("theme_pref", DEFAULT_MODE);
//         applyTheme(appTheme);
//     }
// }


// Path: src/org/kde/kdeconnect/Plugins/NotificationsPlugin/NotificationFilterActivity.java
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.BaseAdapter;
import android.widget.CheckBox;
import android.widget.CheckedTextView;
import android.widget.CompoundButton;
import android.widget.ListView;
import org.kde.kdeconnect.UserInterface.ThemeUtil;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.widget.TextViewCompat;
import com.google.android.material.switchmaterial.SwitchMaterial;
import org.kde.kdeconnect_tp.R;
import org.kde.kdeconnect_tp.databinding.ActivityNotificationFilterBinding;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;

        }

        @Override
        public long getItemId(int position) {
            return position - 1;
        }

        public View getView(int position, View view, ViewGroup parent) {
            if (view == null) {
                LayoutInflater inflater = getLayoutInflater();
                view = inflater.inflate(android.R.layout.simple_list_item_multiple_choice, null, true);
            }
            CheckedTextView checkedTextView = (CheckedTextView) view;
            if (position == 0) {
                checkedTextView.setText(R.string.all);
                TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds(checkedTextView, null, null, null, null);
            } else {
                checkedTextView.setText(apps[position - 1].name);
                TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds(checkedTextView, apps[position - 1].icon, null, null, null);
                checkedTextView.setCompoundDrawablePadding((int) (8 * getResources().getDisplayMetrics().density));
            }

            return view;
        }

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ThemeUtil.setUserPreferredTheme(this);