This commit is contained in:
xmd5a 2015-08-28 12:49:42 +03:00
commit 02552b6780
14 changed files with 90 additions and 43 deletions

View file

@ -123,20 +123,22 @@
android:layout_gravity="bottom"
android:gravity="right">
<Button
<net.osmand.plus.widgets.ButtonEx
android:id="@+id/cancelButton"
style="?android:attr/borderlessButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/shared_string_cancel"
android:textColor="@color/dashboard_general_button_text_light"/>
android:textColor="@color/dashboard_general_button_text_light"
app:textAllCapsCompat="true"/>
<Button
<net.osmand.plus.widgets.ButtonEx
android:id="@+id/saveButton"
style="?android:attr/borderlessButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/dashboard_general_button_text_light"
tools:text="Save"/>
tools:text="Save"
app:textAllCapsCompat="true"/>
</LinearLayout>
</LinearLayout>

View file

@ -98,9 +98,9 @@
<net.osmand.plus.widgets.ButtonEx
android:id="@+id/addTagButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="36dp"
android:text="Add tag"
android:textSize="12sp"
android:textSize="@dimen/default_sub_text_size"
osmand:typeface="@string/font_roboto_medium"/>
<!--XXX due to bug in NestedScroolView-->

View file

@ -111,7 +111,7 @@
android:layout_below="@id/openHoursContainer"
android:layout_marginLeft="72dp"
android:text="Add opening hours"
android:textSize="12sp"
android:textSize="@dimen/default_sub_text_size"
osmand:typeface="@string/font_roboto_medium"/>
<!--XXX due to bug in NestedScroolView-->

View file

@ -26,6 +26,8 @@
android:id="@+id/daysTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/dashboard_black"
android:textSize="@dimen/default_list_text_size"
tools:text="Mo-We"/>
<View
@ -51,6 +53,8 @@
android:id="@+id/openingTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/dashboard_black"
android:textSize="@dimen/default_list_text_size"
tools:text="08:00"/>
<View
@ -74,6 +78,8 @@
android:id="@+id/closingTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/dashboard_black"
android:textSize="@dimen/default_list_text_size"
tools:text="20:00"/>
<View

View file

@ -2116,7 +2116,7 @@
<string name="extended_tab_title">Udvidet</string>
<string name="building_number">Bygningsnummer</string>
<string name="next_proceed">Næste</string>
<string name="opening_at">Åbning på</string>
<string name="closing_at">Lukning på</string>
<string name="opening_at">Åbner</string>
<string name="closing_at">Lukker</string>
<string name="basic_tab_title">Basis</string>
</resources>

View file

@ -1700,7 +1700,7 @@ Si consiglia di aggiungere uno o più punti intermedi per migliorarne le prestaz
<string name="local_map_names">Nomi locali</string>
<string name="lang_sw">Swahili</string>
<string name="forward">Avanti</string>
<string name="home">Casa</string>
<string name="home">Inizio</string>
<string name="live_monitoring_m_descr">Invia i dati di tracciamento a uno specifico servizio web se la registrazione GPX è abilitata.</string>
<string name="live_monitoring_m">Tracciamento online (GPX richiesto)</string>
<string name="live_monitoring_start">Avvia il tracciamento online</string>
@ -2150,4 +2150,10 @@ Si consiglia di aggiungere uno o più punti intermedi per migliorarne le prestaz
<string name="routing_attr_avoid_shuttle_train_name">Evita i treni navetta</string>
<string name="routing_attr_avoid_shuttle_train_description">Evita i treni navetta</string>
<string name="commit_poi">Contribuisci il/i PDI</string>
<string name="basic_tab_title">Semplice</string>
<string name="extended_tab_title">Esteso</string>
<string name="building_number">Numero civico</string>
<string name="next_proceed">Avanti</string>
<string name="opening_at">Apre alle</string>
<string name="closing_at">Chiude alle</string>
</resources>

View file

@ -55,7 +55,8 @@
<color name="search_background_dark">#292f33</color>
<color name="icon_color_light">#727272</color>
<color name="icon_color">#727272</color>
<color name="icon_color_light">#ccc</color>
<color name="dashboard_gpx_on_map">#448AFF</color>
<color name="dashboard_background">#eaeaea</color>

View file

