Fix some colors for the night mode
This commit is contained in:
parent
cbe5c3c20f
commit
4595991aed
5 changed files with 25 additions and 6 deletions
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="@color/color_dialog_buttons_dark" android:state_checked="true"/>
|
||||
<item android:color="@color/ctx_menu_info_text_dark" android:state_checked="false"/>
|
||||
</selector>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="@color/dashboard_blue" android:state_checked="true"/>
|
||||
<item android:color="@color/icon_color" android:state_checked="false"/>
|
||||
</selector>
|
|
@ -98,7 +98,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:background="?attr/bg_color"
|
||||
app:itemBackground="?attr/bg_color"
|
||||
app:itemIconTint="@drawable/bottom_navigation_color_selector"
|
||||
app:itemTextColor="@drawable/bottom_navigation_color_selector"
|
||||
app:itemIconTint="@color/bottom_navigation_color_selector_light"
|
||||
app:itemTextColor="@color/bottom_navigation_color_selector_light"
|
||||
app:menu="@menu/map_markers_bottom_navigation"/>
|
||||
</LinearLayout>
|
||||
|
|
|
@ -24,9 +24,9 @@ import net.osmand.plus.OsmandSettings.MapMarkersOrderByMode;
|
|||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.dashboard.DashboardOnMap;
|
||||
import net.osmand.plus.mapmarkers.ShowDirectionBottomSheetDialogFragment.ShowDirectionFragmentListener;
|
||||
import net.osmand.plus.mapmarkers.OptionsBottomSheetDialogFragment.MarkerOptionsFragmentListener;
|
||||
import net.osmand.plus.mapmarkers.OrderByBottomSheetDialogFragment.OrderByFragmentListener;
|
||||
import net.osmand.plus.mapmarkers.ShowDirectionBottomSheetDialogFragment.ShowDirectionFragmentListener;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
@ -44,12 +44,14 @@ public class MapMarkersDialogFragment extends android.support.v4.app.DialogFragm
|
|||
private LockableViewPager viewPager;
|
||||
private TextView orderByModeTitle;
|
||||
|
||||
private boolean lightTheme;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
OsmandApplication app = getMyApplication();
|
||||
boolean isLightTheme = app.getSettings().OSMAND_THEME.get() == OsmandSettings.OSMAND_LIGHT_THEME;
|
||||
int themeId = isLightTheme ? R.style.OsmandLightTheme : R.style.OsmandDarkTheme;
|
||||
lightTheme = app.getSettings().OSMAND_THEME.get() == OsmandSettings.OSMAND_LIGHT_THEME;
|
||||
int themeId = lightTheme ? R.style.OsmandLightTheme : R.style.OsmandDarkTheme;
|
||||
setStyle(STYLE_NO_FRAME, themeId);
|
||||
}
|
||||
|
||||
|
@ -95,6 +97,9 @@ public class MapMarkersDialogFragment extends android.support.v4.app.DialogFragm
|
|||
View mainView = inflater.inflate(R.layout.fragment_map_markers_dialog, container);
|
||||
|
||||
Toolbar toolbar = (Toolbar) mainView.findViewById(R.id.map_markers_toolbar);
|
||||
if (!lightTheme) {
|
||||
toolbar.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.actionbar_dark_color));
|
||||
}
|
||||
orderByModeTitle = toolbar.findViewById(R.id.order_by_mode_text);
|
||||
setOrderByMode(getMyApplication().getSettings().MAP_MARKERS_ORDER_BY_MODE.get());
|
||||
|
||||
|
@ -121,6 +126,10 @@ public class MapMarkersDialogFragment extends android.support.v4.app.DialogFragm
|
|||
viewPager.setAdapter(adapter);
|
||||
|
||||
BottomNavigationView bottomNav = mainView.findViewById(R.id.map_markers_bottom_navigation);
|
||||
if (!lightTheme) {
|
||||
bottomNav.setItemIconTintList(ContextCompat.getColorStateList(getContext(), R.color.bottom_navigation_color_selector_dark));
|
||||
bottomNav.setItemTextColor(ContextCompat.getColorStateList(getContext(), R.color.bottom_navigation_color_selector_dark));
|
||||
}
|
||||
bottomNav.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
|
||||
@Override
|
||||
public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) {
|
||||
|
|
|
@ -96,7 +96,7 @@ public class MapMarkersActiveAdapter extends RecyclerView.Adapter<MapMarkerItemV
|
|||
holder.iconDirection.setVisibility(View.GONE);
|
||||
|
||||
holder.icon.setImageDrawable(iconsCache.getIcon(R.drawable.ic_arrow_marker_diretion, markerColor));
|
||||
holder.mainLayout.setBackgroundColor(ContextCompat.getColor(mapActivity, R.color.markers_top_bar_background));
|
||||
holder.mainLayout.setBackgroundColor(ContextCompat.getColor(mapActivity, night ? R.color.list_divider_dark : R.color.markers_top_bar_background));
|
||||
holder.title.setTextColor(ContextCompat.getColor(mapActivity, R.color.color_white));
|
||||
holder.divider.setBackgroundColor(ContextCompat.getColor(mapActivity, R.color.map_markers_on_map_divider_color));
|
||||
holder.optionsBtn.setBackgroundDrawable(mapActivity.getResources().getDrawable(R.drawable.marker_circle_background_on_map_with_inset));
|
||||
|
|
Loading…
Reference in a new issue