-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from ianfyan/main
Read JSon Data
- Loading branch information
Showing
53 changed files
with
1,620 additions
and
448 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.fs.bansosapp.data.dummy | ||
|
||
import com.google.android.gms.maps.model.LatLng | ||
|
||
object MapDummy { | ||
fun getMap(): ArrayList<LatLng> { | ||
val listMarker: ArrayList<LatLng> = ArrayList() | ||
listMarker.add(LatLng(-7.257696609001408, 112.74760570042055)) | ||
listMarker.add(LatLng(-7.800131364803854, 110.39141221022824)) | ||
listMarker.add(LatLng(-6.911707432020603, 107.60963649672443)) | ||
listMarker.add(LatLng(-6.170302243562764, 106.82744443430127)) | ||
listMarker.add(LatLng(-8.029995514991295, 112.64339998957783)) | ||
return listMarker | ||
} | ||
} |
90 changes: 90 additions & 0 deletions
90
app/src/main/java/com/fs/bansosapp/data/model/Response/BansosResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
package com.fs.bansosapp.data.model | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class BansosResponse( | ||
|
||
@field:SerializedName("bansos") | ||
val bansos: List<BansosItem> | ||
) | ||
|
||
data class Location( | ||
|
||
@field:SerializedName("nama") | ||
val nama: String | ||
) | ||
|
||
data class Receipient( | ||
|
||
@field:SerializedName("kewarganegaraan") | ||
val kewarganegaraan: String, | ||
|
||
@field:SerializedName("nik") | ||
val nik: String, | ||
|
||
@field:SerializedName("nama") | ||
val nama: String, | ||
|
||
@field:SerializedName("pekerjaan") | ||
val pekerjaan: String, | ||
|
||
@field:SerializedName("gol_darah") | ||
val golDarah: String, | ||
|
||
@field:SerializedName("agama") | ||
val agama: String, | ||
|
||
@field:SerializedName("id") | ||
val id: Int, | ||
|
||
@field:SerializedName("jenis_kelamin") | ||
val jenisKelamin: String, | ||
|
||
@field:SerializedName("ttl") | ||
val ttl: String, | ||
|
||
@field:SerializedName("status_perkawinan") | ||
val statusPerkawinan: String, | ||
|
||
@field:SerializedName("alamat") | ||
val alamat: String | ||
) | ||
|
||
data class BansosItem( | ||
|
||
@field:SerializedName("is_active") | ||
val isActive: Boolean, | ||
|
||
@field:SerializedName("updated_at") | ||
val updatedAt: String, | ||
|
||
@field:SerializedName("latitude") | ||
val latitude: String, | ||
|
||
@field:SerializedName("created_at") | ||
val createdAt: String, | ||
|
||
@field:SerializedName("location") | ||
val location: Location, | ||
|
||
@field:SerializedName("id") | ||
val id: Int, | ||
|
||
@field:SerializedName("stock") | ||
val stock: String, | ||
|
||
@field:SerializedName("location_id") | ||
val locationId: Int, | ||
|
||
@field:SerializedName("longitude") | ||
val longitude: String, | ||
|
||
@field:SerializedName("receipient_ids") | ||
val receipientIds: List<ReceipientIdsItem> | ||
) | ||
|
||
data class ReceipientIdsItem( | ||
|
||
@field:SerializedName("receipient") | ||
val receipient: Receipient | ||
) |
30 changes: 30 additions & 0 deletions
30
app/src/main/java/com/fs/bansosapp/data/model/Response/LocationResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.fs.bansosapp.data.model | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class LocationResponse( | ||
|
||
@field:SerializedName("locations") | ||
val locations: List<LocationsItem> | ||
) | ||
|
||
data class LocationsItem( | ||
|
||
@field:SerializedName("provinsi") | ||
val provinsi: String, | ||
|
||
@field:SerializedName("kota") | ||
val kota: String, | ||
|
||
@field:SerializedName("nama") | ||
val nama: String, | ||
|
||
@field:SerializedName("id") | ||
val id: Int, | ||
|
||
@field:SerializedName("kabupaten") | ||
val kabupaten: String, | ||
|
||
@field:SerializedName("alamat") | ||
val alamat: String | ||
) |
55 changes: 55 additions & 0 deletions
55
app/src/main/java/com/fs/bansosapp/data/model/Response/ProfilResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package com.fs.bansosapp.data.model.Response | ||
|
||
import android.os.Parcel | ||
import android.os.Parcelable | ||
import com.google.gson.annotations.SerializedName | ||
|
||
data class ProfilResponse( | ||
|
||
@field:SerializedName("admins") | ||
val admins: List<AdminsItem> | ||
) | ||
|
||
data class AdminsItem( | ||
|
||
@field:SerializedName("nama") | ||
val nama: String, | ||
|
||
@field:SerializedName("id") | ||
val id: Int, | ||
|
||
@field:SerializedName("email") | ||
val email: String, | ||
|
||
@field:SerializedName("write_access") | ||
val writeAccess: Boolean | ||
): Parcelable { | ||
constructor(parcel: Parcel) : this( | ||
parcel.readString()!!, | ||
parcel.readInt(), | ||
parcel.readString()!!, | ||
parcel.readByte() != 0.toByte() | ||
) { | ||
} | ||
|
||
override fun writeToParcel(parcel: Parcel, flags: Int) { | ||
parcel.writeString(nama) | ||
parcel.writeInt(id) | ||
parcel.writeString(email) | ||
parcel.writeByte(if (writeAccess) 1 else 0) | ||
} | ||
|
||
override fun describeContents(): Int { | ||
return 0 | ||
} | ||
|
||
companion object CREATOR : Parcelable.Creator<AdminsItem> { | ||
override fun createFromParcel(parcel: Parcel): AdminsItem { | ||
return AdminsItem(parcel) | ||
} | ||
|
||
override fun newArray(size: Int): Array<AdminsItem?> { | ||
return arrayOfNulls(size) | ||
} | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
app/src/main/java/com/fs/bansosapp/data/model/Response/RecipientResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.fs.bansosapp.data.model | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class RecipientResponse( | ||
|
||
@field:SerializedName("receipients") | ||
val receipients: List<ReceipientsItem> | ||
) | ||
|
||
data class ReceipientsItem( | ||
|
||
@field:SerializedName("kewarganegaraan") | ||
val kewarganegaraan: String, | ||
|
||
@field:SerializedName("nik") | ||
val nik: String, | ||
|
||
@field:SerializedName("nama") | ||
val nama: String, | ||
|
||
@field:SerializedName("pekerjaan") | ||
val pekerjaan: String, | ||
|
||
@field:SerializedName("gol_darah") | ||
val golDarah: String, | ||
|
||
@field:SerializedName("agama") | ||
val agama: String, | ||
|
||
@field:SerializedName("id") | ||
val id: Int, | ||
|
||
@field:SerializedName("jenis_kelamin") | ||
val jenisKelamin: String, | ||
|
||
@field:SerializedName("ttl") | ||
val ttl: String, | ||
|
||
@field:SerializedName("status_perkawinan") | ||
val statusPerkawinan: String, | ||
|
||
@field:SerializedName("alamat") | ||
val alamat: String | ||
) |
48 changes: 48 additions & 0 deletions
48
app/src/main/java/com/fs/bansosapp/data/model/Response/StatisticResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.fs.bansosapp.data.model | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class StatisticResponse( | ||
|
||
@field:SerializedName("locations_aggregate") | ||
val locationsAggregate: LocationsAggregate, | ||
|
||
@field:SerializedName("transactions_aggregate") | ||
val transactionsAggregate: TransactionsAggregate, | ||
|
||
@field:SerializedName("receipientMap_aggregate") | ||
val receipientMapAggregate: ReceipientMapAggregate, | ||
|
||
@field:SerializedName("bansos_aggregate") | ||
val bansosAggregate: BansosAggregate | ||
) | ||
|
||
data class ReceipientMapAggregate( | ||
|
||
@field:SerializedName("aggregate") | ||
val aggregate: Aggregate | ||
) | ||
|
||
data class TransactionsAggregate( | ||
|
||
@field:SerializedName("aggregate") | ||
val aggregate: Aggregate | ||
) | ||
|
||
data class LocationsAggregate( | ||
|
||
@field:SerializedName("aggregate") | ||
val aggregate: Aggregate | ||
) | ||
|
||
data class Aggregate( | ||
|
||
@field:SerializedName("count") | ||
val count: Int | ||
) | ||
|
||
data class BansosAggregate( | ||
|
||
@field:SerializedName("aggregate") | ||
val aggregate: Aggregate | ||
) |
42 changes: 42 additions & 0 deletions
42
app/src/main/java/com/fs/bansosapp/data/model/Response/TransactionResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.fs.bansosapp.data.model | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class TransactionResponse( | ||
|
||
@field:SerializedName("transactions") | ||
val transactions: List<TransactionsItem> | ||
) | ||
|
||
data class Recipient( | ||
|
||
@field:SerializedName("nik") | ||
val nik: String, | ||
|
||
@field:SerializedName("nama") | ||
val nama: String | ||
) | ||
|
||
data class Locations( | ||
|
||
@field:SerializedName("nama") | ||
val nama: String | ||
) | ||
|
||
data class Bansos( | ||
|
||
@field:SerializedName("location") | ||
val location: Locations | ||
) | ||
|
||
data class TransactionsItem( | ||
|
||
@field:SerializedName("receipient") | ||
val receipient: Recipient, | ||
|
||
@field:SerializedName("created_at") | ||
val createdAt: String, | ||
|
||
@field:SerializedName("bansos") | ||
val bansos: Bansos | ||
) |
2 changes: 1 addition & 1 deletion
2
...java/com/fs/bansosapp/data/SliderModel.kt → ...om/fs/bansosapp/data/model/SliderModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
package com.fs.bansosapp.data | ||
package com.fs.bansosapp.data.model | ||
|
||
data class SliderModel(val image: Int, val desc: String) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package com.fs.bansosapp.data.model | ||
|
||
data class Task(val username: String, val password: String) |
2 changes: 1 addition & 1 deletion
2
...n/java/com/fs/bansosapp/data/UserModel.kt → .../com/fs/bansosapp/data/model/UserModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
package com.fs.bansosapp.data | ||
package com.fs.bansosapp.data.model | ||
|
||
data class UserModel(val id: Int, val name: String) |
Oops, something went wrong.