OsmAnd/OsmAnd-api/src/net/osmand/aidlapi/info/AppInfoParams.java

95 lines
2.3 KiB
Java
Raw Normal View History

2020-08-05 13:12:36 +02:00
package net.osmand.aidlapi.info;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
import net.osmand.aidlapi.map.ALatLon;
public class AppInfoParams extends AidlParams {
private ALatLon lastKnownLocation;
private ALatLon mapLocation;
2020-08-05 13:43:56 +02:00
private Bundle turnInfo;
private int leftTime;
2020-08-05 13:12:36 +02:00
private int leftDistance;
2020-08-05 13:43:56 +02:00
private long arrivalTime;
2020-08-05 13:12:36 +02:00
private boolean mapVisible;
2020-08-05 13:43:56 +02:00
public AppInfoParams(ALatLon lastKnownLocation, ALatLon mapLocation, Bundle turnInfo, int leftTime, int leftDistance, long arrivalTime, boolean mapVisible) {
2020-08-05 13:12:36 +02:00
this.lastKnownLocation = lastKnownLocation;
this.mapLocation = mapLocation;
2020-08-05 13:43:56 +02:00
this.leftTime = leftTime;
2020-08-05 13:12:36 +02:00
this.leftDistance = leftDistance;
2020-08-05 13:43:56 +02:00
this.arrivalTime = arrivalTime;
this.turnInfo = turnInfo;
2020-08-05 13:12:36 +02:00
this.mapVisible = mapVisible;
}
public AppInfoParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<AppInfoParams> CREATOR = new Creator<AppInfoParams>() {
@Override
public AppInfoParams createFromParcel(Parcel in) {
return new AppInfoParams(in);
}
@Override
public AppInfoParams[] newArray(int size) {
return new AppInfoParams[size];
}
};
public ALatLon getLastKnownLocation() {
return lastKnownLocation;
}
public ALatLon getMapLocation() {
return mapLocation;
}
2020-08-05 13:43:56 +02:00
public int getLeftTime() {
return leftTime;
2020-08-05 13:12:36 +02:00
}
2020-08-05 13:43:56 +02:00
public long getArrivalTime() {
return arrivalTime;
2020-08-05 13:12:36 +02:00
}
public int getLeftDistance() {
return leftDistance;
}
public boolean isMapVisible() {
return mapVisible;
}
2020-08-05 13:43:56 +02:00
public Bundle getTurnInfo() {
return turnInfo;
}
2020-08-05 13:12:36 +02:00
@Override
public void writeToBundle(Bundle bundle) {
2020-08-05 13:43:56 +02:00
bundle.putParcelable("lastKnownLocation", lastKnownLocation);
2020-08-05 13:12:36 +02:00
bundle.putParcelable("mapLocation", mapLocation);
2020-08-05 13:43:56 +02:00
bundle.putInt("leftTime", leftTime);
bundle.putLong("arrivalTime", arrivalTime);
2020-08-05 13:12:36 +02:00
bundle.putInt("leftDistance", leftDistance);
2020-08-05 13:43:56 +02:00
bundle.putBundle("turnInfo", turnInfo);
2020-08-05 13:12:36 +02:00
bundle.putBoolean("mapVisible", mapVisible);
}
@Override
protected void readFromBundle(Bundle bundle) {
2020-08-05 13:43:56 +02:00
lastKnownLocation = bundle.getParcelable("lastKnownLocation");
2020-08-05 13:12:36 +02:00
mapLocation = bundle.getParcelable("mapLocation");
2020-08-05 13:43:56 +02:00
leftTime = bundle.getInt("leftTime");
arrivalTime = bundle.getLong("arrivalTime");
2020-08-05 13:12:36 +02:00
leftDistance = bundle.getInt("leftDistance");
2020-08-05 13:43:56 +02:00
turnInfo = bundle.getBundle("turnInfo");
2020-08-05 13:12:36 +02:00
mapVisible = bundle.getBoolean("mapVisible");
}
}