diff options
Diffstat (limited to 'Client')
3 files changed, 46 insertions, 10 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 3a190c9..64c5ac7 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 @@ -112,8 +112,15 @@ class CommentsAdapter (val items : MutableList<CommentSend>,val activity: Activi var rv: RecyclerView = rvReplies rv.setHasFixedSize(true) rv.layoutManager=LinearLayoutManager(activity,LinearLayoutManager.VERTICAL,false) - if(item.replies!=null) + if(item.replies!=null){ + if(item.replies!!.count()==1) + etReplyCount.text=item.replies!!.count().toString() + " odgovor" + else + etReplyCount.text=item.replies!!.count().toString() + " odgovora" + clReplyCount.visibility=View.VISIBLE + clReplyCount.invalidate() rv.adapter=CommentsAdapter(item.replies as MutableList<CommentSend>,activity,fragment) + } else rv.adapter=CommentsAdapter(mutableListOf(),activity,fragment) } diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Services/RetrofitHelper.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Services/RetrofitHelper.kt index 88685e4..43c2109 100644 --- a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Services/RetrofitHelper.kt +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Services/RetrofitHelper.kt @@ -7,8 +7,8 @@ import retrofit2.converter.gson.GsonConverterFactory object RetrofitHelper { - //val baseUrl="http://10.0.2.2:5279" - val baseUrl="http://147.91.204.115:10082" + val baseUrl="http://10.0.2.2:5279" + //val baseUrl="http://147.91.204.115:10082" private var retrofit_noauth: IBackendApi? = null private var retrofit_auth: IBackendApi? = null 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 9a5dcd4..1c05019 100644 --- a/Client/BrzoDoLokacije/app/src/main/res/layout/single_comment.xml +++ b/Client/BrzoDoLokacije/app/src/main/res/layout/single_comment.xml @@ -27,14 +27,43 @@ android:layout_height="wrap_content" android:orientation="vertical" android:layout_weight="1"> + <androidx.appcompat.widget.LinearLayoutCompat + android:layout_width="match_parent" + android:layout_height="wrap_content"> + <TextView + android:id="@+id/tvCommentAuthor" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="autor" + android:textStyle="bold" + android:padding="@dimen/text_padding"/> + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:visibility="gone" + android:id="@+id/clReplyCount"> + + <androidx.constraintlayout.widget.ConstraintLayout + android:id="@+id/constraintLayout4" + android:layout_width="5dp" + android:layout_height="5dp" + android:background="@drawable/rounded_picture_background" + android:backgroundTint="@color/unfollow" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + <TextView + android:id="@+id/etReplyCount" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:clickable="true" + android:padding="@dimen/text_padding" + android:text="0 odgovora" + app:layout_constraintStart_toEndOf="@id/constraintLayout4" + tools:layout_editor_absoluteY="0dp" /> + </androidx.constraintlayout.widget.ConstraintLayout> + </androidx.appcompat.widget.LinearLayoutCompat> - <TextView - android:id="@+id/tvCommentAuthor" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="autor" - android:textStyle="bold" - android:padding="@dimen/text_padding"/> <TextView android:id="@+id/tvCommentText" |