mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-08-31 19:45:27 +02:00
GBReminderListAdapter gets remindersHaveTime through constructor
addresses https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/4049#issuecomment-2270261
This commit is contained in:
parent
e0741d4a13
commit
b64841b48e
@ -66,7 +66,7 @@ public class ConfigureReminders extends AbstractGBActivity {
|
||||
private static final int REQ_CONFIGURE_REMINDER = 1;
|
||||
|
||||
private GBReminderListAdapter mGBReminderListAdapter;
|
||||
public GBDevice gbDevice;
|
||||
private GBDevice gbDevice;
|
||||
|
||||
private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
|
||||
@Override
|
||||
@ -89,7 +89,7 @@ public class ConfigureReminders extends AbstractGBActivity {
|
||||
|
||||
gbDevice = getIntent().getParcelableExtra(GBDevice.EXTRA_DEVICE);
|
||||
|
||||
mGBReminderListAdapter = new GBReminderListAdapter(this);
|
||||
mGBReminderListAdapter = new GBReminderListAdapter(this, gbDevice.getDeviceCoordinator().getRemindersHaveTime());
|
||||
|
||||
final RecyclerView remindersRecyclerView = findViewById(R.id.reminder_list);
|
||||
remindersRecyclerView.setHasFixedSize(true);
|
||||
|
@ -47,9 +47,11 @@ public class GBReminderListAdapter extends RecyclerView.Adapter<GBReminderListAd
|
||||
|
||||
private final Context mContext;
|
||||
private ArrayList<Reminder> reminderList;
|
||||
private boolean remindersHaveTime;
|
||||
|
||||
public GBReminderListAdapter(Context context) {
|
||||
public GBReminderListAdapter(Context context, boolean remindersHaveTime) {
|
||||
this.mContext = context;
|
||||
this.remindersHaveTime = remindersHaveTime;
|
||||
}
|
||||
|
||||
public void setReminderList(List<Reminder> reminders) {
|
||||
@ -101,7 +103,7 @@ public class GBReminderListAdapter extends RecyclerView.Adapter<GBReminderListAd
|
||||
|
||||
final Date time = reminder.getDate();
|
||||
SimpleDateFormat format;
|
||||
if (((ConfigureReminders) mContext).gbDevice.getDeviceCoordinator().getRemindersHaveTime()) {
|
||||
if (remindersHaveTime) {
|
||||
format = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.getDefault());
|
||||
} else {
|
||||
format = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault());
|
||||
|
Loading…
Reference in New Issue
Block a user