mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-12-26 14:46:59 +00:00
close #491
This commit is contained in:
parent
251228dcc4
commit
f85e0fc54c
@ -554,7 +554,7 @@ public class HashTagFragment extends Fragment implements SwipeRefreshLayout.OnRe
|
||||
if (!hasStories) return;
|
||||
// show stories
|
||||
final NavDirections action = HashTagFragmentDirections
|
||||
.actionHashtagFragmentToStoryViewerFragment(-1, null, true, false, hashtagModel.getName(), hashtagModel.getName(), false);
|
||||
.actionHashtagFragmentToStoryViewerFragment(-1, null, true, false, hashtagModel.getName(), hashtagModel.getName(), false, false);
|
||||
NavHostFragment.findNavController(this).navigate(action);
|
||||
});
|
||||
}
|
||||
|
@ -523,7 +523,7 @@ public class LocationFragment extends Fragment implements SwipeRefreshLayout.OnR
|
||||
if (hasStories) {
|
||||
// show stories
|
||||
final NavDirections action = LocationFragmentDirections
|
||||
.actionLocationFragmentToStoryViewerFragment(-1, null, false, true, locationId, locationModel.getName(), false);
|
||||
.actionLocationFragmentToStoryViewerFragment(-1, null, false, true, locationId, locationModel.getName(), false, false);
|
||||
NavHostFragment.findNavController(this).navigate(action);
|
||||
}
|
||||
});
|
||||
|
@ -77,7 +77,7 @@ public final class NotificationsViewerFragment extends Fragment implements Swipe
|
||||
public void onPreviewClick(final NotificationModel model) {
|
||||
if (model.getType() == NotificationType.RESPONDED_STORY) {
|
||||
final NavDirections action = NotificationsViewerFragmentDirections.actionNotificationsViewerFragmentToStoryViewerFragment(
|
||||
-1, null, false, false, model.getPostId(), model.getUsername(), false);
|
||||
-1, null, false, false, model.getPostId(), model.getUsername(), false, true);
|
||||
NavHostFragment.findNavController(NotificationsViewerFragment.this).navigate(action);
|
||||
}
|
||||
else {
|
||||
@ -155,7 +155,7 @@ public final class NotificationsViewerFragment extends Fragment implements Swipe
|
||||
}
|
||||
else if (model.getType() == NotificationType.RESPONDED_STORY) {
|
||||
final NavDirections action = NotificationsViewerFragmentDirections.actionNotificationsViewerFragmentToStoryViewerFragment(
|
||||
-1, null, false, false, model.getPostId(), model.getUsername(), false);
|
||||
-1, null, false, false, model.getPostId(), model.getUsername(), false, true);
|
||||
NavHostFragment.findNavController(NotificationsViewerFragment.this).navigate(action);
|
||||
return;
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ public final class StoryListViewerFragment extends Fragment implements SwipeRefr
|
||||
@Override
|
||||
public void onFeedStoryClick(final FeedStoryModel model, final int position) {
|
||||
if (model == null) return;
|
||||
final NavDirections action = StoryListViewerFragmentDirections.actionStoryListFragmentToStoryViewerFragment(position, null, false, false, null, null, false);
|
||||
final NavDirections action = StoryListViewerFragmentDirections.actionStoryListFragmentToStoryViewerFragment(position, null, false, false, null, null, false, false);
|
||||
NavHostFragment.findNavController(StoryListViewerFragment.this).navigate(action);
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ public final class StoryListViewerFragment extends Fragment implements SwipeRefr
|
||||
public void onHighlightClick(final HighlightModel model, final int position) {
|
||||
if (model == null) return;
|
||||
final NavDirections action = StoryListViewerFragmentDirections.actionStoryListFragmentToStoryViewerFragment(
|
||||
position, getString(R.string.action_archive), false, false, null, null, true);
|
||||
position, getString(R.string.action_archive), false, false, null, null, true, false);
|
||||
NavHostFragment.findNavController(StoryListViewerFragment.this).navigate(action);
|
||||
}
|
||||
|
||||
@ -138,6 +138,13 @@ public final class StoryListViewerFragment extends Fragment implements SwipeRefr
|
||||
shouldRefresh = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
final ActionBar actionBar = fragmentActivity.getSupportActionBar();
|
||||
if (actionBar != null) actionBar.setTitle(type == "feed" ? R.string.feed_stories : R.string.action_archive);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if (archivesViewModel != null) archivesViewModel.getList().postValue(null);
|
||||
|
@ -133,14 +133,13 @@ public class StoryViewerFragment extends Fragment {
|
||||
private SimpleExoPlayer player;
|
||||
private boolean isHashtag, isLoc;
|
||||
private String highlight;
|
||||
private boolean fetching = false, sticking = false;
|
||||
private boolean fetching = false, sticking = false, shouldRefresh = true;
|
||||
private int currentFeedStoryIndex;
|
||||
private double sliderValue;
|
||||
private StoriesViewModel storiesViewModel;
|
||||
private boolean shouldRefresh = true;
|
||||
private StoryViewerFragmentArgs fragmentArgs;
|
||||
private ViewModel viewModel;
|
||||
private boolean isHighlight, isArchive;
|
||||
private boolean isHighlight, isArchive, isNotification;
|
||||
|
||||
private final String cookie = settingsHelper.getString(Constants.COOKIE);
|
||||
|
||||
@ -258,6 +257,7 @@ public class StoryViewerFragment extends Fragment {
|
||||
highlight = fragmentArgs.getHighlight();
|
||||
isHighlight = !TextUtils.isEmpty(highlight);
|
||||
isArchive = fragmentArgs.getIsArchive();
|
||||
isNotification = fragmentArgs.getIsNotification();
|
||||
if (currentFeedStoryIndex >= 0) {
|
||||
viewModel = isHighlight
|
||||
? isArchive
|
||||
@ -693,7 +693,7 @@ public class StoryViewerFragment extends Fragment {
|
||||
}
|
||||
storiesViewModel.getList().setValue(Collections.emptyList());
|
||||
if (currentStoryMediaId == null) return;
|
||||
else if (currentFeedStoryIndex == -1) {
|
||||
else if (isNotification) {
|
||||
storiesService.fetch(currentStoryMediaId, new ServiceCallback<StoryModel>() {
|
||||
@Override
|
||||
public void onSuccess(final StoryModel storyModel) {
|
||||
@ -728,7 +728,9 @@ public class StoryViewerFragment extends Fragment {
|
||||
binding.storiesList.setVisibility(View.GONE);
|
||||
return;
|
||||
}
|
||||
binding.storiesList.setVisibility(View.VISIBLE);
|
||||
binding.storiesList.setVisibility((storyModels.size() == 1 && currentFeedStoryIndex == -1) ? View.GONE : View.VISIBLE);
|
||||
binding.btnBackward.setVisibility(currentFeedStoryIndex == -1 ? View.GONE : View.VISIBLE);
|
||||
binding.btnForward.setVisibility(currentFeedStoryIndex == -1 ? View.GONE : View.VISIBLE);
|
||||
storiesViewModel.getList().setValue(storyModels);
|
||||
currentStory = storyModels.get(0);
|
||||
refreshStory();
|
||||
|
@ -357,7 +357,7 @@ public class FeedFragment extends Fragment implements SwipeRefreshLayout.OnRefre
|
||||
new FeedStoriesAdapter.OnFeedStoryClickListener() {
|
||||
@Override
|
||||
public void onFeedStoryClick(FeedStoryModel model, int position) {
|
||||
final NavDirections action = FeedFragmentDirections.actionFeedFragmentToStoryViewerFragment(position, null, false, false, null, null, false);
|
||||
final NavDirections action = FeedFragmentDirections.actionFeedFragmentToStoryViewerFragment(position, null, false, false, null, null, false, false);
|
||||
NavHostFragment.findNavController(FeedFragment.this).navigate(action);
|
||||
}
|
||||
|
||||
|
@ -1008,7 +1008,7 @@ public class ProfileFragment extends Fragment implements SwipeRefreshLayout.OnRe
|
||||
if (which == 1) {
|
||||
// show stories
|
||||
final NavDirections action = ProfileFragmentDirections
|
||||
.actionProfileFragmentToStoryViewerFragment(-1, null, false, false, profileModel.getId(), username, false);
|
||||
.actionProfileFragmentToStoryViewerFragment(-1, null, false, false, profileModel.getId(), username, false, false);
|
||||
NavHostFragment.findNavController(this).navigate(action);
|
||||
return;
|
||||
}
|
||||
@ -1069,7 +1069,7 @@ public class ProfileFragment extends Fragment implements SwipeRefreshLayout.OnRe
|
||||
highlightsViewModel = new ViewModelProvider(fragmentActivity).get(HighlightsViewModel.class);
|
||||
highlightsAdapter = new HighlightsAdapter((model, position) -> {
|
||||
final NavDirections action = ProfileFragmentDirections
|
||||
.actionProfileFragmentToStoryViewerFragment(position, model.getTitle(), false, false, null, null, false);
|
||||
.actionProfileFragmentToStoryViewerFragment(position, model.getTitle(), false, false, null, null, false, false);
|
||||
NavHostFragment.findNavController(this).navigate(action);
|
||||
});
|
||||
final Context context = getContext();
|
||||
|
@ -217,7 +217,7 @@ public class StoriesService extends BaseService {
|
||||
null,
|
||||
highlightNode.getString(Constants.EXTRAS_ID),
|
||||
highlightNode.getJSONObject("cover_image_version").getString("url"),
|
||||
highlightNode.getLong("timestamp"),
|
||||
highlightNode.getLong("latest_reel_media"),
|
||||
highlightNode.getInt("media_count")
|
||||
));
|
||||
}
|
||||
@ -246,6 +246,7 @@ public class StoriesService extends BaseService {
|
||||
final boolean highlight,
|
||||
final ServiceCallback<List<StoryModel>> callback) {
|
||||
final String url = buildUrl(id, isLoc, isHashtag, highlight);
|
||||
Log.d("austin_debug", url);
|
||||
final Call<String> userStoryCall = repository.getUserStory(Constants.I_USER_AGENT, url);
|
||||
userStoryCall.enqueue(new Callback<String>() {
|
||||
@Override
|
||||
|
@ -134,5 +134,9 @@
|
||||
android:name="isArchive"
|
||||
app:argType="boolean"
|
||||
app:nullable="false" />
|
||||
<argument
|
||||
android:name="isNotification"
|
||||
app:argType="boolean"
|
||||
app:nullable="false" />
|
||||
</fragment>
|
||||
</navigation>
|
@ -101,6 +101,10 @@
|
||||
android:name="isArchive"
|
||||
app:argType="boolean"
|
||||
app:nullable="false" />
|
||||
<argument
|
||||
android:name="isNotification"
|
||||
app:argType="boolean"
|
||||
app:nullable="false" />
|
||||
</fragment>
|
||||
<action
|
||||
android:id="@+id/action_global_hashTagFragment"
|
||||
|
@ -109,5 +109,9 @@
|
||||
android:name="isArchive"
|
||||
app:argType="boolean"
|
||||
app:nullable="false" />
|
||||
<argument
|
||||
android:name="isNotification"
|
||||
app:argType="boolean"
|
||||
app:nullable="false" />
|
||||
</fragment>
|
||||
</navigation>
|
@ -93,5 +93,9 @@
|
||||
android:name="isArchive"
|
||||
app:argType="boolean"
|
||||
app:nullable="false" />
|
||||
<argument
|
||||
android:name="isNotification"
|
||||
app:argType="boolean"
|
||||
app:nullable="false" />
|
||||
</fragment>
|
||||
</navigation>
|
@ -183,6 +183,10 @@
|
||||
android:name="isArchive"
|
||||
app:argType="boolean"
|
||||
app:nullable="false" />
|
||||
<argument
|
||||
android:name="isNotification"
|
||||
app:argType="boolean"
|
||||
app:nullable="false" />
|
||||
</fragment>
|
||||
<fragment
|
||||
android:id="@+id/directMessagesThreadFragment"
|
||||
|
@ -68,5 +68,9 @@
|
||||
android:name="isArchive"
|
||||
app:argType="boolean"
|
||||
app:nullable="false" />
|
||||
<argument
|
||||
android:name="isNotification"
|
||||
app:argType="boolean"
|
||||
app:nullable="false" />
|
||||
</fragment>
|
||||
</navigation>
|
Loading…
Reference in New Issue
Block a user