Media.kt 966 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package uts.sdk.modules.uniChooseSystemImage
  2. import android.os.Parcel
  3. import android.os.Parcelable
  4. import android.os.Parcelable.Creator
  5. class Media : Parcelable {
  6. var type: Int
  7. var path: String?
  8. constructor(type: Int, path: String?) {
  9. this.type = type
  10. this.path = path
  11. }
  12. protected constructor(`in`: Parcel) {
  13. type = `in`.readInt()
  14. path = `in`.readString()
  15. }
  16. override fun describeContents(): Int {
  17. return 0
  18. }
  19. override fun writeToParcel(dest: Parcel, flags: Int) {
  20. dest.writeInt(type)
  21. dest.writeString(path)
  22. }
  23. companion object {
  24. @JvmField
  25. val CREATOR: Creator<Media> = object : Creator<Media> {
  26. override fun createFromParcel(`in`: Parcel): Media {
  27. return Media(`in`)
  28. }
  29. override fun newArray(size: Int): Array<Media?> {
  30. return arrayOfNulls(size)
  31. }
  32. }
  33. }
  34. }