Handle clicks on posts
This commit is contained in:
@@ -230,6 +230,29 @@ public abstract class BaseStatusListFragment<T extends DisplayItemsParent> exten
|
||||
}
|
||||
}
|
||||
});
|
||||
((UsableRecyclerView)list).setSelectorBoundsProvider(new UsableRecyclerView.SelectorBoundsProvider(){
|
||||
@Override
|
||||
public void getSelectorBounds(View view, Rect outRect){
|
||||
outRect.set(view.getLeft(), view.getTop(), view.getRight(), view.getBottom());
|
||||
RecyclerView.ViewHolder holder=list.getChildViewHolder(view);
|
||||
if(holder instanceof StatusDisplayItem.Holder){
|
||||
String id=((StatusDisplayItem.Holder<?>) holder).getItemID();
|
||||
for(int i=0;i<list.getChildCount();i++){
|
||||
View child=list.getChildAt(i);
|
||||
holder=list.getChildViewHolder(child);
|
||||
if(holder instanceof StatusDisplayItem.Holder){
|
||||
String otherID=((StatusDisplayItem.Holder<?>) holder).getItemID();
|
||||
if(otherID.equals(id)){
|
||||
outRect.left=Math.min(outRect.left, child.getLeft());
|
||||
outRect.top=Math.min(outRect.top, child.getTop());
|
||||
outRect.right=Math.max(outRect.right, child.getRight());
|
||||
outRect.bottom=Math.max(outRect.bottom, child.getBottom());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -259,6 +282,10 @@ public abstract class BaseStatusListFragment<T extends DisplayItemsParent> exten
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void onItemClick(String id){
|
||||
|
||||
}
|
||||
|
||||
protected class DisplayItemsAdapter extends UsableRecyclerView.Adapter<BindableViewHolder<StatusDisplayItem>> implements ImageLoaderRecyclerAdapter{
|
||||
|
||||
public DisplayItemsAdapter(){
|
||||
|
||||
@@ -119,6 +119,7 @@ public class ComposeFragment extends ToolbarFragment implements OnBackPressedLis
|
||||
private CustomEmojiPopupKeyboard emojiKeyboard;
|
||||
private Status replyTo;
|
||||
private String initialReplyMentions;
|
||||
private String uuid;
|
||||
|
||||
@Override
|
||||
public void onAttach(Activity activity){
|
||||
@@ -283,6 +284,7 @@ public class ComposeFragment extends ToolbarFragment implements OnBackPressedLis
|
||||
}
|
||||
|
||||
private void updatePublishButtonState(){
|
||||
uuid=null;
|
||||
publishButton.setEnabled((trimmedCharCount>0 || !attachments.isEmpty()) && charCount<=charLimit && uploadingAttachment==null && failedAttachments.isEmpty() && queuedAttachments.isEmpty());
|
||||
}
|
||||
|
||||
@@ -308,7 +310,8 @@ public class ComposeFragment extends ToolbarFragment implements OnBackPressedLis
|
||||
if(replyTo!=null){
|
||||
req.inReplyToId=replyTo.id;
|
||||
}
|
||||
String uuid=UUID.randomUUID().toString();
|
||||
if(uuid==null)
|
||||
uuid=UUID.randomUUID().toString();
|
||||
ProgressDialog progress=new ProgressDialog(getActivity());
|
||||
progress.setMessage(getString(R.string.publishing));
|
||||
progress.setCancelable(false);
|
||||
|
||||
Reference in New Issue
Block a user