Skip to content

Commit

Permalink
Minus UI Changes
Browse files Browse the repository at this point in the history
Signed-off-by: DHD2280 <[email protected]>
  • Loading branch information
DHD2280 committed Nov 21, 2024
1 parent ea5aa1c commit b8d5f7e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import java.util.List;
import java.util.stream.Collectors;

import it.dhd.oneplusui.appcompat.dialog.adapter.SummaryAdapter;
import it.dhd.oxygencustomizer.R;
import it.dhd.oxygencustomizer.databinding.FragmentQsWidgetsBinding;
import it.dhd.oxygencustomizer.ui.adapters.PackageListAdapter;
Expand Down Expand Up @@ -208,18 +209,32 @@ private void showAddWidget() {
String[] filteredArray = widgetValues.toArray(new String[0]);
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(requireContext());
builder.setTitle(R.string.add_widget);
builder.setItems(filteredArray, (dialog, which) -> {
if (mSelectableWidgets.get(which).startsWith("ca")) {
// Custom App Widget
pickApp(mSelectableWidgets.get(which));
SummaryAdapter adapter = new SummaryAdapter(requireContext(), filteredArray);
adapter.setTextCentered(false);
builder.setAdapter(adapter, (dialog, which) -> {
String widget = mSelectableWidgets.get(which);
if (widget.startsWith("ca")) {
pickApp(widget);
return;
}
checkWeather(mSelectableWidgets.get(which));
mWidgetsList.add(mSelectableWidgets.get(which));
checkWeather(widget);
mWidgetsList.add(widget);
mSelectableWidgets.remove(which);
mWidgetAdapter.notifyDataSetChanged();
savePrefs();
});
// builder.setItems(filteredArray, (dialog, which) -> {
// if (mSelectableWidgets.get(which).startsWith("ca")) {
// // Custom App Widget
// pickApp(mSelectableWidgets.get(which));
// return;
// }
// checkWeather(mSelectableWidgets.get(which));
// mWidgetsList.add(mSelectableWidgets.get(which));
// mSelectableWidgets.remove(which);
// mWidgetAdapter.notifyDataSetChanged();
// savePrefs();
// });
builder.show();

}
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ persian-date-time = "4.2.1"
okhttp = "4.12.0"
image-cropper = "4.6.0"
commons-text = "1.12.0"
oneplus-ui = "1.3.7"
oneplus-ui = "1.3.8"

[libraries]

Expand Down

0 comments on commit b8d5f7e

Please sign in to comment.