2019-10-10 16:09:20 +02:00
|
|
|
package net.osmand.aidlapi.favorite;
|
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 AFavorite extends AidlParams {
|
|
|
|
|
|
|
|
private double lat;
|
|
|
|
private double lon;
|
|
|
|
private String name;
|
|
|
|
private String description;
|
2020-08-18 10:34:55 +02:00
|
|
|
private String address;
|
2019-10-08 16:42:00 +02:00
|
|
|
private String category;
|
|
|
|
private String color;
|
|
|
|
private boolean visible;
|
|
|
|
|
2020-08-20 09:23:35 +02:00
|
|
|
public AFavorite(double lat, double lon, String name, String description, String address,
|
2019-10-08 16:42:00 +02:00
|
|
|
String category, String color, boolean visible) {
|
|
|
|
this.lat = lat;
|
|
|
|
this.lon = lon;
|
|
|
|
this.name = name;
|
|
|
|
this.description = description;
|
2020-08-20 09:23:35 +02:00
|
|
|
this.address = address;
|
2019-10-08 16:42:00 +02:00
|
|
|
this.category = category;
|
|
|
|
this.color = color;
|
|
|
|
this.visible = visible;
|
|
|
|
}
|
|
|
|
|
|
|
|
public AFavorite(Parcel in) {
|
2019-10-10 13:49:47 +02:00
|
|
|
readFromParcel(in);
|
2019-10-08 16:42:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public static final Creator<AFavorite> CREATOR = new Creator<AFavorite>() {
|
|
|
|
@Override
|
|
|
|
public AFavorite createFromParcel(Parcel in) {
|
|
|
|
return new AFavorite(in);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public AFavorite[] newArray(int size) {
|
|
|
|
return new AFavorite[size];
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
public double getLat() {
|
|
|
|
return lat;
|
|
|
|
}
|
|
|
|
|
|
|
|
public double getLon() {
|
|
|
|
return lon;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getName() {
|
|
|
|
return name;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getDescription() {
|
|
|
|
return description;
|
|
|
|
}
|
|
|
|
|
2020-08-20 09:23:35 +02:00
|
|
|
public String getAddress() { return address; }
|
2020-08-18 10:34:55 +02:00
|
|
|
|
2019-10-08 16:42:00 +02:00
|
|
|
public String getCategory() {
|
|
|
|
return category;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getColor() {
|
|
|
|
return color;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isVisible() {
|
|
|
|
return visible;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void writeToBundle(Bundle bundle) {
|
|
|
|
bundle.putDouble("lat", lat);
|
|
|
|
bundle.putDouble("lon", lon);
|
|
|
|
bundle.putString("name", name);
|
|
|
|
bundle.putString("description", description);
|
2020-08-18 10:34:55 +02:00
|
|
|
bundle.putString("address", address);
|
2019-10-08 16:42:00 +02:00
|
|
|
bundle.putString("category", category);
|
|
|
|
bundle.putString("color", color);
|
|
|
|
bundle.putBoolean("visible", visible);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void readFromBundle(Bundle bundle) {
|
|
|
|
lat = bundle.getDouble("lat");
|
|
|
|
lon = bundle.getDouble("lon");
|
|
|
|
name = bundle.getString("name");
|
|
|
|
description = bundle.getString("description");
|
2020-08-18 10:34:55 +02:00
|
|
|
address = bundle.getString("address");
|
2019-10-08 16:42:00 +02:00
|
|
|
category = bundle.getString("category");
|
|
|
|
color = bundle.getString("color");
|
|
|
|
visible = bundle.getBoolean("visible");
|
|
|
|
}
|
|
|
|
}
|