Fixed advanced timetable editor layout

Signed-off-by: S. Kozyr <s.trump@gmail.com>
This commit is contained in:
Sergiy Kozyr 2022-08-11 11:32:16 +03:00 committed by Viktor Govako
parent a67fef95c1
commit e496ad2b82
2 changed files with 10 additions and 3 deletions

View file

@ -15,6 +15,7 @@
android:layout_below="@id/toolbar"/>
<View
android:id="@+id/v__bottom_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/tv__mode_switch"

View file

@ -75,6 +75,10 @@ public class TimetableContainerFragment extends BaseMwmFragment implements OnBac
@NonNull
private TextView mSwitchMode;
@SuppressWarnings("NullableProblems")
@NonNull
private View mBottomBar;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
@ -117,9 +121,10 @@ public class TimetableContainerFragment extends BaseMwmFragment implements OnBac
@Override
public void onTimetableChanged(@Nullable String timetable)
{
UiUtils.showIf(TextUtils.isEmpty(timetable)
|| OpeningHours.nativeTimetablesFromString(timetable) != null,
mSwitchMode);
boolean isValidTimetable = TextUtils.isEmpty(timetable)
|| OpeningHours.nativeTimetablesFromString(timetable) != null;
UiUtils.showIf(isValidTimetable, mSwitchMode);
UiUtils.showIf(isValidTimetable, mBottomBar);
}
@Override
@ -132,6 +137,7 @@ public class TimetableContainerFragment extends BaseMwmFragment implements OnBac
{
mSwitchMode = root.findViewById(R.id.tv__mode_switch);
mSwitchMode.setOnClickListener(v -> switchMode());
mBottomBar = root.findViewById(R.id.v__bottom_bar);
}
private void switchMode()