-
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.
Merge pull request #5 from dbof10/cleanup
cleanup, rename
- Loading branch information
Showing
62 changed files
with
367 additions
and
493 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
32 changes: 28 additions & 4 deletions
32
app/src/main/java/com/ctech/eaty/repository/BarcodeGenerator.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,22 +1,46 @@ | ||
package com.ctech.eaty.repository | ||
|
||
import com.ctech.eaty.entity.Comments | ||
import com.ctech.eaty.response.CollectionDetailResponse | ||
import com.ctech.eaty.response.CollectionResponse | ||
import com.ctech.eaty.response.ProductDetailResponse | ||
import com.ctech.eaty.response.ProductResponse | ||
import com.ctech.eaty.response.TopicResponse | ||
import com.ctech.eaty.response.UserResponse | ||
import com.ctech.eaty.response.VoteResponse | ||
import com.ctech.eaty.ui.comment.action.CommentBarCode | ||
import com.ctech.eaty.ui.topicdetail.action.TopicDetailBarCode | ||
import com.ctech.eaty.ui.user.action.UserProductBarCode | ||
import com.ctech.eaty.ui.vote.action.VoteBarCode | ||
import com.ctech.eaty.util.DateUtils | ||
import com.nytimes.android.external.store3.base.impl.BarCode | ||
import org.joda.time.DateTime | ||
|
||
|
||
object BarcodeGenerator { | ||
|
||
fun createHomeNextBarCode(dayAgo: Int): BarCode = BarCode(ProductResponse::class.java.simpleName, | ||
DateUtils.getFormattedPastDate(DateTime.now(), dayAgo)) | ||
} | ||
|
||
|
||
fun createProductDetailBarcode(id: Int): BarCode = BarCode(ProductDetailResponse::class.java.simpleName, id.toString()) | ||
fun createProductDetailBarCode(id: Int): BarCode = BarCode(ProductDetailResponse::class.java.simpleName, id.toString()) | ||
|
||
fun createUserProductBarCode(id: Int, page: Int) = UserProductBarCode(ProductResponse::class.java.simpleName, "User $id page $page", id, page) | ||
|
||
fun createUserBarCode(id: Int): BarCode = BarCode(UserResponse::class.java.simpleName, id.toString()) | ||
|
||
fun createCollectionDetailBarCode(id: Int): BarCode = BarCode(CollectionDetailResponse::class.java.simpleName, id.toString()) | ||
|
||
fun createCollectionListBarCode(page: Int): BarCode = BarCode(CollectionResponse::class.java.simpleName, page.toString()) | ||
|
||
fun createTopicListBarCode(page: Int): BarCode = BarCode(TopicResponse::class.java.simpleName, page.toString()) | ||
|
||
fun createTopicDetailBarCode(id: Int, page: Int): TopicDetailBarCode = TopicDetailBarCode(ProductResponse::class.java.simpleName, "Post $id page $page", id, page) | ||
|
||
fun createVoteListBarCode(id: Int, page: Int): VoteBarCode = VoteBarCode(VoteResponse::class.java.simpleName, "Post $id page $page", id, page) | ||
|
||
fun createCommentListBarCode(id: Int, page: Int): CommentBarCode = CommentBarCode(Comments::class.java.simpleName, "Post $id page $page", id, page) | ||
|
||
} | ||
|
||
fun createUserProductBarCode(id: Int, page: Int) = UserProductBarCode(ProductResponse::class.java.simpleName, "User $id page $page", id, page) | ||
|
||
fun createUserBarCode(id: Int): BarCode = BarCode(UserResponse::class.java.simpleName, id.toString()) |
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
8 changes: 0 additions & 8 deletions
8
app/src/main/java/com/ctech/eaty/ui/collection/action/BarCodeGenerator.kt
This file was deleted.
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
9 changes: 0 additions & 9 deletions
9
app/src/main/java/com/ctech/eaty/ui/collectiondetail/action/BarCodeGenerator.kt
This file was deleted.
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
11 changes: 0 additions & 11 deletions
11
app/src/main/java/com/ctech/eaty/ui/comment/action/BarCodeGenerator.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.