Skip to content

Commit

Permalink
fixed autocache text dialog with dark theme
Browse files Browse the repository at this point in the history
  • Loading branch information
gdlbo committed Mar 26, 2024
1 parent 899554a commit d98d81f
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
import bruhcollective.itaysonlab.libvkx.client.LibVKXClient;
import com.vk.core.dialogs.alert.VkAlertDialog;
import com.vk.dto.music.Playlist;
Expand All @@ -26,6 +28,8 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import static ru.vtosters.hooks.other.ThemesUtils.getTextAttr;

public class MusicFragment extends TrackedMaterialPreferenceToolbarFragment {
private static final ExecutorService executor = Executors.newCachedThreadPool();

Expand Down Expand Up @@ -104,7 +108,14 @@ public void onCreate(Bundle bundle) {
preference -> {
List<String> items = Arrays.asList("Не кешировать", "Только свои", "Все");

ArrayAdapter<String> adapter = new ArrayAdapter<>(requireContext(), android.R.layout.simple_list_item_1, items);
ArrayAdapter<String> adapter = new ArrayAdapter<>(requireContext(), android.R.layout.simple_list_item_1, items) {
@Override
public View getView(int position, View convertView, ViewGroup parent) {
TextView textView = (TextView) super.getView(position, convertView, parent);
textView.setTextColor(getTextAttr());
return textView;
}
};

int selectedItem = Preferences.getPreferences().getInt("autocaching", 0);
if (selectedItem >= 0 && selectedItem < items.size()) {
Expand Down

0 comments on commit d98d81f

Please sign in to comment.