diff options
Diffstat (limited to 'Client')
13 files changed, 273 insertions, 48 deletions
diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/ActivityUserProfile.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/ActivityUserProfile.kt index 4f48dc7..5119da9 100644 --- a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/ActivityUserProfile.kt +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/ActivityUserProfile.kt @@ -6,10 +6,12 @@ import android.util.Log  import android.widget.*  import androidx.appcompat.app.AppCompatActivity  import androidx.core.view.isVisible -import androidx.fragment.app.Fragment +import androidx.fragment.app.FragmentManager +import androidx.fragment.app.FragmentTransaction  import com.bumptech.glide.Glide -import com.example.brzodolokacije.Fragments.FragmentShowUserPosts +import com.example.brzodolokacije.Fragments.FragmentUserPostsProfileActivity  import com.example.brzodolokacije.Models.UserReceive +import com.example.brzodolokacije.R  import com.example.brzodolokacije.R.*  import com.example.brzodolokacije.Services.RetrofitHelper  import com.example.brzodolokacije.Services.SharedPreferencesHelper @@ -31,8 +33,7 @@ class ActivityUserProfile : AppCompatActivity() {      private lateinit var userObject:UserReceive      private lateinit var openChat:ImageButton      private lateinit var unfollowUser:Button -    private lateinit var followersList: MutableList<UserReceive> -    private lateinit var followingList: MutableList<UserReceive> +      private var follow:Boolean=false      override fun onCreate(savedInstanceState: Bundle?) { @@ -137,13 +138,13 @@ class ActivityUserProfile : AppCompatActivity() {          }          showUserPosts.setOnClickListener { -            val bundle = Bundle() -            bundle.putString("user", Gson().toJson(userObject)) -            val fragment = Fragment() -            fragment.arguments = bundle -            getSupportFragmentManager().beginTransaction() -                .replace(id.flActivityProfileFragmentContainer,FragmentShowUserPosts()).commit() - +            var fm: FragmentTransaction =supportFragmentManager.beginTransaction() +            val fragment = FragmentUserPostsProfileActivity() +            val b = Bundle() +            b.putString("userId", userObject._id.toString()) +            fragment.arguments = b +            fm.replace(R.id.flActivityProfileFragmentContainer, fragment) +            fm.commit()          }      } diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/ChatActivity.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/ChatActivity.kt index 25ef88e..951cbb4 100644 --- a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/ChatActivity.kt +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/ChatActivity.kt @@ -21,6 +21,7 @@ import com.example.brzodolokacije.chat.SignalRListener  import com.example.brzodolokacije.databinding.ActivityChatBinding  import retrofit2.Call  import retrofit2.Response +import java.util.*  class ChatActivity : AppCompatActivity(), SwipeRefreshLayout.OnRefreshListener { @@ -83,9 +84,11 @@ class ChatActivity : AppCompatActivity(), SwipeRefreshLayout.OnRefreshListener {                      if(!messages.isNullOrEmpty()){                          var dbHelper= DBHelper.getInstance(this@ChatActivity)                          for( message in messages){ +                            var cal: Calendar = Calendar.getInstance() +                            cal.time=message.timestamp                              dbHelper.addMessage(                                  Message(message.senderId+message.timestamp,message.senderId, -                                JWT(SharedPreferencesHelper.getValue("jwt",this@ChatActivity)!!).claims["id"]?.asString()!!,message.messagge,message.timestamp),false) +                                JWT(SharedPreferencesHelper.getValue("jwt",this@ChatActivity)!!).claims["id"]?.asString()!!,message.messagge,message.timestamp,cal),false)                          }                      }                      requestForChats() diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/ChatActivityConversation.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/ChatActivityConversation.kt index b4722ea..47cd903 100644 --- a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/ChatActivityConversation.kt +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/ChatActivityConversation.kt @@ -24,6 +24,7 @@ import kotlinx.coroutines.MainScope  import kotlinx.coroutines.launch  import retrofit2.Call  import retrofit2.Response +import java.util.*  class ChatActivityConversation : AppCompatActivity() { @@ -78,6 +79,9 @@ class ChatActivityConversation : AppCompatActivity() {                                      if(response.isSuccessful()){                                          //zahtev da se posalje poruka                                          var responseMessage=response.body() +                                        var cal: Calendar = Calendar.getInstance() +                                        cal.time=responseMessage?.timestamp +                                        responseMessage?.usableTimeStamp=cal                                          dbConnection?.addMessage(responseMessage!!)                                          requestMessages()                                          binding.etNewMessage.text?.clear() @@ -115,6 +119,9 @@ class ChatActivityConversation : AppCompatActivity() {                          if(response.isSuccessful()){                              //zahtev da se posalje poruka                              var responseMessage=response.body() +                            var cal: Calendar = Calendar.getInstance() +                            cal.time=responseMessage?.timestamp +                            responseMessage?.usableTimeStamp=cal                              dbConnection?.addMessage(responseMessage!!)                              requestMessages()                              binding.etNewMessage.text?.clear() diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Adapters/ChatMessagesAdapter.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Adapters/ChatMessagesAdapter.kt index 45ffbf0..403b736 100644 --- a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Adapters/ChatMessagesAdapter.kt +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Adapters/ChatMessagesAdapter.kt @@ -2,6 +2,7 @@ package com.example.brzodolokacije.Adapters  import android.app.Activity  import android.view.LayoutInflater +import android.view.View  import android.view.ViewGroup  import androidx.recyclerview.widget.RecyclerView  import com.auth0.android.jwt.JWT @@ -9,6 +10,7 @@ import com.example.brzodolokacije.Models.Message  import com.example.brzodolokacije.Services.SharedPreferencesHelper  import com.example.brzodolokacije.databinding.ChatMessageBinding  import com.example.brzodolokacije.databinding.ChatMessageOtherBinding +import java.util.*  class ChatMessagesAdapter (val items : MutableList<Message>, val activity:Activity)      : RecyclerView.Adapter<RecyclerView.ViewHolder>(){ @@ -49,6 +51,17 @@ class ChatMessagesAdapter (val items : MutableList<Message>, val activity:Activi          fun bind(item : Message){              bindingOther?.apply {                  tvMessage?.text=item.messagge +                tvTimestamp.text=item.usableTimeStamp.get(Calendar.HOUR_OF_DAY).toString() + ":" + item.usableTimeStamp.get(Calendar.MINUTE).toString() +                if(layoutPosition==0 || isDifferentDays(items[layoutPosition].usableTimeStamp,items[layoutPosition-1].usableTimeStamp)){ + +                    tvDate.text=item.usableTimeStamp.get(Calendar.DAY_OF_MONTH).toString()+"/"+ +                            (item.usableTimeStamp.get(Calendar.MONTH)+1).toString()+"/"+ +                            item.usableTimeStamp.get(Calendar.YEAR).toString() +                } +                else{ +                    tvDate.visibility= View.GONE +                    tvDate.forceLayout() +                }              }          }      } @@ -56,10 +69,31 @@ class ChatMessagesAdapter (val items : MutableList<Message>, val activity:Activi          fun bind(item : Message){              binding?.apply {                  tvMessage.text=item.messagge +                tvTimestamp.text=item.usableTimeStamp.get(Calendar.HOUR_OF_DAY).toString() + ":" + item.usableTimeStamp.get(Calendar.MINUTE).toString() +                if(layoutPosition==0 || isDifferentDays(items[layoutPosition].usableTimeStamp,items[layoutPosition-1].usableTimeStamp)){ + +                    tvDate.text=item.usableTimeStamp.get(Calendar.DAY_OF_MONTH).toString()+"/"+ +                            (item.usableTimeStamp.get(Calendar.MONTH)+1).toString()+"/"+ +                            item.usableTimeStamp.get(Calendar.YEAR).toString() +                } +                else{ +                    tvDate.visibility= View.GONE +                    tvDate.forceLayout() +                }              }          }      } +    fun isDifferentDays(c1:Calendar,c2:Calendar):Boolean{ +        if(c1.get(Calendar.DAY_OF_YEAR)!=c2.get(Calendar.DAY_OF_YEAR)){ +            return true +        } +        else if(c1.get(Calendar.YEAR)!=c2.get(Calendar.YEAR)){ +            return true +        } +        return false +    } +      override fun getItemViewType(position: Int): Int {          var sender=items.get(position).senderId diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentUserPostsProfileActivity.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentUserPostsProfileActivity.kt new file mode 100644 index 0000000..d841430 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentUserPostsProfileActivity.kt @@ -0,0 +1,64 @@ +package com.example.brzodolokacije.Fragments + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.fragment.app.Fragment +import androidx.recyclerview.widget.GridLayoutManager +import androidx.recyclerview.widget.LinearLayoutManager +import androidx.recyclerview.widget.RecyclerView +import com.example.brzodolokacije.Adapters.MyPostsAdapter +import com.example.brzodolokacije.Adapters.ShowPostsHomePageAdapter +import com.example.brzodolokacije.Models.PostPreview +import com.example.brzodolokacije.R +import com.example.brzodolokacije.Services.RetrofitHelper +import com.example.brzodolokacije.Services.SharedPreferencesHelper +import retrofit2.Call +import retrofit2.Callback +import retrofit2.Response + + +class FragmentUserPostsProfileActivity : Fragment() { +    private lateinit var recyclerView: RecyclerView +    override fun onCreateView( +        inflater: LayoutInflater, container: ViewGroup?, +        savedInstanceState: Bundle? +    ): View? { +        // Inflate the layout for this fragment +        var view =inflater.inflate(R.layout.fragment_user_posts_profile_activity, container, false) + +        recyclerView=view.findViewById(R.id.rvFragmentUserPostsProfileActivity) + +        val bundle = arguments +        val userId = bundle!!.getString("userId") + +        val api = RetrofitHelper.getInstance() +        val token = SharedPreferencesHelper.getValue("jwt", requireActivity()) +        var data = api.getUsersPosts("Bearer " + token, userId!!); +        data.enqueue(object : Callback<MutableList<PostPreview>> { +            override fun onResponse( +                call: Call<MutableList<PostPreview>>, +                response: Response<MutableList<PostPreview>> +            ) { +                if (response.body() == null) { +                    return +                } +                var posts = response.body()!!.toMutableList<PostPreview>() +                recyclerView.apply { +                    layoutManager= GridLayoutManager(requireContext(),3, +                        GridLayoutManager.VERTICAL,false) +                    adapter= MyPostsAdapter(requireActivity(),posts) +                } +            } + +            override fun onFailure(call: Call<MutableList<PostPreview>>, t: Throwable) { +            } +        }) + + +        return view +    } + + +}
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Interfaces/IBackendApi.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Interfaces/IBackendApi.kt index f2ca608..f753f43 100644 --- a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Interfaces/IBackendApi.kt +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Interfaces/IBackendApi.kt @@ -104,4 +104,6 @@ interface IBackendApi {      @GET("/api/user/{id}/unfollow")      fun unfollow(@Header("Authorization") authHeader:String,@Path("id") id:String):Call<Boolean> +    @GET("api/Post/posts/{id}/getUserPosts") +    fun getUsersPosts(@Header("Authorization") authHeader:String,@Path("id") id:String):Call<MutableList<PostPreview>>  }
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Models/Chat.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Models/Chat.kt index 3404541..6725c15 100644 --- a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Models/Chat.kt +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Models/Chat.kt @@ -18,7 +18,8 @@ data class Message(      var senderId: String,      var receiverId: String,      var messagge: String, -    var timestamp: Date +    var timestamp: Date, +    var usableTimeStamp:Calendar  )  data class ChatPreview( diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/chat/DBHelper.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/chat/DBHelper.kt index 191df3c..74e30bd 100644 --- a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/chat/DBHelper.kt +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/chat/DBHelper.kt @@ -41,7 +41,7 @@ class DBHelper :          if(!doesTableExist(CONTACTS_TABLE_NAME,db)){              var sql:String="CREATE TABLE "+ CONTACTS_TABLE_NAME+" (" +                      "userId " +"TEXT PRIMARY KEY,"+ -                    "read " +"INT"+ +                    "read " +"INTEGER"+                      ")"              db?.execSQL(sql)          } @@ -51,7 +51,7 @@ class DBHelper :                      "senderId " +"TEXT,"+                      "receiverId "+"TEXT,"+                      "messagge " +"TEXT,"+ -                    "timestamp "+"TEXT"+ +                    "timestamp "+"INTEGER"+                      ")"              db?.execSQL(sql)          } @@ -88,8 +88,8 @@ class DBHelper :              var sql="INSERT INTO "+ MESSAGES_TABLE_NAME+"(_id,senderId,receiverid,messagge,timestamp) VALUES('"+message._id+"','"+                      message.senderId+"','"+                      message.receiverId+"','"+ -                    message.messagge+ "','"+ -                    message.timestamp+ "')" +                    message.messagge+ "',"+ +                    message.usableTimeStamp.timeInMillis+")"              db?.execSQL(sql)              if(sent)                  sql="SELECT * FROM "+ CONTACTS_TABLE_NAME+" WHERE userId='"+message.receiverId+"'" @@ -111,9 +111,9 @@ class DBHelper :          onCreate(db)          var sql:String          if(!self) -            sql="SELECT * FROM "+ MESSAGES_TABLE_NAME+" WHERE senderId='"+userId+"' OR receiverId='"+userId+"'" +            sql="SELECT * FROM "+ MESSAGES_TABLE_NAME+" WHERE senderId='"+userId+"' OR receiverId='"+userId+"' ORDER BY timestamp ASC"          else -            sql="SELECT * FROM "+ MESSAGES_TABLE_NAME+" WHERE senderId='"+userId+"' AND receiverId='"+userId+"'" +            sql="SELECT * FROM "+ MESSAGES_TABLE_NAME+" WHERE senderId='"+userId+"' AND receiverId='"+userId+"' ORDER BY timestamp ASC"          var cursor=db?.rawQuery(sql,null)          if(cursor?.count!! >0){              var messagesList:MutableList<Message> =mutableListOf() @@ -123,17 +123,20 @@ class DBHelper :              var messageIndex=cursor.getColumnIndexOrThrow("messagge")              var timestampIndex=cursor.getColumnIndexOrThrow("timestamp")              while(cursor.moveToNext()){ +                var cal:Calendar= Calendar.getInstance() +                cal.timeInMillis=cursor.getLong(timestampIndex)                  messagesList.add(                      Message(                          cursor.getString(idIndex),                          cursor.getString(senderIdIndex),                          cursor.getString(receiverIdIndex),                          cursor.getString(messageIndex), -                        Date() +                        cal.time, +                        cal                          )                      ) +                Log.d("main",cal.time.toString())              } -            Log.d("main",messagesList.size.toString())              return messagesList          }          return null diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/chat/SignalRListener.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/chat/SignalRListener.kt index 4b16f25..39689c7 100644 --- a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/chat/SignalRListener.kt +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/chat/SignalRListener.kt @@ -14,6 +14,7 @@ import com.microsoft.signalr.Action1  import com.microsoft.signalr.HubConnection  import com.microsoft.signalr.HubConnectionBuilder  import com.microsoft.signalr.HubConnectionState +import java.util.*  class SignalRListener private constructor(val activity: Activity){ @@ -62,8 +63,10 @@ class SignalRListener private constructor(val activity: Activity){      }      fun addToDbAndloadMessageIfInChat(message:MessageReceive,activity: Activity){ +        var cal:Calendar= Calendar.getInstance() +        cal.time=message.timestamp          dbHelper.addMessage(Message(message.senderId+message.timestamp,message.senderId, -        JWT(SharedPreferencesHelper.getValue("jwt",activity)!!).claims["id"]?.asString()!!,message.messagge,message.timestamp),false) +        JWT(SharedPreferencesHelper.getValue("jwt",activity)!!).claims["id"]?.asString()!!,message.messagge,message.timestamp,cal),false)          if(activity is ChatActivity){              if(activity.clickedChat?.userId==message.senderId){                  activity.clickedChat?.requestMessages() diff --git a/Client/BrzoDoLokacije/app/src/main/res/layout/activity_user_profile.xml b/Client/BrzoDoLokacije/app/src/main/res/layout/activity_user_profile.xml index 0e90fc7..bb917cf 100644 --- a/Client/BrzoDoLokacije/app/src/main/res/layout/activity_user_profile.xml +++ b/Client/BrzoDoLokacije/app/src/main/res/layout/activity_user_profile.xml @@ -128,7 +128,7 @@              app:layout_constraintHorizontal_bias="0.0"              app:layout_constraintStart_toStartOf="parent"              app:layout_constraintTop_toTopOf="@+id/divider" -            app:layout_constraintVertical_bias="1.0"></FrameLayout> +            app:layout_constraintVertical_bias="0.0"></FrameLayout>          <TableLayout diff --git a/Client/BrzoDoLokacije/app/src/main/res/layout/chat_message.xml b/Client/BrzoDoLokacije/app/src/main/res/layout/chat_message.xml index 2342779..a5f4a34 100644 --- a/Client/BrzoDoLokacije/app/src/main/res/layout/chat_message.xml +++ b/Client/BrzoDoLokacije/app/src/main/res/layout/chat_message.xml @@ -1,26 +1,69 @@  <?xml version="1.0" encoding="utf-8"?>  <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" -    android:layout_width="wrap_content" -    android:layout_height="wrap_content"      xmlns:app="http://schemas.android.com/apk/res-auto" -    android:background="@drawable/rounded_cyan_button" -    android:clipToOutline="true" -    android:id="@+id/clMessage" -    android:layout_margin="@dimen/text_padding" -    android:layout_gravity="end"> +    android:layout_width="match_parent" +    android:layout_height="wrap_content" +    android:layout_marginEnd="8dp" +    android:layout_marginTop="16dp"> + +    <TextView +        android:id="@+id/tvDate" +        android:layout_width="wrap_content" +        android:layout_height="wrap_content" +        android:layout_marginTop="32dp" +        android:paddingStart="8dp" +        android:paddingTop="4dp" +        android:paddingEnd="8dp" +        android:paddingBottom="4dp" +        android:text="June 10" +        android:textColor="#C0C0C0" +        app:layout_constraintEnd_toEndOf="parent" +        app:layout_constraintStart_toStartOf="parent" +        app:layout_constraintTop_toTopOf="parent" /> +      <androidx.cardview.widget.CardView +        android:id="@+id/cvContainer"          android:layout_width="wrap_content"          android:layout_height="wrap_content" +        app:cardBackgroundColor="@color/dark_blue_transparent" +        app:cardCornerRadius="12dp" +        app:cardElevation="0dp" +        app:cardPreventCornerOverlap="false" +        app:cardUseCompatPadding="true"          app:layout_constraintEnd_toEndOf="parent" -        app:cardBackgroundColor="@color/cardview_dark_background"> +        app:layout_constraintTop_toBottomOf="@id/tvDate"> -        <TextView +        <LinearLayout +            android:id="@+id/llContainer"              android:layout_width="wrap_content"              android:layout_height="wrap_content" -            android:textColor="@color/white" -            android:id="@+id/tvMessage" -            android:text="blabla" -            android:padding="@dimen/component_padding"/> +            android:orientation="vertical"> + +            <TextView +                android:id="@+id/tvMessage" +                android:layout_width="wrap_content" +                android:layout_height="wrap_content" +                android:layout_marginBottom="8dp" +                android:maxWidth="260dp" +                android:paddingLeft="12dp" +                android:paddingTop="8dp" +                android:paddingRight="12dp" +                android:text="This is a Message" +                android:textColor="#ffffff" +                android:textSize="16sp" /> +        </LinearLayout> +      </androidx.cardview.widget.CardView> +    <TextView +        android:id="@+id/tvTimestamp" +        android:layout_width="wrap_content" +        android:layout_height="wrap_content" +        android:text="10:00" +        android:textColor="#C0C0C0" +        android:textSize="10sp" +        app:layout_constraintBottom_toBottomOf="@+id/cvContainer" +        app:layout_constraintEnd_toStartOf="@+id/cvContainer" /> + +  </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/res/layout/chat_message_other.xml b/Client/BrzoDoLokacije/app/src/main/res/layout/chat_message_other.xml index 647127c..016852e 100644 --- a/Client/BrzoDoLokacije/app/src/main/res/layout/chat_message_other.xml +++ b/Client/BrzoDoLokacije/app/src/main/res/layout/chat_message_other.xml @@ -1,23 +1,69 @@  <?xml version="1.0" encoding="utf-8"?>  <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" -    android:layout_width="wrap_content" -    android:layout_height="wrap_content"      xmlns:app="http://schemas.android.com/apk/res-auto" -    android:background="@drawable/rounded_cyan_button" -    android:id="@+id/clMessage" -    android:layout_margin="@dimen/text_padding" -    android:clipToOutline="true"> +    android:layout_width="match_parent" +    android:layout_height="wrap_content" +    android:layout_marginStart="8dp" +    android:layout_marginTop="16dp"> + +    <TextView +        android:id="@+id/tvDate" +        android:layout_width="wrap_content" +        android:layout_height="wrap_content" +        android:layout_marginTop="32dp" +        android:paddingStart="8dp" +        android:paddingTop="4dp" +        android:paddingEnd="8dp" +        android:paddingBottom="4dp" +        android:text="June 10" +        android:textColor="#C0C0C0" +        app:layout_constraintEnd_toEndOf="parent" +        app:layout_constraintStart_toStartOf="parent" +        app:layout_constraintTop_toTopOf="parent" />      <androidx.cardview.widget.CardView +        android:id="@+id/cvContainer"          android:layout_width="wrap_content"          android:layout_height="wrap_content" -        app:cardBackgroundColor="@color/dark_blue_transparent"> +        app:cardBackgroundColor="#eef1f6" +        app:cardCornerRadius="12dp" +        app:cardElevation="0dp" +        app:cardPreventCornerOverlap="false" +        app:cardUseCompatPadding="true" +        app:layout_constraintTop_toBottomOf="@+id/tvDate"> + +        <LinearLayout +            android:id="@+id/llContainer" +            android:layout_width="wrap_content" +            android:layout_height="wrap_content" +            android:orientation="vertical"> + +            <TextView +                android:id="@+id/tvMessage" +                android:layout_width="wrap_content" +                android:layout_height="wrap_content" +                android:layout_marginBottom="8dp" +                android:maxWidth="260dp" +                android:paddingLeft="12dp" +                android:paddingTop="8dp" +                android:paddingRight="12dp" +                android:text="Message" +                android:textColor="#000000" +                android:textSize="16sp" /> +        </LinearLayout> + +    </androidx.cardview.widget.CardView> + +      <TextView +        android:id="@+id/tvTimestamp"          android:layout_width="wrap_content"          android:layout_height="wrap_content" -        android:textColor="@color/white" -        android:id="@+id/tvMessage" -        android:text="blabla" -        android:padding="@dimen/component_padding"/> -    </androidx.cardview.widget.CardView> +        android:text="8:00" +        android:textColor="#C0C0C0" +        android:textSize="10sp" +        app:layout_constraintBottom_toBottomOf="@+id/cvContainer" +        app:layout_constraintStart_toEndOf="@+id/cvContainer" /> + +  </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_user_posts_profile_activity.xml b/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_user_posts_profile_activity.xml new file mode 100644 index 0000000..2c5012e --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_user_posts_profile_activity.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" +    xmlns:tools="http://schemas.android.com/tools" +    android:layout_width="match_parent" +    android:layout_height="match_parent" +    tools:context=".Fragments.FragmentUserPostsProfileActivity"> + +    <!-- TODO: Update blank fragment layout --> +    <TextView +        android:layout_width="match_parent" +        android:layout_height="match_parent" /> + +    <androidx.recyclerview.widget.RecyclerView +        android:id="@+id/rvFragmentUserPostsProfileActivity" +        android:layout_width="match_parent" +        android:layout_height="match_parent" /> + +</FrameLayout>
\ No newline at end of file  | 
