-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
495 additions
and
913 deletions.
There are no files selected for viewing
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
5 changes: 2 additions & 3 deletions
5
app/src/main/java/com/template/androidtemplate/data/api/ApiHelper.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,11 +1,10 @@ | ||
package com.template.androidtemplate.data.api | ||
|
||
import com.template.androidtemplate.data.model.Home | ||
import com.template.androidtemplate.data.model.Photos | ||
import com.template.androidtemplate.data.model.User | ||
import retrofit2.Response | ||
|
||
interface ApiHelper { | ||
suspend fun postLogin(email: String,password: String): Response<User> | ||
|
||
suspend fun homeFeeds(): Response<Home> | ||
suspend fun getPhotos(): Response<List<Photos>> | ||
} |
4 changes: 2 additions & 2 deletions
4
app/src/main/java/com/template/androidtemplate/data/api/ApiHelperImpl.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,13 +1,13 @@ | ||
package com.template.androidtemplate.data.api | ||
|
||
import com.template.androidtemplate.data.model.Home | ||
import com.template.androidtemplate.data.model.Photos | ||
import com.template.androidtemplate.data.model.User | ||
import retrofit2.Response | ||
import javax.inject.Inject | ||
|
||
class ApiHelperImpl @Inject constructor(private val apiService: ApiService) : ApiHelper { | ||
|
||
override suspend fun postLogin(email: String, password: String): Response<User> = apiService.userLogin(email,password) | ||
override suspend fun homeFeeds(): Response<Home> = apiService.homeFeeds() | ||
override suspend fun getPhotos(): Response<List<Photos>> = apiService.getPhotosUrl() | ||
|
||
} |
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
19 changes: 19 additions & 0 deletions
19
app/src/main/java/com/template/androidtemplate/data/model/Photos.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,19 @@ | ||
package com.template.androidtemplate.data.model | ||
import com.google.gson.annotations.SerializedName | ||
|
||
|
||
|
||
data class Photos( | ||
@SerializedName("author") | ||
var author: String, // Matthew Wiebe | ||
@SerializedName("download_url") | ||
var downloadUrl: String, // https://picsum.photos/id/1025/4951/3301 | ||
@SerializedName("height") | ||
var height: Int, // 3301 | ||
@SerializedName("id") | ||
var id: String, // 1025 | ||
@SerializedName("url") | ||
var url: String, // https://unsplash.com/photos/U5rMrSI7Pn4 | ||
@SerializedName("width") | ||
var width: Int // 4951 | ||
) |
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
108 changes: 0 additions & 108 deletions
108
app/src/main/java/com/template/androidtemplate/ui/login/view/LoginActivity.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.