@ -51,7 +51,7 @@ public class IconsCache {
public Drawable getContentIcon(int id) {
return getDrawable(id, app.getSettings().isLightContent() ? R.color.icon_color_light : 0);
return getDrawable(id, app.getSettings().isLightContent() ? R.color.icon_color : 0);
}
@ -60,7 +60,7 @@ public class IconsCache {
}
public Drawable getIcon(int id, boolean light) {
return getDrawable(id, light ? R.color.icon_color_light : 0);
return getDrawable(id, light ? R.color.icon_color : 0);
}
}

View file

@ -135,7 +135,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
backup = getActivity().getResources().getDrawable(R.drawable.ic_type_archive);
backup.mutate();
if (light) {
backup.setColorFilter(getResources().getColor(R.color.icon_color_light), PorterDuff.Mode.MULTIPLY);
backup.setColorFilter(getResources().getColor(R.color.icon_color), PorterDuff.Mode.MULTIPLY);
}
sdcard = getActivity().getResources().getDrawable(R.drawable.ic_sdcard);
sdcard.mutate();

View file

@ -64,7 +64,7 @@ public class AdvancedDataFragment extends Fragment {
}
});
deleteDrawable = ((MapActivity)getActivity()).getMyApplication().getIconsCache()
.getContentIcon(R.drawable.ic_action_remove_dark);
.getPaintedContentIcon(R.drawable.ic_action_remove_dark, R.color.icon_color_light);
deleteItemImageButton.setImageDrawable(deleteDrawable);
TextView nameTextView = (TextView) view.findViewById(R.id.nameTextView);
TextView amenityTagTextView = (TextView) view.findViewById(R.id.amenityTagTextView);

View file

@ -25,6 +25,7 @@ import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.osmedit.data.EditPoiData;
import net.osmand.plus.osmedit.data.Tag;
import net.osmand.plus.osmedit.dialogs.OpeningHoursDaysDialogFragment;
import net.osmand.plus.osmedit.dialogs.OpeningHoursHoursDialogFragment;
import net.osmand.util.OpeningHoursParser;
import net.osmand.util.OpeningHoursParser.BasicOpeningHourRule;
@ -94,7 +95,9 @@ public class BasicDataFragment extends Fragment {
});
LinearLayout openHoursContainer = (LinearLayout) view.findViewById(R.id.openHoursContainer);
Drawable clockDrawable = iconsCache.getContentIcon(R.drawable.ic_action_time);
Drawable deleteDrawable = iconsCache.getContentIcon(R.drawable.ic_action_remove_dark);
Drawable deleteDrawable = iconsCache
.getPaintedContentIcon(R.drawable.ic_action_remove_dark,
getActivity().getResources().getColor(R.color.icon_color_light));
if (savedInstanceState != null && savedInstanceState.containsKey(OPENING_HOURS)) {
mOpeningHoursAdapter = new OpeningHoursAdapter(
(OpeningHoursParser.OpeningHours) savedInstanceState.getSerializable(OPENING_HOURS),
@ -553,7 +556,7 @@ public class BasicDataFragment extends Fragment {
closingTextView.setText(formatTime(enHour, enTime));
timeContainer.setVisibility(View.VISIBLE);
view.setOnClickListener(new View.OnClickListener() {
daysTextView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
OpeningHoursDaysDialogFragment fragment =
@ -561,6 +564,22 @@ public class BasicDataFragment extends Fragment {
fragment.show(getChildFragmentManager(), "OpenTimeDialogFragment");
}
});
openingTextView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
OpeningHoursHoursDialogFragment fragment =
OpeningHoursHoursDialogFragment.createInstance(rule, position, true);
fragment.show(getChildFragmentManager(), "OpeningHoursHoursDialogFragment");
}
});
closingTextView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
OpeningHoursHoursDialogFragment fragment =
OpeningHoursHoursDialogFragment.createInstance(rule, position, false);
fragment.show(getChildFragmentManager(), "OpeningHoursHoursDialogFragment");
}
});
} else if (openingHours.getRules().get(position) instanceof UnparseableRule) {
daysTextView.setText(openingHours.getRules().get(position).toRuleString(false));
timeContainer.setVisibility(View.GONE);

View file

@ -10,6 +10,7 @@ import android.text.format.DateFormat;
import net.osmand.PlatformUtil;
import net.osmand.plus.R;
import net.osmand.plus.osmedit.BasicDataFragment;
import net.osmand.util.OpeningHoursParser;
import org.apache.commons.logging.Log;
@ -30,7 +31,7 @@ public class OpeningHoursDaysDialogFragment extends DialogFragment {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
boolean add = positionToAdd > -1;
final boolean createNew = positionToAdd == -1;
Calendar inst = Calendar.getInstance();
final int first = inst.getFirstDayOfWeek();
final boolean[] dayToShow = new boolean[7];
@ -55,7 +56,8 @@ public class OpeningHoursDaysDialogFragment extends DialogFragment {
}
});
builder.setPositiveButton(getActivity().getString(R.string.next_proceed),
builder.setPositiveButton(createNew ? R.string.next_proceed
: R.string.shared_string_save,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
@ -63,9 +65,13 @@ public class OpeningHoursDaysDialogFragment extends DialogFragment {
for (int i = 0; i < 7; i++) {
days[(first + 5 + i) % 7] = dayToShow[i];
}
OpeningHoursHoursDialogFragment.createInstance(item, positionToAdd, true)
.show(getFragmentManager(), "TimePickerDialogFragment");
if (createNew) {
OpeningHoursHoursDialogFragment.createInstance(item, positionToAdd, true)
.show(getFragmentManager(), "TimePickerDialogFragment");
} else {
((BasicDataFragment) getParentFragment())
.setBasicOpeningHoursRule(item, positionToAdd);
}
}
});

