OsmAnd/OsmAnd-api/src/net/osmand/aidlapi/mapwidget/UpdateMapWidgetParams.java

46 lines
1 KiB
Java
Raw Normal View History

2019-10-10 16:09:20 +02:00
package net.osmand.aidlapi.mapwidget;
2019-10-08 16:42:00 +02:00
import android.os.Bundle;
import android.os.Parcel;
2019-10-10 16:09:20 +02:00
import net.osmand.aidlapi.AidlParams;
2019-10-08 16:42:00 +02:00
public class UpdateMapWidgetParams extends AidlParams {
private AMapWidget widget;
public UpdateMapWidgetParams(AMapWidget widget) {
this.widget = widget;
}
public UpdateMapWidgetParams(Parcel in) {
2019-10-10 13:49:47 +02:00
readFromParcel(in);
2019-10-08 16:42:00 +02:00
}
public static final Creator<UpdateMapWidgetParams> CREATOR = new Creator<UpdateMapWidgetParams>() {
@Override
public UpdateMapWidgetParams createFromParcel(Parcel in) {
return new UpdateMapWidgetParams(in);
}
@Override
public UpdateMapWidgetParams[] newArray(int size) {
return new UpdateMapWidgetParams[size];
}
};
public AMapWidget getWidget() {
return widget;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putParcelable("widget", widget);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(AMapWidget.class.getClassLoader());
widget = bundle.getParcelable("widget");
}
}