Browse Source
convert StoryModel to StoryMedia
convert StoryModel to StoryMedia
close #1151, close #1208renovate/org.robolectric-robolectric-4.x
Austin Huang
4 years ago
No known key found for this signature in database
GPG Key ID: 84C23AA04587A91F
25 changed files with 292 additions and 603 deletions
-
28app/src/main/java/awais/instagrabber/adapters/StoriesAdapter.java
-
2app/src/main/java/awais/instagrabber/fragments/HashTagFragment.java
-
2app/src/main/java/awais/instagrabber/fragments/LocationFragment.java
-
281app/src/main/java/awais/instagrabber/fragments/StoryViewerFragment.java
-
29app/src/main/java/awais/instagrabber/models/StoryModel.kt
-
52app/src/main/java/awais/instagrabber/models/stickers/PollModel.java
-
20app/src/main/java/awais/instagrabber/models/stickers/QuestionModel.java
-
37app/src/main/java/awais/instagrabber/models/stickers/QuizModel.java
-
53app/src/main/java/awais/instagrabber/models/stickers/SliderModel.java
-
20app/src/main/java/awais/instagrabber/models/stickers/SwipeUpModel.java
-
17app/src/main/java/awais/instagrabber/repositories/StoriesService.kt
-
2app/src/main/java/awais/instagrabber/repositories/requests/StoryViewerOptions.java
-
2app/src/main/java/awais/instagrabber/repositories/responses/stories/PollSticker.kt
-
2app/src/main/java/awais/instagrabber/repositories/responses/stories/QuizSticker.kt
-
8app/src/main/java/awais/instagrabber/repositories/responses/stories/ReelsMediaResponse.kt
-
3app/src/main/java/awais/instagrabber/repositories/responses/stories/ReelsResponse.kt
-
2app/src/main/java/awais/instagrabber/repositories/responses/stories/SliderSticker.kt
-
2app/src/main/java/awais/instagrabber/repositories/responses/stories/StoryMedia.kt
-
14app/src/main/java/awais/instagrabber/repositories/responses/stories/StoryMediaResponse.kt
-
17app/src/main/java/awais/instagrabber/utils/DownloadUtils.kt
-
174app/src/main/java/awais/instagrabber/utils/ResponseBodyUtils.java
-
10app/src/main/java/awais/instagrabber/viewmodels/ProfileFragmentViewModel.kt
-
6app/src/main/java/awais/instagrabber/viewmodels/StoriesViewModel.java
-
106app/src/main/java/awais/instagrabber/webservices/StoriesRepository.kt
-
6app/src/test/java/awais/instagrabber/viewmodels/ProfileFragmentViewModelTest.kt
@ -1,29 +0,0 @@ |
|||
package awais.instagrabber.models |
|||
|
|||
import awais.instagrabber.models.enums.MediaItemType |
|||
import awais.instagrabber.models.stickers.* |
|||
import java.io.Serializable |
|||
|
|||
data class StoryModel( |
|||
val storyMediaId: String? = null, |
|||
val storyUrl: String? = null, |
|||
var thumbnail: String? = null, |
|||
val itemType: MediaItemType? = null, |
|||
val timestamp: Long = 0, |
|||
val username: String? = null, |
|||
val userId: Long = 0, |
|||
val canReply: Boolean = false, |
|||
) : Serializable { |
|||
var videoUrl: String? = null |
|||
var tappableShortCode: String? = null |
|||
val tappableId: String? = null |
|||
var spotify: String? = null |
|||
var poll: PollModel? = null |
|||
var question: QuestionModel? = null |
|||
var slider: SliderModel? = null |
|||
var quiz: QuizModel? = null |
|||
var swipeUp: SwipeUpModel? = null |
|||
var mentions: Array<String>? = null |
|||
var position = 0 |
|||
var isCurrentSlide = false |
|||
} |
@ -1,52 +0,0 @@ |
|||
package awais.instagrabber.models.stickers; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
public final class PollModel implements Serializable { |
|||
private int leftcount, rightcount, mychoice; |
|||
private final String id, question, leftchoice, rightchoice; |
|||
|
|||
public PollModel(final String id, final String question, final String leftchoice, final int leftcount, |
|||
final String rightchoice, final int rightcount, final int mychoice) { |
|||
this.id = id; // only the poll id |
|||
this.question = question; |
|||
this.leftchoice = leftchoice; |
|||
this.leftcount = leftcount; |
|||
this.rightchoice = rightchoice; |
|||
this.rightcount = rightcount; |
|||
this.mychoice = mychoice; |
|||
} |
|||
|
|||
public String getId() { |
|||
return id; |
|||
} |
|||
|
|||
public String getQuestion() { |
|||
return question; |
|||
} |
|||
|
|||
public String getLeftChoice() { |
|||
return leftchoice; |
|||
} |
|||
|
|||
public int getLeftCount() { |
|||
return leftcount; |
|||
} |
|||
|
|||
public String getRightChoice() { |
|||
return rightchoice; |
|||
} |
|||
|
|||
public int getRightCount() { |
|||
return rightcount; |
|||
} |
|||
|
|||
public int getMyChoice() { return mychoice; } |
|||
|
|||
public int setMyChoice(final int choice) { |
|||
this.mychoice = choice; |
|||
if (choice == 0) this.leftcount += 1; |
|||
else if (choice == 1) this.rightcount += 1; |
|||
return choice; |
|||
} |
|||
} |
@ -1,20 +0,0 @@ |
|||
package awais.instagrabber.models.stickers; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
public final class QuestionModel implements Serializable { |
|||
private final String id, question; |
|||
|
|||
public QuestionModel(final String id, final String question) { |
|||
this.id = id; // only the poll id |
|||
this.question = question; |
|||
} |
|||
|
|||
public String getId() { |
|||
return id; |
|||
} |
|||
|
|||
public String getQuestion() { |
|||
return question; |
|||
} |
|||
} |
@ -1,37 +0,0 @@ |
|||
package awais.instagrabber.models.stickers; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
public final class QuizModel implements Serializable { |
|||
private final String id, question; |
|||
private final String[] choices; |
|||
private Long[] counts; |
|||
private int mychoice; |
|||
|
|||
public QuizModel(final String id, final String question, final String[] choices, final Long[] counts, final int mychoice) { |
|||
this.id = id; // only the poll id |
|||
this.question = question; |
|||
this.choices = choices; |
|||
this.counts = counts; |
|||
this.mychoice = mychoice; |
|||
} |
|||
|
|||
public String getId() { |
|||
return id; |
|||
} |
|||
|
|||
public String getQuestion() { |
|||
return question; |
|||
} |
|||
|
|||
public String[] getChoices() { return choices;} |
|||
|
|||
public Long[] getCounts() { return counts;} |
|||
|
|||
public int getMyChoice() { return mychoice; } |
|||
|
|||
public void setMyChoice(final int choice) { |
|||
this.mychoice = choice; |
|||
counts[choice] += 1L; |
|||
} |
|||
} |
@ -1,53 +0,0 @@ |
|||
package awais.instagrabber.models.stickers; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
public final class SliderModel implements Serializable { |
|||
private final int voteCount; |
|||
private final Double average; |
|||
private Double myChoice; |
|||
private final boolean canVote; |
|||
private final String id, question, emoji; |
|||
|
|||
public SliderModel(final String id, final String question, final String emoji, final boolean canVote, |
|||
final Double average, final int voteCount, final Double myChoice) { |
|||
this.id = id; |
|||
this.question = question; |
|||
this.emoji = emoji; |
|||
this.canVote = canVote; |
|||
this.average = average; |
|||
this.voteCount = voteCount; |
|||
this.myChoice = myChoice; |
|||
} |
|||
|
|||
public String getId() { |
|||
return id; |
|||
} |
|||
|
|||
public String getQuestion() { |
|||
return question; |
|||
} |
|||
|
|||
public String getEmoji() { |
|||
return emoji; |
|||
} |
|||
|
|||
public boolean canVote() { |
|||
return canVote; |
|||
} |
|||
|
|||
public int getVoteCount() { |
|||
return voteCount; |
|||
} |
|||
|
|||
public Double getAverage() { |
|||
return average; |
|||
} |
|||
|
|||
public Double getMyChoice() { return myChoice; } |
|||
|
|||
public Double setMyChoice(final Double choice) { |
|||
this.myChoice = choice; |
|||
return choice; |
|||
} |
|||
} |
@ -1,20 +0,0 @@ |
|||
package awais.instagrabber.models.stickers; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
public final class SwipeUpModel implements Serializable { |
|||
private final String url, text; |
|||
|
|||
public SwipeUpModel(final String url, final String text) { |
|||
this.url = url; |
|||
this.text = text; |
|||
} |
|||
|
|||
public String getUrl() { |
|||
return url; |
|||
} |
|||
|
|||
public String getText() { |
|||
return text; |
|||
} |
|||
} |
@ -0,0 +1,8 @@ |
|||
package awais.instagrabber.repositories.responses.stories |
|||
|
|||
import java.io.Serializable |
|||
|
|||
data class ReelsMediaResponse( |
|||
val status: String?, |
|||
val reels: Map<String, Story?>? |
|||
) : Serializable |
@ -0,0 +1,14 @@ |
|||
package awais.instagrabber.repositories.responses.stories |
|||
|
|||
import awais.instagrabber.models.enums.MediaItemType |
|||
import awais.instagrabber.repositories.responses.ImageVersions2 |
|||
import awais.instagrabber.repositories.responses.MediaCandidate |
|||
import awais.instagrabber.repositories.responses.User |
|||
import awais.instagrabber.utils.TextUtils |
|||
import java.io.Serializable |
|||
|
|||
data class StoryMediaResponse( |
|||
val items: List<StoryMedia?>?, // length 1 |
|||
val status: String? |
|||
// ignoring pagination properties |
|||
) : Serializable |
Write
Preview
Loading…
Cancel
Save
Reference in new issue