View file

@ -28,6 +28,7 @@ public class OpeningHoursHoursDialogFragment extends DialogFragment {
Bundle args = getArguments();
final boolean isStart = args.getBoolean(IS_START);
final int positionToAdd = args.getInt(POSITION_TO_ADD);
final boolean createNew = positionToAdd == -1;
final OpeningHoursParser.BasicOpeningHourRule item = (OpeningHoursParser.BasicOpeningHourRule)
args.getSerializable(BASIC_OPENING_HOUR_RULE);
AlertDialog.Builder builder =
@ -43,24 +44,30 @@ public class OpeningHoursHoursDialogFragment extends DialogFragment {
timePicker.setCurrentMinute(minute);
builder.setView(timePicker)
.setPositiveButton(R.string.next_proceed, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
int minute = timePicker.getCurrentMinute();
int hourOfDay = timePicker.getCurrentHour();
int time = minute + hourOfDay * 60;
if (isStart) {
item.setStartTime(time);
OpeningHoursHoursDialogFragment
.createInstance(item, positionToAdd, false)
.show(getFragmentManager(), "TimePickerDialogFragment");
} else {
item.setEndTime(time);
((BasicDataFragment) getParentFragment())
.setBasicOpeningHoursRule(item, positionToAdd);
}
}
})
.setPositiveButton(isStart && createNew ? R.string.next_proceed
: R.string.shared_string_save,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
int minute = timePicker.getCurrentMinute();
int hourOfDay = timePicker.getCurrentHour();
int time = minute + hourOfDay * 60;
if (isStart && createNew) {
item.setStartTime(time);
OpeningHoursHoursDialogFragment
.createInstance(item, positionToAdd, false)
.show(getFragmentManager(), "TimePickerDialogFragment");
} else {
if (isStart) {
item.setStartTime(time);
} else {
item.setEndTime(time);
}
((BasicDataFragment) getParentFragment())
.setBasicOpeningHoursRule(item, positionToAdd);
}
}
})
.setNegativeButton(R.string.shared_string_cancel, null);
int paddingInDp = 18;

View file

@ -660,7 +660,7 @@ public class MapControlsLayer extends OsmandMapLayer {
if (!enabled) {
backToLocationControl.setBg(R.drawable.btn_circle, R.drawable.btn_circle_night);
backToLocationControl.setIconColorId(R.color.icon_color_light, 0);
backToLocationControl.setIconColorId(R.color.icon_color, 0);
} else if (tracked) {
backToLocationControl.setBg(R.drawable.btn_circle, R.drawable.btn_circle_night);
backToLocationControl.setIconColorId(R.color.color_myloc_distance);
@ -751,7 +751,7 @@ public class MapControlsLayer extends OsmandMapLayer {
int resId;
int resLightId;
int resDarkId;
int resClrLight = R.color.icon_color_light;
int resClrLight = R.color.icon_color;
int resClrDark = 0;
@ -877,7 +877,7 @@ public class MapControlsLayer extends OsmandMapLayer {
Drawable[] icons = new Drawable[vls.size()];
int[] values = new int[vls.size()];
for (int k = 0; k < modes.length; k++) {
icons[k] = app.getIconsCache().getIcon(modes[k].getSmallIconDark(), R.color.icon_color_light);
icons[k] = app.getIconsCache().getIcon(modes[k].getSmallIconDark(), R.color.icon_color);
values[k] = modes[k].getStringResource();
}
for (int i = 0; i < modes.length; i++) {