-
Notifications
You must be signed in to change notification settings - Fork 0
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 #80 from azrael8576/refactor/core-data
Extract ImageDetail, VideoDetail to core:model
- Loading branch information
Showing
13 changed files
with
74 additions
and
68 deletions.
There are no files selected for viewing
27 changes: 1 addition & 26 deletions
27
core/data/src/main/java/com/wei/picquest/core/data/model/ImageDetail.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
34 changes: 3 additions & 31 deletions
34
core/data/src/main/java/com/wei/picquest/core/data/model/VideoDetail.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
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
2 changes: 1 addition & 1 deletion
2
core/data/src/main/java/com/wei/picquest/core/data/repository/SearchImagesRepository.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
2 changes: 1 addition & 1 deletion
2
core/data/src/main/java/com/wei/picquest/core/data/repository/SearchVideosRepository.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
27 changes: 27 additions & 0 deletions
27
core/model/src/main/java/com/wei/picquest/core/model/data/ImageDetail.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,27 @@ | ||
package com.wei.picquest.core.model.data | ||
|
||
data class ImageDetail( | ||
val id: Int, | ||
val pageURL: String, | ||
val type: String, | ||
val tags: String, | ||
val previewURL: String, | ||
val previewWidth: Int, | ||
val previewHeight: Int, | ||
val webformatURL: String, | ||
val webformatWidth: Int, | ||
val webformatHeight: Int, | ||
val largeImageURL: String, | ||
val imageWidth: Int, | ||
val imageHeight: Int, | ||
val imageSize: Long, | ||
val views: Int, | ||
val downloads: Int, | ||
val likes: Int, | ||
val comments: Int, | ||
val userId: Int, | ||
val user: String, | ||
val userImageURL: String, | ||
) { | ||
val aspectRatio get() = imageWidth.toFloat() / imageHeight.toFloat() | ||
} |
32 changes: 32 additions & 0 deletions
32
core/model/src/main/java/com/wei/picquest/core/model/data/VideoDetail.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,32 @@ | ||
package com.wei.picquest.core.model.data | ||
|
||
data class VideoDetail( | ||
val id: Int, | ||
val pageURL: String, | ||
val type: String, | ||
val tags: String, | ||
val duration: Int, | ||
val pictureId: String, | ||
val videos: VideoStreams, | ||
val views: Int, | ||
val downloads: Int, | ||
val likes: Int, | ||
val comments: Int, | ||
val userId: Int, | ||
val user: String, | ||
val userImageURL: String, | ||
) | ||
|
||
data class VideoStreams( | ||
val large: VideoDetailSize, | ||
val medium: VideoDetailSize, | ||
val small: VideoDetailSize, | ||
val tiny: VideoDetailSize, | ||
) | ||
|
||
data class VideoDetailSize( | ||
val url: String, | ||
val width: Int, | ||
val height: Int, | ||
val size: Long, | ||
) |
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
2 changes: 1 addition & 1 deletion
2
...o/src/main/java/com/wei/picquest/feature/photo/photolibrary/data/fake/FakeImageDetails.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
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