feat(): fixed the UI changes 🦍 + notificationIcon logic and long press userAvatar 🐒 (#226)
This commit is contained in:
parent
49175a962a
commit
2742f58af5
3 changed files with 43 additions and 24 deletions
|
@ -32,6 +32,7 @@ import ani.dantotsu.media.Media
|
||||||
import ani.dantotsu.media.MediaAdaptor
|
import ani.dantotsu.media.MediaAdaptor
|
||||||
import ani.dantotsu.media.user.ListActivity
|
import ani.dantotsu.media.user.ListActivity
|
||||||
import ani.dantotsu.navBarHeight
|
import ani.dantotsu.navBarHeight
|
||||||
|
import ani.dantotsu.profile.ProfileActivity
|
||||||
import ani.dantotsu.setSafeOnClickListener
|
import ani.dantotsu.setSafeOnClickListener
|
||||||
import ani.dantotsu.setSlideIn
|
import ani.dantotsu.setSlideIn
|
||||||
import ani.dantotsu.setSlideUp
|
import ani.dantotsu.setSlideUp
|
||||||
|
@ -120,6 +121,13 @@ class HomeFragment : Fragment() {
|
||||||
"dialog"
|
"dialog"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
binding.homeUserAvatarContainer.setOnLongClickListener {
|
||||||
|
ContextCompat.startActivity(
|
||||||
|
requireContext(), Intent(requireContext(), ProfileActivity::class.java)
|
||||||
|
.putExtra("userId", Anilist.userid), null
|
||||||
|
)
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
binding.homeContainer.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
binding.homeContainer.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
||||||
bottomMargin = navBarHeight
|
bottomMargin = navBarHeight
|
||||||
|
|
|
@ -59,6 +59,13 @@ class SettingsDialogFragment : BottomSheetDialogFragment() {
|
||||||
val theme = requireContext().theme
|
val theme = requireContext().theme
|
||||||
theme.resolveAttribute(com.google.android.material.R.attr.colorSurface, typedValue, true)
|
theme.resolveAttribute(com.google.android.material.R.attr.colorSurface, typedValue, true)
|
||||||
window?.navigationBarColor = typedValue.data
|
window?.navigationBarColor = typedValue.data
|
||||||
|
val notificationIcon = if (Anilist.unreadNotificationCount > 0) {
|
||||||
|
R.drawable.ic_round_notifications_active_24
|
||||||
|
} else {
|
||||||
|
R.drawable.ic_round_notifications_none_24
|
||||||
|
}
|
||||||
|
binding.settingsNotification.setImageResource(notificationIcon)
|
||||||
|
binding.settingsNotification.visibility = View.VISIBLE
|
||||||
|
|
||||||
if (Anilist.token != null) {
|
if (Anilist.token != null) {
|
||||||
binding.settingsLogin.setText(R.string.logout)
|
binding.settingsLogin.setText(R.string.logout)
|
||||||
|
|
|
@ -73,32 +73,36 @@
|
||||||
|
|
||||||
</com.google.android.material.card.MaterialCardView>
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/notificationText"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="end|center"
|
|
||||||
android:layout_marginStart="128dp"
|
|
||||||
android:padding="8dp"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:fontFamily="@font/poppins_semi_bold"
|
|
||||||
android:maxLines="3"
|
|
||||||
android:textSize="14dp"
|
|
||||||
android:transitionName="mediaTitle"
|
|
||||||
tools:ignore="SpUsage"
|
|
||||||
tools:text="@string/slogan" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/notificationDate"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="end|bottom"
|
android:layout_gravity="start|center"
|
||||||
android:layout_marginTop="2dp"
|
android:orientation="vertical"
|
||||||
android:layout_marginEnd="20dp"
|
android:layout_marginStart="125dp">
|
||||||
android:fontFamily="@font/poppins_semi_bold"
|
|
||||||
android:text="Wed,06 March 2024, 7:00PM"
|
<TextView
|
||||||
android:textSize="10sp"
|
android:id="@+id/notificationText"
|
||||||
tools:ignore="HardcodedText" />
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:fontFamily="@font/poppins_semi_bold"
|
||||||
|
android:maxLines="3"
|
||||||
|
android:textSize="14dp"
|
||||||
|
android:transitionName="mediaTitle"
|
||||||
|
tools:ignore="SpUsage"
|
||||||
|
tools:text="@string/slogan" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/notificationDate"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="start"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:fontFamily="@font/poppins_semi_bold"
|
||||||
|
android:text="Wed,06 March 2024, 7:00PM"
|
||||||
|
android:textSize="10sp"
|
||||||
|
tools:ignore="HardcodedText" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</com.google.android.material.card.MaterialCardView>
|
</com.google.android.material.card.MaterialCardView>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
Loading…
Add table
Add a link
Reference in a new issue