ParkingPlugin: textView to Add Parking Marker dialog added
This commit is contained in:
parent
81d94a491c
commit
416bbc96ff
3 changed files with 12 additions and 11 deletions
|
@ -4,13 +4,12 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<!-- <TextView
|
||||
android:id="@+id/parkTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="Time to pick up the car: " />
|
||||
-->
|
||||
<TextView
|
||||
android:id="@+id/parkTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/osmand_parking_position_description_add" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
@ -188,7 +188,7 @@ public class ParkingPositionLayer extends OsmandMapLayer implements ContextMenuL
|
|||
return null;
|
||||
}
|
||||
|
||||
private String getFormattedTime(long timeInMillis) {
|
||||
String getFormattedTime(long timeInMillis) {
|
||||
StringBuilder timeStringBuilder = new StringBuilder();
|
||||
Time time = new Time();
|
||||
time.set(timeInMillis);
|
||||
|
|
|
@ -196,13 +196,13 @@ public class ParkingPositionPlugin extends OsmandPlugin {
|
|||
setTime.setView(setTimeParking);
|
||||
setTime.setTitle(mapActivity.getString(R.string.osmand_parking_time_limit_title));
|
||||
setTime.setNegativeButton(R.string.default_buttons_cancel, null);
|
||||
// final TextView textView = (TextView) setTimeParking.findViewById(R.id.parkTime);
|
||||
final TextView textView = (TextView) setTimeParking.findViewById(R.id.parkTime);
|
||||
final TimePicker timePicker = (TimePicker) setTimeParking.findViewById(R.id.parking_time_picker);
|
||||
|
||||
timePicker.setOnTimeChangedListener(new TimePicker.OnTimeChangedListener() {
|
||||
private static final int TIME_PICKER_INTERVAL = 5;
|
||||
private boolean mIgnoreEvent = false;
|
||||
// private Calendar cal = Calendar.getInstance();
|
||||
private Calendar cal = Calendar.getInstance();
|
||||
|
||||
@Override
|
||||
public void onTimeChanged(TimePicker timePicker, int hourOfDay, int minute) {
|
||||
|
@ -218,7 +218,9 @@ public class ParkingPositionPlugin extends OsmandPlugin {
|
|||
mIgnoreEvent = true;
|
||||
timePicker.setCurrentMinute(minute);
|
||||
mIgnoreEvent = false;
|
||||
// textView.setText("Time to pick up the car: "+ cal.get(Calendar.HOUR_OF_DAY) + hourOfDay + ":" + cal.get(Calendar.MINUTE) + minute);
|
||||
long timeInMillis = cal.getTimeInMillis() + hourOfDay*60*60*1000+ minute*60*1000;
|
||||
textView.setText(mapActivity.getString(R.string.osmand_parking_position_description_add)
|
||||
+ " "+ parkingLayer.getFormattedTime(timeInMillis));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue