revert unwanted changes

Signed-off-by: Hidde Wieringa <hidde@hiddewieringa.nl>
This commit is contained in:
Hidde Wieringa 2022-10-19 20:59:38 +02:00 committed by Roman Tsisyk
parent a10f1ff5df
commit 78f4216797
2 changed files with 15 additions and 12 deletions

View file

@ -231,7 +231,7 @@ class SimpleTimetableAdapter extends RecyclerView.Adapter<SimpleTimetableAdapter
closedHours[i] = span;
final int finalI = i;
span.findViewById(R.id.iv__remove_closed)
.setOnClickListener(v -> removeClosedHours(getBindingAdapterPosition(), finalI));
.setOnClickListener(v -> removeClosedHours(getAdapterPosition(), finalI));
}
}
@ -249,7 +249,7 @@ class SimpleTimetableAdapter extends RecyclerView.Adapter<SimpleTimetableAdapter
@Override
void onBind()
{
final int position = getBindingAdapterPosition();
final int position = getAdapterPosition();
final Timetable data = mItems.get(position);
UiUtils.showIf(position > 0, deleteTimetable);
tvOpen.setText(data.workingTimespan.start.toString());
@ -265,16 +265,16 @@ class SimpleTimetableAdapter extends RecyclerView.Adapter<SimpleTimetableAdapter
switch (v.getId())
{
case R.id.time_open:
pickTime(getBindingAdapterPosition(), HoursMinutesPickerFragment.TAB_FROM, ID_OPENING);
pickTime(getAdapterPosition(), HoursMinutesPickerFragment.TAB_FROM, ID_OPENING);
break;
case R.id.time_close:
pickTime(getBindingAdapterPosition(), HoursMinutesPickerFragment.TAB_TO, ID_OPENING);
pickTime(getAdapterPosition(), HoursMinutesPickerFragment.TAB_TO, ID_OPENING);
break;
case R.id.tv__remove_timetable:
removeTimetable(getBindingAdapterPosition());
removeTimetable(getAdapterPosition());
break;
case R.id.tv__add_closed:
pickTime(getBindingAdapterPosition(), HoursMinutesPickerFragment.TAB_FROM, ID_CLOSING);
pickTime(getAdapterPosition(), HoursMinutesPickerFragment.TAB_FROM, ID_CLOSING);
break;
case R.id.allday:
swAllday.toggle();
@ -288,7 +288,7 @@ class SimpleTimetableAdapter extends RecyclerView.Adapter<SimpleTimetableAdapter
switch (buttonView.getId())
{
case R.id.sw__allday:
setFullday(getBindingAdapterPosition(), isChecked);
setFullday(getAdapterPosition(), isChecked);
break;
case R.id.chb__day:
final int dayIndex = (Integer) buttonView.getTag();
@ -362,9 +362,9 @@ class SimpleTimetableAdapter extends RecyclerView.Adapter<SimpleTimetableAdapter
{
final CheckBox checkBox = days.get(dayIndex);
if (checkBox.isChecked())
addWorkingDay(dayIndex, getBindingAdapterPosition());
addWorkingDay(dayIndex, getAdapterPosition());
else
removeWorkingDay(dayIndex, getBindingAdapterPosition());
removeWorkingDay(dayIndex, getAdapterPosition());
}
private void checkWithoutCallback(CompoundButton button, boolean check)

View file

@ -10,6 +10,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import com.mapswithme.maps.DownloadResourcesLegacyActivity;
import com.mapswithme.maps.Framework;
import com.mapswithme.maps.MapFragment;
@ -376,12 +377,14 @@ public class Factory
@Override
public boolean run(@NonNull MwmActivity target)
{
Fragment f = target.getSupportFragmentManager().findFragmentByTag(mDialogName);
final FragmentManager fragmentManager = target.getSupportFragmentManager();
Fragment f = fragmentManager.findFragmentByTag(mDialogName);
if (f != null)
return true;
final DialogFragment fragment = (DialogFragment) Fragment.instantiate(target, mDialogName);
fragment.show(target.getSupportFragmentManager(), mDialogName);
final DialogFragment fragment = (DialogFragment) fragmentManager.getFragmentFactory()
.instantiate(target.getClassLoader(), mDialogName);
fragment.show(fragmentManager, mDialogName);
return true;
}