diff options
11 files changed, 424 insertions, 106 deletions
diff --git a/Backend/Api/Api/Services/UserService.cs b/Backend/Api/Api/Services/UserService.cs index cc75533..d95b5eb 100644 --- a/Backend/Api/Api/Services/UserService.cs +++ b/Backend/Api/Api/Services/UserService.cs @@ -395,11 +395,17 @@ namespace Api.Services          public async Task<Boolean> AddFollower(string followerId)          { +                          string id = null;              if (_httpContext.HttpContext.User.FindFirstValue("id") != null)              {                  id = _httpContext.HttpContext.User.FindFirstValue("id").ToString();              } + +            if (followerId == id)  +            { +                return false; +            }              User f = await _users.Find(user => user._id == followerId).FirstOrDefaultAsync();              User u = await _users.Find(user => user._id == id).FirstOrDefaultAsync(); @@ -413,7 +419,8 @@ namespace Api.Services                  f.followers.Add(id);                  f.followersCount =f.followers.Count(); -                 +                _users.ReplaceOne(user => user._id == followerId, f); +                  if (u.following == null)                  {                      u.following = new List<string>(); @@ -423,7 +430,7 @@ namespace Api.Services                  u.followingCount =u.following.Count();                  _users.ReplaceOne(user=>user._id==id, u); -                _users.ReplaceOne(user => user._id == followerId, f); +                                 // updateUserFollowerFollowingCount(u.followers, u.following, u._id);                  //updateUserFollowerFollowingCount(f.followers, f.following, f._id); @@ -452,9 +459,12 @@ namespace Api.Services                              continue;                          }                          UserSend follower = new UserSend(); +                        follower.creationDate = utemp.creationDate; +                        follower.name = utemp.name;                                                  follower.pfp = utemp.pfp;                          follower.username = utemp.username;                          follower.email = utemp.username; +                        follower.following = utemp.following;                          follower.followers = utemp.followers;                          follower._id = utemp._id; @@ -484,9 +494,12 @@ namespace Api.Services                              continue;                          }                          UserSend follower = new UserSend(); +                        follower.creationDate = utemp.creationDate; +                        follower.name = utemp.name;                          follower.pfp = utemp.pfp;                          follower.username = utemp.username;                          follower.email = utemp.username; +                        follower.following = utemp.following;                          follower.followers = utemp.followers;                          follower._id = utemp._id; diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/ActivityShowFollowersAndFollowing.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/ActivityShowFollowersAndFollowing.kt index 845021e..fe0d546 100644 --- a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/ActivityShowFollowersAndFollowing.kt +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/ActivityShowFollowersAndFollowing.kt @@ -1,39 +1,110 @@  package com.example.brzodolokacije.Activities +import android.content.Intent  import androidx.appcompat.app.AppCompatActivity  import android.os.Bundle -import android.widget.Button -import android.widget.FrameLayout +import android.widget.*  import androidx.fragment.app.FragmentTransaction -import com.example.brzodolokacije.Fragments.FragmentFollowers -import com.example.brzodolokacije.Fragments.FragmentFollowing -import com.example.brzodolokacije.Fragments.FragmentRegister +import com.example.brzodolokacije.Fragments.* +import com.example.brzodolokacije.Models.UserReceive  import com.example.brzodolokacije.R +import com.example.brzodolokacije.Services.RetrofitHelper +import com.example.brzodolokacije.Services.SharedPreferencesHelper +import com.google.gson.Gson +import kotlinx.android.synthetic.main.list_item.* +import retrofit2.Call +import retrofit2.Response  class ActivityShowFollowersAndFollowing : AppCompatActivity() { -    private lateinit var showFollowers:Button -    private lateinit var showFollowing:Button +   // private lateinit var showFollowers:Button +    //private lateinit var showFollowing:Button      private lateinit var fragmentContainer:FrameLayout +    private lateinit var followersOrFollowing:String +    private lateinit var userId:String +    private lateinit var text:TextView +    private lateinit var back: ImageView +      override fun onCreate(savedInstanceState: Bundle?) {          super.onCreate(savedInstanceState)          setContentView(R.layout.activity_show_followers_and_following) +        val bundle = intent.extras +        if (bundle != null){ +            userId= bundle.getString("userId").toString().trim() +            followersOrFollowing=bundle.get("show").toString().trim() +        } + +        fragmentContainer=findViewById(R.id.flActivityShowFollowerAndFollowing) +        text=findViewById(R.id.tvActivityShowFollowersOrFollowingShow) +        back=findViewById(R.id.btnActivityShowFollowersAndFollowingBackToUser) + +        if(followersOrFollowing=="followers"){ +            text.text="Pratioci" +            val mFragmentManager = supportFragmentManager +            val mFragmentTransaction = mFragmentManager.beginTransaction() +            val mFragment = FragmentUserFollowers() +            val mBundle = Bundle() +            mBundle.putString("userId",userId) +            mFragment.arguments = mBundle +            mFragmentTransaction.replace(R.id.flActivityShowFollowerAndFollowing, mFragment).commit() +        } + +        if(followersOrFollowing=="following"){ +            text.text="Praćenja" +            val mFragmentManager = supportFragmentManager +            val mFragmentTransaction = mFragmentManager.beginTransaction() +            val mFragment = FragmentUserFollowing() +            val mBundle = Bundle() +            mBundle.putString("userId",userId) +            mFragment.arguments = mBundle +            mFragmentTransaction.replace(R.id.flActivityShowFollowerAndFollowing, mFragment).commit() +        } + +        back.setOnClickListener { +            var token= SharedPreferencesHelper.getValue("jwt", this).toString() +            val api= RetrofitHelper.getInstance() +            val request= api.getProfileFromId("Bearer " + token, userId) +            request.enqueue(object : retrofit2.Callback<UserReceive>  { +                override fun onResponse(call: Call<UserReceive>, +                                        response: Response<UserReceive> +                ) { +                    if (response.body() == null) { +                        return +                    } +                    var userData = response.body()!! +                    val intent: Intent = Intent(this@ActivityShowFollowersAndFollowing,ActivityUserProfile::class.java) +                    var b= Bundle() +                    intent.putExtra("user", Gson().toJson(userData)) +                    startActivity(intent) +                } + +                override fun onFailure(call: Call<UserReceive>, t: Throwable) { + +                } +            }) + +        } + + +/*          showFollowers=findViewById(R.id.btnActivityShowFollowersAndFollowingShowFollowers)          showFollowing=findViewById(R.id.btnActivityShowFollowersAndFollowingShowFollowing)          fragmentContainer=findViewById(R.id.flActivityShowFollowerAndFollowing)          showFollowers.setOnClickListener { +            followersOrFollowing="followers"              var fm: FragmentTransaction =supportFragmentManager.beginTransaction() -            fm.replace(R.id.flActivityShowFollowerAndFollowing, FragmentFollowers()) +            fm.replace(R.id.flActivityShowFollowerAndFollowing, FragmentUserFollowers())              fm.commit()          }          showFollowing.setOnClickListener { +            followersOrFollowing="following"              var fm: FragmentTransaction =supportFragmentManager.beginTransaction() -            fm.replace(R.id.flActivityShowFollowerAndFollowing, FragmentFollowing()) +            fm.replace(R.id.flActivityShowFollowerAndFollowing, FragmentUserFollowing())              fm.commit()          } - +*/      }  }
\ No newline at end of file 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 5119da9..61a5db1 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 @@ -1,6 +1,7 @@  package com.example.brzodolokacije.Activities  import android.annotation.SuppressLint +import android.content.Intent  import android.os.Bundle  import android.util.Log  import android.widget.* @@ -34,6 +35,9 @@ class ActivityUserProfile : AppCompatActivity() {      private lateinit var openChat:ImageButton      private lateinit var unfollowUser:Button +    private lateinit var showFollowers:Button +    private lateinit var showFollowing:Button +      private var follow:Boolean=false      override fun onCreate(savedInstanceState: Bundle?) { @@ -50,6 +54,8 @@ class ActivityUserProfile : AppCompatActivity() {          showUserPosts=findViewById(id.btnActivityUserProfileShowPosts)          fragmentContainer=findViewById(id.flActivityProfileFragmentContainer)          openChat=findViewById(id.activityUserProfileOpenChat) +        showFollowing=findViewById(id.tvActivityUserProfileFollow) +        showFollowers=findViewById(R.id.tvActivityUserProfileFollowers)          val jsonMyObject: String          val extras = intent.extras @@ -65,7 +71,7 @@ class ActivityUserProfile : AppCompatActivity() {              followingNumber.text=userObject?.followingCount.toString()              if(userObject.pfp!=null) { -                Glide.with(this) +                Glide.with(this@ActivityUserProfile)                      .load(RetrofitHelper.baseUrl + "/api/post/image/" + userObject.pfp!!._id)                      .circleCrop()//Round image                      .into(profilePicture) @@ -91,6 +97,7 @@ class ActivityUserProfile : AppCompatActivity() {                          followUser.isVisible=false                          followUser.isClickable=false                          followUser.isEnabled=false +                          updateUserData()                          Toast.makeText( @@ -107,35 +114,53 @@ class ActivityUserProfile : AppCompatActivity() {          }          unfollowUser.setOnClickListener { -                val api = RetrofitHelper.getInstance() -                val token = SharedPreferencesHelper.getValue("jwt", this@ActivityUserProfile) -                var data = api.unfollow("Bearer " + token, userObject._id); -                data.enqueue(object : Callback<Boolean> { -                    override fun onResponse( -                        call: Call<Boolean>, -                        response: Response<Boolean> -                    ) { -                        unfollowUser.isVisible=false -                        unfollowUser.isClickable=false -                        unfollowUser.isEnabled=false -                        followUser.isVisible=true -                        followUser.isClickable=true -                        followUser.isEnabled=true -                        updateUserData() -                        Toast.makeText( -                            this@ActivityUserProfile, "VIŠE NE PRATITE KORISNIKA", Toast.LENGTH_LONG -                        ).show(); -                    } +            val api = RetrofitHelper.getInstance() +            val token = SharedPreferencesHelper.getValue("jwt", this@ActivityUserProfile) +            var data = api.unfollow("Bearer " + token, userObject._id); +            data.enqueue(object : Callback<Boolean> { +                override fun onResponse( +                    call: Call<Boolean>, +                    response: Response<Boolean> +                ) { +                    unfollowUser.isVisible = false +                    unfollowUser.isClickable = false +                    unfollowUser.isEnabled = false +                    followUser.isVisible = true +                    followUser.isClickable = true +                    followUser.isEnabled = true +                    updateUserData() +                    Toast.makeText( +                        this@ActivityUserProfile, "VIŠE NE PRATITE KORISNIKA", Toast.LENGTH_LONG +                    ).show(); +                } -                    override fun onFailure(call: Call<Boolean>, t: Throwable) { -                        Toast.makeText( -                            this@ActivityUserProfile, t.toString(), Toast.LENGTH_LONG -                        ).show(); -                    } -                }) +                override fun onFailure(call: Call<Boolean>, t: Throwable) { +                    Toast.makeText( +                        this@ActivityUserProfile, t.toString(), Toast.LENGTH_LONG +                    ).show(); +                } +            }) +        } +            showFollowers.setOnClickListener { +                val bundle = Bundle() +                bundle.putString("userId", userObject._id.toString()) +                bundle.putString("show","followers") +                val intent = Intent(this@ActivityUserProfile,ActivityShowFollowersAndFollowing::class.java) +                intent.putExtras(bundle) +                startActivity(intent) + +            } + +            showFollowing.setOnClickListener { +                val bundle = Bundle() +                bundle.putString("userId", userObject._id.toString()) +                bundle.putString("show","following") +                val intent = Intent(this@ActivityUserProfile,ActivityShowFollowersAndFollowing::class.java) +                intent.putExtras(bundle) +                startActivity(intent) +            } -        }          showUserPosts.setOnClickListener {              var fm: FragmentTransaction =supportFragmentManager.beginTransaction() @@ -212,6 +237,7 @@ class ActivityUserProfile : AppCompatActivity() {                  response: Response<UserReceive>              ) {                  var userData=response.body()!! +                  name.text=userData.name                  postsNumber.text=userData.postNumber.toString()                  followersNumber.text=userData.followersCount.toString() diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Adapters/FollowersAdapter.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Adapters/FollowersAdapter.kt index e439d0e..5381ebc 100644 --- a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Adapters/FollowersAdapter.kt +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Adapters/FollowersAdapter.kt @@ -33,10 +33,10 @@ class FollowersAdapter (var followers:MutableList<UserReceive>, val activity: Ac          inner class FollowerViewHolder(view: View): RecyclerView.ViewHolder(view){              private val name: TextView =view.findViewById(R.id.tvFollowerItemName) -            private val username:TextView=view.findViewById(R.id.tvFolloewItemUsername) +            private val username:TextView=view.findViewById(R.id.tvFollowerItemUsername)              fun bindView(follower: UserReceive){                  name.text=follower.name -                username.text=follower.username +                username.text="@"+follower.username              }          }  }
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentUserFollowers.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentUserFollowers.kt new file mode 100644 index 0000000..09920dc --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentUserFollowers.kt @@ -0,0 +1,71 @@ +package com.example.brzodolokacije.Fragments + +import android.os.Bundle +import android.util.Log +import androidx.fragment.app.Fragment +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.recyclerview.widget.LinearLayoutManager +import androidx.recyclerview.widget.RecyclerView +import com.example.brzodolokacije.Adapters.FollowersAdapter +import com.example.brzodolokacije.Adapters.ShowPostsHomePageAdapter +import com.example.brzodolokacije.Models.PostPreview +import com.example.brzodolokacije.Models.UserReceive +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 FragmentUserFollowers : Fragment() { + +    private lateinit var followers:MutableList<UserReceive> +    private lateinit var rvFollowers:RecyclerView +    private lateinit var userId:String +    override fun onCreateView( +        inflater: LayoutInflater, container: ViewGroup?, +        savedInstanceState: Bundle? +    ): View? { +        // Inflate the layout for this fragment +        var view=inflater.inflate(R.layout.fragment_user_followers, container, false) + +        val bundle = arguments +        userId = bundle!!.getString("userId").toString() + +        rvFollowers=view.findViewById(R.id.rvFragmentUserFollowers) + +        getFollowers() + +        return view +    } + +    fun getFollowers(){ +        val api = RetrofitHelper.getInstance() +        val token= SharedPreferencesHelper.getValue("jwt", requireActivity()) +        val data=api.getFollowers("Bearer "+token,userId) + +        data.enqueue(object : Callback<MutableList<UserReceive>> { + +            override fun onResponse( +                call: Call<MutableList<UserReceive>>, +                response: Response<MutableList<UserReceive>> +            ) { +                if (response.body() == null) { +                    return +                } +                followers = response.body()!!.toMutableList<UserReceive>() +                rvFollowers.apply { +                    layoutManager= LinearLayoutManager(activity, LinearLayoutManager.HORIZONTAL,false) +                    adapter= FollowersAdapter(followers,requireActivity()) + +                } +            } +            override fun onFailure(call: Call<MutableList<UserReceive>>, t: Throwable) { +                Log.d("Followers","Faillllllllllllllllllllllllll") +                Log.d("Followers",t.toString()) +            } +        }) +    } +}
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentUserFollowing.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentUserFollowing.kt new file mode 100644 index 0000000..0f6323f --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentUserFollowing.kt @@ -0,0 +1,65 @@ +package com.example.brzodolokacije.Fragments + +import android.os.Bundle +import android.util.Log +import androidx.fragment.app.Fragment +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.recyclerview.widget.LinearLayoutManager +import androidx.recyclerview.widget.RecyclerView +import com.example.brzodolokacije.Adapters.FollowersAdapter +import com.example.brzodolokacije.Models.UserReceive +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 FragmentUserFollowing : Fragment() { + +    private lateinit var following:MutableList<UserReceive> +    private lateinit var rvFollowing: RecyclerView +    private lateinit var userId:String + + +    override fun onCreateView( +        inflater: LayoutInflater, container: ViewGroup?, +        savedInstanceState: Bundle? +    ): View? { +        // Inflate the layout for this fragment +        var view=inflater.inflate(R.layout.fragment_user_following, container, false) +        val bundle = arguments +        userId = bundle!!.getString("userId").toString() +        rvFollowing=view.findViewById(R.id.rvFragmentUserFollowing) + +        getFollowing() + +        return view +    } + +    fun getFollowing(){ +        val api = RetrofitHelper.getInstance() +        val token= SharedPreferencesHelper.getValue("jwt", requireActivity()) +        val data=api.getFollowing("Bearer "+token,userId) +        data.enqueue(object : Callback<MutableList<UserReceive>> { +            override fun onResponse(call: Call<MutableList<UserReceive>>, response: Response<MutableList<UserReceive>>) { +                if (response.body() == null) { +                    return +                } +                Log.d("Following","Sucesssssssssssssssssssssssssssssss") +                following = response.body()!!.toMutableList<UserReceive>() +                rvFollowing.apply { +                    layoutManager= LinearLayoutManager(activity, LinearLayoutManager.HORIZONTAL,false) +                    adapter= FollowersAdapter(following,requireActivity()) +                } +            } +            override fun onFailure(call: Call<MutableList<UserReceive>>, t: Throwable) { +                Log.d("Following","Faillllllllllllllllllllllllll") +            } +        }) +    } + +}
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/res/layout/activity_show_followers_and_following.xml b/Client/BrzoDoLokacije/app/src/main/res/layout/activity_show_followers_and_following.xml index 18c519b..7ee4cbe 100644 --- a/Client/BrzoDoLokacije/app/src/main/res/layout/activity_show_followers_and_following.xml +++ b/Client/BrzoDoLokacije/app/src/main/res/layout/activity_show_followers_and_following.xml @@ -2,67 +2,82 @@  <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"      xmlns:app="http://schemas.android.com/apk/res-auto"      xmlns:tools="http://schemas.android.com/tools" + +    android:padding="16dp"      android:layout_width="match_parent"      android:layout_height="match_parent"      tools:context=".Activities.ActivityShowFollowersAndFollowing"> -     <Button -        android:id="@+id/btnActivityShowFollowersAndFollowingBackToUser" -        android:layout_width="wrap_content" -        android:layout_height="wrap_content" -        android:drawableLeft="@drawable/ic_baseline_arrow_back" -        android:text="Korisnik" +    <!-- +       <View +           android:id="@+id/divider" +           android:layout_width="409dp" +           android:layout_height="1dp" +           android:layout_marginTop="4dp" +           android:background="?android:attr/listDivider" +           app:layout_constraintEnd_toEndOf="parent" +           app:layout_constraintHorizontal_bias="1.0" +           app:layout_constraintStart_toStartOf="parent" +           app:layout_constraintTop_toBottomOf="@+id/btnActivityShowFollowersAndwingShowFollowers" /> -        android:textAllCaps="false" -        app:layout_constraintStart_toStartOf="parent" -        app:layout_constraintTop_toTopOf="parent" /> +           <Button +               android:id="@+id/btnActivityShowFollowersAndFollowingShowFollowers" +               android:layout_width="wrap_content" +               android:layout_height="wrap_content" +               android:layout_marginStart="16dp" +               android:backgroundTint="#FFFFFF" +               android:stateListAnimator="@null" +               android:text="Pratioci" +               android:textColor="@color/cardview_dark_background" +               app:layout_constraintStart_toStartOf="parent" +               app:layout_constraintTop_toBottomOf="@+id/btnActiShowFollowersAndFollowingBackToUser" /> -    <View -        android:id="@+id/divider" -        android:layout_width="409dp" -        android:layout_height="1dp" -        android:layout_marginTop="4dp" -        android:background="?android:attr/listDivider" -        app:layout_constraintEnd_toEndOf="parent" -        app:layout_constraintHorizontal_bias="1.0" -        app:layout_constraintStart_toStartOf="parent" -        app:layout_constraintTop_toBottomOf="@+id/btnActivityShowFollowersAndFollowingShowFollowers" /> +           <Button +               android:id="@+id/btnActivityShowFollowersAndFollowingShowFollowing" +               android:layout_width="wrap_content" +               android:layout_height="wrap_content" +               android:layout_marginEnd="20dp" +               android:backgroundTint="#FFFFFF" +               android:stateListAnimator="@null" +               android:text="Praćenja" +               android:textColor="@color/cardview_dark_background" +               app:layout_constraintEnd_toEndOf="parent" +               app:layout_constraintTop_toBottomOf="@+id/btnActivityShowFollowersAndFollowingBackToUser" /> +       --> -    <Button -        android:id="@+id/btnActivityShowFollowersAndFollowingShowFollowers" -        android:layout_width="wrap_content" -        android:layout_height="wrap_content" -        android:layout_marginStart="16dp" -        android:backgroundTint="#FFFFFF" -        android:stateListAnimator="@null" -        android:text="Objave" -        android:drawableBottom="@drawable/ic_baseline_circle_7" -        android:textColor="@color/cardview_dark_background" +    <ImageView +        android:id="@+id/btnActivityShowFollowersAndFollowingBackToUser" +        android:layout_width="35dp" +        android:layout_height="35dp" +        android:layout_marginStart="4dp" +        android:layout_marginTop="4dp" +        android:clickable="true" +        android:src="@drawable/ic_baseline_arrow_back" +        android:textAllCaps="false"          app:layout_constraintStart_toStartOf="parent" -        app:layout_constraintTop_toBottomOf="@+id/btnActivityShowFollowersAndFollowingBackToUser" /> +        app:layout_constraintTop_toTopOf="parent" +        tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck" /> -    <Button -        android:id="@+id/btnActivityShowFollowersAndFollowingShowFollowing" +    <TextView +        android:id="@+id/tvActivityShowFollowersOrFollowingShow"          android:layout_width="wrap_content"          android:layout_height="wrap_content" -        android:layout_marginEnd="20dp" -        android:backgroundTint="#FFFFFF" -        android:stateListAnimator="@null" -        android:text="Podaci" -        android:drawableBottom="@drawable/ic_baseline_circle_7" -        android:drawableTint="@color/white" -        android:textColor="@color/cardview_dark_background" +        android:layout_marginTop="4dp" +        android:textSize="25dp" +        android:textStyle="bold"          app:layout_constraintEnd_toEndOf="parent" -        app:layout_constraintTop_toBottomOf="@+id/btnActivityShowFollowersAndFollowingBackToUser" /> +        app:layout_constraintHorizontal_bias="0.11" +        app:layout_constraintStart_toEndOf="@+id/btnActivityShowFollowersAndFollowingBackToUser" +        app:layout_constraintTop_toTopOf="parent" />      <FrameLayout -        android:id="@+id/flActivityShowFollowerAndFollowing" -        android:layout_width="match_parent" -        android:layout_height="0dp" -        android:layout_marginTop="16dp" -        android:orientation="vertical" -        app:layout_constraintBottom_toBottomOf="parent" -        app:layout_constraintEnd_toEndOf="parent" -        app:layout_constraintStart_toStartOf="parent" -        app:layout_constraintTop_toBottomOf="@+id/divider"/> -</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file +               android:id="@+id/flActivityShowFollowerAndFollowing" +               android:layout_width="match_parent" +               android:layout_height="0dp" +               android:layout_marginTop="16dp" +               android:orientation="vertical" +               app:layout_constraintBottom_toBottomOf="parent" +               app:layout_constraintEnd_toEndOf="parent" +               app:layout_constraintStart_toStartOf="parent" +               app:layout_constraintTop_toBottomOf="@+id/btnActivityShowFollowersAndFollowingBackToUser"/> +       </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file 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 bb917cf..cbcafc5 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 @@ -166,26 +166,45 @@              </TableRow> -            <TableRow android:layout_marginTop="30dp"> +            <TableRow android:layout_marginTop="20dp">                  <TextView                      android:id="@+id/tvFragmentUserProfilePosts" -                    android:layout_width="110dp" +                    android:layout_width="105dp"                      android:gravity="center" -                    android:text="OBJAVE" /> +                    android:text="OBJAVE" +                    android:stateListAnimator="@null" +                    android:backgroundTint="@color/white" +                    android:textColor="#757471"/> -                <TextView -                    android:id="@+id/tvFragmentUserProfileFollowers" -                    android:layout_width="10dp" +                <Button +                    android:id="@+id/tvActivityUserProfileFollowers" +                    android:layout_width="110dp" +                    android:layout_height="28dp" +                    android:layout_margin="0dp" +                    android:backgroundTint="@color/white" +                    android:clickable="true"                      android:gravity="center" -                    android:text="PRATIOCI" /> +                    android:padding="0dp" +                    android:stateListAnimator="@null" +                    android:text="PRATIOCI" +                    android:textColor="#757471" -                <TextView -                    android:id="@+id/tvFragmentUserProfileFollow" +                    tools:ignore="TouchTargetSizeCheck" /> +                <Button +                    android:id="@+id/tvActivityUserProfileFollow"                      android:layout_width="110dp" +                    android:layout_height="28dp" +                    android:layout_margin="0dp" +                    android:backgroundTint="@color/white" +                    android:clickable="true"                      android:gravity="center" -                    android:text="PRAĆENJA" /> +                    android:padding="0dp" +                    android:stateListAnimator="@null" +                    android:text="PRAĆENJA" +                    android:textColor="#757471" +                    tools:ignore="TouchTargetSizeCheck" />              </TableRow>              <TableRow @@ -281,7 +300,7 @@                          app:layout_constraintTop_toTopOf="parent"                          app:layout_constraintVertical_bias="0.0"                          app:shapeAppearanceOverlay="@style/Circular" -                        tools:ignore="SpeakableTextPresentCheck" /> +                        tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck" />                  </androidx.constraintlayout.widget.ConstraintLayout>              </TableRow>          </TableLayout> diff --git a/Client/BrzoDoLokacije/app/src/main/res/layout/follower_item.xml b/Client/BrzoDoLokacije/app/src/main/res/layout/follower_item.xml index bc43f1b..d0c6a2d 100644 --- a/Client/BrzoDoLokacije/app/src/main/res/layout/follower_item.xml +++ b/Client/BrzoDoLokacije/app/src/main/res/layout/follower_item.xml @@ -4,13 +4,14 @@      xmlns:tools="http://schemas.android.com/tools"      android:id="@+id/tvFolloewItemUsername"      android:layout_width="match_parent" -    android:layout_height="match_parent" +    android:layout_height="wrap_content"      android:layout_marginBottom="10dp">      <androidx.constraintlayout.widget.ConstraintLayout          android:layout_width="match_parent"          android:layout_height="wrap_content"          android:orientation="horizontal" +        android:elevation="10dp"          app:layout_constraintEnd_toEndOf="parent"          app:layout_constraintHorizontal_bias="1.0"          app:layout_constraintStart_toStartOf="parent" @@ -19,8 +20,8 @@          <androidx.cardview.widget.CardView              android:id="@+id/cvFragmentHomePageProfile" -            android:layout_width="100dp" -            android:layout_height="100dp" +            android:layout_width="80dp" +            android:layout_height="80dp"              android:layout_gravity="center"              android:elevation="10dp" @@ -58,13 +59,14 @@          </TextView>          <TextView +            android:id="@+id/tvFollowerItemUsername"              android:layout_width="wrap_content"              android:layout_height="wrap_content"              android:text="Petar Petrovic"              android:textSize="15sp"              app:layout_constraintBottom_toBottomOf="parent"              app:layout_constraintEnd_toStartOf="@+id/materialButton" -            app:layout_constraintHorizontal_bias="0.656" +            app:layout_constraintHorizontal_bias="0.597"              app:layout_constraintStart_toStartOf="parent"              app:layout_constraintTop_toBottomOf="@+id/tvFollowerItemName"              app:layout_constraintVertical_bias="0.0" /> diff --git a/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_user_followers.xml b/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_user_followers.xml new file mode 100644 index 0000000..8b820bc --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_user_followers.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.FragmentUserFollowers"> + +    <!-- TODO: Update blank fragment layout --> +    <TextView +        android:layout_width="match_parent" +        android:layout_height="match_parent" /> + +    <androidx.recyclerview.widget.RecyclerView +        android:id="@+id/rvFragmentUserFollowers" +        android:layout_width="match_parent" +        android:layout_height="match_parent" /> + +</FrameLayout>
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_user_following.xml b/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_user_following.xml new file mode 100644 index 0000000..7558375 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_user_following.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.FragmentUserFollowing"> + +    <!-- TODO: Update blank fragment layout --> +    <TextView +        android:layout_width="match_parent" +        android:layout_height="match_parent" /> + +    <androidx.recyclerview.widget.RecyclerView +        android:id="@+id/rvFragmentUserFollowing" +        android:layout_width="match_parent" +        android:layout_height="match_parent" /> + +</FrameLayout>
\ No newline at end of file  | 
