From 5baf2701b043d769e8efb1b59847db8ef3902e76 Mon Sep 17 00:00:00 2001 From: Austin Huang Date: Tue, 4 Aug 2020 10:43:53 -0400 Subject: [PATCH] v17.2 --- app/build.gradle | 4 +- .../java/awais/instagrabber/MainHelper.java | 18 ++-- .../activities/DirectMessages.java | 2 +- .../instagrabber/activities/StoryViewer.java | 21 +++-- .../asyncs/FeedStoriesFetcher.java | 18 ---- .../asyncs/NotificationsFetcher.java | 2 + .../java/awais/instagrabber/utils/Utils.java | 86 ------------------- app/src/main/res/values-zh/strings.xml | 6 +- app/src/main/res/values/strings.xml | 2 +- 9 files changed, 35 insertions(+), 124 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index dff3cdcf..2e99b482 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,8 +12,8 @@ android { // REMEMBER TO CHANGE versionCode AS WELL // 16.7 is 32, 16.9 is 35 (34 is public beta) - versionCode 37 - versionName '17.1' + versionCode 38 + versionName '17.2' multiDexEnabled true diff --git a/app/src/main/java/awais/instagrabber/MainHelper.java b/app/src/main/java/awais/instagrabber/MainHelper.java index f32754ac..0e39e1ef 100755 --- a/app/src/main/java/awais/instagrabber/MainHelper.java +++ b/app/src/main/java/awais/instagrabber/MainHelper.java @@ -238,15 +238,19 @@ public final class MainHelper implements SwipeRefreshLayout.OnRefreshListener { final Object tag = v.getTag(); if (tag instanceof FeedStoryModel) { final FeedStoryModel feedStoryModel = (FeedStoryModel) tag; - StoryModel[] storyModels = feedStoryModel.getStoryModels(); final int index = indexOfIntArray(stories, feedStoryModel); + new iStoryStatusFetcher(feedStoryModel.getStoryMediaId(), null, false, false, result -> { + if (result != null && result.length > 0) + main.startActivity(new Intent(main, StoryViewer.class) + .putExtra(Constants.EXTRAS_STORIES, result) + .putExtra(Constants.EXTRAS_USERNAME, feedStoryModel.getProfileModel().getUsername()) + .putExtra(Constants.FEED, stories) + .putExtra(Constants.FEED_ORDER, index) + ); + else Toast.makeText(main, R.string.downloader_unknown_error, Toast.LENGTH_SHORT).show(); + }).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); + - main.startActivity(new Intent(main, StoryViewer.class) - .putExtra(Constants.EXTRAS_STORIES, storyModels) - .putExtra(Constants.EXTRAS_USERNAME, feedStoryModel.getProfileModel().getUsername()) - .putExtra(Constants.FEED, stories) - .putExtra(Constants.FEED_ORDER, index) - ); } } }); diff --git a/app/src/main/java/awais/instagrabber/activities/DirectMessages.java b/app/src/main/java/awais/instagrabber/activities/DirectMessages.java index 6449cdc8..77ae1862 100755 --- a/app/src/main/java/awais/instagrabber/activities/DirectMessages.java +++ b/app/src/main/java/awais/instagrabber/activities/DirectMessages.java @@ -48,7 +48,7 @@ public final class DirectMessages extends BaseLanguageActivity implements SwipeR // todo get request / unseen count from inboxModel final InboxThreadModel[] threads = inboxModel.getThreads(); - if (threads != null) { + if (threads != null && threads.length > 0) { final int oldSize = inboxThreadModelList.size(); inboxThreadModelList.addAll(Arrays.asList(threads)); diff --git a/app/src/main/java/awais/instagrabber/activities/StoryViewer.java b/app/src/main/java/awais/instagrabber/activities/StoryViewer.java index 7fce2239..af41abf0 100755 --- a/app/src/main/java/awais/instagrabber/activities/StoryViewer.java +++ b/app/src/main/java/awais/instagrabber/activities/StoryViewer.java @@ -55,6 +55,7 @@ import awais.instagrabber.BuildConfig; import awais.instagrabber.R; import awais.instagrabber.adapters.StoriesAdapter; import awais.instagrabber.asyncs.DownloadAsync; +import awais.instagrabber.asyncs.i.iStoryStatusFetcher; import awais.instagrabber.customviews.helpers.SwipeGestureListener; import awais.instagrabber.databinding.ActivityStoryViewerBinding; import awais.instagrabber.interfaces.SwipeEvent; @@ -150,14 +151,18 @@ public final class StoryViewer extends BaseLanguageActivity { (index == 0 ? null : storyFeed[index - 1]) : (storyFeed.length == index + 1 ? null : storyFeed[index + 1]); if (feedStoryModel != null) { - final StoryModel[] nextStoryModels = feedStoryModel.getStoryModels(); - final Intent newIntent = new Intent(getApplicationContext(), StoryViewer.class) - .putExtra(Constants.EXTRAS_STORIES, nextStoryModels) - .putExtra(Constants.EXTRAS_USERNAME, feedStoryModel.getProfileModel().getUsername()) - .putExtra(Constants.FEED, storyFeed) - .putExtra(Constants.FEED_ORDER, isRightSwipe ? (index - 1) : (index + 1)); - newIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); - startActivity(newIntent); + new iStoryStatusFetcher(feedStoryModel.getStoryMediaId(), null, false, false, result -> { + if (result != null && result.length > 0) { + final Intent newIntent = new Intent(getApplicationContext(), StoryViewer.class) + .putExtra(Constants.EXTRAS_STORIES, result) + .putExtra(Constants.EXTRAS_USERNAME, feedStoryModel.getProfileModel().getUsername()) + .putExtra(Constants.FEED, storyFeed) + .putExtra(Constants.FEED_ORDER, isRightSwipe ? (index - 1) : (index + 1)); + newIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + startActivity(newIntent); + } + else Toast.makeText(getApplicationContext(), R.string.downloader_unknown_error, Toast.LENGTH_SHORT).show(); + }).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); } } } diff --git a/app/src/main/java/awais/instagrabber/asyncs/FeedStoriesFetcher.java b/app/src/main/java/awais/instagrabber/asyncs/FeedStoriesFetcher.java index 0202785e..995d8386 100755 --- a/app/src/main/java/awais/instagrabber/asyncs/FeedStoriesFetcher.java +++ b/app/src/main/java/awais/instagrabber/asyncs/FeedStoriesFetcher.java @@ -67,24 +67,6 @@ public final class FeedStoriesFetcher extends AsyncTask整个图集 显示快拍 到底啦! - 浏览快拍 + 浏览帖子 查看帖子 Spotify 投票 @@ -185,4 +185,8 @@ 感谢阁下更新InstaGrabber! 应用崩溃了 糟糕.. 应用崩溃了,不过别担心,你可以向开发者发送错误报告来帮助他修复问题。(: + 回答 + 在此回答... + 回答完成! + 提及 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 3aefd479..5031003d 100755 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -61,7 +61,7 @@ Whole Album Show stories No more stories! - View Story Post + View Post View Post Spotify Vote