diff options
author | Jelena Petrovic <jelenapetrovic.7119@gmail.com> | 2022-12-07 22:00:11 +0100 |
---|---|---|
committer | Jelena Petrovic <jelenapetrovic.7119@gmail.com> | 2022-12-07 22:00:11 +0100 |
commit | a519aa027f8fce9c5bc76aa215e56bb3d8ec3880 (patch) | |
tree | 1feb657f2483d4ef03c0e9d21824f0eae479074e | |
parent | 5d9040be525a7c53c7eb37802cb40d7f9e75d20c (diff) |
Dobar prikaz teksta koji zauzima vise linija pri kucanju komentara, izmenjen izgled polja za unos komentara #81
3 files changed, 96 insertions, 33 deletions
diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Adapters/CommentsAdapter.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Adapters/CommentsAdapter.kt index 8f737a3..6964209 100644 --- a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Adapters/CommentsAdapter.kt +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Adapters/CommentsAdapter.kt @@ -80,7 +80,7 @@ class CommentsAdapter (val items : MutableList<CommentSend>,val activity: Activi else{ showKeyboard(etReply) btnPostReply.setOnClickListener{ - if(etReply.text.isNotEmpty()){ + if(etReply.text!!.isNotEmpty()){ val postId=(activity as ActivitySinglePost).post._id Log.d("main",binding.toString()) val comment= CommentReceive(etReply.text.toString(),item._id) @@ -121,7 +121,7 @@ class CommentsAdapter (val items : MutableList<CommentSend>,val activity: Activi if(response.isSuccessful){ var newComment=response.body()!! requestGetComments(newComment) - itemView.etReply.text.clear() + itemView.etReply.text!!.clear() hideKeyboard(itemView.etReply) itemView.etReply.clearFocus() }else{ diff --git a/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_single_post_comments.xml b/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_single_post_comments.xml index 250f640..005c802 100644 --- a/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_single_post_comments.xml +++ b/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_single_post_comments.xml @@ -50,29 +50,60 @@ app:layout_constraintTop_toBottomOf="@+id/postCommentLayout"> </androidx.recyclerview.widget.RecyclerView> - - <LinearLayout + <androidx.appcompat.widget.LinearLayoutCompat android:id="@+id/postCommentLayout" android:layout_width="match_parent" android:layout_height="wrap_content" - android:orientation="horizontal" app:layout_constraintTop_toBottomOf="@+id/constraintLayout"> - <EditText - android:id="@+id/NewComment" - android:layout_width="match_parent" + <androidx.cardview.widget.CardView + android:id="@+id/cvParentCommentEdit" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" - android:hint="Unesite komentar ovde" /> + android:minHeight="40dp" + android:layout_marginBottom="5dp" + android:layout_marginHorizontal="10dp" + android:elevation="16dp" + app:cardCornerRadius="20dp"> + + + <com.google.android.material.textfield.TextInputEditText + android:id="@+id/NewComment" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:backgroundTint="@color/white" + android:hint="Unesite komentar..." + android:paddingLeft="10dp" + tools:ignore="TouchTargetSizeCheck" + android:inputType="textCapSentences|textMultiLine"/> + + </androidx.cardview.widget.CardView> + <androidx.cardview.widget.CardView + android:id="@+id/cvParentSendButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="bottom" + android:minHeight="40dp" + android:backgroundTint="@color/purple_500" + android:layout_marginBottom="5dp" + android:layout_marginEnd="5dp" + android:elevation="16dp" + app:cardCornerRadius="20dp"> - <ImageView - android:id="@+id/btnPostComment" - android:layout_width="30dp" - android:layout_height="30dp" - android:backgroundTint="@color/white" - android:scaleType="fitCenter" - android:src="@drawable/ic_baseline_send_24" /> - </LinearLayout> + <ImageButton + android:id="@+id/btnPostComment" + android:layout_width="25dp" + android:layout_height="25dp" + android:layout_gravity="center" + android:layout_margin="10dp" + android:background="@null" + android:scaleType="fitCenter" + android:src="@drawable/ic_baseline_send_white_24" + app:cornerRadius="16dp" + tools:ignore="SpeakableTextPresentCheck" /> + </androidx.cardview.widget.CardView> + </androidx.appcompat.widget.LinearLayoutCompat> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/res/layout/single_comment.xml b/Client/BrzoDoLokacije/app/src/main/res/layout/single_comment.xml index 5e0dc03..45ecde0 100644 --- a/Client/BrzoDoLokacije/app/src/main/res/layout/single_comment.xml +++ b/Client/BrzoDoLokacije/app/src/main/res/layout/single_comment.xml @@ -58,26 +58,58 @@ </androidx.appcompat.widget.LinearLayoutCompat> <androidx.appcompat.widget.LinearLayoutCompat + android:id="@+id/llReply" android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="horizontal" - android:id="@+id/llReply"> + android:layout_height="wrap_content"> - <EditText - android:layout_width="match_parent" + <androidx.cardview.widget.CardView + android:id="@+id/cvParentCommentEdit" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" - android:id="@+id/etReply" - android:hint="odgovor na komentar"/> - <ImageButton - android:id="@+id/btnPostReply" - android:layout_width="50dp" - android:layout_height="50dp" - android:layout_gravity="end" - android:layout_weight="0" - android:backgroundTint="@color/white" - android:scaleType="centerCrop" - android:src="@drawable/post_comment" /> + android:minHeight="40dp" + android:layout_marginBottom="5dp" + android:layout_marginHorizontal="10dp" + android:elevation="16dp" + app:cardCornerRadius="20dp"> + + + <com.google.android.material.textfield.TextInputEditText + android:id="@+id/etReply" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:backgroundTint="@color/white" + android:hint="Unesite komentar..." + android:paddingLeft="10dp" + tools:ignore="TouchTargetSizeCheck" + android:inputType="textCapSentences|textMultiLine"/> + + </androidx.cardview.widget.CardView> + <androidx.cardview.widget.CardView + android:id="@+id/cvParentSendReplyButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="bottom" + android:minHeight="40dp" + android:backgroundTint="@color/purple_500" + android:layout_marginBottom="5dp" + android:layout_marginEnd="5dp" + android:elevation="16dp" + app:cardCornerRadius="20dp"> + + + <ImageButton + android:id="@+id/btnPostReply" + android:layout_width="25dp" + android:layout_height="25dp" + android:layout_gravity="center" + android:layout_margin="10dp" + android:background="@null" + android:scaleType="fitCenter" + android:src="@drawable/ic_baseline_send_white_24" + app:cornerRadius="16dp" + tools:ignore="SpeakableTextPresentCheck" /> + </androidx.cardview.widget.CardView> </androidx.appcompat.widget.LinearLayoutCompat> <androidx.recyclerview.widget.RecyclerView android:layout_width="match_parent" |