|
@ -24,6 +24,7 @@ import androidx.appcompat.app.ActionBar; |
|
|
import androidx.coordinatorlayout.widget.CoordinatorLayout; |
|
|
import androidx.coordinatorlayout.widget.CoordinatorLayout; |
|
|
import androidx.core.content.PermissionChecker; |
|
|
import androidx.core.content.PermissionChecker; |
|
|
import androidx.fragment.app.Fragment; |
|
|
import androidx.fragment.app.Fragment; |
|
|
|
|
|
import androidx.fragment.app.FragmentManager; |
|
|
import androidx.navigation.NavController; |
|
|
import androidx.navigation.NavController; |
|
|
import androidx.navigation.NavDirections; |
|
|
import androidx.navigation.NavDirections; |
|
|
import androidx.navigation.fragment.NavHostFragment; |
|
|
import androidx.navigation.fragment.NavHostFragment; |
|
@ -56,6 +57,7 @@ import awais.instagrabber.models.enums.FavoriteType; |
|
|
import awais.instagrabber.repositories.requests.StoryViewerOptions; |
|
|
import awais.instagrabber.repositories.requests.StoryViewerOptions; |
|
|
import awais.instagrabber.repositories.responses.Location; |
|
|
import awais.instagrabber.repositories.responses.Location; |
|
|
import awais.instagrabber.repositories.responses.Media; |
|
|
import awais.instagrabber.repositories.responses.Media; |
|
|
|
|
|
import awais.instagrabber.repositories.responses.User; |
|
|
import awais.instagrabber.utils.Constants; |
|
|
import awais.instagrabber.utils.Constants; |
|
|
import awais.instagrabber.utils.CookieUtils; |
|
|
import awais.instagrabber.utils.CookieUtils; |
|
|
import awais.instagrabber.utils.DownloadUtils; |
|
|
import awais.instagrabber.utils.DownloadUtils; |
|
@ -204,7 +206,9 @@ public class LocationFragment extends Fragment implements SwipeRefreshLayout.OnR |
|
|
final View mainPostImage, |
|
|
final View mainPostImage, |
|
|
final int position) { |
|
|
final int position) { |
|
|
if (opening) return; |
|
|
if (opening) return; |
|
|
if (TextUtils.isEmpty(feedModel.getUser().getUsername())) { |
|
|
|
|
|
|
|
|
final User user = feedModel.getUser(); |
|
|
|
|
|
if (user == null) return; |
|
|
|
|
|
if (TextUtils.isEmpty(user.getUsername())) { |
|
|
opening = true; |
|
|
opening = true; |
|
|
new PostFetcher(feedModel.getCode(), newFeedModel -> { |
|
|
new PostFetcher(feedModel.getCode(), newFeedModel -> { |
|
|
opening = false; |
|
|
opening = false; |
|
@ -223,7 +227,9 @@ public class LocationFragment extends Fragment implements SwipeRefreshLayout.OnR |
|
|
builder.setSharedProfilePicElement(profilePicView) |
|
|
builder.setSharedProfilePicElement(profilePicView) |
|
|
.setSharedMainPostElement(mainPostImage); |
|
|
.setSharedMainPostElement(mainPostImage); |
|
|
} |
|
|
} |
|
|
builder.build().show(getChildFragmentManager(), "post_view"); |
|
|
|
|
|
|
|
|
final FragmentManager fragmentManager = getChildFragmentManager(); |
|
|
|
|
|
if (fragmentManager.isDestroyed()) return; |
|
|
|
|
|
builder.build().show(fragmentManager, "post_view"); |
|
|
opening = false; |
|
|
opening = false; |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
@ -399,8 +405,7 @@ public class LocationFragment extends Fragment implements SwipeRefreshLayout.OnR |
|
|
try { |
|
|
try { |
|
|
Toast.makeText(getContext(), R.string.error_loading_location, Toast.LENGTH_SHORT).show(); |
|
|
Toast.makeText(getContext(), R.string.error_loading_location, Toast.LENGTH_SHORT).show(); |
|
|
binding.swipeRefreshLayout.setEnabled(false); |
|
|
binding.swipeRefreshLayout.setEnabled(false); |
|
|
} |
|
|
|
|
|
catch (Exception ignored) {} |
|
|
|
|
|
|
|
|
} catch (Exception ignored) {} |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
setTitle(); |
|
|
setTitle(); |
|
|