mirror of
https://framagit.org/tom79/fedilab-tube
synced 2025-04-26 16:08:44 +02:00
Some improvements
This commit is contained in:
parent
d93c74a449
commit
43fd2945cc
@ -1,5 +1,5 @@
|
|||||||
- Custom default instance depending of the country
|
- Custom default instance depending of the country
|
||||||
- New comment feature
|
|
||||||
- See replies to comments
|
- See replies to comments
|
||||||
- Reply to comment
|
- Reply to comments
|
||||||
|
- Reply to replies
|
||||||
- Fix some issues when posting
|
- Fix some issues when posting
|
@ -341,13 +341,13 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
}
|
}
|
||||||
List<CommentData.CommentThreadData> commentThreadDataList = apiResponse.getCommentThreadData().getChildren();
|
List<CommentData.CommentThreadData> commentThreadDataList = apiResponse.getCommentThreadData().getChildren();
|
||||||
commentsThread = generateCommentReply(commentThreadDataList, new ArrayList<>());
|
commentsThread = generateCommentReply(commentThreadDataList, new ArrayList<>());
|
||||||
if (commentsThread.size() > 0) {
|
|
||||||
commentReplyListAdapter = new CommentListAdapter(commentsThread, Helper.isVideoOwner(PeertubeActivity.this, peertube));
|
commentReplyListAdapter = new CommentListAdapter(commentsThread, Helper.isVideoOwner(PeertubeActivity.this, peertube));
|
||||||
LinearLayoutManager mLayoutManager = new LinearLayoutManager(PeertubeActivity.this);
|
LinearLayoutManager mLayoutManager = new LinearLayoutManager(PeertubeActivity.this);
|
||||||
binding.peertubeReply.setLayoutManager(mLayoutManager);
|
binding.peertubeReply.setLayoutManager(mLayoutManager);
|
||||||
binding.peertubeReply.setNestedScrollingEnabled(false);
|
binding.peertubeReply.setNestedScrollingEnabled(false);
|
||||||
binding.peertubeReply.setAdapter(commentReplyListAdapter);
|
binding.peertubeReply.setAdapter(commentReplyListAdapter);
|
||||||
binding.peertubeReply.setVisibility(View.VISIBLE);
|
binding.peertubeReply.setVisibility(View.VISIBLE);
|
||||||
|
if (commentsThread.size() > 0) {
|
||||||
commentReplyListAdapter.notifyItemRangeInserted(0, commentsThread.size());
|
commentReplyListAdapter.notifyItemRangeInserted(0, commentsThread.size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -508,7 +508,6 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
binding.writeCommentContainer.setVisibility(View.GONE);
|
binding.writeCommentContainer.setVisibility(View.GONE);
|
||||||
binding.writeCommentContainerReply.setVisibility(View.GONE);
|
binding.writeCommentContainerReply.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.send.setOnClickListener(v -> {
|
binding.send.setOnClickListener(v -> {
|
||||||
if (isLoggedIn(PeertubeActivity.this) && !sepiaSearch) {
|
if (isLoggedIn(PeertubeActivity.this) && !sepiaSearch) {
|
||||||
String comment = binding.addCommentWrite.getText().toString();
|
String comment = binding.addCommentWrite.getText().toString();
|
||||||
@ -860,7 +859,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
if( binding.writeCommentContainerReply.getVisibility() == View.VISIBLE) {
|
if( binding.replyThread.getVisibility() == View.VISIBLE) {
|
||||||
closeCommentThread();
|
closeCommentThread();
|
||||||
}else {
|
}else {
|
||||||
if (playInMinimized && player != null) {
|
if (playInMinimized && player != null) {
|
||||||
@ -1009,6 +1008,8 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
public void onAnimationRepeat(Animation animation) {}
|
public void onAnimationRepeat(Animation animation) {}
|
||||||
});
|
});
|
||||||
animate.setDuration(500);
|
animate.setDuration(500);
|
||||||
|
binding.addCommentWriteReply.setText(String.format("@%s ", comment.getAccount().getAcct()));
|
||||||
|
binding.addCommentWriteReply.setSelection(binding.addCommentWriteReply.getText().length());
|
||||||
binding.replyThread.startAnimation(animate);
|
binding.replyThread.startAnimation(animate);
|
||||||
binding.sendReply.setOnClickListener(null);
|
binding.sendReply.setOnClickListener(null);
|
||||||
binding.sendReply.setOnClickListener(v -> {
|
binding.sendReply.setOnClickListener(v -> {
|
||||||
|
@ -263,6 +263,10 @@ public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
|||||||
}else{
|
}else{
|
||||||
holder.write_comment_container_reply.setVisibility(View.GONE);
|
holder.write_comment_container_reply.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
if( holder.add_comment_write_reply.getText() == null || holder.add_comment_write_reply.getText().toString().trim().length() == 0) {
|
||||||
|
holder.add_comment_write_reply.setText(String.format("@%s ", comment.getAccount().getAcct()));
|
||||||
|
holder.add_comment_write_reply.setSelection(holder.add_comment_write_reply.getText().length());
|
||||||
|
}
|
||||||
holder.replyButton.setOnClickListener(v->{
|
holder.replyButton.setOnClickListener(v->{
|
||||||
comment.setReplyViewOpen(!comment.isReplyViewOpen());
|
comment.setReplyViewOpen(!comment.isReplyViewOpen());
|
||||||
notifyItemChanged(i);
|
notifyItemChanged(i);
|
||||||
@ -346,7 +350,7 @@ public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
|||||||
TextView comment_content;
|
TextView comment_content;
|
||||||
TextView comment_account_username;
|
TextView comment_account_username;
|
||||||
TextView comment_account_displayname;
|
TextView comment_account_displayname;
|
||||||
ImageView comment_account_profile, my_pp_reply, send_reply;
|
ImageView comment_account_profile, send_reply;
|
||||||
TextView comment_date, replyButton;
|
TextView comment_date, replyButton;
|
||||||
LinearLayout main_container;
|
LinearLayout main_container;
|
||||||
TextView more_actions, number_of_replies;
|
TextView more_actions, number_of_replies;
|
||||||
@ -365,7 +369,6 @@ public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
|||||||
main_container = itemView.findViewById(R.id.main_container);
|
main_container = itemView.findViewById(R.id.main_container);
|
||||||
more_actions = itemView.findViewById(R.id.more_actions);
|
more_actions = itemView.findViewById(R.id.more_actions);
|
||||||
number_of_replies = itemView.findViewById(R.id.number_of_replies);
|
number_of_replies = itemView.findViewById(R.id.number_of_replies);
|
||||||
my_pp_reply = itemView.findViewById(R.id.my_pp_reply);
|
|
||||||
add_comment_write_reply = itemView.findViewById(R.id.add_comment_write_reply);
|
add_comment_write_reply = itemView.findViewById(R.id.add_comment_write_reply);
|
||||||
send_reply = itemView.findViewById(R.id.send_reply);
|
send_reply = itemView.findViewById(R.id.send_reply);
|
||||||
replyButton = itemView.findViewById(R.id.replyButton);
|
replyButton = itemView.findViewById(R.id.replyButton);
|
||||||
|
@ -141,19 +141,12 @@
|
|||||||
android:id="@+id/write_container_reply"
|
android:id="@+id/write_container_reply"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
<ImageView
|
|
||||||
android:id="@+id/my_pp_reply"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
android:layout_width="30dp"
|
|
||||||
android:layout_height="30dp"
|
|
||||||
android:contentDescription="@string/profile_picture" />
|
|
||||||
<studio.carbonylgroup.textfieldboxes.TextFieldBoxes
|
<studio.carbonylgroup.textfieldboxes.TextFieldBoxes
|
||||||
android:id="@+id/text_field_boxes_reply"
|
android:id="@+id/text_field_boxes_reply"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@+id/my_pp_reply"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/send_reply"
|
app:layout_constraintEnd_toStartOf="@+id/send_reply"
|
||||||
app:labelText="@string/add_public_reply"
|
app:labelText="@string/add_public_reply"
|
||||||
app:secondaryColor="?attr/colorAccent"
|
app:secondaryColor="?attr/colorAccent"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user