dix: many small changes
This commit is contained in:
parent
adb304f138
commit
42f23e4345
6 changed files with 60 additions and 36 deletions
|
@ -2,6 +2,8 @@ package ani.dantotsu.profile.activity
|
|||
|
||||
import android.util.TypedValue
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.view.updateLayoutParams
|
||||
import ani.dantotsu.R
|
||||
import ani.dantotsu.blurImage
|
||||
import ani.dantotsu.connections.anilist.api.Notification
|
||||
|
@ -37,17 +39,25 @@ class NotificationItem(
|
|||
?: notification.user?.avatar?.medium else notification.media?.bannerImage
|
||||
?: notification.media?.coverImage?.large
|
||||
blurImage(binding.notificationBannerImage, cover)
|
||||
|
||||
val defaultHeight = TypedValue.applyDimension(
|
||||
TypedValue.COMPLEX_UNIT_DIP,
|
||||
170f,
|
||||
153f,
|
||||
binding.root.context.resources.displayMetrics
|
||||
).toInt()
|
||||
|
||||
val userHeight = TypedValue.applyDimension(
|
||||
TypedValue.COMPLEX_UNIT_DIP,
|
||||
90f,
|
||||
binding.root.context.resources.displayMetrics
|
||||
).toInt()
|
||||
|
||||
val textMarginStart = TypedValue.applyDimension(
|
||||
TypedValue.COMPLEX_UNIT_DIP,
|
||||
125f,
|
||||
binding.root.context.resources.displayMetrics
|
||||
).toInt()
|
||||
|
||||
if (user) {
|
||||
binding.notificationCover.visibility = View.GONE
|
||||
binding.notificationCoverUser.visibility = View.VISIBLE
|
||||
|
@ -60,12 +70,16 @@ class NotificationItem(
|
|||
binding.notificationCoverUser.loadImage(notification.user?.avatar?.large)
|
||||
}
|
||||
binding.notificationBannerImage.layoutParams.height = userHeight
|
||||
binding.notificationGradiant.layoutParams.height = userHeight
|
||||
(binding.notificationTextContainer.layoutParams as ViewGroup.MarginLayoutParams).marginStart = userHeight
|
||||
} else {
|
||||
binding.notificationCover.visibility = View.VISIBLE
|
||||
binding.notificationCoverUser.visibility = View.VISIBLE
|
||||
binding.notificationCoverUserContainer.visibility = View.GONE
|
||||
binding.notificationCover.loadImage(notification.media?.coverImage?.large)
|
||||
binding.notificationBannerImage.layoutParams.height = defaultHeight
|
||||
binding.notificationGradiant.layoutParams.height = defaultHeight
|
||||
(binding.notificationTextContainer.layoutParams as ViewGroup.MarginLayoutParams).marginStart = textMarginStart
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -94,14 +94,14 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="18dp"
|
||||
android:layout_marginEnd="18dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_marginEnd="18dp"
|
||||
android:background="?android:colorBackground"
|
||||
android:fontFamily="@font/poppins_semi_bold"
|
||||
android:text="@string/lorem_ipsum"
|
||||
android:textAlignment="center"
|
||||
tools:visibility="gone"
|
||||
android:background="?android:colorBackground"
|
||||
android:textSize="12sp" />
|
||||
android:textSize="12sp"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/activityBannerContainer"
|
||||
|
@ -114,13 +114,13 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start|center_vertical"
|
||||
android:backgroundTint="?attr/colorSurface"
|
||||
app:strokeColor="@color/transparent"
|
||||
app:cardCornerRadius="24dp">
|
||||
app:cardCornerRadius="24dp"
|
||||
app:strokeColor="@color/transparent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/activityBannerImage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="169dp"
|
||||
android:layout_height="152dp"
|
||||
android:scaleType="centerCrop"
|
||||
tools:ignore="ContentDescription"
|
||||
tools:srcCompat="@tools:sample/backgrounds/scenic" />
|
||||
|
@ -128,8 +128,8 @@
|
|||
<ImageView
|
||||
android:id="@+id/imageView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="170dp"
|
||||
app:srcCompat="@drawable/linear_gradient_nav_inv"
|
||||
android:layout_height="153dp"
|
||||
app:srcCompat="@drawable/linear_gradient_nav"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
|
||||
|
@ -138,14 +138,16 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start|center_vertical"
|
||||
android:layout_margin="16dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:backgroundTint="@color/bg_white"
|
||||
app:cardCornerRadius="16dp">
|
||||
app:cardCornerRadius="16dp"
|
||||
app:strokeColor="@color/transparent">
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/activityCover"
|
||||
android:layout_width="102dp"
|
||||
android:layout_height="154dp"
|
||||
android:layout_width="108dp"
|
||||
android:layout_height="160dp"
|
||||
android:layout_gravity="center"
|
||||
android:scaleType="centerCrop"
|
||||
app:srcCompat="@drawable/ic_round_add_circle_24"
|
||||
|
@ -161,15 +163,15 @@
|
|||
android:layout_marginStart="128dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:padding="8dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/activityMediaName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:fontFamily="@font/poppins_semi_bold"
|
||||
android:textColor="@color/bg_opp"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:maxLines="2"
|
||||
android:text="@string/anime"
|
||||
android:textSize="16sp"
|
||||
|
@ -181,9 +183,12 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:alpha="0.66"
|
||||
android:ellipsize="end"
|
||||
android:fontFamily="@font/poppins_semi_bold"
|
||||
android:textColor="@color/bg_opp"
|
||||
android:maxLines="2"
|
||||
android:text="@string/slogan"
|
||||
android:textColor="@color/bg_opp"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
@ -224,8 +229,8 @@
|
|||
android:id="@+id/activityReplies"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone"
|
||||
android:layout_marginStart="16dp"
|
||||
android:nestedScrollingEnabled="false"
|
||||
android:layout_marginStart="16dp"/>
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
|
@ -18,7 +18,7 @@
|
|||
<ImageView
|
||||
android:id="@+id/profileBannerImage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="89dp"
|
||||
android:scaleType="centerCrop"
|
||||
tools:srcCompat="@tools:sample/backgrounds/scenic"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
|
|
@ -19,14 +19,15 @@
|
|||
<ImageView
|
||||
android:id="@+id/notificationBannerImage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="170dp"
|
||||
android:layout_height="153dp"
|
||||
android:scaleType="centerCrop"
|
||||
tools:ignore="ContentDescription"
|
||||
tools:srcCompat="@tools:sample/backgrounds/scenic" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/notificationGradiant"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="153dp"
|
||||
app:srcCompat="@drawable/linear_gradient_nav"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
|
@ -35,18 +36,19 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start|center_vertical"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_margin="16dp"
|
||||
android:backgroundTint="@color/transparent"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:strokeColor="@color/transparent">
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/notificationCover"
|
||||
android:layout_width="96dp"
|
||||
android:layout_height="144dp"
|
||||
android:layout_gravity="center"
|
||||
app:srcCompat="@drawable/ic_round_add_circle_24"
|
||||
android:layout_width="108dp"
|
||||
android:layout_height="160dp"
|
||||
android:scaleType="centerCrop"
|
||||
app:shapeAppearanceOverlay="@style/roundedImageView"
|
||||
tools:ignore="ContentDescription,ImageContrastCheck"
|
||||
tools:srcCompat="@tools:sample/backgrounds/scenic"
|
||||
tools:tint="@color/transparent" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
@ -74,11 +76,14 @@
|
|||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:id="@+id/notificationTextContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start|bottom"
|
||||
android:layout_marginStart="125dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:padding="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
|
@ -86,7 +91,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:fontFamily="@font/poppins_semi_bold"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:maxLines="3"
|
||||
android:textSize="14dp"
|
||||
android:transitionName="mediaTitle"
|
||||
|
@ -98,11 +103,11 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:alpha="0.66"
|
||||
android:fontFamily="@font/poppins_semi_bold"
|
||||
android:text="Wed,06 March 2024, 7:00PM"
|
||||
android:textSize="10sp"
|
||||
tools:ignore="HardcodedText" />
|
||||
tools:ignore="HardcodedText,SmallSp" />
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<color name="nav_bg">#1C1C1C</color>
|
||||
<color name="nav_bg_inv">#001C1C1C</color>
|
||||
<color name="nav_tab">#40ffffff</color>
|
||||
<color name="gradiant_bg_start">#AA1C1C1C</color>
|
||||
<color name="gradiant_bg_end">#20000000</color>
|
||||
<color name="gradiant_bg_end">#AA1C1C1C</color>
|
||||
<color name="gradiant_bg_start">#434343</color>
|
||||
<color name="nav_tab_disabled">#40ffffff</color>
|
||||
<color name="transparent">#00000000</color>
|
||||
<color name="nav_status">#80000000</color>
|
||||
|
|
|
@ -11,10 +11,10 @@
|
|||
<color name="bg_black_50" alpha="128">#80000000</color>
|
||||
<color name="nav_bg">#fff</color>
|
||||
<color name="nav_bg_inv">#00BFAEAE</color>
|
||||
<color name="nav_tab">#40000000</color>
|
||||
<color name="gradiant_bg_start">#88989898</color>
|
||||
<color name="gradiant_bg_end">#00FFFFFF</color>
|
||||
<color name="gradiant_bg_start">#ACACAC</color>
|
||||
<color name="gradiant_bg_end">#00BFAEAE</color>
|
||||
<color name="nav_tab_disabled">#19000000</color>
|
||||
<color name="nav_tab">#40000000</color>
|
||||
<color name="transparent">#00000000</color>
|
||||
<color name="button_icon">#A9FFFFFF</color>
|
||||
<color name="nav_status">#80FFFFFF</color>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue