mirror of
https://gitlab.com/oeffi/oeffi.git
synced 2025-07-07 18:58:48 +00:00
Dark mode.
This commit is contained in:
parent
befb673a30
commit
69f3d85be3
34 changed files with 178 additions and 95 deletions
|
@ -63,7 +63,7 @@
|
|||
android:icon="@mipmap/ic_oeffi_stations_color_48dp"
|
||||
android:label="@string/app_name"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:theme="@style/My.Theme.Light">
|
||||
android:theme="@style/My.Theme">
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
|
@ -486,8 +486,7 @@
|
|||
<activity
|
||||
android:name=".directions.TripsOverviewActivity"
|
||||
android:configChanges="keyboard|keyboardHidden"
|
||||
android:taskAffinity="de.schildbach.oeffi.directions"
|
||||
android:theme="@style/My.Theme.Dark" />
|
||||
android:taskAffinity="de.schildbach.oeffi.directions" />
|
||||
|
||||
<activity
|
||||
android:name=".directions.TripDetailsActivity"
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<solid android:color="#bfff" />
|
||||
|
||||
<corners android:radius="4dp" />
|
||||
|
||||
<padding
|
||||
android:bottom="2dp"
|
||||
android:left="4dp"
|
||||
android:right="4dp"
|
||||
android:top="2dp" />
|
||||
|
||||
</shape>
|
8
oeffi/res/drawable/list_divider.xml
Normal file
8
oeffi/res/drawable/list_divider.xml
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/bg_divider" />
|
||||
<size
|
||||
android:height="1dp"
|
||||
android:width="1dp" />
|
||||
</shape>
|
|
@ -5,14 +5,14 @@
|
|||
<!-- activated, plain -->
|
||||
<item android:state_activated="true">
|
||||
<shape>
|
||||
<solid android:color="#ffcfffaf" />
|
||||
<solid android:color="@color/bg_selected_entry" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!-- plain -->
|
||||
<item>
|
||||
<shape>
|
||||
<solid android:color="#ffffffff" />
|
||||
<solid android:color="@color/bg_level0" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top"
|
||||
android:background="@android:color/white"
|
||||
android:background="@color/bg_level1"
|
||||
android:elevation="@dimen/elevation_panel">
|
||||
|
||||
<include layout="@layout/directions_form_include" />
|
||||
|
|
|
@ -4,7 +4,9 @@
|
|||
style="?android:attr/dropDownItemStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/bg_level0"
|
||||
android:drawablePadding="@dimen/list_entry_padding_horizontal_lax"
|
||||
android:drawableTint="@color/fg_less_significant"
|
||||
android:minHeight="52dp"
|
||||
android:paddingLeft="@dimen/list_entry_padding_horizontal_lax"
|
||||
android:textSize="@dimen/font_size_large" />
|
||||
|
|
|
@ -17,7 +17,8 @@
|
|||
android:gravity="left"
|
||||
android:paddingBottom="@dimen/list_entry_padding_vertical"
|
||||
android:paddingLeft="@dimen/list_entry_padding_horizontal"
|
||||
android:paddingRight="@dimen/list_entry_padding_horizontal" />
|
||||
android:paddingRight="@dimen/list_entry_padding_horizontal"
|
||||
android:textColor="@color/fg_significant_on_light" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/directions_map_pin_buttons"
|
||||
|
@ -35,7 +36,8 @@
|
|||
android:paddingLeft="@dimen/list_entry_padding_horizontal_cram"
|
||||
android:paddingRight="@dimen/list_entry_padding_horizontal_cram"
|
||||
android:singleLine="true"
|
||||
android:text="@string/directions_map_pin_button_from" />
|
||||
android:text="@string/directions_map_pin_button_from"
|
||||
android:textColor="@color/fg_significant_on_light" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/directions_map_pin_button_to"
|
||||
|
@ -46,7 +48,8 @@
|
|||
android:paddingLeft="@dimen/list_entry_padding_horizontal_cram"
|
||||
android:paddingRight="@dimen/list_entry_padding_horizontal_cram"
|
||||
android:singleLine="true"
|
||||
android:text="@string/directions_map_pin_button_to" />
|
||||
android:text="@string/directions_map_pin_button_to"
|
||||
android:textColor="@color/fg_significant_on_light" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawablePadding="@dimen/list_entry_padding_horizontal_lax"
|
||||
android:drawableTint="@color/fg_less_significant"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="@dimen/list_entry_padding_horizontal_lax"
|
||||
android:paddingRight="@dimen/list_entry_padding_horizontal_cram"
|
||||
|
@ -37,6 +38,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawablePadding="@dimen/list_entry_padding_horizontal_lax"
|
||||
android:drawableTint="@color/fg_less_significant"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingBottom="@dimen/list_entry_padding_vertical_verylax"
|
||||
android:paddingLeft="@dimen/list_entry_padding_horizontal_lax"
|
||||
|
@ -51,6 +53,7 @@
|
|||
android:layout_weight="2"
|
||||
android:drawableLeft="@drawable/ic_beenhere_grey600_24dp"
|
||||
android:drawablePadding="@dimen/list_entry_padding_horizontal_lax"
|
||||
android:drawableTint="@color/fg_less_significant"
|
||||
android:gravity="left|center_vertical"
|
||||
android:paddingLeft="@dimen/list_entry_padding_horizontal_lax"
|
||||
android:paddingRight="@dimen/list_entry_padding_horizontal_cram" />
|
||||
|
|
|
@ -30,14 +30,14 @@
|
|||
android:id="@+id/directions_trip_details_legs_group"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:divider="?android:attr/listDivider"
|
||||
android:divider="@drawable/list_divider"
|
||||
android:orientation="vertical"
|
||||
android:showDividers="middle">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/listDivider"
|
||||
android:background="@color/bg_divider"
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="@dimen/list_entry_padding_vertical_lax"
|
||||
android:paddingLeft="@dimen/list_entry_padding_horizontal_lax"
|
||||
|
@ -63,7 +63,7 @@
|
|||
android:id="@+id/directions_trip_details_fares"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/listDivider"
|
||||
android:background="@color/bg_divider"
|
||||
android:baselineAligned="true"
|
||||
android:paddingBottom="@dimen/list_entry_padding_vertical_lax"
|
||||
android:paddingLeft="@dimen/list_entry_padding_horizontal_verylax"
|
||||
|
@ -77,6 +77,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:drawableLeft="@drawable/ic_settings_input_antenna_grey600_18dp"
|
||||
android:drawablePadding="@dimen/list_entry_padding_horizontal_lax"
|
||||
android:drawableTint="@color/fg_less_significant"
|
||||
android:gravity="left|center_vertical"
|
||||
android:paddingBottom="@dimen/list_entry_padding_vertical_lax"
|
||||
android:paddingLeft="@dimen/list_entry_padding_horizontal_lax"
|
||||
|
@ -90,7 +91,6 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_margin="4dp"
|
||||
android:background="@drawable/disclaimer_background"
|
||||
android:baselineAligned="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
android:layout_width="@dimen/action_bar_button_width"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_map_black_24dp" />
|
||||
android:src="@drawable/ic_map_black_24dp"
|
||||
android:tint="@color/fg_less_significant" />
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -72,7 +72,8 @@
|
|||
android:layout_width="@dimen/action_bar_button_width"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_expand_black_24dp" />
|
||||
android:src="@drawable/ic_expand_black_24dp"
|
||||
android:tint="@color/fg_less_significant" />
|
||||
</LinearLayout>
|
||||
|
||||
<TableLayout
|
||||
|
|
|
@ -26,8 +26,6 @@
|
|||
android:layout_gravity="bottom|left"
|
||||
android:layout_margin="4dp"
|
||||
android:gravity="left"
|
||||
android:shadowColor="#000"
|
||||
android:shadowRadius="2"
|
||||
android:textSize="@dimen/font_size_disclaimer"
|
||||
android:visibility="gone" />
|
||||
|
||||
|
@ -37,8 +35,6 @@
|
|||
android:layout_gravity="bottom|right"
|
||||
android:layout_margin="4dp"
|
||||
android:gravity="right"
|
||||
android:shadowColor="#000"
|
||||
android:shadowRadius="2"
|
||||
android:text="@string/disclaimer_responsibility_2line"
|
||||
android:textSize="@dimen/font_size_disclaimer" />
|
||||
</FrameLayout>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
android:layout_width="@dimen/layout_navigation_drawer_width"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="left"
|
||||
android:background="@android:color/white"
|
||||
android:background="@color/bg_level0"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
android:id="@android:id/text1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/listDivider"
|
||||
android:background="@color/bg_divider"
|
||||
android:focusable="false"
|
||||
android:paddingBottom="1dp"
|
||||
android:paddingLeft="@dimen/list_entry_padding_horizontal_lax"
|
||||
android:paddingRight="@dimen/list_entry_padding_horizontal_lax"
|
||||
android:paddingTop="1dp"
|
||||
android:textColor="@color/grey600"
|
||||
android:textColor="@color/fg_less_significant"
|
||||
android:textStyle="bold" />
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:drawableLeft="@drawable/ic_search_grey600_24dp"
|
||||
android:drawableTint="@color/fg_significant"
|
||||
android:drawablePadding="@dimen/list_entry_padding_horizontal"
|
||||
android:gravity="left|center_vertical"
|
||||
android:paddingBottom="@dimen/list_entry_padding_vertical"
|
||||
|
@ -61,7 +62,8 @@
|
|||
android:layout_width="36dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="right|center_vertical"
|
||||
android:src="@drawable/ic_clear_black_24dp" />
|
||||
android:src="@drawable/ic_clear_black_24dp"
|
||||
android:tint="@color/fg_significant" />
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
|
|
|
@ -29,7 +29,8 @@
|
|||
<ImageView
|
||||
android:id="@+id/plans_picker_entry_thumb"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
android:layout_height="match_parent"
|
||||
android:alpha="@dimen/alpha_bright_white" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/plans_picker_entry_progress"
|
||||
|
@ -56,7 +57,8 @@
|
|||
android:layout_marginLeft="@dimen/list_entry_padding_horizontal_lax"
|
||||
android:layout_marginTop="@dimen/list_entry_padding_vertical_lax"
|
||||
android:layout_toLeftOf="@id/plans_picker_entry_context_button_space"
|
||||
android:src="@drawable/ic_offline_pin_grey600_24dp" />
|
||||
android:src="@drawable/ic_offline_pin_grey600_24dp"
|
||||
android:tint="@color/fg_less_significant" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/plans_picker_entry_name"
|
||||
|
@ -80,7 +82,7 @@
|
|||
android:gravity="right"
|
||||
android:paddingBottom="@dimen/list_entry_padding_vertical_lax"
|
||||
android:paddingTop="@dimen/list_entry_padding_vertical_lax"
|
||||
android:textColor="#a00" />
|
||||
android:textColor="@color/fg_less_significant" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/plans_picker_entry_network_logo"
|
||||
|
@ -102,7 +104,7 @@
|
|||
android:maxLines="2"
|
||||
android:paddingBottom="@dimen/list_entry_padding_vertical_lax"
|
||||
android:paddingTop="@dimen/list_entry_padding_vertical_lax"
|
||||
android:textColor="#aaa" />
|
||||
android:textColor="@color/fg_less_significant" />
|
||||
</RelativeLayout>
|
||||
|
||||
<ImageButton
|
||||
|
|
|
@ -58,6 +58,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:drawableLeft="@drawable/ic_search_grey600_24dp"
|
||||
android:drawableTint="@color/fg_significant"
|
||||
android:drawablePadding="@dimen/list_entry_padding_horizontal"
|
||||
android:gravity="left|center_vertical"
|
||||
android:paddingBottom="@dimen/list_entry_padding_vertical"
|
||||
|
@ -72,7 +73,8 @@
|
|||
android:layout_width="36dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="right|center_vertical"
|
||||
android:src="@drawable/ic_clear_black_24dp" />
|
||||
android:src="@drawable/ic_clear_black_24dp"
|
||||
android:tint="@color/fg_significant" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
|
@ -369,7 +371,6 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_margin="4dp"
|
||||
android:background="@drawable/disclaimer_background"
|
||||
android:baselineAligned="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
|
|
@ -48,7 +48,6 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_margin="4dp"
|
||||
android:background="@drawable/disclaimer_background"
|
||||
android:baselineAligned="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/listDivider"
|
||||
android:background="@color/bg_divider"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="@dimen/list_entry_padding_vertical_lax"
|
||||
android:paddingLeft="@dimen/list_entry_padding_horizontal_lax"
|
||||
|
|
28
oeffi/res/values-night/colors.xml
Normal file
28
oeffi/res/values-night/colors.xml
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<!-- foreground -->
|
||||
<color name="fg_significant">#ffffff</color>
|
||||
<color name="fg_less_significant">#aaaaaa</color>
|
||||
<color name="fg_insignificant">#888888</color>
|
||||
<color name="fg_highlighted">#ff9966</color>
|
||||
<color name="fg_arrow">#ff6666</color>
|
||||
<color name="fg_position">#000000</color>
|
||||
|
||||
<!-- background -->
|
||||
<color name="bg_level0">#222222</color>
|
||||
<color name="bg_level1">#333333</color>
|
||||
<color name="bg_divider">#444444</color>
|
||||
<color name="bg_action_bar">#444444</color>
|
||||
<color name="bg_action_bar_stations">#444400</color>
|
||||
<color name="bg_action_bar_directions">#114411</color>
|
||||
<color name="bg_action_bar_appendix">#555555</color>
|
||||
<color name="bg_selected_entry">#284028</color>
|
||||
<color name="bg_individual">#444444</color>
|
||||
<color name="bg_delayed">#444444</color>
|
||||
<color name="bg_current_time">#ffff00</color>
|
||||
<color name="bg_position">#bbbbbb</color>
|
||||
|
||||
<item name="alpha_bright_white" format="float" type="dimen">0.7</item>
|
||||
|
||||
</resources>
|
47
oeffi/res/values-night/styles.xml
Normal file
47
oeffi/res/values-night/styles.xml
Normal file
|
@ -0,0 +1,47 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="My.Theme" parent="@android:style/Theme.Material.NoActionBar">
|
||||
<item name="android:windowBackground">@color/bg_level0</item>
|
||||
<item name="android:windowTranslucentStatus">true</item>
|
||||
<item name="android:textViewStyle">@style/My.Widget.TextView</item>
|
||||
<item name="android:autoCompleteTextViewStyle">@style/My.Widget.AutoCompleteTextView</item>
|
||||
<item name="android:dropDownListViewStyle">@style/My.Widget.ListView.DropDown</item>
|
||||
<item name="android:buttonStyle">@style/My.Widget.Button</item>
|
||||
<item name="android:imageButtonStyle">@style/My.Widget.ImageButton</item>
|
||||
<item name="android:checkboxStyle">@style/My.Widget.CompoundButton.CheckBox</item>
|
||||
<item name="android:popupMenuStyle">@style/My.Widget.PopupMenu</item>
|
||||
</style>
|
||||
|
||||
<style name="My.Theme.Preference" parent="@android:style/Theme.Material">
|
||||
<item name="android:actionBarStyle">@style/My.Widget.ActionBar</item>
|
||||
</style>
|
||||
|
||||
<style name="My.Theme.Dialog" parent="@android:style/Theme.Material.Dialog.Alert">
|
||||
<item name="android:background">@color/bg_level1</item>
|
||||
</style>
|
||||
|
||||
<style name="My.Widget.AutoCompleteTextView" parent="@android:style/Widget.Material.AutoCompleteTextView">
|
||||
<item name="android:textColor">@color/fg_significant</item>
|
||||
<item name="android:background">@null</item>
|
||||
<item name="android:popupBackground">@android:color/white</item>
|
||||
<item name="android:dropDownVerticalOffset">0px</item>
|
||||
</style>
|
||||
|
||||
<style name="My.Widget.Button" parent="@android:style/Widget.Material.Button">
|
||||
<item name="android:background">?android:attr/selectableItemBackground</item>
|
||||
<item name="android:textColor">@color/fg_significant</item>
|
||||
<item name="android:textSize">@dimen/font_size_normal</item>
|
||||
<item name="android:textAllCaps">false</item>
|
||||
</style>
|
||||
|
||||
<style name="My.Widget.Button.Border" parent="@android:style/Widget.Material.Button">
|
||||
<item name="android:textColor">@color/fg_significant</item>
|
||||
<item name="android:textSize">@dimen/font_size_normal</item>
|
||||
</style>
|
||||
|
||||
<style name="My.Widget.PopupMenu" parent="@android:style/Widget.Material.PopupMenu" />
|
||||
|
||||
</resources>
|
|
@ -1,21 +1,30 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<color name="grey600">#757575</color>
|
||||
|
||||
<!-- foreground -->
|
||||
<color name="fg_significant">#000000</color>
|
||||
<color name="fg_less_significant">#999999</color>
|
||||
<color name="fg_insignificant">#bbbbbb</color>
|
||||
<color name="fg_highlighted">#dd9055</color>
|
||||
<color name="fg_arrow">#aa0000</color>
|
||||
<color name="fg_position">#ffffff</color>
|
||||
<color name="fg_significant_on_dark">#ffffff</color>
|
||||
<color name="fg_significant_on_light">#000000</color>
|
||||
|
||||
<!-- background -->
|
||||
<color name="bg_level0">#f7f7f7</color>
|
||||
<color name="bg_level1">#ffffff</color>
|
||||
<color name="bg_divider">#dddddd</color>
|
||||
<color name="bg_action_bar">#555555</color>
|
||||
<color name="bg_action_bar_stations">#777700</color>
|
||||
<color name="bg_action_bar_directions">#227722</color>
|
||||
<color name="bg_action_bar_directions_dark">#114411</color>
|
||||
<color name="bg_action_bar_appendix">#cccccc</color>
|
||||
<color name="bg_selected_entry">#ffcfffaf</color>
|
||||
<color name="bg_individual">#cccccc</color>
|
||||
<color name="bg_delayed">#cccccc</color>
|
||||
<color name="bg_current_time">#eebb00</color>
|
||||
<color name="bg_position">#757575</color>
|
||||
|
||||
<item name="alpha_bright_white" format="float" type="dimen">1</item>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="My.Theme.Light" parent="@android:style/Theme.Material.Light.NoActionBar">
|
||||
<item name="android:windowBackground">@android:color/white</item>
|
||||
<style name="My.Theme" parent="@android:style/Theme.Material.Light.NoActionBar">
|
||||
<item name="android:windowBackground">@color/bg_level0</item>
|
||||
<item name="android:windowTranslucentStatus">true</item>
|
||||
<item name="android:textViewStyle">@style/My.Widget.TextView</item>
|
||||
<item name="android:autoCompleteTextViewStyle">@style/My.Widget.AutoCompleteTextView</item>
|
||||
|
@ -15,12 +15,6 @@
|
|||
<item name="android:popupMenuStyle">@style/My.Widget.PopupMenu</item>
|
||||
</style>
|
||||
|
||||
<style name="My.Theme.Dark" parent="@android:style/Theme.Material.NoActionBar">
|
||||
<item name="android:windowBackground">@android:color/black</item>
|
||||
<item name="android:windowTranslucentStatus">true</item>
|
||||
<item name="android:imageButtonStyle">@style/My.Widget.ImageButton</item>
|
||||
</style>
|
||||
|
||||
<style name="My.Theme.Fullscreen" parent="@android:style/Theme.Material.Light.NoActionBar.Fullscreen">
|
||||
<item name="android:windowBackground">@android:color/black</item>
|
||||
<item name="android:textViewStyle">@style/My.Widget.TextView</item>
|
||||
|
@ -31,7 +25,11 @@
|
|||
<item name="android:actionBarStyle">@style/My.Widget.ActionBar</item>
|
||||
</style>
|
||||
|
||||
<style name="My.Theme.Translucent" parent="@style/My.Theme.Light">
|
||||
<style name="My.Theme.Dialog" parent="@android:style/Theme.Material.Light.Dialog.Alert">
|
||||
<item name="android:background">@color/bg_level1</item>
|
||||
</style>
|
||||
|
||||
<style name="My.Theme.Translucent" parent="@style/My.Theme">
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowIsFloating">true</item>
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
|
@ -70,6 +68,7 @@
|
|||
<item name="android:layout_width">40dp</item>
|
||||
<item name="android:layout_height">40dp</item>
|
||||
<item name="android:src">@drawable/ic_more_vert_grey600_24dp</item>
|
||||
<item name="android:tint">@color/fg_less_significant</item>
|
||||
</style>
|
||||
|
||||
<style name="My.Widget.CompoundButton.CheckBox" parent="@android:style/Widget.Material.CompoundButton.CheckBox">
|
||||
|
|
|
@ -69,7 +69,4 @@ public class Constants {
|
|||
public static final String DESTINATION_ARROW_PREFIX = Character.toString(Constants.CHAR_RIGHTWARDS_ARROW)
|
||||
+ Constants.CHAR_THIN_SPACE;
|
||||
public static final String DESTINATION_ARROW_INVISIBLE_PREFIX = " ";
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public static final int ALERT_DIALOG_THEME = android.R.style.Theme_DeviceDefault_Light_Dialog;
|
||||
}
|
||||
|
|
|
@ -698,7 +698,7 @@ public class DirectionsActivity extends OeffiMainActivity implements ActivityCom
|
|||
final int month = calendar.get(Calendar.MONTH);
|
||||
final int day = calendar.get(Calendar.DAY_OF_MONTH);
|
||||
|
||||
new DatePickerDialog(DirectionsActivity.this, Constants.ALERT_DIALOG_THEME, (view, year1, month1, day1) -> {
|
||||
new DatePickerDialog(DirectionsActivity.this, R.style.My_Theme_Dialog, (view, year1, month1, day1) -> {
|
||||
calendar.set(Calendar.YEAR, year1);
|
||||
calendar.set(Calendar.MONTH, month1);
|
||||
calendar.set(Calendar.DAY_OF_MONTH, day1);
|
||||
|
@ -713,7 +713,7 @@ public class DirectionsActivity extends OeffiMainActivity implements ActivityCom
|
|||
final int hour = calendar.get(Calendar.HOUR_OF_DAY);
|
||||
final int minute = calendar.get(Calendar.MINUTE);
|
||||
|
||||
new TimePickerDialog(DirectionsActivity.this, Constants.ALERT_DIALOG_THEME, (view, hour1, minute1) -> {
|
||||
new TimePickerDialog(DirectionsActivity.this, R.style.My_Theme_Dialog, (view, hour1, minute1) -> {
|
||||
calendar.set(Calendar.HOUR_OF_DAY, hour1);
|
||||
calendar.set(Calendar.MINUTE, minute1);
|
||||
time = new TimeSpec.Absolute(time.depArr, calendar.getTimeInMillis());
|
||||
|
|
|
@ -37,6 +37,7 @@ public class PearlView extends View {
|
|||
private final int lineWidth;
|
||||
private final int intermediateSize;
|
||||
private final float stopStrokeWidth;
|
||||
private final int colorBackground;
|
||||
|
||||
private final Paint paint = new Paint();
|
||||
|
||||
|
@ -57,12 +58,14 @@ public class PearlView extends View {
|
|||
|
||||
final Resources res = getResources();
|
||||
|
||||
defaultStyle = new Style(res.getColor(R.color.grey600), Color.WHITE);
|
||||
defaultStyle = new Style(Color.GRAY, Color.WHITE);
|
||||
|
||||
lineWidth = res.getDimensionPixelSize(R.dimen.pearl_line_width);
|
||||
intermediateSize = res.getDimensionPixelSize(R.dimen.pearl_intermediate_size);
|
||||
stopStrokeWidth = res.getDisplayMetrics().density;
|
||||
|
||||
colorBackground = res.getColor(R.color.bg_level0);
|
||||
|
||||
paint.setAntiAlias(true);
|
||||
}
|
||||
|
||||
|
@ -110,7 +113,7 @@ public class PearlView extends View {
|
|||
|
||||
paint.setStyle(Paint.Style.STROKE);
|
||||
paint.setStrokeWidth(stopStrokeWidth);
|
||||
paint.setColor(style.hasBorder() ? style.borderColor : Color.WHITE);
|
||||
paint.setColor(style.hasBorder() ? style.borderColor : colorBackground);
|
||||
canvas.drawCircle(x, y, circleRadius, paint);
|
||||
|
||||
paint.setStyle(Paint.Style.FILL);
|
||||
|
@ -125,7 +128,7 @@ public class PearlView extends View {
|
|||
|
||||
paint.setStyle(Paint.Style.STROKE);
|
||||
paint.setStrokeWidth(stopStrokeWidth);
|
||||
paint.setColor(style.hasBorder() ? style.borderColor : Color.WHITE);
|
||||
paint.setColor(style.hasBorder() ? style.borderColor : colorBackground);
|
||||
canvas.drawCircle(x, y, circleRadius, paint);
|
||||
|
||||
paint.setStyle(Paint.Style.FILL);
|
||||
|
|
|
@ -25,7 +25,6 @@ import android.content.IntentFilter;
|
|||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Typeface;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
|
@ -109,7 +108,7 @@ public class TripDetailsActivity extends OeffiActivity implements LocationListen
|
|||
private int colorSignificant;
|
||||
private int colorInsignificant;
|
||||
private int colorHighlighted;
|
||||
private int colorGrey600;
|
||||
private int colorPosition, colorPositionBackground;
|
||||
private DisplayMetrics displayMetrics;
|
||||
private LocationManager locationManager;
|
||||
private BroadcastReceiver tickReceiver;
|
||||
|
@ -141,7 +140,8 @@ public class TripDetailsActivity extends OeffiActivity implements LocationListen
|
|||
colorSignificant = res.getColor(R.color.fg_significant);
|
||||
colorInsignificant = res.getColor(R.color.fg_insignificant);
|
||||
colorHighlighted = res.getColor(R.color.fg_highlighted);
|
||||
colorGrey600 = res.getColor(R.color.grey600);
|
||||
colorPosition = res.getColor(R.color.fg_position);
|
||||
colorPositionBackground = res.getColor(R.color.bg_position);
|
||||
displayMetrics = res.getDisplayMetrics();
|
||||
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
|
||||
|
||||
|
@ -816,8 +816,8 @@ public class TripDetailsActivity extends OeffiActivity implements LocationListen
|
|||
stopPositionView.setText(positionStr);
|
||||
stopPositionView.setTypeface(null, Typeface.BOLD + (isPositionPredicted ? Typeface.ITALIC : 0));
|
||||
final int padding = (int) (2 * displayMetrics.density);
|
||||
stopPositionView.setBackgroundDrawable(new ColorDrawable(colorGrey600));
|
||||
stopPositionView.setTextColor(Color.WHITE);
|
||||
stopPositionView.setBackgroundDrawable(new ColorDrawable(colorPositionBackground));
|
||||
stopPositionView.setTextColor(colorPosition);
|
||||
stopPositionView.setPadding(padding, 0, padding, 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -76,7 +76,8 @@ public class TripsGallery extends Gallery {
|
|||
final Resources res = getResources();
|
||||
density = res.getDisplayMetrics().density;
|
||||
final float strokeWidth = res.getDimension(R.dimen.trips_overview_stroke_width);
|
||||
final int colorSignificant = res.getColor(R.color.fg_significant_on_dark);
|
||||
final int colorSignificant = res.getColor(R.color.fg_significant);
|
||||
final int colorCurrentTime = res.getColor(R.color.bg_current_time);
|
||||
|
||||
gridPaint.setColor(Color.GRAY);
|
||||
gridPaint.setStyle(Paint.Style.STROKE);
|
||||
|
@ -89,16 +90,14 @@ public class TripsGallery extends Gallery {
|
|||
gridLabelPaint.setTextSize(res.getDimension(R.dimen.font_size_normal));
|
||||
gridLabelPaint.setTextAlign(Align.CENTER);
|
||||
|
||||
currenttimePaint.setColor(Color.YELLOW);
|
||||
currenttimePaint.setColor(colorCurrentTime);
|
||||
currenttimePaint.setStyle(Paint.Style.FILL_AND_STROKE);
|
||||
currenttimePaint.setStrokeWidth(strokeWidth);
|
||||
currenttimePaint.setShadowLayer(2, 0, 0, Color.BLACK);
|
||||
currenttimePaint.setAntiAlias(false);
|
||||
|
||||
currenttimeLabelBackgroundPaint.setColor(Color.YELLOW);
|
||||
currenttimeLabelBackgroundPaint.setColor(colorCurrentTime);
|
||||
currenttimeLabelBackgroundPaint.setStyle(Paint.Style.FILL_AND_STROKE);
|
||||
currenttimeLabelBackgroundPaint.setStrokeWidth(strokeWidth);
|
||||
currenttimeLabelBackgroundPaint.setShadowLayer(2, 0, 0, Color.BLACK);
|
||||
currenttimeLabelBackgroundPaint.setAntiAlias(true);
|
||||
|
||||
currenttimeLabelTextPaint.setColor(Color.BLACK);
|
||||
|
|
|
@ -76,6 +76,7 @@ public final class TripsGalleryAdapter extends BaseAdapter {
|
|||
private final Paint individualTimePaint = new Paint();
|
||||
private final Paint publicTimePaint = new Paint();
|
||||
private final Paint cannotScrollPaint = new Paint();
|
||||
private final int colorDelayed;
|
||||
|
||||
private static final float ROUNDED_CORNER_RADIUS = 8f;
|
||||
private static final float CIRCLE_CORNER_RADIUS = 16f;
|
||||
|
@ -86,7 +87,10 @@ public final class TripsGalleryAdapter extends BaseAdapter {
|
|||
final Resources res = context.getResources();
|
||||
|
||||
final float strokeWidth = res.getDimension(R.dimen.trips_overview_entry_box_stroke_width);
|
||||
final int colorSignificant = res.getColor(R.color.fg_significant_on_dark);
|
||||
final int colorSignificant = res.getColor(R.color.fg_significant);
|
||||
final int colorLessSignificant = res.getColor(R.color.fg_less_significant);
|
||||
final int colorIndividual = res.getColor(R.color.bg_individual);
|
||||
colorDelayed = res.getColor(R.color.bg_delayed);
|
||||
|
||||
tripWidth = res.getDimensionPixelSize(R.dimen.trips_overview_entry_width);
|
||||
|
||||
|
@ -102,24 +106,22 @@ public final class TripsGalleryAdapter extends BaseAdapter {
|
|||
publicLabelPaint.setAntiAlias(true);
|
||||
|
||||
individualFillPaint.setStyle(Paint.Style.FILL);
|
||||
individualFillPaint.setColor(Color.DKGRAY);
|
||||
individualFillPaint.setColor(colorIndividual);
|
||||
|
||||
individualLabelPaint.setColor(Color.GRAY);
|
||||
individualLabelPaint.setTypeface(Typeface.DEFAULT);
|
||||
individualLabelPaint.setTextSize(res.getDimension(R.dimen.font_size_xlarge));
|
||||
individualLabelPaint.setTextAlign(Align.CENTER);
|
||||
|
||||
individualTimePaint.setColor(Color.LTGRAY);
|
||||
individualTimePaint.setColor(colorLessSignificant);
|
||||
individualTimePaint.setTypeface(Typeface.DEFAULT);
|
||||
individualTimePaint.setTextSize(res.getDimension(R.dimen.font_size_normal) * 0.9f);
|
||||
individualTimePaint.setShadowLayer(1, 0, 0, Color.BLACK);
|
||||
individualTimePaint.setAntiAlias(true);
|
||||
individualTimePaint.setTextAlign(Align.CENTER);
|
||||
|
||||
publicTimePaint.setColor(colorSignificant);
|
||||
publicTimePaint.setTypeface(Typeface.DEFAULT_BOLD);
|
||||
publicTimePaint.setTextSize(res.getDimension(R.dimen.font_size_normal));
|
||||
publicTimePaint.setShadowLayer(1, 0, 0, Color.BLACK);
|
||||
publicTimePaint.setAntiAlias(true);
|
||||
publicTimePaint.setTextAlign(Align.CENTER);
|
||||
|
||||
|
@ -331,7 +333,7 @@ public final class TripsGalleryAdapter extends BaseAdapter {
|
|||
if (leg instanceof Public) {
|
||||
final Public publicLeg = (Public) leg;
|
||||
publicFillPaint.setShader(null);
|
||||
publicFillPaint.setColor(Color.DKGRAY);
|
||||
publicFillPaint.setColor(colorDelayed);
|
||||
final Line line = publicLeg.line;
|
||||
final Style style = line.style;
|
||||
final float radius;
|
||||
|
|
|
@ -131,7 +131,7 @@ public class TripsOverviewActivity extends OeffiActivity {
|
|||
|
||||
setContentView(R.layout.directions_trip_overview_content);
|
||||
final MyActionBar actionBar = getMyActionBar();
|
||||
setPrimaryColor(R.color.bg_action_bar_directions_dark);
|
||||
setPrimaryColor(R.color.bg_action_bar_directions);
|
||||
actionBar.setBack(v -> finish());
|
||||
actionBar.setCustomTitles(R.layout.directions_trip_overview_custom_title);
|
||||
actionBar.addProgressButton().setOnClickListener(v -> handler.post(checkMoreRunnable));
|
||||
|
|
|
@ -33,7 +33,7 @@ public class NetworkViewHolder extends RecyclerView.ViewHolder {
|
|||
private final Context context;
|
||||
private final Resources res;
|
||||
private final int colorSignificant;
|
||||
private final int colorGrey600;
|
||||
private final int colorLessSignificant;
|
||||
|
||||
private final ImageView iconView;
|
||||
private final TextView labelView;
|
||||
|
@ -50,7 +50,7 @@ public class NetworkViewHolder extends RecyclerView.ViewHolder {
|
|||
this.context = context;
|
||||
this.res = context.getResources();
|
||||
this.colorSignificant = res.getColor(R.color.fg_significant);
|
||||
this.colorGrey600 = res.getColor(R.color.grey600);
|
||||
this.colorLessSignificant = res.getColor(R.color.fg_less_significant);
|
||||
|
||||
iconView = itemView.findViewById(R.id.network_picker_entry_icon);
|
||||
labelView = itemView.findViewById(R.id.network_picker_entry_label);
|
||||
|
@ -81,7 +81,7 @@ public class NetworkViewHolder extends RecyclerView.ViewHolder {
|
|||
}
|
||||
|
||||
labelView.setText(networkRes.label);
|
||||
labelView.setTextColor(isEnabled ? colorSignificant : colorGrey600);
|
||||
labelView.setTextColor(isEnabled ? colorSignificant : colorLessSignificant);
|
||||
|
||||
if (entry.state != null && isEnabled)
|
||||
stateView.setText(
|
||||
|
@ -90,7 +90,7 @@ public class NetworkViewHolder extends RecyclerView.ViewHolder {
|
|||
stateView.setText(null);
|
||||
|
||||
commentView.setText(networkRes.comment);
|
||||
commentView.setTextColor(isEnabled ? colorSignificant : colorGrey600);
|
||||
commentView.setTextColor(isEnabled ? colorSignificant : colorLessSignificant);
|
||||
|
||||
if (dbFileLength > 0) {
|
||||
usageView.setVisibility(View.VISIBLE);
|
||||
|
|
|
@ -19,12 +19,11 @@ package de.schildbach.oeffi.util;
|
|||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import de.schildbach.oeffi.Constants;
|
||||
import de.schildbach.oeffi.R;
|
||||
|
||||
public class DialogBuilder extends AlertDialog.Builder {
|
||||
public static DialogBuilder get(final Context context) {
|
||||
return new DialogBuilder(context, Constants.ALERT_DIALOG_THEME);
|
||||
return new DialogBuilder(context, R.style.My_Theme_Dialog);
|
||||
}
|
||||
|
||||
public static DialogBuilder warn(final Context context, final int titleResId) {
|
||||
|
|
|
@ -17,17 +17,15 @@
|
|||
package de.schildbach.oeffi.util;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.view.View;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import de.schildbach.oeffi.R;
|
||||
|
||||
public class DividerItemDecoration extends RecyclerView.ItemDecoration {
|
||||
private static final int[] ATTRS = new int[] { android.R.attr.listDivider };
|
||||
|
||||
public static final int HORIZONTAL_LIST = LinearLayoutManager.HORIZONTAL;
|
||||
public static final int VERTICAL_LIST = LinearLayoutManager.VERTICAL;
|
||||
|
||||
|
@ -35,9 +33,7 @@ public class DividerItemDecoration extends RecyclerView.ItemDecoration {
|
|||
private int mOrientation;
|
||||
|
||||
public DividerItemDecoration(final Context context, final int orientation) {
|
||||
final TypedArray a = context.obtainStyledAttributes(ATTRS);
|
||||
mDivider = a.getDrawable(0);
|
||||
a.recycle();
|
||||
mDivider = context.getDrawable(R.drawable.list_divider);
|
||||
setOrientation(orientation);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ import android.content.Context;
|
|||
import android.content.res.Resources;
|
||||
import android.graphics.drawable.AnimationDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import de.schildbach.oeffi.R;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
@ -34,6 +35,7 @@ public class MultiDrawable extends AnimationDrawable {
|
|||
public MultiDrawable(final Context context) {
|
||||
this.res = context.getResources();
|
||||
setFadeDuration(250);
|
||||
setTint(res.getColor(R.color.fg_less_significant));
|
||||
}
|
||||
|
||||
private void setFadeDuration(final int ms) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue