mirror of
https://github.com/rebelonion/Dantotsu.git
synced 2026-01-22 15:53:56 +00:00
Merge branch 'rebelonion:dev' into dev
This commit is contained in:
@@ -115,12 +115,12 @@
|
||||
android:windowSoftInputMode="adjustResize|stateHidden"
|
||||
android:parentActivityName=".MainActivity" />
|
||||
<activity
|
||||
android:name=".profile.ActivityActivity"
|
||||
android:name=".profile.activity.ActivityActivity"
|
||||
android:label="Inbox Activity"
|
||||
android:parentActivityName=".MainActivity" >
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".notifications.NotificationActivity"
|
||||
android:name=".profile.activity.NotificationActivity"
|
||||
android:label="Inbox Activity"
|
||||
android:parentActivityName=".MainActivity" >
|
||||
</activity>
|
||||
|
||||
@@ -6,6 +6,7 @@ import ani.dantotsu.checkGenreTime
|
||||
import ani.dantotsu.checkId
|
||||
import ani.dantotsu.connections.anilist.Anilist.authorRoles
|
||||
import ani.dantotsu.connections.anilist.Anilist.executeQuery
|
||||
import ani.dantotsu.connections.anilist.api.FeedResponse
|
||||
import ani.dantotsu.connections.anilist.api.FuzzyDate
|
||||
import ani.dantotsu.connections.anilist.api.Notification
|
||||
import ani.dantotsu.connections.anilist.api.NotificationResponse
|
||||
@@ -1348,4 +1349,12 @@ Page(page:$page,perPage:50) {
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
suspend fun getFeed(userId: Int?, global: Boolean = false, page: Int = 1): FeedResponse? {
|
||||
val filter = if (userId != null) "userId:$userId,"
|
||||
else if (global) "isFollowing:false,"
|
||||
else "isFollowing:true,"
|
||||
val res = executeQuery<FeedResponse>("""{Page(page:$page,perPage:25){activities(${filter}sort:ID_DESC){__typename ... on TextActivity{id userId type replyCount text(asHtml:true)siteUrl isLocked isSubscribed likeCount isLiked isPinned createdAt user{id name bannerImage avatar{medium large}}replies{id userId activityId text(asHtml:true)likeCount isLiked createdAt user{id name bannerImage avatar{medium large}}likes{id name bannerImage avatar{medium large}}}likes{id name bannerImage avatar{medium large}}}... on ListActivity{id userId type replyCount status progress siteUrl isLocked isSubscribed likeCount isLiked isPinned createdAt user{id name bannerImage avatar{medium large}}media{id title{english romaji native userPreferred}bannerImage coverImage{medium large}}replies{id userId activityId text(asHtml:true)likeCount isLiked createdAt user{id name bannerImage avatar{medium large}}likes{id name bannerImage avatar{medium large}}}likes{id name bannerImage avatar{medium large}}}... on MessageActivity{id recipientId messengerId type replyCount message(asHtml:true)isLocked isSubscribed isLiked isPrivate siteUrl createdAt recipient{id name bannerImage avatar{medium large}}messenger{id name bannerImage avatar{medium large}}replies{id userId activityId text(asHtml:true)likeCount isLiked createdAt user{id name bannerImage avatar{medium large}}likes{id name bannerImage avatar{medium large}}}likes{id name bannerImage avatar{medium large}}}}}}""")
|
||||
return res
|
||||
}
|
||||
}
|
||||
@@ -353,6 +353,11 @@ class ProfileViewModel : ViewModel(){
|
||||
mangaFav.postValue(Anilist.query.userFavMedia(false, id))
|
||||
animeFav.postValue(Anilist.query.userFavMedia(true, id))
|
||||
listImages.postValue(Anilist.query.getUserBannerImages(id))
|
||||
}
|
||||
|
||||
fun refresh() {
|
||||
mangaFav.postValue(mangaFav.value)
|
||||
animeFav.postValue(animeFav.value)
|
||||
listImages.postValue(listImages.value)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package ani.dantotsu.connections.anilist.api
|
||||
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class FeedResponse(
|
||||
@SerialName("data")
|
||||
val data: Data
|
||||
) {
|
||||
@Serializable
|
||||
data class Data(
|
||||
@SerialName("Page")
|
||||
val page: ActivityPage
|
||||
)
|
||||
}
|
||||
|
||||
@Serializable
|
||||
data class ActivityPage(
|
||||
@SerialName("activities")
|
||||
val activities: List<Activity>
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class Activity(
|
||||
@SerialName("__typename")
|
||||
val typename: String,
|
||||
@SerialName("id")
|
||||
val id: Int,
|
||||
@SerialName("recipientId")
|
||||
val recipientId: Int?,
|
||||
@SerialName("messengerId")
|
||||
val messengerId: Int?,
|
||||
@SerialName("userId")
|
||||
val userId: Int?,
|
||||
@SerialName("type")
|
||||
val type: String,
|
||||
@SerialName("replyCount")
|
||||
val replyCount: Int,
|
||||
@SerialName("status")
|
||||
val status: String?,
|
||||
@SerialName("progress")
|
||||
val progress: String?,
|
||||
@SerialName("text")
|
||||
val text: String?,
|
||||
@SerialName("message")
|
||||
val message: String?,
|
||||
@SerialName("siteUrl")
|
||||
val siteUrl: String?,
|
||||
@SerialName("isLocked")
|
||||
val isLocked: Boolean,
|
||||
@SerialName("isSubscribed")
|
||||
val isSubscribed: Boolean,
|
||||
@SerialName("likeCount")
|
||||
val likeCount: Int?,
|
||||
@SerialName("isLiked")
|
||||
val isLiked: Boolean?,
|
||||
@SerialName("isPinned")
|
||||
val isPinned: Boolean?,
|
||||
@SerialName("isPrivate")
|
||||
val isPrivate: Boolean?,
|
||||
@SerialName("createdAt")
|
||||
val createdAt: Int,
|
||||
@SerialName("user")
|
||||
val user: User?,
|
||||
@SerialName("media")
|
||||
val media: Media?,
|
||||
@SerialName("replies")
|
||||
val replies: List<Reply>?,
|
||||
@SerialName("likes")
|
||||
val likes: List<User>?,
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class Reply(
|
||||
@SerialName("id")
|
||||
val id: Int,
|
||||
@SerialName("userId")
|
||||
val userId: Int,
|
||||
@SerialName("text")
|
||||
val text: String,
|
||||
@SerialName("likeCount")
|
||||
val likeCount: Int,
|
||||
@SerialName("isLiked")
|
||||
val isLiked: Boolean,
|
||||
@SerialName("createdAt")
|
||||
val createdAt: Int,
|
||||
@SerialName("user")
|
||||
val user: User,
|
||||
@SerialName("likes")
|
||||
val likes: List<User>?,
|
||||
)
|
||||
@@ -283,7 +283,6 @@ class AnimeFragment : Fragment() {
|
||||
binding.root.requestApplyInsets()
|
||||
binding.root.requestLayout()
|
||||
}
|
||||
|
||||
super.onResume()
|
||||
}
|
||||
}
|
||||
@@ -94,6 +94,8 @@ class AnimePageAdapter : RecyclerView.Adapter<AnimePageAdapter.AnimePageViewHold
|
||||
SettingsDialogFragment.newInstance(SettingsDialogFragment.Companion.PageType.ANIME)
|
||||
dialogFragment.show((it.context as AppCompatActivity).supportFragmentManager, "dialog")
|
||||
}
|
||||
binding.animeNotificationCount.visibility = if (Anilist.unreadNotificationCount > 0) View.VISIBLE else View.GONE
|
||||
binding.animeNotificationCount.text = Anilist.unreadNotificationCount.toString()
|
||||
|
||||
listOf(
|
||||
binding.animePreviousSeason,
|
||||
|
||||
@@ -32,6 +32,7 @@ import ani.dantotsu.media.Media
|
||||
import ani.dantotsu.media.MediaAdaptor
|
||||
import ani.dantotsu.media.user.ListActivity
|
||||
import ani.dantotsu.navBarHeight
|
||||
import ani.dantotsu.profile.ProfileActivity
|
||||
import ani.dantotsu.setSafeOnClickListener
|
||||
import ani.dantotsu.setSlideIn
|
||||
import ani.dantotsu.setSlideUp
|
||||
@@ -79,8 +80,8 @@ class HomeFragment : Fragment() {
|
||||
if (!(PrefManager.getVal(PrefName.BannerAnimations) as Boolean)) binding.homeUserBg.pause()
|
||||
binding.homeUserBg.loadImage(Anilist.bg)
|
||||
binding.homeUserDataProgressBar.visibility = View.GONE
|
||||
|
||||
binding.homeNotificationDot.visibility = if (Anilist.unreadNotificationCount > 0) View.VISIBLE else View.GONE
|
||||
binding.homeNotificationCount.visibility = if (Anilist.unreadNotificationCount > 0) View.VISIBLE else View.GONE
|
||||
binding.homeNotificationCount.text = Anilist.unreadNotificationCount.toString()
|
||||
|
||||
binding.homeAnimeList.setOnClickListener {
|
||||
ContextCompat.startActivity(
|
||||
@@ -120,6 +121,13 @@ class HomeFragment : Fragment() {
|
||||
"dialog"
|
||||
)
|
||||
}
|
||||
binding.homeUserAvatarContainer.setOnLongClickListener {
|
||||
ContextCompat.startActivity(
|
||||
requireContext(), Intent(requireContext(), ProfileActivity::class.java)
|
||||
.putExtra("userId", Anilist.userid), null
|
||||
)
|
||||
false
|
||||
}
|
||||
|
||||
binding.homeContainer.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
||||
bottomMargin = navBarHeight
|
||||
@@ -360,11 +368,12 @@ class HomeFragment : Fragment() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
if (!model.loaded) Refresh.activity[1]!!.postValue(true)
|
||||
if (_binding != null)
|
||||
binding.homeNotificationDot.visibility = if (Anilist.unreadNotificationCount > 0) View.VISIBLE else View.GONE
|
||||
if (_binding != null) {
|
||||
binding.homeNotificationCount.visibility = if (Anilist.unreadNotificationCount > 0) View.VISIBLE else View.GONE
|
||||
binding.homeNotificationCount.text = Anilist.unreadNotificationCount.toString()
|
||||
}
|
||||
super.onResume()
|
||||
}
|
||||
}
|
||||
@@ -74,7 +74,8 @@ class MangaPageAdapter : RecyclerView.Adapter<MangaPageAdapter.MangaPageViewHold
|
||||
}
|
||||
|
||||
updateAvatar()
|
||||
|
||||
binding.mangaNotificationCount.visibility = if (Anilist.unreadNotificationCount > 0) View.VISIBLE else View.GONE
|
||||
binding.mangaNotificationCount.text = Anilist.unreadNotificationCount.toString()
|
||||
binding.mangaSearchBar.hint = "MANGA"
|
||||
binding.mangaSearchBarText.setOnClickListener {
|
||||
ContextCompat.startActivity(
|
||||
|
||||
@@ -369,7 +369,7 @@ class MangaChapterAdapter(
|
||||
}
|
||||
1L -> "1 day ago"
|
||||
in 2..6 -> "$daysDifference days ago"
|
||||
else -> SimpleDateFormat("dd MMM yyyy", Locale.ENGLISH).format(targetDate)
|
||||
else -> SimpleDateFormat("dd MMM yyyy", Locale.getDefault()).format(targetDate)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
package ani.dantotsu.profile
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.ViewGroup
|
||||
import android.view.Window
|
||||
import android.view.WindowManager
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.updateLayoutParams
|
||||
import ani.dantotsu.R
|
||||
import ani.dantotsu.databinding.ActivityActivityBinding
|
||||
import ani.dantotsu.initActivity
|
||||
import ani.dantotsu.settings.saving.PrefManager
|
||||
import ani.dantotsu.settings.saving.PrefName
|
||||
import ani.dantotsu.statusBarHeight
|
||||
import ani.dantotsu.themes.ThemeManager
|
||||
|
||||
|
||||
class ActivityActivity : AppCompatActivity() {
|
||||
private lateinit var binding: ActivityActivityBinding
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val immersiveMode = PrefManager.getVal<Boolean>(PrefName.ImmersiveMode)
|
||||
if (immersiveMode) {
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE)
|
||||
}
|
||||
super.onCreate(savedInstanceState)
|
||||
ThemeManager(this).applyTheme()
|
||||
initActivity(this)
|
||||
binding = ActivityActivityBinding.inflate(layoutInflater)
|
||||
if (!immersiveMode) {
|
||||
this.window.statusBarColor =
|
||||
ContextCompat.getColor(this, R.color.nav_bg_inv)
|
||||
binding.root.fitsSystemWindows = true
|
||||
|
||||
} else {
|
||||
binding.root.fitsSystemWindows = false
|
||||
window.setFlags(
|
||||
WindowManager.LayoutParams.FLAG_FULLSCREEN,
|
||||
WindowManager.LayoutParams.FLAG_FULLSCREEN
|
||||
)
|
||||
binding.listTitle.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
||||
topMargin = statusBarHeight
|
||||
}
|
||||
}
|
||||
setContentView(binding.root)
|
||||
}
|
||||
}
|
||||
@@ -2,23 +2,18 @@ package ani.dantotsu.profile
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.ViewGroup
|
||||
import android.view.View
|
||||
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
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import ani.dantotsu.R
|
||||
import ani.dantotsu.connections.anilist.Anilist
|
||||
import ani.dantotsu.connections.anilist.api.User
|
||||
import ani.dantotsu.databinding.ActivityFollowBinding
|
||||
import ani.dantotsu.initActivity
|
||||
import ani.dantotsu.navBarHeight
|
||||
import ani.dantotsu.settings.saving.PrefManager
|
||||
import ani.dantotsu.settings.saving.PrefName
|
||||
import ani.dantotsu.statusBarHeight
|
||||
@@ -36,31 +31,11 @@ class FollowActivity : AppCompatActivity(){
|
||||
private lateinit var selected: ImageButton
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val immersiveMode = PrefManager.getVal<Boolean>(PrefName.ImmersiveMode)
|
||||
if (immersiveMode) {
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE)
|
||||
}
|
||||
super.onCreate(savedInstanceState)
|
||||
ThemeManager(this).applyTheme()
|
||||
initActivity(this)
|
||||
binding = ActivityFollowBinding.inflate(layoutInflater)
|
||||
|
||||
if (!immersiveMode) {
|
||||
this.window.statusBarColor =
|
||||
ContextCompat.getColor(this, R.color.nav_bg_inv)
|
||||
binding.root.fitsSystemWindows = true
|
||||
|
||||
} else {
|
||||
binding.root.fitsSystemWindows = false
|
||||
window.setFlags(
|
||||
WindowManager.LayoutParams.FLAG_FULLSCREEN,
|
||||
WindowManager.LayoutParams.FLAG_FULLSCREEN
|
||||
)
|
||||
binding.listTitle.updateLayoutParams<MarginLayoutParams> {
|
||||
topMargin = statusBarHeight
|
||||
}
|
||||
}
|
||||
|
||||
binding.listToolbar.updateLayoutParams<MarginLayoutParams> { topMargin = statusBarHeight }
|
||||
setContentView(binding.root)
|
||||
val layoutType = PrefManager.getVal<Int>(PrefName.FollowerLayout)
|
||||
selected = getSelected(layoutType)
|
||||
@@ -73,7 +48,7 @@ class FollowActivity : AppCompatActivity(){
|
||||
false
|
||||
)
|
||||
binding.listRecyclerView.adapter = adapter
|
||||
|
||||
binding.listProgressBar.visibility = View.VISIBLE
|
||||
binding.listBack.setOnClickListener { finish() }
|
||||
|
||||
val title = intent.getStringExtra("title")
|
||||
@@ -89,6 +64,7 @@ class FollowActivity : AppCompatActivity(){
|
||||
users = respond
|
||||
withContext(Dispatchers.Main) {
|
||||
fillList()
|
||||
binding.listProgressBar.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
binding.followerList.setOnClickListener {
|
||||
@@ -112,7 +88,7 @@ class FollowActivity : AppCompatActivity(){
|
||||
}
|
||||
users?.forEach { user ->
|
||||
if (getLayoutType(selected) == 0) {
|
||||
adapter.add(FollowerItem(user.id, user.name ?: "Unknown", user.avatar?.medium, user.bannerImage) { onUserClick(it) })
|
||||
adapter.add(FollowerItem(user.id, user.name ?: "Unknown", user.avatar?.medium, user.bannerImage ?: user.avatar?.medium ) { onUserClick(it) })
|
||||
} else {
|
||||
adapter.add(GridFollowerItem(user.id, user.name ?: "Unknown", user.avatar?.medium) { onUserClick(it) })
|
||||
}
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
package ani.dantotsu.profile
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import ani.dantotsu.R
|
||||
import ani.dantotsu.databinding.ItemFollowerBinding
|
||||
import ani.dantotsu.loadImage
|
||||
import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
||||
import com.bumptech.glide.load.model.GlideUrl
|
||||
import com.bumptech.glide.request.RequestOptions
|
||||
import com.xwray.groupie.viewbinding.BindableItem
|
||||
import jp.wasabeef.glide.transformations.BlurTransformation
|
||||
|
||||
class FollowerItem(
|
||||
private val id: Int,
|
||||
@@ -18,9 +25,16 @@ class FollowerItem(
|
||||
override fun bind(viewBinding: ItemFollowerBinding, position: Int) {
|
||||
binding = viewBinding
|
||||
binding.profileUserName.text = name
|
||||
val context = binding.profileBannerImage.context
|
||||
avatar?.let { binding.profileUserAvatar.loadImage(it) }
|
||||
if (banner != null) {
|
||||
binding.profileBannerImage.loadImage(banner)
|
||||
if (!(context as Activity).isDestroyed)
|
||||
Glide.with(context as Context)
|
||||
.load(GlideUrl(banner))
|
||||
.diskCacheStrategy(DiskCacheStrategy.ALL).override(400)
|
||||
.apply(RequestOptions.bitmapTransform(BlurTransformation(2, 2)))
|
||||
.into(binding.profileBannerImage)
|
||||
} else {
|
||||
binding.profileBannerImage.setImageResource(R.drawable.linear_gradient_bg)
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import ani.dantotsu.initActivity
|
||||
import ani.dantotsu.loadImage
|
||||
import ani.dantotsu.navBarHeight
|
||||
import ani.dantotsu.others.ImageViewDialog
|
||||
import ani.dantotsu.profile.activity.ActivityActivity
|
||||
import ani.dantotsu.settings.saving.PrefManager
|
||||
import ani.dantotsu.settings.saving.PrefName
|
||||
import ani.dantotsu.snackString
|
||||
|
||||
@@ -36,6 +36,8 @@ class ProfileFragment() : Fragment() {
|
||||
lateinit var binding: FragmentProfileBinding
|
||||
private lateinit var activity: ProfileActivity
|
||||
private lateinit var user: Query.UserProfile
|
||||
private val favStaff = arrayListOf<Author>()
|
||||
private val favCharacter = arrayListOf<Character>()
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
@@ -132,24 +134,27 @@ class ProfileFragment() : Fragment() {
|
||||
binding.profileFavManga
|
||||
)
|
||||
|
||||
val favCharacter = arrayListOf<Character>()
|
||||
user.favourites?.characters?.nodes?.forEach { i ->
|
||||
favCharacter.add(Character(i.id, i.name.full, i.image.large, i.image.large, ""))
|
||||
}
|
||||
if (favCharacter.isEmpty()) {
|
||||
binding.profileFavCharactersContainer.visibility = View.GONE
|
||||
}
|
||||
binding.profileFavCharactersRecycler.adapter = CharacterAdapter(favCharacter)
|
||||
binding.profileFavCharactersRecycler.layoutManager = LinearLayoutManager(
|
||||
requireContext(),
|
||||
LinearLayoutManager.HORIZONTAL,
|
||||
false
|
||||
)
|
||||
|
||||
val favStaff = arrayListOf<Author>()
|
||||
user.favourites?.staff?.nodes?.forEach { i ->
|
||||
favStaff.add(Author(i.id, i.name.full, i.image.large , "" ))
|
||||
}
|
||||
|
||||
setFavPeople()
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
if (this::binding.isInitialized) {
|
||||
binding.root.requestLayout()
|
||||
setFavPeople()
|
||||
model.refresh()
|
||||
}
|
||||
}
|
||||
|
||||
private fun setFavPeople() {
|
||||
if (favStaff.isEmpty()) {
|
||||
binding.profileFavStaffContainer.visibility = View.GONE
|
||||
}
|
||||
@@ -159,15 +164,15 @@ class ProfileFragment() : Fragment() {
|
||||
LinearLayoutManager.HORIZONTAL,
|
||||
false
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
if (this::binding.isInitialized) {
|
||||
binding.root.requestLayout()
|
||||
|
||||
if (favCharacter.isEmpty()) {
|
||||
binding.profileFavCharactersContainer.visibility = View.GONE
|
||||
}
|
||||
binding.profileFavCharactersRecycler.adapter = CharacterAdapter(favCharacter)
|
||||
binding.profileFavCharactersRecycler.layoutManager = LinearLayoutManager(
|
||||
requireContext(),
|
||||
LinearLayoutManager.HORIZONTAL,
|
||||
false
|
||||
)
|
||||
}
|
||||
|
||||
private fun convertMarkdownToHtml(markdown: String): String {
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package ani.dantotsu.profile.activity
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.os.Bundle
|
||||
import android.view.ViewGroup
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.view.updateLayoutParams
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import ani.dantotsu.connections.anilist.Anilist
|
||||
import ani.dantotsu.connections.anilist.api.Activity
|
||||
import ani.dantotsu.databinding.ActivityFollowBinding
|
||||
import ani.dantotsu.initActivity
|
||||
import ani.dantotsu.statusBarHeight
|
||||
import ani.dantotsu.themes.ThemeManager
|
||||
import com.xwray.groupie.GroupieAdapter
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
class ActivityActivity : AppCompatActivity() {
|
||||
private lateinit var binding: ActivityFollowBinding
|
||||
private var adapter: GroupieAdapter = GroupieAdapter()
|
||||
private var activityList: List<Activity> = emptyList()
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
ThemeManager(this).applyTheme()
|
||||
initActivity(this)
|
||||
binding = ActivityFollowBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
|
||||
binding.listTitle.text = "Activity"
|
||||
binding.listToolbar.updateLayoutParams<ViewGroup.MarginLayoutParams> { topMargin = statusBarHeight }
|
||||
binding.listRecyclerView.adapter = adapter
|
||||
binding.listRecyclerView.layoutManager = LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)
|
||||
binding.followerGrid.visibility = ViewGroup.GONE
|
||||
binding.followerList.visibility = ViewGroup.GONE
|
||||
binding.listBack.setOnClickListener {
|
||||
onBackPressed()
|
||||
}
|
||||
binding.listProgressBar.visibility = ViewGroup.VISIBLE
|
||||
var userId: Int? = intent.getIntExtra("userId", -1)
|
||||
if (userId == -1) userId = null
|
||||
val global = intent.getBooleanExtra("global", false)
|
||||
|
||||
lifecycleScope.launch(Dispatchers.IO) {
|
||||
val res = Anilist.query.getFeed(userId, global)
|
||||
|
||||
withContext(Dispatchers.Main){
|
||||
res?.data?.page?.activities?.let { activities ->
|
||||
activityList = activities
|
||||
adapter.update(activityList.map { ActivityItem(it){} })
|
||||
}
|
||||
binding.listProgressBar.visibility = ViewGroup.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,22 +1,64 @@
|
||||
package ani.dantotsu.profile.activity
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import androidx.core.content.ContextCompat
|
||||
import ani.dantotsu.R
|
||||
import ani.dantotsu.databinding.ItemNotificationBinding
|
||||
import ani.dantotsu.connections.anilist.api.Activity
|
||||
import ani.dantotsu.databinding.ItemActivityBinding
|
||||
import ani.dantotsu.loadImage
|
||||
import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
||||
import com.bumptech.glide.load.model.GlideUrl
|
||||
import com.bumptech.glide.request.RequestOptions
|
||||
import com.xwray.groupie.viewbinding.BindableItem
|
||||
import jp.wasabeef.glide.transformations.BlurTransformation
|
||||
|
||||
class ActivityItem(
|
||||
): BindableItem<ItemNotificationBinding>() {
|
||||
private lateinit var binding: ItemNotificationBinding
|
||||
override fun bind(viewBinding: ItemNotificationBinding, position: Int) {
|
||||
private val activity: Activity,
|
||||
val clickCallback: (Int) -> Unit
|
||||
): BindableItem<ItemActivityBinding>() {
|
||||
private lateinit var binding: ItemActivityBinding
|
||||
@SuppressLint("SetTextI18n")
|
||||
override fun bind(viewBinding: ItemActivityBinding, position: Int) {
|
||||
binding = viewBinding
|
||||
when (activity.typename) {
|
||||
"ListActivity" ->{
|
||||
binding.activityUserName.text = activity.user?.name
|
||||
binding.activityUserAvatar.loadImage(activity.user?.avatar?.medium)
|
||||
binding.activityTime.text = ActivityItemBuilder.getDateTime(activity.createdAt)
|
||||
val color = if (activity.isLiked == true)
|
||||
ContextCompat.getColor(binding.root.context, R.color.yt_red)
|
||||
else
|
||||
ContextCompat.getColor(binding.root.context, R.color.bg_opp)
|
||||
binding.activityFavorite.setColorFilter(color)
|
||||
binding.activityFavoriteCount.text = activity.likeCount.toString()
|
||||
binding.activityMediaName.text = activity.media?.title?.userPreferred
|
||||
binding.activityText.text = "${activity.user!!.name} ${activity.status} ${activity.progress ?: ""}"
|
||||
binding.activityCover.loadImage(activity.media?.coverImage?.large)
|
||||
val context = binding.root.context
|
||||
val banner = activity.media?.bannerImage ?: activity.media?.coverImage?.large
|
||||
if (banner != null) {
|
||||
if (!(context as android.app.Activity).isDestroyed) {
|
||||
Glide.with(context as Context)
|
||||
.load(GlideUrl(banner))
|
||||
.diskCacheStrategy(DiskCacheStrategy.ALL).override(400)
|
||||
.apply(RequestOptions.bitmapTransform(BlurTransformation(2, 2)))
|
||||
.into(binding.activityBannerImage)
|
||||
}
|
||||
} else {
|
||||
binding.activityBannerImage.setImageResource(R.drawable.linear_gradient_bg)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getLayout(): Int {
|
||||
return R.layout.item_notification
|
||||
return R.layout.item_activity
|
||||
}
|
||||
|
||||
override fun initializeViewBinding(view: View): ItemNotificationBinding {
|
||||
return ItemNotificationBinding.bind(view)
|
||||
override fun initializeViewBinding(view: View): ItemActivityBinding {
|
||||
return ItemActivityBinding.bind(view)
|
||||
}
|
||||
}
|
||||
@@ -5,63 +5,7 @@ import ani.dantotsu.connections.anilist.api.NotificationType
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Date
|
||||
import java.util.Locale
|
||||
|
||||
/*
|
||||
* ACTIVITY_MESSAGE
|
||||
|
||||
A user has sent you message
|
||||
ACTIVITY_REPLY
|
||||
|
||||
A user has replied to your activity
|
||||
FOLLOWING
|
||||
|
||||
A user has followed you
|
||||
ACTIVITY_MENTION
|
||||
|
||||
A user has mentioned you in their activity
|
||||
THREAD_COMMENT_MENTION
|
||||
|
||||
A user has mentioned you in a forum comment
|
||||
THREAD_SUBSCRIBED
|
||||
|
||||
A user has commented in one of your subscribed forum threads
|
||||
THREAD_COMMENT_REPLY
|
||||
|
||||
A user has replied to your forum comment
|
||||
AIRING
|
||||
|
||||
An anime you are currently watching has aired
|
||||
ACTIVITY_LIKE
|
||||
|
||||
A user has liked your activity
|
||||
ACTIVITY_REPLY_LIKE
|
||||
|
||||
A user has liked your activity reply
|
||||
THREAD_LIKE
|
||||
|
||||
A user has liked your forum thread
|
||||
THREAD_COMMENT_LIKE
|
||||
|
||||
A user has liked your forum comment
|
||||
ACTIVITY_REPLY_SUBSCRIBED
|
||||
|
||||
A user has replied to activity you have also replied to
|
||||
RELATED_MEDIA_ADDITION
|
||||
|
||||
A new anime or manga has been added to the site where its related media is on the user's list
|
||||
MEDIA_DATA_CHANGE
|
||||
|
||||
An anime or manga has had a data change that affects how a user may track it in their lists
|
||||
MEDIA_MERGE
|
||||
|
||||
Anime or manga entries on the user's list have been merged into a single entry
|
||||
MEDIA_DELETION
|
||||
|
||||
An anime or manga on the user's list has been deleted from the site
|
||||
|
||||
* */
|
||||
|
||||
interface NotificationItemBuilder {
|
||||
class ActivityItemBuilder {
|
||||
|
||||
companion object {
|
||||
fun getContent(notification: Notification): String {
|
||||
@@ -138,11 +82,33 @@ interface NotificationItemBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
fun getDateTime(time: Int): String {
|
||||
val date = Date(time * 1000L)
|
||||
val sdf = SimpleDateFormat("dd/MM/yyyy hh:mm a", Locale.getDefault())
|
||||
return sdf.format(date)
|
||||
}
|
||||
|
||||
fun getDateTime(timestamp: Int): String {
|
||||
|
||||
val targetDate = Date(timestamp * 1000L)
|
||||
|
||||
if (targetDate < Date(946684800000L)) { // January 1, 2000 (who want dates before that?)
|
||||
return ""
|
||||
}
|
||||
|
||||
val currentDate = Date()
|
||||
val difference = currentDate.time - targetDate.time
|
||||
|
||||
return when (val daysDifference = difference / (1000 * 60 * 60 * 24)) {
|
||||
0L -> {
|
||||
val hoursDifference = difference / (1000 * 60 * 60)
|
||||
val minutesDifference = (difference / (1000 * 60)) % 60
|
||||
|
||||
when {
|
||||
hoursDifference > 0 -> "$hoursDifference hour${if (hoursDifference > 1) "s" else ""} ago"
|
||||
minutesDifference > 0 -> "$minutesDifference minute${if (minutesDifference > 1) "s" else ""} ago"
|
||||
else -> "Just now"
|
||||
}
|
||||
}
|
||||
1L -> "1 day ago"
|
||||
in 2..6 -> "$daysDifference days ago"
|
||||
else -> SimpleDateFormat("dd MMM yyyy", Locale.getDefault()).format(targetDate)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,74 +1,58 @@
|
||||
package ani.dantotsu.notifications
|
||||
package ani.dantotsu.profile.activity
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.ViewGroup
|
||||
import android.view.Window
|
||||
import android.view.WindowManager
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.updateLayoutParams
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import ani.dantotsu.R
|
||||
import ani.dantotsu.connections.anilist.Anilist
|
||||
import ani.dantotsu.connections.anilist.api.Notification
|
||||
import ani.dantotsu.databinding.ActivityNotificationBinding
|
||||
import ani.dantotsu.databinding.ActivityFollowBinding
|
||||
import ani.dantotsu.initActivity
|
||||
import ani.dantotsu.media.MediaDetailsActivity
|
||||
import ani.dantotsu.profile.ProfileActivity
|
||||
import ani.dantotsu.profile.activity.NotificationItem
|
||||
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
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
class NotificationActivity : AppCompatActivity() {
|
||||
private lateinit var binding: ActivityNotificationBinding
|
||||
private lateinit var binding: ActivityFollowBinding
|
||||
private var adapter: GroupieAdapter = GroupieAdapter()
|
||||
private var notificationList: List<Notification> = emptyList()
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val immersiveMode = PrefManager.getVal<Boolean>(PrefName.ImmersiveMode)
|
||||
if (immersiveMode) {
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE)
|
||||
}
|
||||
super.onCreate(savedInstanceState)
|
||||
ThemeManager(this).applyTheme()
|
||||
initActivity(this)
|
||||
binding = ActivityNotificationBinding.inflate(layoutInflater)
|
||||
if (!immersiveMode) {
|
||||
this.window.statusBarColor =
|
||||
ContextCompat.getColor(this, R.color.nav_bg_inv)
|
||||
binding.root.fitsSystemWindows = true
|
||||
|
||||
} else {
|
||||
binding.root.fitsSystemWindows = false
|
||||
window.setFlags(
|
||||
WindowManager.LayoutParams.FLAG_FULLSCREEN,
|
||||
WindowManager.LayoutParams.FLAG_FULLSCREEN
|
||||
)
|
||||
binding.listTitle.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
||||
topMargin = statusBarHeight
|
||||
}
|
||||
}
|
||||
binding = ActivityFollowBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
|
||||
binding.notificationList.adapter = adapter
|
||||
binding.notificationList.layoutManager = LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)
|
||||
|
||||
binding.listTitle.text = "Notifications"
|
||||
binding.listToolbar.updateLayoutParams<ViewGroup.MarginLayoutParams> { topMargin = statusBarHeight }
|
||||
binding.listRecyclerView.adapter = adapter
|
||||
binding.listRecyclerView.layoutManager = LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)
|
||||
binding.followerGrid.visibility = ViewGroup.GONE
|
||||
binding.followerList.visibility = ViewGroup.GONE
|
||||
binding.listBack.setOnClickListener {
|
||||
onBackPressed()
|
||||
}
|
||||
|
||||
binding.listProgressBar.visibility = ViewGroup.VISIBLE
|
||||
lifecycleScope.launch {
|
||||
val res = Anilist.query.getNotifications(Anilist.userid?:0)
|
||||
res?.data?.page?.notifications?.let { notifications ->
|
||||
notificationList = notifications
|
||||
adapter.update(notificationList.map { NotificationItem(it, ::onNotificationClick) })
|
||||
}
|
||||
withContext(Dispatchers.Main){
|
||||
binding.listProgressBar.visibility = ViewGroup.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,20 @@
|
||||
package ani.dantotsu.profile.activity
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.util.TypedValue
|
||||
import android.view.View
|
||||
import ani.dantotsu.R
|
||||
import ani.dantotsu.connections.anilist.api.Notification
|
||||
import ani.dantotsu.connections.anilist.api.NotificationType
|
||||
import ani.dantotsu.databinding.ItemNotificationBinding
|
||||
import ani.dantotsu.loadImage
|
||||
import ani.dantotsu.notifications.NotificationActivity
|
||||
import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
||||
import com.bumptech.glide.load.model.GlideUrl
|
||||
import com.bumptech.glide.request.RequestOptions
|
||||
import com.xwray.groupie.viewbinding.BindableItem
|
||||
import jp.wasabeef.glide.transformations.BlurTransformation
|
||||
|
||||
class NotificationItem(
|
||||
private val notification: Notification,
|
||||
@@ -29,107 +36,137 @@ class NotificationItem(
|
||||
return ItemNotificationBinding.bind(view)
|
||||
}
|
||||
|
||||
private fun image(user: Boolean = false) {
|
||||
val context = binding.notificationBannerImage.context
|
||||
val cover = if (user) notification.user?.bannerImage ?: notification.user?.avatar?.medium else notification.media?.bannerImage ?: notification.media?.coverImage?.large
|
||||
if (cover != null) {
|
||||
if (!(context as Activity).isDestroyed)
|
||||
Glide.with(context as Context)
|
||||
.load(GlideUrl(cover))
|
||||
.diskCacheStrategy(DiskCacheStrategy.ALL).override(400)
|
||||
.apply(RequestOptions.bitmapTransform(BlurTransformation(2, 2)))
|
||||
.into(binding.notificationBannerImage)
|
||||
} else {
|
||||
binding.notificationBannerImage.setImageResource(R.drawable.linear_gradient_bg)
|
||||
}
|
||||
val defaultHeight = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 170f, context.resources.displayMetrics).toInt()
|
||||
val userHeight = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 90f, context.resources.displayMetrics).toInt()
|
||||
|
||||
if (user) {
|
||||
binding.notificationCover.visibility = View.GONE
|
||||
binding.notificationCoverUser.visibility = View.VISIBLE
|
||||
binding.notificationCoverUserContainer.visibility = View.VISIBLE
|
||||
binding.notificationCoverUser.loadImage(notification.user?.avatar?.large)
|
||||
binding.notificationBannerImage.layoutParams.height = 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
|
||||
}
|
||||
}
|
||||
|
||||
private fun setBinding() {
|
||||
val notificationType: NotificationType =
|
||||
NotificationType.valueOf(notification.notificationType)
|
||||
binding.notificationText.text = NotificationItemBuilder.getContent(notification)
|
||||
binding.notificationDate.text = NotificationItemBuilder.getDateTime(notification.createdAt)
|
||||
binding.notificationText.text = ActivityItemBuilder.getContent(notification)
|
||||
binding.notificationDate.text = ActivityItemBuilder.getDateTime(notification.createdAt)
|
||||
binding.root.setOnClickListener { clickCallback(id, clickType) }
|
||||
|
||||
|
||||
when (notificationType) {
|
||||
NotificationType.ACTIVITY_MESSAGE -> {
|
||||
binding.notificationCover.loadImage(notification.user?.avatar?.large)
|
||||
binding.notificationBannerImage.loadImage(notification.user?.bannerImage)
|
||||
image(true)
|
||||
clickType = NotificationActivity.Companion.NotificationClickType.USER
|
||||
id = notification.user?.id ?: 0
|
||||
}
|
||||
NotificationType.ACTIVITY_REPLY -> {
|
||||
binding.notificationCover.loadImage(notification.user?.avatar?.large)
|
||||
binding.notificationBannerImage.loadImage(notification.user?.bannerImage)
|
||||
image(true)
|
||||
clickType = NotificationActivity.Companion.NotificationClickType.USER
|
||||
id = notification.user?.id ?: 0
|
||||
}
|
||||
NotificationType.FOLLOWING -> {
|
||||
binding.notificationCover.loadImage(notification.user?.avatar?.large)
|
||||
binding.notificationBannerImage.loadImage(notification.user?.bannerImage)
|
||||
image(true)
|
||||
clickType = NotificationActivity.Companion.NotificationClickType.USER
|
||||
id = notification.user?.id ?: 0
|
||||
}
|
||||
NotificationType.ACTIVITY_MENTION -> {
|
||||
binding.notificationCover.loadImage(notification.user?.avatar?.large)
|
||||
binding.notificationBannerImage.loadImage(notification.user?.bannerImage)
|
||||
image(true)
|
||||
clickType = NotificationActivity.Companion.NotificationClickType.USER
|
||||
id = notification.user?.id ?: 0
|
||||
}
|
||||
NotificationType.THREAD_COMMENT_MENTION -> {
|
||||
binding.notificationCover.loadImage(notification.user?.avatar?.large)
|
||||
binding.notificationBannerImage.loadImage(notification.user?.bannerImage)
|
||||
image(true)
|
||||
clickType = NotificationActivity.Companion.NotificationClickType.USER
|
||||
id = notification.user?.id ?: 0
|
||||
}
|
||||
NotificationType.THREAD_SUBSCRIBED -> {
|
||||
binding.notificationCover.loadImage(notification.user?.avatar?.large)
|
||||
binding.notificationBannerImage.loadImage(notification.user?.bannerImage)
|
||||
image(true)
|
||||
clickType = NotificationActivity.Companion.NotificationClickType.USER
|
||||
id = notification.user?.id ?: 0
|
||||
}
|
||||
NotificationType.THREAD_COMMENT_REPLY -> {
|
||||
binding.notificationCover.loadImage(notification.user?.avatar?.large)
|
||||
binding.notificationBannerImage.loadImage(notification.user?.bannerImage)
|
||||
image(true)
|
||||
clickType = NotificationActivity.Companion.NotificationClickType.USER
|
||||
id = notification.user?.id ?: 0
|
||||
}
|
||||
NotificationType.AIRING -> {
|
||||
binding.notificationCover.loadImage(notification.media?.coverImage?.large)
|
||||
binding.notificationBannerImage.loadImage(notification.media?.bannerImage)
|
||||
image()
|
||||
clickType = NotificationActivity.Companion.NotificationClickType.MEDIA
|
||||
id = notification.media?.id ?: 0
|
||||
}
|
||||
NotificationType.ACTIVITY_LIKE -> {
|
||||
binding.notificationCover.loadImage(notification.user?.avatar?.large)
|
||||
binding.notificationBannerImage.loadImage(notification.user?.bannerImage)
|
||||
image(true)
|
||||
clickType = NotificationActivity.Companion.NotificationClickType.USER
|
||||
id = notification.user?.id ?: 0
|
||||
}
|
||||
NotificationType.ACTIVITY_REPLY_LIKE -> {
|
||||
binding.notificationCover.loadImage(notification.user?.avatar?.large)
|
||||
binding.notificationBannerImage.loadImage(notification.user?.bannerImage)
|
||||
image(true)
|
||||
clickType = NotificationActivity.Companion.NotificationClickType.USER
|
||||
id = notification.user?.id ?: 0
|
||||
}
|
||||
NotificationType.THREAD_LIKE -> {
|
||||
binding.notificationCover.loadImage(notification.user?.avatar?.large)
|
||||
binding.notificationBannerImage.loadImage(notification.user?.bannerImage)
|
||||
image(true)
|
||||
clickType = NotificationActivity.Companion.NotificationClickType.USER
|
||||
id = notification.user?.id ?: 0
|
||||
}
|
||||
NotificationType.THREAD_COMMENT_LIKE -> {
|
||||
binding.notificationCover.loadImage(notification.user?.avatar?.large)
|
||||
binding.notificationBannerImage.loadImage(notification.user?.bannerImage)
|
||||
image(true)
|
||||
clickType = NotificationActivity.Companion.NotificationClickType.USER
|
||||
id = notification.user?.id ?: 0
|
||||
}
|
||||
NotificationType.ACTIVITY_REPLY_SUBSCRIBED -> {
|
||||
binding.notificationCover.loadImage(notification.user?.avatar?.large)
|
||||
binding.notificationBannerImage.loadImage(notification.user?.bannerImage)
|
||||
image(true)
|
||||
clickType = NotificationActivity.Companion.NotificationClickType.USER
|
||||
id = notification.user?.id ?: 0
|
||||
}
|
||||
NotificationType.RELATED_MEDIA_ADDITION -> {
|
||||
binding.notificationCover.loadImage(notification.media?.coverImage?.large)
|
||||
binding.notificationBannerImage.loadImage(notification.media?.bannerImage)
|
||||
image()
|
||||
clickType = NotificationActivity.Companion.NotificationClickType.MEDIA
|
||||
id = notification.media?.id ?: 0
|
||||
}
|
||||
NotificationType.MEDIA_DATA_CHANGE -> {
|
||||
binding.notificationCover.loadImage(notification.media?.coverImage?.large)
|
||||
binding.notificationBannerImage.loadImage(notification.media?.bannerImage)
|
||||
image()
|
||||
clickType = NotificationActivity.Companion.NotificationClickType.MEDIA
|
||||
id = notification.media?.id ?: 0
|
||||
}
|
||||
NotificationType.MEDIA_MERGE -> {
|
||||
binding.notificationCover.loadImage(notification.media?.coverImage?.large)
|
||||
binding.notificationBannerImage.loadImage(notification.media?.bannerImage)
|
||||
image()
|
||||
clickType = NotificationActivity.Companion.NotificationClickType.MEDIA
|
||||
id = notification.media?.id ?: 0
|
||||
}
|
||||
|
||||
@@ -23,10 +23,8 @@ import ani.dantotsu.home.MangaFragment
|
||||
import ani.dantotsu.home.NoInternet
|
||||
import ani.dantotsu.incognitoNotification
|
||||
import ani.dantotsu.loadImage
|
||||
import ani.dantotsu.notifications.NotificationActivity
|
||||
import ani.dantotsu.profile.activity.NotificationActivity
|
||||
import ani.dantotsu.offline.OfflineFragment
|
||||
import ani.dantotsu.openLinkInBrowser
|
||||
import ani.dantotsu.others.imagesearch.ImageSearchActivity
|
||||
import ani.dantotsu.setSafeOnClickListener
|
||||
import ani.dantotsu.settings.saving.PrefManager
|
||||
import ani.dantotsu.settings.saving.PrefName
|
||||
@@ -61,6 +59,12 @@ class SettingsDialogFragment : BottomSheetDialogFragment() {
|
||||
val theme = requireContext().theme
|
||||
theme.resolveAttribute(com.google.android.material.R.attr.colorSurface, typedValue, true)
|
||||
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)
|
||||
|
||||
if (Anilist.token != null) {
|
||||
binding.settingsLogin.setText(R.string.logout)
|
||||
@@ -79,31 +83,31 @@ class SettingsDialogFragment : BottomSheetDialogFragment() {
|
||||
Anilist.loginIntent(requireActivity())
|
||||
}
|
||||
}
|
||||
binding.settingsNotificationCount.visibility = if (Anilist.unreadNotificationCount > 0) View.VISIBLE else View.GONE
|
||||
binding.settingsNotificationCount.text = Anilist.unreadNotificationCount.toString()
|
||||
binding.settingsUserAvatar.setOnClickListener{
|
||||
ContextCompat.startActivity(
|
||||
requireContext(), Intent(requireContext(), ProfileActivity::class.java)
|
||||
.putExtra("userId", Anilist.userid), null
|
||||
)
|
||||
}
|
||||
binding.settingsIncognito.isChecked =
|
||||
PrefManager.getVal(PrefName.Incognito)
|
||||
|
||||
binding.settingsIncognito.isChecked = PrefManager.getVal(PrefName.Incognito)
|
||||
binding.settingsIncognito.setOnCheckedChangeListener { _, isChecked ->
|
||||
PrefManager.setVal(PrefName.Incognito, isChecked)
|
||||
incognitoNotification(requireContext())
|
||||
}
|
||||
|
||||
binding.settingsExtensionSettings.setSafeOnClickListener {
|
||||
startActivity(Intent(activity, ExtensionsActivity::class.java))
|
||||
dismiss()
|
||||
}
|
||||
|
||||
binding.settingsSettings.setSafeOnClickListener {
|
||||
startActivity(Intent(activity, SettingsActivity::class.java))
|
||||
dismiss()
|
||||
}
|
||||
binding.settingsAnilistSettings.setOnClickListener {
|
||||
openLinkInBrowser("https://anilist.co/settings/lists")
|
||||
dismiss()
|
||||
}
|
||||
|
||||
binding.settingsNotification.setOnClickListener {
|
||||
startActivity(Intent(activity, NotificationActivity::class.java))
|
||||
dismiss()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="?attr/colorError"/>
|
||||
<solid android:color="#C6140A"/>
|
||||
<size
|
||||
android:width="100dp"
|
||||
android:height="100dp"/>
|
||||
|
||||
@@ -6,15 +6,21 @@
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ProgressBar
|
||||
<LinearLayout
|
||||
android:id="@+id/listProgressBar"
|
||||
style="?android:attr/progressBarStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:visibility="gone" />
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
tools:visibility="gone">
|
||||
|
||||
<ProgressBar
|
||||
style="?android:attr/progressBarStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/listToolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
<LinearLayout 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:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/listProgressBar"
|
||||
style="?android:attr/progressBarStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:visibility="gone" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/listBack"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start|center_vertical"
|
||||
android:layout_marginStart="12dp"
|
||||
android:src="@drawable/ic_round_arrow_back_ios_new_24"
|
||||
app:tint="?attr/colorOnBackground"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/listTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="48dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="44dp"
|
||||
android:ellipsize="end"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:gravity="center|start"
|
||||
android:singleLine="true"
|
||||
android:text="Notifications"
|
||||
android:textAppearance="@style/TextAppearance.Widget.AppCompat.Toolbar.Title"
|
||||
android:textColor="?attr/colorOnBackground"
|
||||
android:textSize="18sp"
|
||||
tools:ignore="HardcodedText" />
|
||||
</FrameLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/notificationList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
tools:listitem="@layout/item_notification" />
|
||||
</LinearLayout>
|
||||
@@ -67,6 +67,7 @@
|
||||
android:layout_height="82dp"
|
||||
android:layout_gravity="center"
|
||||
android:backgroundTint="@color/transparent"
|
||||
app:strokeColor="@color/transparent"
|
||||
app:cardCornerRadius="64dp">
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
@@ -100,7 +101,7 @@
|
||||
android:backgroundTint="?attr/colorSecondaryContainer"
|
||||
android:enabled="true"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:text="Follow"
|
||||
android:text="@string/follow"
|
||||
android:textColor="@color/bg_opp"
|
||||
android:textSize="14sp"
|
||||
app:cornerRadius="8dp"
|
||||
|
||||
@@ -2,13 +2,9 @@
|
||||
<androidx.core.widget.NestedScrollView 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:background="@drawable/bottom_sheet_background"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bottom_sheet_background">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -17,196 +13,219 @@
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:orientation="horizontal"
|
||||
android:padding="16dp">
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="64dp"
|
||||
android:orientation="vertical">
|
||||
android:layout_gravity="bottom"
|
||||
android:orientation="horizontal"
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/settingsUsername"
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/homeUserAvatarContainer"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="52dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:backgroundTint="@color/nav_bg_inv"
|
||||
app:cardCornerRadius="26dp">
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/settingsUserAvatar"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="52dp"
|
||||
android:scaleType="center"
|
||||
app:srcCompat="@drawable/ic_round_person_24"
|
||||
tools:ignore="ContentDescription,ImageContrastCheck" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="64dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/settingsUsername"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="-4dp"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:gravity="center"
|
||||
android:text="@string/username"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/settingsLogin"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="-16dp"
|
||||
android:layout_marginTop="-16dp"
|
||||
android:layout_marginBottom="-16dp"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:padding="16dp"
|
||||
android:text="@string/logout"
|
||||
android:textColor="?attr/colorSecondary"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="-4dp"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:gravity="center"
|
||||
android:text="@string/username"
|
||||
android:textSize="16sp" />
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginEnd="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/settingsLogin"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="-16dp"
|
||||
android:layout_marginTop="-16dp"
|
||||
android:layout_marginBottom="-16dp"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:padding="16dp"
|
||||
android:text="@string/logout"
|
||||
android:textColor="?attr/colorSecondary"
|
||||
android:textSize="14sp" />
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="52dp"
|
||||
|
||||
android:backgroundTint="@color/nav_bg_inv"
|
||||
app:cardCornerRadius="26dp">
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/settingsNotification"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="52dp"
|
||||
android:scaleType="center"
|
||||
app:srcCompat="@drawable/ic_round_notifications_active_24"
|
||||
app:tint="@color/bg_opp"
|
||||
tools:ignore="ContentDescription,ImageContrastCheck" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/settingsNotificationCount"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_gravity="end|bottom"
|
||||
android:background="@drawable/notification_circle"
|
||||
android:fontFamily="@font/poppins_semi_bold"
|
||||
android:gravity="center"
|
||||
android:textColor="#F3F3F3"
|
||||
android:textSize="12sp"
|
||||
android:visibility="gone"
|
||||
tools:ignore="SmallSp"
|
||||
tools:text="1"
|
||||
tools:visibility="visible" />
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="52dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginEnd="14dp"
|
||||
android:backgroundTint="@color/nav_bg_inv"
|
||||
app:cardCornerRadius="26dp">
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/settingsNotification"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="52dp"
|
||||
android:scaleType="center"
|
||||
app:srcCompat="@drawable/ic_round_notifications_active_24"
|
||||
app:tint="@color/bg_opp"
|
||||
tools:ignore="ContentDescription,ImageContrastCheck" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/homeUserAvatarContainer"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="52dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:backgroundTint="@color/nav_bg_inv"
|
||||
app:cardCornerRadius="26dp">
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/settingsUserAvatar"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="52dp"
|
||||
android:scaleType="center"
|
||||
app:srcCompat="@drawable/ic_round_person_24"
|
||||
tools:ignore="ContentDescription,ImageContrastCheck" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
<com.google.android.material.materialswitch.MaterialSwitch
|
||||
android:id="@+id/settingsIncognito"
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="64dp"
|
||||
android:checked="false"
|
||||
android:drawableStart="@drawable/ic_incognito_24"
|
||||
android:drawablePadding="16dp"
|
||||
android:elegantTextHeight="true"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:insetTop="0dp"
|
||||
android:insetBottom="0dp"
|
||||
android:paddingStart="32dp"
|
||||
android:paddingEnd="32dp"
|
||||
android:text="@string/incognito_mode"
|
||||
android:textAlignment="viewStart"
|
||||
android:textColor="?attr/colorOnBackground"
|
||||
app:cornerRadius="0dp"
|
||||
app:drawableTint="?attr/colorPrimary"
|
||||
app:showText="false"
|
||||
app:thumbTint="@color/button_switch_track" />
|
||||
|
||||
<com.google.android.material.materialswitch.MaterialSwitch
|
||||
android:id="@+id/settingsDownloads"
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="64dp"
|
||||
android:checked="false"
|
||||
android:drawableStart="@drawable/ic_download_24"
|
||||
android:drawablePadding="16dp"
|
||||
android:elegantTextHeight="true"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:insetTop="0dp"
|
||||
android:insetBottom="0dp"
|
||||
android:paddingStart="32dp"
|
||||
android:paddingEnd="32dp"
|
||||
android:text="@string/offline_mode"
|
||||
android:textAlignment="viewStart"
|
||||
android:textColor="?attr/colorOnBackground"
|
||||
app:cornerRadius="0dp"
|
||||
app:drawableTint="?attr/colorPrimary"
|
||||
app:showText="false"
|
||||
app:thumbTint="@color/button_switch_track" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.materialswitch.MaterialSwitch
|
||||
android:id="@+id/settingsIncognito"
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="64dp"
|
||||
android:checked="false"
|
||||
android:drawableStart="@drawable/ic_incognito_24"
|
||||
android:drawablePadding="16dp"
|
||||
android:elegantTextHeight="true"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:insetTop="0dp"
|
||||
android:insetBottom="0dp"
|
||||
android:paddingStart="32dp"
|
||||
android:paddingEnd="32dp"
|
||||
android:text="@string/incognito_mode"
|
||||
android:textAlignment="viewStart"
|
||||
android:textColor="?attr/colorOnBackground"
|
||||
app:cornerRadius="0dp"
|
||||
app:drawableTint="?attr/colorPrimary"
|
||||
app:showText="false"
|
||||
app:thumbTint="@color/button_switch_track" />
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginEnd="58dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.materialswitch.MaterialSwitch
|
||||
android:id="@+id/settingsDownloads"
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="64dp"
|
||||
android:checked="false"
|
||||
android:drawableStart="@drawable/ic_download_24"
|
||||
android:drawablePadding="16dp"
|
||||
android:elegantTextHeight="true"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:insetTop="0dp"
|
||||
android:insetBottom="0dp"
|
||||
android:paddingStart="32dp"
|
||||
android:paddingEnd="32dp"
|
||||
android:text="@string/offline_mode"
|
||||
android:textAlignment="viewStart"
|
||||
android:textColor="?attr/colorOnBackground"
|
||||
app:cornerRadius="0dp"
|
||||
app:drawableTint="?attr/colorPrimary"
|
||||
app:showText="false"
|
||||
app:thumbTint="@color/button_switch_track" />
|
||||
</LinearLayout>
|
||||
<Button
|
||||
android:id="@+id/settingsActivity"
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="64dp"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:insetTop="0dp"
|
||||
android:insetBottom="0dp"
|
||||
android:paddingStart="32dp"
|
||||
android:paddingEnd="32dp"
|
||||
android:text="Activity"
|
||||
android:textAlignment="viewStart"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="?attr/colorOnBackground"
|
||||
app:cornerRadius="0dp"
|
||||
app:icon="@drawable/inbox_empty"
|
||||
app:iconPadding="16dp"
|
||||
app:iconSize="24dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginEnd="58dp"
|
||||
android:orientation="vertical">
|
||||
<Button
|
||||
android:id="@+id/settingsExtensionSettings"
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="64dp"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:insetTop="0dp"
|
||||
android:insetBottom="0dp"
|
||||
android:paddingStart="32dp"
|
||||
android:paddingEnd="32dp"
|
||||
android:text="@string/extension_settings"
|
||||
android:textAlignment="viewStart"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="?attr/colorOnBackground"
|
||||
app:cornerRadius="0dp"
|
||||
app:icon="@drawable/ic_extension"
|
||||
app:iconPadding="16dp"
|
||||
app:iconSize="24dp" />
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/settingsAnilistSettings"
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="64dp"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:insetTop="0dp"
|
||||
android:insetBottom="0dp"
|
||||
android:paddingStart="32dp"
|
||||
android:paddingEnd="32dp"
|
||||
android:text="@string/anilist_settings"
|
||||
android:textAlignment="viewStart"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="?attr/colorOnBackground"
|
||||
app:cornerRadius="0dp"
|
||||
app:icon="@drawable/ic_anilist"
|
||||
app:iconPadding="16dp"
|
||||
app:iconSize="24dp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/settingsExtensionSettings"
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="64dp"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:insetTop="0dp"
|
||||
android:insetBottom="0dp"
|
||||
android:paddingStart="32dp"
|
||||
android:paddingEnd="32dp"
|
||||
android:text="@string/extension_settings"
|
||||
android:textAlignment="viewStart"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="?attr/colorOnBackground"
|
||||
app:cornerRadius="0dp"
|
||||
app:icon="@drawable/ic_extension"
|
||||
app:iconPadding="16dp"
|
||||
app:iconSize="24dp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/settingsSettings"
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="64dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:insetTop="0dp"
|
||||
android:insetBottom="0dp"
|
||||
android:paddingStart="32dp"
|
||||
android:paddingEnd="32dp"
|
||||
android:text="@string/settings"
|
||||
android:textAlignment="viewStart"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="?attr/colorOnBackground"
|
||||
app:cornerRadius="0dp"
|
||||
|
||||
app:icon="@drawable/ic_round_settings_24"
|
||||
app:iconPadding="16dp"
|
||||
app:iconSize="24dp" />
|
||||
|
||||
</LinearLayout>
|
||||
<Button
|
||||
android:id="@+id/settingsSettings"
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="64dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:insetTop="0dp"
|
||||
android:insetBottom="0dp"
|
||||
android:paddingStart="32dp"
|
||||
android:paddingEnd="32dp"
|
||||
android:text="@string/settings"
|
||||
android:textAlignment="viewStart"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="?attr/colorOnBackground"
|
||||
app:cornerRadius="0dp"
|
||||
app:icon="@drawable/ic_round_settings_24"
|
||||
app:iconPadding="16dp"
|
||||
app:iconSize="24dp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
@@ -157,12 +157,20 @@
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<View
|
||||
android:id="@+id/homeNotificationDot"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:background="@drawable/notification_circle"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/homeNotificationCount"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_gravity="end|bottom"
|
||||
android:background="@drawable/notification_circle"
|
||||
android:fontFamily="@font/poppins_semi_bold"
|
||||
android:gravity="center"
|
||||
android:textColor="#F3F3F3"
|
||||
android:textSize="12sp"
|
||||
android:visibility="gone"
|
||||
tools:ignore="SmallSp"
|
||||
tools:text="1"
|
||||
tools:visibility="visible" />
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="HardcodedText">
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/userListContainer"
|
||||
@@ -145,8 +144,8 @@
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:text="@string/stats"
|
||||
android:padding="8dp"
|
||||
android:text="Stats"
|
||||
android:textSize="18sp"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
@@ -157,8 +156,7 @@
|
||||
android:paddingStart="32dp"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingEnd="32dp"
|
||||
android:paddingBottom="16dp"
|
||||
tools:ignore="HardcodedText">
|
||||
android:paddingBottom="16dp">
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
@@ -169,7 +167,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="0.58"
|
||||
android:text="Episodes watched"
|
||||
android:text="@string/episodes_watched"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
@@ -191,7 +189,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="0.58"
|
||||
android:text="Days watched"
|
||||
android:text="@string/days_watched"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
@@ -212,7 +210,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="0.58"
|
||||
android:text="Total Anime"
|
||||
android:text="@string/total_anime"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
@@ -233,7 +231,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="0.58"
|
||||
android:text="Anime Mean Score"
|
||||
android:text="@string/anime_mean_score"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
@@ -254,7 +252,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="0.58"
|
||||
android:text="Chapter read"
|
||||
android:text="@string/chapters_read"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
@@ -275,7 +273,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="0.58"
|
||||
android:text="Volume read"
|
||||
android:text="@string/volume_read"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
@@ -296,7 +294,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="0.58"
|
||||
android:text="Total Manga"
|
||||
android:text="@string/total_manga"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
@@ -317,7 +315,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="0.58"
|
||||
android:text="Manga Mean Score"
|
||||
android:text="@string/manga_mean_score"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
@@ -346,10 +344,9 @@
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:text="@string/about_me"
|
||||
android:padding="8dp"
|
||||
android:text="Bio"
|
||||
android:textSize="18sp"
|
||||
tools:ignore="HardcodedText" />
|
||||
android:textSize="18sp"/>
|
||||
|
||||
<WebView
|
||||
android:id="@+id/profileUserBio"
|
||||
@@ -467,8 +464,8 @@
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:text="@string/fav_character"
|
||||
android:padding="8dp"
|
||||
android:text="Favorite Characters"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<ani.dantotsu.FadingEdgeRecyclerView
|
||||
@@ -500,8 +497,8 @@
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:text="@string/fav_staff"
|
||||
android:padding="8dp"
|
||||
android:text="Favorite Staff"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<ani.dantotsu.FadingEdgeRecyclerView
|
||||
|
||||
@@ -18,8 +18,9 @@
|
||||
android:layout_height="64dp"
|
||||
android:layout_gravity="start|center_vertical"
|
||||
android:layout_marginStart="16dp"
|
||||
android:backgroundTint="@color/bg_white"
|
||||
app:cardCornerRadius="64dp">
|
||||
android:backgroundTint="@color/transparent"
|
||||
app:cardCornerRadius="64dp"
|
||||
app:strokeColor="@color/transparent">
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/activityUserAvatar"
|
||||
@@ -60,20 +61,35 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end|center"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@drawable/ic_round_favorite_24"
|
||||
tools:ignore="ContentDescription" />
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/activityFavorite"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_round_favorite_24"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/activityFavoriteCount"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:fontFamily="@font/poppins_semi_bold"
|
||||
android:textSize="15sp"
|
||||
tools:text="12" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="180dp"
|
||||
android:layout_marginTop="8dp">
|
||||
android:layout_height="180dp">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
@@ -85,16 +101,18 @@
|
||||
<ImageView
|
||||
android:id="@+id/activityBannerImage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="169dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/linear_gradient_bg"
|
||||
tools:ignore="ContentDescription"
|
||||
tools:srcCompat="@tools:sample/backgrounds/scenic" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="170dp"
|
||||
app:srcCompat="@drawable/linear_gradient_nav"
|
||||
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/activityCoverContainer"
|
||||
@@ -110,6 +128,7 @@
|
||||
android:layout_width="102dp"
|
||||
android:layout_height="154dp"
|
||||
android:layout_gravity="center"
|
||||
android:scaleType="centerCrop"
|
||||
app:srcCompat="@drawable/ic_round_add_circle_24"
|
||||
tools:ignore="ContentDescription,ImageContrastCheck"
|
||||
tools:tint="@color/transparent" />
|
||||
|
||||
@@ -59,26 +59,43 @@
|
||||
tools:ignore="LabelFor,TextContrastCheck" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/animeUserAvatarContainer"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="4dp"
|
||||
app:cardBackgroundColor="?attr/colorPrimaryContainer"
|
||||
app:cardCornerRadius="26dp"
|
||||
app:strokeColor="@color/text_input_layout_stroke_color">
|
||||
<FrameLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/animeUserAvatar"
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/animeUserAvatarContainer"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="52dp"
|
||||
android:scaleType="center"
|
||||
android:tint="@color/bg_opp"
|
||||
app:srcCompat="@drawable/ic_round_settings_24"
|
||||
tools:ignore="ContentDescription,ImageContrastCheck" />
|
||||
android:layout_marginTop="4dp"
|
||||
android:backgroundTint="@color/nav_bg_inv"
|
||||
app:cardCornerRadius="26dp">
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/animeUserAvatar"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="52dp"
|
||||
android:scaleType="center"
|
||||
app:srcCompat="@drawable/ic_round_settings_24"
|
||||
tools:ignore="ContentDescription,ImageContrastCheck" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/animeNotificationCount"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_gravity="end|bottom"
|
||||
android:background="@drawable/notification_circle"
|
||||
android:fontFamily="@font/poppins_semi_bold"
|
||||
android:gravity="center"
|
||||
android:textColor="#F3F3F3"
|
||||
android:textSize="12sp"
|
||||
android:visibility="gone"
|
||||
tools:ignore="SmallSp"
|
||||
tools:text="1"
|
||||
tools:visibility="visible" />
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<ProgressBar
|
||||
|
||||
@@ -3,44 +3,47 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="90dp"
|
||||
android:layout_gravity="start|center_vertical"
|
||||
android:backgroundTint="@color/bg_white"
|
||||
app:cardCornerRadius="16dp">
|
||||
app:cardCornerRadius="24dp">
|
||||
|
||||
<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:srcCompat="@tools:sample/backgrounds/scenic"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<View
|
||||
<ImageView
|
||||
android:id="@+id/imageView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/bg_black_50"
|
||||
app:srcCompat="@drawable/linear_gradient_nav"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/profileUserAvatarContainer"
|
||||
android:layout_width="82dp"
|
||||
android:layout_height="82dp"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
android:layout_gravity="start|center_vertical"
|
||||
android:layout_marginStart="16dp"
|
||||
android:backgroundTint="@color/bg_white"
|
||||
android:backgroundTint="@color/transparent"
|
||||
app:strokeColor="@color/transparent"
|
||||
app:cardCornerRadius="64dp">
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/profileUserAvatar"
|
||||
android:layout_width="82dp"
|
||||
android:layout_height="82dp"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
android:layout_gravity="center"
|
||||
app:srcCompat="@drawable/ic_round_add_circle_24"
|
||||
tools:ignore="ContentDescription,ImageContrastCheck"
|
||||
@@ -54,10 +57,9 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start|center_vertical"
|
||||
android:layout_marginStart="120dp"
|
||||
android:text="Username"
|
||||
android:text="@string/username"
|
||||
android:textColor="@color/bg_white"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
tools:ignore="HardcodedText" />
|
||||
android:textStyle="bold"/>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
</FrameLayout>
|
||||
@@ -27,11 +27,10 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal|center_vertical"
|
||||
android:fontFamily="@font/poppins_semi_bold"
|
||||
android:text="Username"
|
||||
android:text="@string/username"
|
||||
android:textColor="?attr/colorOnBackground"
|
||||
android:textSize="12sp"
|
||||
android:ellipsize="end"
|
||||
android:textStyle="bold"
|
||||
tools:ignore="HardcodedText" />
|
||||
android:textStyle="bold"/>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -61,25 +61,43 @@
|
||||
tools:ignore="LabelFor,TextContrastCheck" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/mangaUserAvatarContainer"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="4dp"
|
||||
app:cardBackgroundColor="?attr/colorPrimaryContainer"
|
||||
app:cardCornerRadius="26dp"
|
||||
app:strokeColor="@color/text_input_layout_stroke_color">
|
||||
<FrameLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/mangaUserAvatar"
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/mangaUserAvatarContainer"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="52dp"
|
||||
android:scaleType="center"
|
||||
android:tint="@color/bg_opp"
|
||||
app:srcCompat="@drawable/ic_round_settings_24"
|
||||
tools:ignore="ContentDescription,ImageContrastCheck" />
|
||||
android:layout_marginTop="4dp"
|
||||
android:backgroundTint="@color/nav_bg_inv"
|
||||
app:cardCornerRadius="26dp">
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/mangaUserAvatar"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="52dp"
|
||||
android:scaleType="center"
|
||||
app:srcCompat="@drawable/ic_round_settings_24"
|
||||
tools:ignore="ContentDescription,ImageContrastCheck" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/mangaNotificationCount"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_gravity="end|bottom"
|
||||
android:background="@drawable/notification_circle"
|
||||
android:fontFamily="@font/poppins_semi_bold"
|
||||
android:gravity="center"
|
||||
android:textColor="#F3F3F3"
|
||||
android:textSize="12sp"
|
||||
android:visibility="gone"
|
||||
tools:ignore="SmallSp"
|
||||
tools:text="1"
|
||||
tools:visibility="visible" />
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -94,9 +94,11 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
android:orientation="horizontal"
|
||||
tools:ignore="UseCompoundDrawables">
|
||||
|
||||
<ImageView
|
||||
@@ -113,7 +115,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="0.58"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="4dp"
|
||||
android:paddingEnd="4dp"
|
||||
android:singleLine="true"
|
||||
@@ -123,7 +125,7 @@
|
||||
android:textStyle="italic"
|
||||
android:transitionName="mediaTitle"
|
||||
tools:ignore="TextContrastCheck"
|
||||
tools:text="Relation " />
|
||||
tools:text="Relation" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
app:cardBackgroundColor="@color/nav_bg"
|
||||
app:cardCornerRadius="28dp">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/itemCompactBanner"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -2,30 +2,31 @@
|
||||
<FrameLayout 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:id="@+id/notificationContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="170dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start|center_vertical"
|
||||
android:backgroundTint="@color/bg_white"
|
||||
app:cardBackgroundColor="@color/nav_bg"
|
||||
app:cardCornerRadius="24dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/notificationBannerImage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="170dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/linear_gradient_bg"
|
||||
tools:ignore="ContentDescription" />
|
||||
tools:ignore="ContentDescription"
|
||||
tools:srcCompat="@tools:sample/backgrounds/scenic" />
|
||||
|
||||
<View
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/bg_black_50"
|
||||
app:srcCompat="@drawable/linear_gradient_nav"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
@@ -34,47 +35,73 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start|center_vertical"
|
||||
android:layout_marginStart="16dp"
|
||||
android:backgroundTint="@color/bg_white"
|
||||
app:cardCornerRadius="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"
|
||||
android:scaleType="centerCrop"
|
||||
app:srcCompat="@drawable/ic_round_add_circle_24"
|
||||
tools:ignore="ContentDescription,ImageContrastCheck"
|
||||
tools:tint="@color/transparent" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/notificationText"
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/notificationCoverUserContainer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start|center_vertical"
|
||||
android:layout_marginStart="128dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:fontFamily="@font/poppins_semi_bold"
|
||||
android:text="@string/slogan"
|
||||
android:textColor="@color/bg_white"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
tools:ignore="HardcodedText" />
|
||||
android:layout_marginStart="23dp"
|
||||
android:backgroundTint="@color/transparent"
|
||||
android:visibility="gone"
|
||||
app:cardCornerRadius="64dp"
|
||||
app:strokeColor="@color/transparent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/notificationDate"
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/notificationCoverUser"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
android:layout_gravity="center"
|
||||
app:srcCompat="@drawable/ic_round_add_circle_24"
|
||||
tools:ignore="ContentDescription,ImageContrastCheck"
|
||||
tools:tint="@color/transparent" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:fontFamily="@font/poppins_semi_bold"
|
||||
android:text="Wed,06 March 2024, 7:00PM"
|
||||
android:textColor="@color/bg_white"
|
||||
android:textSize="14sp"
|
||||
tools:ignore="HardcodedText" />
|
||||
android:layout_gravity="start|center"
|
||||
android:layout_marginStart="125dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/notificationText"
|
||||
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>
|
||||
</FrameLayout>
|
||||
Reference in New Issue
Block a user