diff --git a/app/src/main/java/ani/dantotsu/profile/FollowActivity.kt b/app/src/main/java/ani/dantotsu/profile/FollowActivity.kt index 30d641b3941..4d05174c2b3 100644 --- a/app/src/main/java/ani/dantotsu/profile/FollowActivity.kt +++ b/app/src/main/java/ani/dantotsu/profile/FollowActivity.kt @@ -2,9 +2,13 @@ package ani.dantotsu.profile import android.content.Intent import android.os.Bundle +import android.view.ViewGroup import android.view.ViewGroup.MarginLayoutParams +import android.view.Window +import android.view.WindowManager import android.widget.ImageButton import androidx.appcompat.app.AppCompatActivity +import androidx.core.content.ContextCompat import androidx.core.view.updateLayoutParams import androidx.lifecycle.lifecycleScope import androidx.recyclerview.widget.GridLayoutManager @@ -17,6 +21,7 @@ import ani.dantotsu.initActivity import ani.dantotsu.navBarHeight import ani.dantotsu.settings.saving.PrefManager import ani.dantotsu.settings.saving.PrefName +import ani.dantotsu.statusBarHeight import ani.dantotsu.themes.ThemeManager import com.xwray.groupie.GroupieAdapter import kotlinx.coroutines.Dispatchers @@ -37,12 +42,27 @@ class FollowActivity : AppCompatActivity(){ binding = ActivityFollowBinding.inflate(layoutInflater) setContentView(binding.root) + if (!PrefManager.getVal(PrefName.ImmersiveMode)) { + this.window.statusBarColor = + ContextCompat.getColor(this, R.color.nav_bg_inv) + binding.root.fitsSystemWindows = true + + } else { + binding.root.fitsSystemWindows = false + requestWindowFeature(Window.FEATURE_NO_TITLE) + window.setFlags( + WindowManager.LayoutParams.FLAG_FULLSCREEN, + WindowManager.LayoutParams.FLAG_FULLSCREEN + ) + binding.listTitle.updateLayoutParams { + topMargin = statusBarHeight + } + } val layoutType = PrefManager.getVal(PrefName.FollowerLayout) selected = getSelected(layoutType) binding.followerGrid.alpha = 0.33f binding.followerList.alpha = 0.33f selected(selected) - binding.root.updateLayoutParams { topMargin += navBarHeight } binding.listRecyclerView.layoutManager = LinearLayoutManager( this, LinearLayoutManager.VERTICAL, @@ -53,11 +73,13 @@ class FollowActivity : AppCompatActivity(){ binding.listBack.setOnClickListener { finish() } val title = intent.getStringExtra("title") + val userID= intent.getIntExtra("userId", 0) binding.listTitle.text = title + lifecycleScope.launch(Dispatchers.IO) { val respond = when (title) { - "Following" -> Anilist.query.userFollowing(intent.getIntExtra("userId", 0))?.data?.page?.following - "Followers" -> Anilist.query.userFollowers(intent.getIntExtra("userId", 0))?.data?.page?.followers + "Following" -> Anilist.query.userFollowing(userID)?.data?.page?.following + "Followers" -> Anilist.query.userFollowers(userID)?.data?.page?.followers else -> null } users = respond diff --git a/app/src/main/res/layout/activity_follow.xml b/app/src/main/res/layout/activity_follow.xml index 5990652e0e4..7cd44c3fe1f 100644 --- a/app/src/main/res/layout/activity_follow.xml +++ b/app/src/main/res/layout/activity_follow.xml @@ -15,9 +15,8 @@ android:visibility="gone" /> + tools:text="Follow" /> + android:visibility="gone" + tools:visibility="visible"> @@ -552,6 +556,7 @@ android:layout_marginStart="8dp" android:layout_marginTop="8dp" android:layout_marginEnd="32dp" + android:padding="8dp" android:fontFamily="@font/poppins_bold" android:text="Favorite Staff" android:textSize="18sp" /> diff --git a/app/src/main/res/layout/item_follower.xml b/app/src/main/res/layout/item_follower.xml index c9ed8f43930..3c56e72f2e6 100644 --- a/app/src/main/res/layout/item_follower.xml +++ b/app/src/main/res/layout/item_follower.xml @@ -4,53 +4,59 @@ android:layout_height="120dp" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" - android:layout_marginBottom="8dp" + android:layout_marginTop="16dp" android:orientation="horizontal"> - - - - - + app:cardCornerRadius="32dp"> + + + - + android:layout_gravity="start|center_vertical" + android:layout_marginStart="16dp" + android:backgroundTint="@color/bg_white" + app:cardCornerRadius="64dp"> - + - + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_follower_grid.xml b/app/src/main/res/layout/item_follower_grid.xml index caf9e815418..9593aba7724 100644 --- a/app/src/main/res/layout/item_follower_grid.xml +++ b/app/src/main/res/layout/item_follower_grid.xml @@ -1,24 +1,32 @@ - + +