For insetting the content, use window insets listeners rather than the fitsSystemWindows XML attribute.

This commit is contained in:
Andreas Schildbach 2021-01-29 18:37:51 +01:00
parent 37a398ecb8
commit 2c33349988
8 changed files with 22 additions and 5 deletions

View file

@ -87,6 +87,7 @@
</ScrollView> </ScrollView>
<LinearLayout <LinearLayout
android:id="@+id/directions_trip_details_disclaimer_group"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom" android:layout_gravity="bottom"
@ -94,7 +95,6 @@
android:layout_marginRight="@dimen/list_entry_padding_horizontal_verylax" android:layout_marginRight="@dimen/list_entry_padding_horizontal_verylax"
android:layout_marginTop="@dimen/list_entry_padding_vertical_lax" android:layout_marginTop="@dimen/list_entry_padding_vertical_lax"
android:layout_marginBottom="@dimen/list_entry_padding_vertical_lax" android:layout_marginBottom="@dimen/list_entry_padding_vertical_lax"
android:fitsSystemWindows="true"
android:baselineAligned="false" android:baselineAligned="false"
android:orientation="horizontal"> android:orientation="horizontal">

View file

@ -20,13 +20,13 @@
android:unselectedAlpha="1" /> android:unselectedAlpha="1" />
<FrameLayout <FrameLayout
android:id="@+id/directions_trip_overview_disclaimer_group"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="@dimen/list_entry_padding_horizontal_verylax" android:layout_marginLeft="@dimen/list_entry_padding_horizontal_verylax"
android:layout_marginRight="@dimen/list_entry_padding_horizontal_verylax" android:layout_marginRight="@dimen/list_entry_padding_horizontal_verylax"
android:layout_marginTop="@dimen/list_entry_padding_vertical_lax" android:layout_marginTop="@dimen/list_entry_padding_vertical_lax"
android:layout_marginBottom="@dimen/list_entry_padding_vertical_lax" android:layout_marginBottom="@dimen/list_entry_padding_vertical_lax">
android:fitsSystemWindows="true">
<TextView <TextView
android:id="@+id/trips_server_product" android:id="@+id/trips_server_product"

View file

@ -366,6 +366,7 @@
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/stations_disclaimer_group"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom" android:layout_gravity="bottom"
@ -373,7 +374,6 @@
android:layout_marginRight="@dimen/list_entry_padding_horizontal_verylax" android:layout_marginRight="@dimen/list_entry_padding_horizontal_verylax"
android:layout_marginTop="@dimen/list_entry_padding_vertical_lax" android:layout_marginTop="@dimen/list_entry_padding_vertical_lax"
android:layout_marginBottom="@dimen/list_entry_padding_vertical_lax" android:layout_marginBottom="@dimen/list_entry_padding_vertical_lax"
android:fitsSystemWindows="true"
android:baselineAligned="false" android:baselineAligned="false"
android:orientation="horizontal"> android:orientation="horizontal">

View file

@ -43,6 +43,7 @@
</ViewAnimator> </ViewAnimator>
<LinearLayout <LinearLayout
android:id="@+id/stations_station_details_disclaimer_group"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom" android:layout_gravity="bottom"
@ -50,7 +51,6 @@
android:layout_marginRight="@dimen/list_entry_padding_horizontal_verylax" android:layout_marginRight="@dimen/list_entry_padding_horizontal_verylax"
android:layout_marginTop="@dimen/list_entry_padding_vertical_lax" android:layout_marginTop="@dimen/list_entry_padding_vertical_lax"
android:layout_marginBottom="@dimen/list_entry_padding_vertical_lax" android:layout_marginBottom="@dimen/list_entry_padding_vertical_lax"
android:fitsSystemWindows="true"
android:baselineAligned="false" android:baselineAligned="false"
android:orientation="horizontal"> android:orientation="horizontal">

View file

@ -274,6 +274,10 @@ public class TripDetailsActivity extends OeffiActivity implements LocationListen
((TextView) findViewById(R.id.directions_trip_details_footer)) ((TextView) findViewById(R.id.directions_trip_details_footer))
.setText(Html.fromHtml(getString(R.string.directions_trip_details_realtime))); .setText(Html.fromHtml(getString(R.string.directions_trip_details_realtime)));
findViewById(R.id.directions_trip_details_disclaimer_group).setOnApplyWindowInsetsListener((v, insets) -> {
v.setPadding(0, 0, 0, insets.getSystemWindowInsetBottom());
return insets;
});
final TextView disclaimerSourceView = findViewById(R.id.directions_trip_details_disclaimer_source); final TextView disclaimerSourceView = findViewById(R.id.directions_trip_details_disclaimer_source);
updateDisclaimerSource(disclaimerSourceView, network.name(), null); updateDisclaimerSource(disclaimerSourceView, network.name(), null);

View file

@ -160,6 +160,11 @@ public class TripsOverviewActivity extends OeffiActivity {
}); });
barView.setOnScrollListener(() -> handler.post(checkMoreRunnable)); barView.setOnScrollListener(() -> handler.post(checkMoreRunnable));
findViewById(R.id.directions_trip_overview_disclaimer_group).setOnApplyWindowInsetsListener((v, insets) -> {
v.setPadding(0, 0, 0, insets.getSystemWindowInsetBottom());
return insets;
});
processResult(result, dep); processResult(result, dep);
} }

View file

@ -269,6 +269,10 @@ public class StationDetailsActivity extends OeffiActivity implements StationsAwa
favoriteButton favoriteButton
.setChecked(selectedFavState != null && selectedFavState == FavoriteStationsProvider.TYPE_FAVORITE); .setChecked(selectedFavState != null && selectedFavState == FavoriteStationsProvider.TYPE_FAVORITE);
findViewById(R.id.stations_station_details_disclaimer_group).setOnApplyWindowInsetsListener((v, insets) -> {
v.setPadding(0, 0, 0, insets.getSystemWindowInsetBottom());
return insets;
});
disclaimerSourceView = findViewById(R.id.stations_station_details_disclaimer_source); disclaimerSourceView = findViewById(R.id.stations_station_details_disclaimer_source);
updateDisclaimerSource(disclaimerSourceView, selectedNetwork.name(), null); updateDisclaimerSource(disclaimerSourceView, selectedNetwork.name(), null);
} }

View file

@ -262,6 +262,10 @@ public class StationsActivity extends OeffiMainActivity implements StationsAware
mapView.setZoomControls(zoom); mapView.setZoomControls(zoom);
connectivityWarningView = findViewById(R.id.stations_connectivity_warning_box); connectivityWarningView = findViewById(R.id.stations_connectivity_warning_box);
findViewById(R.id.stations_disclaimer_group).setOnApplyWindowInsetsListener((v, insets) -> {
v.setPadding(0, 0, 0, insets.getSystemWindowInsetBottom());
return insets;
});
disclaimerSourceView = findViewById(R.id.stations_disclaimer_source); disclaimerSourceView = findViewById(R.id.stations_disclaimer_source);
// initialize stations list // initialize stations list