Merge pull request #8161 from osmandapp/FixTextColor

Fix text color
This commit is contained in:
max-klaus 2020-01-02 11:59:53 +03:00 committed by GitHub
commit 0090acf0a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 6 deletions

View file

@ -10,6 +10,7 @@
android:layout_marginLeft="24dp"
android:layout_marginTop="16dp"
android:layout_marginRight="16dp"
android:textColor="?android:attr/textColorSecondary"
android:layout_marginBottom="8dp"
android:text="@string/animate_routing_gpx" />
@ -25,6 +26,7 @@
android:layout_marginLeft="24dp"
android:layout_marginTop="5dp"
android:layout_marginRight="16dp"
android:textColor="?android:attr/textColorSecondary"
android:gravity="left"
android:text="@string/select_animate_speedup" />
@ -47,6 +49,7 @@
android:id="@+id/MinSpeedup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?android:attr/textColorSecondary"
android:layout_weight="0.5"
android:gravity="left"
android:text="10" />
@ -55,6 +58,7 @@
android:id="@+id/MaxSpeedup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?android:attr/textColorSecondary"
android:layout_weight="0.5"
android:gravity="right"
android:text="15" />

View file

@ -4,11 +4,8 @@ package net.osmand.plus;
import android.app.Activity;
import android.content.DialogInterface;
import android.support.v7.app.AlertDialog;
import android.support.v7.view.ContextThemeWrapper;
import android.view.View;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.SeekBar;
import android.widget.TextView;
import android.widget.Toast;
@ -55,7 +52,9 @@ public class OsmAndLocationSimulation {
public void startStopRouteAnimation(final Activity ma, boolean useGpx, final Runnable runnable) {
if (!isRouteAnimating()) {
if (useGpx) {
AlertDialog.Builder builder = new AlertDialog.Builder(ma);
boolean nightMode = app.getDaynightHelper().isNightModeForMapControls();
int themeRes = nightMode ? R.style.OsmandDarkTheme : R.style.OsmandLightTheme;
AlertDialog.Builder builder = new AlertDialog.Builder(new ContextThemeWrapper(ma, themeRes));
builder.setTitle(R.string.animate_route);
final View view = ma.getLayoutInflater().inflate(R.layout.animate_route, null);
@ -63,6 +62,7 @@ public class OsmAndLocationSimulation {
((TextView) view.findViewById(R.id.MaxSpeedup)).setText("4"); //$NON-NLS-1$
final SeekBar speedup = (SeekBar) view.findViewById(R.id.Speedup);
speedup.setMax(3);
UiUtilities.setupSeekBar(app, speedup, nightMode, true);
builder.setView(view);
builder.setPositiveButton(R.string.shared_string_ok, new DialogInterface.OnClickListener() {

View file

@ -466,12 +466,15 @@ public class OsmandMonitoringPlugin extends OsmandPlugin {
final int[] minutes, final ValueHolder<Boolean> choice,
final ValueHolder<Integer> v,
final boolean showTrackSelection, boolean nightMode) {
int textColorPrimary = ContextCompat.getColor(app, nightMode ? R.color.text_color_primary_dark : R.color.text_color_primary_light);
int textColorSecondary = ContextCompat.getColor(app, nightMode ? R.color.text_color_secondary_dark : R.color.text_color_secondary_light);
LinearLayout ll = new LinearLayout(uiCtx);
final int dp24 = AndroidUtils.dpToPx(uiCtx, 24f);
final int dp8 = AndroidUtils.dpToPx(uiCtx, 8f);
final TextView tv = new TextView(uiCtx);
tv.setPadding(dp24, dp8 * 2, dp24, dp8);
tv.setText(String.format(patternMsg, uiCtx.getString(R.string.int_continuosly)));
tv.setTextColor(textColorSecondary);
SeekBar sp = new SeekBar(uiCtx);
sp.setPadding(dp24 + dp8, dp8, dp24 + dp8, dp8);
@ -524,7 +527,6 @@ public class OsmandMonitoringPlugin extends OsmandPlugin {
ll.setOrientation(LinearLayout.VERTICAL);
ll.addView(tv);
ll.addView(sp);
int textColorPrimary = ContextCompat.getColor(app, nightMode ? R.color.text_color_primary_dark : R.color.text_color_primary_light);
if (choice != null) {
final AppCompatCheckBox cb = new AppCompatCheckBox(uiCtx);
cb.setText(R.string.shared_string_remember_my_choice);