wangzhibo
4 天以前 ae6f40460dcd56af6c5f60ba52c883854c3bac55
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package net.osmand.aidlapi.gpx;
 
import android.graphics.Bitmap;
import android.os.Bundle;
import android.os.Parcel;
 
import androidx.annotation.NonNull;
 
import net.osmand.aidlapi.AidlParams;
 
public class AGpxBitmap extends AidlParams {
 
    private Bitmap bitmap;
 
    public AGpxBitmap(@NonNull Bitmap bitmap) {
        this.bitmap = bitmap;
    }
 
    public AGpxBitmap(Parcel in) {
        readFromParcel(in);
    }
 
    public Bitmap getBitmap() {
        return bitmap;
    }
 
    public static final Creator<AGpxBitmap> CREATOR = new Creator<AGpxBitmap>() {
        @Override
        public AGpxBitmap createFromParcel(Parcel in) {
            return new AGpxBitmap(in);
        }
 
        @Override
        public AGpxBitmap[] newArray(int size) {
            return new AGpxBitmap[size];
        }
    };
 
    @Override
    public void writeToBundle(Bundle bundle) {
        bundle.putParcelable("bitmap", bitmap);
    }
 
    @Override
    protected void readFromBundle(Bundle bundle) {
        bundle.setClassLoader(Bitmap.class.getClassLoader());
        bitmap = bundle.getParcelable("bitmap");
    }
}