mirror of
https://gitlab.com/oeffi/oeffi.git
synced 2025-07-07 15:58:49 +00:00
Replace custom shadows by elevation attributes.
This only works on Lollipop and above. KitKat users will not see shadows any more.
This commit is contained in:
parent
99477d496b
commit
9c1ed53bf8
14 changed files with 65 additions and 97 deletions
|
@ -1,12 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<gradient
|
||||
android:angle="270"
|
||||
android:endColor="#0000"
|
||||
android:startColor="#20000000" >
|
||||
</gradient>
|
||||
|
||||
<size android:height="8dp" />
|
||||
|
||||
</shape>
|
|
@ -1,12 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<gradient
|
||||
android:angle="0"
|
||||
android:endColor="#0000"
|
||||
android:startColor="#20000000" >
|
||||
</gradient>
|
||||
|
||||
<size android:width="8dp" />
|
||||
|
||||
</shape>
|
|
@ -1,12 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<gradient
|
||||
android:angle="90"
|
||||
android:endColor="#0000"
|
||||
android:startColor="#20000000" >
|
||||
</gradient>
|
||||
|
||||
<size android:height="8dp" />
|
||||
|
||||
</shape>
|
|
@ -1,9 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<de.schildbach.oeffi.MyActionBar xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<de.schildbach.oeffi.MyActionBar
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/action_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:animateLayoutChanges="true" >
|
||||
android:animateLayoutChanges="true"
|
||||
android:elevation="@dimen/elevation_action_bar"
|
||||
tools:targetApi="21">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/action_bar_menu_button"
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:baselineAligned="false"
|
||||
|
@ -8,7 +10,9 @@
|
|||
<androidx.drawerlayout.widget.DrawerLayout
|
||||
android:id="@+id/navigation_drawer_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
android:layout_height="match_parent"
|
||||
android:elevation="@dimen/elevation_content"
|
||||
tools:targetApi="21">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/directions_content_layout"
|
||||
|
@ -86,7 +90,8 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top"
|
||||
android:background="@android:color/white"
|
||||
android:elevation="3dp" >
|
||||
android:elevation="@dimen/elevation_panel"
|
||||
tools:targetApi="21">
|
||||
|
||||
<include layout="@layout/directions_form_include" />
|
||||
</ScrollView>
|
||||
|
@ -100,8 +105,8 @@
|
|||
android:id="@+id/directions_map_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:foreground="@drawable/view_shadow_right"
|
||||
android:foregroundGravity="left|fill_vertical" >
|
||||
android:elevation="@dimen/elevation_map"
|
||||
tools:targetApi="21">
|
||||
|
||||
<de.schildbach.oeffi.OeffiMapView
|
||||
android:id="@+id/directions_map"
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/stations_layout"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -11,15 +12,15 @@
|
|||
android:id="@+id/directions_trip_details_list_frame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical" >
|
||||
android:orientation="vertical"
|
||||
android:elevation="@dimen/elevation_content"
|
||||
tools:targetApi="21">
|
||||
|
||||
<include layout="@layout/action_bar" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:foreground="@drawable/view_shadow_bottom"
|
||||
android:foregroundGravity="top|fill_horizontal" >
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
|
@ -121,8 +122,8 @@
|
|||
android:id="@+id/directions_trip_details_map_frame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:foreground="@drawable/view_shadow_right"
|
||||
android:foregroundGravity="left|fill_vertical" >
|
||||
android:elevation="@dimen/elevation_map"
|
||||
tools:targetApi="21">
|
||||
|
||||
<de.schildbach.oeffi.OeffiMapView
|
||||
android:id="@+id/directions_trip_details_map"
|
||||
|
|
|
@ -8,9 +8,7 @@
|
|||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:foreground="@drawable/view_shadow_bottom"
|
||||
android:foregroundGravity="top|fill_horizontal" >
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<de.schildbach.oeffi.directions.TripsGallery
|
||||
android:id="@+id/trips_bar_view"
|
||||
|
|
|
@ -9,9 +9,7 @@
|
|||
<ViewAnimator
|
||||
android:id="@+id/favorites_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:foreground="@drawable/view_shadow_bottom"
|
||||
android:foregroundGravity="top|fill_horizontal" >
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/favorites_list"
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/stations_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:baselineAligned="false"
|
||||
android:orientation="horizontal" >
|
||||
android:elevation="@dimen/elevation_content"
|
||||
android:orientation="horizontal"
|
||||
tools:targetApi="21">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/network_picker_list_frame"
|
||||
|
@ -17,8 +21,6 @@
|
|||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:foreground="@drawable/view_shadow_bottom"
|
||||
android:foregroundGravity="top|fill_horizontal"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
|
@ -36,22 +38,13 @@
|
|||
android:id="@+id/network_picker_firsttime_message_shadow"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0px"
|
||||
android:layout_weight="1"
|
||||
android:foreground="@drawable/view_shadow_bottom"
|
||||
android:foregroundGravity="top|fill_horizontal" >
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:foreground="@drawable/view_shadow_top"
|
||||
android:foregroundGravity="bottom|fill_horizontal" >
|
||||
android:layout_weight="1">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@android:id/list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</FrameLayout>
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -59,8 +52,7 @@
|
|||
android:id="@+id/network_picker_map_frame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:foreground="@drawable/view_shadow_right"
|
||||
android:foregroundGravity="left|fill_vertical" >
|
||||
android:elevation="@dimen/elevation_map">
|
||||
|
||||
<de.schildbach.oeffi.OeffiMapView
|
||||
android:id="@+id/network_picker_map"
|
||||
|
|
|
@ -15,8 +15,6 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:animateLayoutChanges="true"
|
||||
android:foreground="@drawable/view_shadow_bottom"
|
||||
android:foregroundGravity="top|fill_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:baselineAligned="false"
|
||||
|
@ -8,7 +10,9 @@
|
|||
<androidx.drawerlayout.widget.DrawerLayout
|
||||
android:id="@+id/navigation_drawer_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
android:layout_height="match_parent"
|
||||
android:elevation="@dimen/elevation_content"
|
||||
tools:targetApi="21">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -19,9 +23,7 @@
|
|||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:foreground="@drawable/view_shadow_bottom"
|
||||
android:foregroundGravity="top|fill_horizontal" >
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -402,8 +404,8 @@
|
|||
android:id="@+id/stations_map_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:foreground="@drawable/view_shadow_right"
|
||||
android:foregroundGravity="left|fill_vertical" >
|
||||
android:elevation="@dimen/elevation_map"
|
||||
tools:targetApi="21">
|
||||
|
||||
<de.schildbach.oeffi.OeffiMapView
|
||||
android:id="@+id/stations_map"
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:baselineAligned="false"
|
||||
|
@ -9,15 +11,15 @@
|
|||
android:id="@+id/stations_station_details_list_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical" >
|
||||
android:elevation="@dimen/elevation_content"
|
||||
android:orientation="vertical"
|
||||
tools:targetApi="21">
|
||||
|
||||
<include layout="@layout/action_bar" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:foreground="@drawable/view_shadow_bottom"
|
||||
android:foregroundGravity="top|fill_horizontal" >
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ViewAnimator
|
||||
android:id="@+id/stations_station_details_list_layout"
|
||||
|
@ -78,8 +80,8 @@
|
|||
android:id="@+id/stations_station_details_map_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:foreground="@drawable/view_shadow_right"
|
||||
android:foregroundGravity="left|fill_vertical" >
|
||||
android:elevation="@dimen/elevation_map"
|
||||
tools:targetApi="21">
|
||||
|
||||
<de.schildbach.oeffi.OeffiMapView
|
||||
android:id="@+id/stations_station_details_map"
|
||||
|
|
|
@ -44,6 +44,11 @@
|
|||
<dimen name="layout_navigation_drawer_width">300dp</dimen>
|
||||
<dimen name="layout_list_width">360dp</dimen>
|
||||
|
||||
<dimen name="elevation_map">0dp</dimen>
|
||||
<dimen name="elevation_content">4dp</dimen>
|
||||
<dimen name="elevation_panel">6dp</dimen>
|
||||
<dimen name="elevation_action_bar">8dp</dimen>
|
||||
|
||||
<bool name="layout_list_show">true</bool>
|
||||
<bool name="layout_map_show">false</bool>
|
||||
<bool name="layout_navigation_drawer_footer_show">false</bool>
|
||||
|
|
|
@ -201,7 +201,6 @@ public abstract class OeffiMainActivity extends OeffiActivity {
|
|||
.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL_LIST));
|
||||
navigationDrawerListView.setAdapter(menuAdapter);
|
||||
|
||||
navigationDrawerLayout.setDrawerShadow(R.drawable.view_shadow_right, Gravity.LEFT);
|
||||
navigationDrawerLayout.addDrawerListener(new DrawerLayout.DrawerListener() {
|
||||
public void onDrawerOpened(final View drawerView) {
|
||||
handler.postDelayed(() -> heartbeat.start(), 2000);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue