mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-11-22 14:47:29 +00:00
edit caption (finalized)
This commit is contained in:
parent
7ee756eff3
commit
312c90ad92
@ -46,7 +46,7 @@ public final class FeedAdapterV2 extends ListAdapter<FeedModel, RecyclerView.Vie
|
||||
|
||||
@Override
|
||||
public boolean areContentsTheSame(@NonNull final FeedModel oldItem, @NonNull final FeedModel newItem) {
|
||||
return oldItem.getPostId().equals(newItem.getPostId());
|
||||
return oldItem.getPostId().equals(newItem.getPostId()) && oldItem.getPostCaption().equals(newItem.getPostCaption());
|
||||
}
|
||||
};
|
||||
private final AdapterSelectionCallback adapterSelectionCallback = new AdapterSelectionCallback() {
|
||||
|
@ -72,6 +72,7 @@ import awais.instagrabber.customviews.VideoPlayerCallbackAdapter;
|
||||
import awais.instagrabber.customviews.VideoPlayerViewHelper;
|
||||
import awais.instagrabber.customviews.drawee.AnimatedZoomableController;
|
||||
import awais.instagrabber.databinding.DialogPostViewBinding;
|
||||
import awais.instagrabber.fragments.main.ProfileFragment;
|
||||
import awais.instagrabber.models.FeedModel;
|
||||
import awais.instagrabber.models.PostChild;
|
||||
import awais.instagrabber.models.ProfileModel;
|
||||
@ -712,7 +713,7 @@ public class PostViewV2Fragment extends SharedElementTransitionDialogFragment {
|
||||
}
|
||||
|
||||
private void setupCaption() {
|
||||
if (postCaption == null) postCaption = feedModel.getPostCaption();
|
||||
postCaption = feedModel.getPostCaption();
|
||||
binding.date.setText(Utils.datetimeParser.format(new Date(feedModel.getTimestamp() * 1000L)));
|
||||
if (!feedModel.getProfileModel().getId().equals(CookieUtils.getUserIdFromCookie(COOKIE)) && TextUtils.isEmpty(postCaption)) {
|
||||
binding.caption.setVisibility(View.GONE);
|
||||
@ -740,6 +741,7 @@ public class PostViewV2Fragment extends SharedElementTransitionDialogFragment {
|
||||
public void onSuccess(final Boolean result) {
|
||||
binding.editCaption.setVisibility(View.VISIBLE);
|
||||
if (result) {
|
||||
feedModel.setPostCaption(input.getText().toString());
|
||||
binding.caption.setText(input.getText().toString());
|
||||
}
|
||||
else Toast.makeText(context, R.string.downloader_unknown_error, Toast.LENGTH_SHORT).show();
|
||||
|
Loading…
Reference in New Issue
Block a user