fix(profile): padding and stuff
This commit is contained in:
parent
31afbd547e
commit
bd64454c15
5 changed files with 105 additions and 64 deletions
|
@ -2,9 +2,13 @@ package ani.dantotsu.profile
|
||||||
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
import android.view.ViewGroup
|
||||||
import android.view.ViewGroup.MarginLayoutParams
|
import android.view.ViewGroup.MarginLayoutParams
|
||||||
|
import android.view.Window
|
||||||
|
import android.view.WindowManager
|
||||||
import android.widget.ImageButton
|
import android.widget.ImageButton
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.core.view.updateLayoutParams
|
import androidx.core.view.updateLayoutParams
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import androidx.recyclerview.widget.GridLayoutManager
|
import androidx.recyclerview.widget.GridLayoutManager
|
||||||
|
@ -17,6 +21,7 @@ import ani.dantotsu.initActivity
|
||||||
import ani.dantotsu.navBarHeight
|
import ani.dantotsu.navBarHeight
|
||||||
import ani.dantotsu.settings.saving.PrefManager
|
import ani.dantotsu.settings.saving.PrefManager
|
||||||
import ani.dantotsu.settings.saving.PrefName
|
import ani.dantotsu.settings.saving.PrefName
|
||||||
|
import ani.dantotsu.statusBarHeight
|
||||||
import ani.dantotsu.themes.ThemeManager
|
import ani.dantotsu.themes.ThemeManager
|
||||||
import com.xwray.groupie.GroupieAdapter
|
import com.xwray.groupie.GroupieAdapter
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
|
@ -37,12 +42,27 @@ class FollowActivity : AppCompatActivity(){
|
||||||
binding = ActivityFollowBinding.inflate(layoutInflater)
|
binding = ActivityFollowBinding.inflate(layoutInflater)
|
||||||
setContentView(binding.root)
|
setContentView(binding.root)
|
||||||
|
|
||||||
|
if (!PrefManager.getVal<Boolean>(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<MarginLayoutParams> {
|
||||||
|
topMargin = statusBarHeight
|
||||||
|
}
|
||||||
|
}
|
||||||
val layoutType = PrefManager.getVal<Int>(PrefName.FollowerLayout)
|
val layoutType = PrefManager.getVal<Int>(PrefName.FollowerLayout)
|
||||||
selected = getSelected(layoutType)
|
selected = getSelected(layoutType)
|
||||||
binding.followerGrid.alpha = 0.33f
|
binding.followerGrid.alpha = 0.33f
|
||||||
binding.followerList.alpha = 0.33f
|
binding.followerList.alpha = 0.33f
|
||||||
selected(selected)
|
selected(selected)
|
||||||
binding.root.updateLayoutParams<MarginLayoutParams> { topMargin += navBarHeight }
|
|
||||||
binding.listRecyclerView.layoutManager = LinearLayoutManager(
|
binding.listRecyclerView.layoutManager = LinearLayoutManager(
|
||||||
this,
|
this,
|
||||||
LinearLayoutManager.VERTICAL,
|
LinearLayoutManager.VERTICAL,
|
||||||
|
@ -53,11 +73,13 @@ class FollowActivity : AppCompatActivity(){
|
||||||
binding.listBack.setOnClickListener { finish() }
|
binding.listBack.setOnClickListener { finish() }
|
||||||
|
|
||||||
val title = intent.getStringExtra("title")
|
val title = intent.getStringExtra("title")
|
||||||
|
val userID= intent.getIntExtra("userId", 0)
|
||||||
binding.listTitle.text = title
|
binding.listTitle.text = title
|
||||||
|
|
||||||
lifecycleScope.launch(Dispatchers.IO) {
|
lifecycleScope.launch(Dispatchers.IO) {
|
||||||
val respond = when (title) {
|
val respond = when (title) {
|
||||||
"Following" -> Anilist.query.userFollowing(intent.getIntExtra("userId", 0))?.data?.page?.following
|
"Following" -> Anilist.query.userFollowing(userID)?.data?.page?.following
|
||||||
"Followers" -> Anilist.query.userFollowers(intent.getIntExtra("userId", 0))?.data?.page?.followers
|
"Followers" -> Anilist.query.userFollowers(userID)?.data?.page?.followers
|
||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
users = respond
|
users = respond
|
||||||
|
|
|
@ -15,9 +15,8 @@
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:layout_marginTop="16dp"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="48dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
@ -33,16 +32,17 @@
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/listTitle"
|
android:id="@+id/listTitle"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="36dp"
|
android:layout_height="48dp"
|
||||||
android:layout_marginStart="44dp"
|
android:layout_marginStart="44dp"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:gravity="center|start"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:fontFamily="@font/poppins_bold"
|
android:fontFamily="@font/poppins_bold"
|
||||||
android:gravity="center|start"
|
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textAppearance="@style/TextAppearance.Widget.AppCompat.Toolbar.Title"
|
android:textAppearance="@style/TextAppearance.Widget.AppCompat.Toolbar.Title"
|
||||||
android:textColor="?attr/colorOnBackground"
|
android:textColor="?attr/colorOnBackground"
|
||||||
android:textSize="18sp"
|
android:textSize="18sp"
|
||||||
tools:text="xyz" />
|
tools:text="Follow" />
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -55,8 +55,8 @@
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/followerList"
|
android:id="@+id/followerList"
|
||||||
android:layout_width="36dp"
|
android:layout_width="48dp"
|
||||||
android:layout_height="36dp"
|
android:layout_height="48dp"
|
||||||
android:alpha="0.33"
|
android:alpha="0.33"
|
||||||
android:background="?android:attr/selectableItemBackground"
|
android:background="?android:attr/selectableItemBackground"
|
||||||
android:scaleX="-1"
|
android:scaleX="-1"
|
||||||
|
@ -76,8 +76,8 @@
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/followerGrid"
|
android:id="@+id/followerGrid"
|
||||||
android:layout_width="36dp"
|
android:layout_width="48dp"
|
||||||
android:layout_height="36dp"
|
android:layout_height="48dp"
|
||||||
android:alpha="0.33"
|
android:alpha="0.33"
|
||||||
android:background="?android:attr/selectableItemBackground"
|
android:background="?android:attr/selectableItemBackground"
|
||||||
app:srcCompat="@drawable/ic_round_grid_view_24"
|
app:srcCompat="@drawable/ic_round_grid_view_24"
|
||||||
|
|
|
@ -144,6 +144,7 @@
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:layout_marginEnd="32dp"
|
android:layout_marginEnd="32dp"
|
||||||
|
android:padding="8dp"
|
||||||
android:fontFamily="@font/poppins_bold"
|
android:fontFamily="@font/poppins_bold"
|
||||||
android:text="Stats"
|
android:text="Stats"
|
||||||
android:textSize="18sp"
|
android:textSize="18sp"
|
||||||
|
@ -344,6 +345,7 @@
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:layout_marginEnd="32dp"
|
android:layout_marginEnd="32dp"
|
||||||
|
android:padding="8dp"
|
||||||
android:fontFamily="@font/poppins_bold"
|
android:fontFamily="@font/poppins_bold"
|
||||||
android:text="Bio"
|
android:text="Bio"
|
||||||
android:textSize="18sp"
|
android:textSize="18sp"
|
||||||
|
@ -367,7 +369,8 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:visibility="gone">
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible">
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -521,6 +524,7 @@
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:layout_marginEnd="32dp"
|
android:layout_marginEnd="32dp"
|
||||||
|
android:padding="8dp"
|
||||||
android:fontFamily="@font/poppins_bold"
|
android:fontFamily="@font/poppins_bold"
|
||||||
android:text="Favorite Characters"
|
android:text="Favorite Characters"
|
||||||
android:textSize="18sp" />
|
android:textSize="18sp" />
|
||||||
|
@ -552,6 +556,7 @@
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:layout_marginEnd="32dp"
|
android:layout_marginEnd="32dp"
|
||||||
|
android:padding="8dp"
|
||||||
android:fontFamily="@font/poppins_bold"
|
android:fontFamily="@font/poppins_bold"
|
||||||
android:text="Favorite Staff"
|
android:text="Favorite Staff"
|
||||||
android:textSize="18sp" />
|
android:textSize="18sp" />
|
||||||
|
|
|
@ -4,53 +4,59 @@
|
||||||
android:layout_height="120dp"
|
android:layout_height="120dp"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_marginBottom="8dp"
|
android:layout_marginTop="16dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/profileBannerImage"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:scaleType="centerCrop"
|
|
||||||
android:src="@drawable/linear_gradient_bg"
|
|
||||||
tools:ignore="ContentDescription" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="@color/bg_black_50"
|
|
||||||
tools:ignore="ContentDescription" />
|
|
||||||
|
|
||||||
<com.google.android.material.card.MaterialCardView
|
<com.google.android.material.card.MaterialCardView
|
||||||
android:id="@+id/profileUserAvatarContainer"
|
android:id="@+id/profile"
|
||||||
android:layout_width="82dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="82dp"
|
|
||||||
android:layout_gravity="start|center_vertical"
|
|
||||||
android:layout_marginStart="16dp"
|
|
||||||
android:backgroundTint="@color/bg_white"
|
|
||||||
app:cardCornerRadius="64dp">
|
|
||||||
|
|
||||||
<com.google.android.material.imageview.ShapeableImageView
|
|
||||||
android:id="@+id/profileUserAvatar"
|
|
||||||
android:layout_width="82dp"
|
|
||||||
android:layout_height="82dp"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
app:srcCompat="@drawable/ic_round_add_circle_24"
|
|
||||||
tools:tint="@color/transparent"
|
|
||||||
tools:ignore="ContentDescription,ImageContrastCheck" />
|
|
||||||
|
|
||||||
</com.google.android.material.card.MaterialCardView>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/profileUserName"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="start|center_vertical"
|
android:layout_gravity="start|center_vertical"
|
||||||
android:layout_marginStart="120dp"
|
android:backgroundTint="@color/bg_white"
|
||||||
android:text="Username"
|
app:cardCornerRadius="32dp">
|
||||||
android:textColor="@color/bg_white"
|
<ImageView
|
||||||
android:textSize="18sp"
|
android:id="@+id/profileBannerImage"
|
||||||
android:textStyle="bold"
|
android:layout_width="match_parent"
|
||||||
tools:ignore="HardcodedText" />
|
android:layout_height="match_parent"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/linear_gradient_bg"
|
||||||
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/bg_black_50"
|
||||||
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
|
<com.google.android.material.card.MaterialCardView
|
||||||
|
android:id="@+id/profileUserAvatarContainer"
|
||||||
|
android:layout_width="82dp"
|
||||||
|
android:layout_height="82dp"
|
||||||
|
android:layout_gravity="start|center_vertical"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:backgroundTint="@color/bg_white"
|
||||||
|
app:cardCornerRadius="64dp">
|
||||||
|
|
||||||
|
<com.google.android.material.imageview.ShapeableImageView
|
||||||
|
android:id="@+id/profileUserAvatar"
|
||||||
|
android:layout_width="82dp"
|
||||||
|
android:layout_height="82dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
app:srcCompat="@drawable/ic_round_add_circle_24"
|
||||||
|
tools:tint="@color/transparent"
|
||||||
|
tools:ignore="ContentDescription,ImageContrastCheck" />
|
||||||
|
|
||||||
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/profileUserName"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="start|center_vertical"
|
||||||
|
android:layout_marginStart="120dp"
|
||||||
|
android:text="Username"
|
||||||
|
android:textColor="@color/bg_white"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:ignore="HardcodedText" />
|
||||||
|
</com.google.android.material.card.MaterialCardView>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
|
@ -1,24 +1,32 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="wrap_content"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_height="150dp"
|
|
||||||
android:padding="8dp"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="8dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
<com.google.android.material.card.MaterialCardView
|
||||||
|
android:id="@+id/profileUserAvatarContainer"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:backgroundTint="@color/bg_white"
|
||||||
|
app:cardCornerRadius="124dp">
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/profileUserAvatar"
|
android:id="@+id/profileUserAvatar"
|
||||||
android:layout_width="112dp"
|
android:layout_width="100dp"
|
||||||
android:layout_height="112dp"
|
android:layout_height="100dp"
|
||||||
android:layout_gravity="center"
|
|
||||||
tools:tint="@color/transparent"
|
tools:tint="@color/transparent"
|
||||||
tools:ignore="ContentDescription,ImageContrastCheck" />
|
tools:ignore="ContentDescription,ImageContrastCheck" />
|
||||||
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/profileUserName"
|
android:id="@+id/profileUserName"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal|center_vertical"
|
android:layout_gravity="center_horizontal|center_vertical"
|
||||||
|
android:fontFamily="@font/poppins_semi_bold"
|
||||||
android:text="Username"
|
android:text="Username"
|
||||||
android:textColor="?attr/colorOnBackground"
|
android:textColor="?attr/colorOnBackground"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue