Skip to content

Commit

Permalink
fix: small bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aayush2622 committed May 26, 2024
1 parent 72fe910 commit 46c17dc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ class AnilistQueries {
response.data.page2.activities
).asSequence().flatten()
.filter { it.typename != "MessageActivity" }
.filter { if (Anilist.adult) true else it.media?.isAdult == false }
.filter { if (Anilist.adult) true else it.media?.isAdult != true }
.filter { it.createdAt * 1000L > threeDaysAgo }.toList()
.sortedByDescending { it.createdAt }
val anilistActivities = mutableListOf<User>()
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/ani/dantotsu/home/AnimePageAdapter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,9 @@ class AnimePageAdapter : RecyclerView.Adapter<AnimePageAdapter.AnimePageViewHold
LinearLayoutManager.HORIZONTAL,
false
)
MediaListViewActivity.passedMedia = media.toCollection(ArrayList())

more.setOnClickListener {
MediaListViewActivity.passedMedia = media.toCollection(ArrayList())
ContextCompat.startActivity(
it.context, Intent(it.context, MediaListViewActivity::class.java)
.putExtra("title", string),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import androidx.fragment.app.Fragment
import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import ani.dantotsu.R
import ani.dantotsu.connections.anilist.Anilist
import ani.dantotsu.connections.anilist.api.Activity
import ani.dantotsu.databinding.FragmentFeedBinding
Expand Down Expand Up @@ -54,6 +55,7 @@ class ActivityFragment(
binding.feedRefresh.updateLayoutParams<ViewGroup.MarginLayoutParams> {
bottomMargin = navBarHeight
}
binding.emptyTextView.text = getString(R.string.no_notifications)
lifecycleScope.launch {
getList()
if (adapter.itemCount == 0) {
Expand Down Expand Up @@ -102,10 +104,10 @@ class ActivityFragment(
): List<Activity> {
val res = Anilist.query.getFeed(userId, global, page, activityId)?.data?.page?.activities
page += 1
return res?.filter {
if (Anilist.adult) true else it.media?.isAdult == false &&
(it.recipient?.id == null || it.recipient.id == Anilist.userid)
} ?: emptyList()
return res
?.filter { if (Anilist.adult) true else it.media?.isAdult != true }
?.filterNot { it.recipient?.id != null && it.recipient.id != Anilist.userid }
?: emptyList()
}

private fun shouldLoadMore(): Boolean {
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/item_profile_app_bar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:backgroundTint="?attr/colorSecondaryContainer"
android:backgroundTint="?attr/colorOnPrimary"
android:enabled="true"
android:fontFamily="@font/poppins_bold"
android:text="@string/follow"
android:textColor="@color/bg_opp"
android:textSize="14sp"
app:cornerRadius="8dp"
app:strokeColor="?attr/colorSecondaryContainer"
app:strokeColor="?attr/colorOnPrimary"
tools:ignore="SpeakableTextPresentCheck" />

</LinearLayout>
Expand Down

0 comments on commit 46c17dc

Please sign in to comment.