MonitoringPlugin: missing icons added. ParkingPlugin: timePicker interval is set to 5 minutes.

This commit is contained in:
aFedasenka 2012-07-18 00:51:36 +02:00
parent 15b9e2b193
commit b447b247bf
10 changed files with 36 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View file

@ -4,6 +4,14 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" > 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: " />
-->
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"

View file

@ -23,6 +23,7 @@ import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.widget.CheckBox; import android.widget.CheckBox;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.TimePicker; import android.widget.TimePicker;
/** /**
@ -195,8 +196,35 @@ public class ParkingPositionPlugin extends OsmandPlugin {
setTime.setView(setTimeParking); setTime.setView(setTimeParking);
setTime.setTitle(mapActivity.getString(R.string.osmand_parking_time_limit_title)); setTime.setTitle(mapActivity.getString(R.string.osmand_parking_time_limit_title));
setTime.setNegativeButton(R.string.default_buttons_cancel, null); setTime.setNegativeButton(R.string.default_buttons_cancel, null);
// final TextView textView = (TextView) setTimeParking.findViewById(R.id.parkTime);
final TimePicker timePicker = (TimePicker) setTimeParking.findViewById(R.id.parking_time_picker); 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();
@Override
public void onTimeChanged(TimePicker timePicker, int hourOfDay, int minute) {
if (mIgnoreEvent) {
return;
}
if (minute%TIME_PICKER_INTERVAL != 0) {
int minuteFloor=minute-(minute%TIME_PICKER_INTERVAL);
minute=minuteFloor + (minute == minuteFloor + 1 ? TIME_PICKER_INTERVAL : 0);
if (minute == 60) {
minute = 0;
}
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);
}
}
});
//to set the same 24-hour or 12-hour mode as it is set in the device //to set the same 24-hour or 12-hour mode as it is set in the device
timePicker.setIs24HourView(true); timePicker.setIs24HourView(true);
timePicker.setCurrentHour(0); timePicker.setCurrentHour(0);