Fixes osm editing

This commit is contained in:
GaidamakUA 2015-09-07 10:08:28 +03:00
parent 6a8004af43
commit 27eb829848
6 changed files with 26 additions and 20 deletions

View file

@ -32,7 +32,7 @@
android:layout_marginLeft="16dp" android:layout_marginLeft="16dp"
android:layout_marginRight="16dp" android:layout_marginRight="16dp"
android:text="@string/tag_poi_name" android:text="@string/tag_poi_name"
android:textColor="@color/dashboard_black" android:textColor="?android:attr/textColorPrimary"
android:textSize="@dimen/default_desc_text_size" android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_regular"/> osmand:typeface="@string/font_roboto_regular"/>
@ -69,7 +69,7 @@
android:layout_marginLeft="16dp" android:layout_marginLeft="16dp"
android:layout_marginRight="16dp" android:layout_marginRight="16dp"
android:text="@string/tag_poi_amenity" android:text="@string/tag_poi_amenity"
android:textColor="@color/dashboard_black" android:textColor="?android:attr/textColorPrimary"
android:textSize="@dimen/default_desc_text_size" android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_regular"/> osmand:typeface="@string/font_roboto_regular"/>

View file

@ -2256,4 +2256,5 @@ Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua and Barbuda, A
<string name="poi_dialog_poi_type">POI Type</string> <string name="poi_dialog_poi_type">POI Type</string>
<string name="number_of_rows_in_dash">Number of rows in dash %1$s</string> <string name="number_of_rows_in_dash">Number of rows in dash %1$s</string>
<string name="please_specify_poi_type">Please specify POI type.</string> <string name="please_specify_poi_type">Please specify POI type.</string>
<string name="working_days">Working days</string>
</resources> </resources>

View file

@ -78,19 +78,19 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks {
private static final DashFragmentData[] fragmentsData = new DashFragmentData[]{ private static final DashFragmentData[] fragmentsData = new DashFragmentData[]{
new DashFragmentData(DashRateUsFragment.TAG, DashRateUsFragment.class, new DashFragmentData(DashRateUsFragment.TAG, DashRateUsFragment.class,
"Rate us", rateUsShouldShow, true, 0), -1, rateUsShouldShow, true, 0),
new DashFragmentData(DashFirstTimeFragment.TAG, DashFirstTimeFragment.class, new DashFragmentData(DashFirstTimeFragment.TAG, DashFirstTimeFragment.class,
"First time", firstTimeShouldShow, true, 1), -1, firstTimeShouldShow, true, 1),
new DashFragmentData(DashChooseAppDirFragment.TAG, DashChooseAppDirFragment.class, new DashFragmentData(DashChooseAppDirFragment.TAG, DashChooseAppDirFragment.class,
"Choose app dir", chooseAppDirShouldShow, true, 2), -1, chooseAppDirShouldShow, true, 2),
new DashFragmentData(DashErrorFragment.TAG, DashErrorFragment.class, new DashFragmentData(DashErrorFragment.TAG, DashErrorFragment.class,
"Error", errorShouldShow, true, 3), -1, errorShouldShow, true, 3),
new DashFragmentData(DashNavigationFragment.TAG, DashNavigationFragment.class, new DashFragmentData(DashNavigationFragment.TAG, DashNavigationFragment.class,
"Navigation", 4), R.string.tip_navigation, 4),
new DashFragmentData(DashWaypointsFragment.TAG, DashWaypointsFragment.class, new DashFragmentData(DashWaypointsFragment.TAG, DashWaypointsFragment.class,
"Waypoints", 6), R.string.waypoints, 6),
new DashFragmentData(DashSearchFragment.TAG, DashSearchFragment.class, new DashFragmentData(DashSearchFragment.TAG, DashSearchFragment.class,
"Search", 7), R.string.shared_string_search, 7),
new DashFragmentData(DashRecentsFragment.TAG, DashRecentsFragment.class, new DashFragmentData(DashRecentsFragment.TAG, DashRecentsFragment.class,
"Recent places", 8), "Recent places", 8),
new DashFragmentData(DashFavoritesFragment.TAG, DashFavoritesFragment.class, new DashFragmentData(DashFavoritesFragment.TAG, DashFavoritesFragment.class,

View file

@ -10,18 +10,18 @@ import net.osmand.plus.dashboard.DashboardOnMap;
public final class DashFragmentData implements Comparable<DashFragmentData> { public final class DashFragmentData implements Comparable<DashFragmentData> {
public final String tag; public final String tag;
public final Class<? extends DashBaseFragment> fragmentClass; public final Class<? extends DashBaseFragment> fragmentClass;
public final String title; public final int titleStringId;
public final ShouldShowFunction shouldShowFunction; public final ShouldShowFunction shouldShowFunction;
public final boolean customDeletionLogic; public final boolean customDeletionLogic;
public final int position; public final int position;
public final String rowNumberTag; public final String rowNumberTag;
public DashFragmentData(String tag, Class<? extends DashBaseFragment> fragmentClass, public DashFragmentData(String tag, Class<? extends DashBaseFragment> fragmentClass,
String title, ShouldShowFunction shouldShowFunction, int titleStringId, ShouldShowFunction shouldShowFunction,
boolean customDeletionLogic, int position, String rowNumberTag) { boolean customDeletionLogic, int position, String rowNumberTag) {
this.tag = tag; this.tag = tag;
this.fragmentClass = fragmentClass; this.fragmentClass = fragmentClass;
this.title = title; this.titleStringId = titleStringId;
this.shouldShowFunction = shouldShowFunction; this.shouldShowFunction = shouldShowFunction;
this.customDeletionLogic = customDeletionLogic; this.customDeletionLogic = customDeletionLogic;
this.position = position; this.position = position;
@ -29,19 +29,19 @@ public final class DashFragmentData implements Comparable<DashFragmentData> {
} }
public DashFragmentData(String tag, Class<? extends DashBaseFragment> fragmentClass, public DashFragmentData(String tag, Class<? extends DashBaseFragment> fragmentClass,
String title, ShouldShowFunction shouldShowFunction, int titleStringId, ShouldShowFunction shouldShowFunction,
boolean customDeletionLogic, int position) { boolean customDeletionLogic, int position) {
this(tag, fragmentClass, title, shouldShowFunction, customDeletionLogic, position, null); this(tag, fragmentClass, titleStringId, shouldShowFunction, customDeletionLogic, position, null);
} }
public DashFragmentData(String tag, Class<? extends DashBaseFragment> fragmentClass, public DashFragmentData(String tag, Class<? extends DashBaseFragment> fragmentClass,
String title, ShouldShowFunction shouldShowFunction, int position) { int titleStringId, ShouldShowFunction shouldShowFunction, int position) {
this(tag, fragmentClass, title, shouldShowFunction, false, position, null); this(tag, fragmentClass, titleStringId, shouldShowFunction, false, position, null);
} }
public DashFragmentData(String tag, Class<? extends DashBaseFragment> fragmentClass, public DashFragmentData(String tag, Class<? extends DashBaseFragment> fragmentClass,
String title, int position) { int titleStringId, int position) {
this(tag, fragmentClass, title, new DashboardOnMap.DefaultShouldShow(), false, position, this(tag, fragmentClass, titleStringId, new DashboardOnMap.DefaultShouldShow(), false, position,
null); null);
} }

View file

@ -46,7 +46,7 @@ public class OpeningHoursDaysDialogFragment extends DialogFragment {
final int pos = (d + 5) % 7; final int pos = (d + 5) % 7;
dayToShow[i] = item.getDays()[pos]; dayToShow[i] = item.getDays()[pos];
} }
builder.setTitle("Working days"); builder.setTitle(getResources().getString(R.string.working_days));
builder.setMultiChoiceItems(daysToShow, dayToShow, new DialogInterface.OnMultiChoiceClickListener() { builder.setMultiChoiceItems(daysToShow, dayToShow, new DialogInterface.OnMultiChoiceClickListener() {
@Override @Override

View file

@ -74,13 +74,18 @@ public class OpeningHoursHoursDialogFragment extends DialogFragment {
float density = getActivity().getResources().getDisplayMetrics().density; float density = getActivity().getResources().getDisplayMetrics().density;
int paddingInPx = (int) (paddingInDp * density); int paddingInPx = (int) (paddingInDp * density);
final TypedValue textColorTypedValue = new TypedValue();
getActivity().getTheme().resolveAttribute(android.R.attr.textColorPrimary,
textColorTypedValue, true);
int textColor = textColorTypedValue.data;
TextView titleTextView = new TextView(getActivity()); TextView titleTextView = new TextView(getActivity());
titleTextView.setText(isStart ? getActivity().getString(R.string.opening_at) titleTextView.setText(isStart ? getActivity().getString(R.string.opening_at)
: getActivity().getString(R.string.closing_at)); : getActivity().getString(R.string.closing_at));
titleTextView.setPadding(paddingInPx, paddingInPx, paddingInPx, paddingInPx); titleTextView.setPadding(paddingInPx, paddingInPx, paddingInPx, paddingInPx);
titleTextView.setGravity(Gravity.CENTER_VERTICAL); titleTextView.setGravity(Gravity.CENTER_VERTICAL);
titleTextView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18); titleTextView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
titleTextView.setTextColor(getActivity().getResources().getColor(R.color.color_black)); titleTextView.setTextColor(textColor);
Typeface typeface = titleTextView.getTypeface(); Typeface typeface = titleTextView.getTypeface();
titleTextView.setTypeface(typeface, Typeface.BOLD); titleTextView.setTypeface(typeface, Typeface.BOLD);
builder.setCustomTitle(titleTextView); builder.setCustomTitle(titleTextView);