mirror of
				https://github.com/KokaKiwi/BarInsta
				synced 2025-11-03 21:15:35 +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
 | 
					        @Override
 | 
				
			||||||
        public boolean areContentsTheSame(@NonNull final FeedModel oldItem, @NonNull final FeedModel newItem) {
 | 
					        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() {
 | 
					    private final AdapterSelectionCallback adapterSelectionCallback = new AdapterSelectionCallback() {
 | 
				
			||||||
 | 
				
			|||||||
@ -72,6 +72,7 @@ import awais.instagrabber.customviews.VideoPlayerCallbackAdapter;
 | 
				
			|||||||
import awais.instagrabber.customviews.VideoPlayerViewHelper;
 | 
					import awais.instagrabber.customviews.VideoPlayerViewHelper;
 | 
				
			||||||
import awais.instagrabber.customviews.drawee.AnimatedZoomableController;
 | 
					import awais.instagrabber.customviews.drawee.AnimatedZoomableController;
 | 
				
			||||||
import awais.instagrabber.databinding.DialogPostViewBinding;
 | 
					import awais.instagrabber.databinding.DialogPostViewBinding;
 | 
				
			||||||
 | 
					import awais.instagrabber.fragments.main.ProfileFragment;
 | 
				
			||||||
import awais.instagrabber.models.FeedModel;
 | 
					import awais.instagrabber.models.FeedModel;
 | 
				
			||||||
import awais.instagrabber.models.PostChild;
 | 
					import awais.instagrabber.models.PostChild;
 | 
				
			||||||
import awais.instagrabber.models.ProfileModel;
 | 
					import awais.instagrabber.models.ProfileModel;
 | 
				
			||||||
@ -712,7 +713,7 @@ public class PostViewV2Fragment extends SharedElementTransitionDialogFragment {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private void setupCaption() {
 | 
					    private void setupCaption() {
 | 
				
			||||||
        if (postCaption == null) postCaption = feedModel.getPostCaption();
 | 
					        postCaption = feedModel.getPostCaption();
 | 
				
			||||||
        binding.date.setText(Utils.datetimeParser.format(new Date(feedModel.getTimestamp() * 1000L)));
 | 
					        binding.date.setText(Utils.datetimeParser.format(new Date(feedModel.getTimestamp() * 1000L)));
 | 
				
			||||||
        if (!feedModel.getProfileModel().getId().equals(CookieUtils.getUserIdFromCookie(COOKIE)) && TextUtils.isEmpty(postCaption)) {
 | 
					        if (!feedModel.getProfileModel().getId().equals(CookieUtils.getUserIdFromCookie(COOKIE)) && TextUtils.isEmpty(postCaption)) {
 | 
				
			||||||
            binding.caption.setVisibility(View.GONE);
 | 
					            binding.caption.setVisibility(View.GONE);
 | 
				
			||||||
@ -740,6 +741,7 @@ public class PostViewV2Fragment extends SharedElementTransitionDialogFragment {
 | 
				
			|||||||
                                        public void onSuccess(final Boolean result) {
 | 
					                                        public void onSuccess(final Boolean result) {
 | 
				
			||||||
                                            binding.editCaption.setVisibility(View.VISIBLE);
 | 
					                                            binding.editCaption.setVisibility(View.VISIBLE);
 | 
				
			||||||
                                            if (result) {
 | 
					                                            if (result) {
 | 
				
			||||||
 | 
					                                                feedModel.setPostCaption(input.getText().toString());
 | 
				
			||||||
                                                binding.caption.setText(input.getText().toString());
 | 
					                                                binding.caption.setText(input.getText().toString());
 | 
				
			||||||
                                            }
 | 
					                                            }
 | 
				
			||||||
                                            else Toast.makeText(context, R.string.downloader_unknown_error, Toast.LENGTH_SHORT).show();
 | 
					                                            else Toast.makeText(context, R.string.downloader_unknown_error, Toast.LENGTH_SHORT).show();
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user