diff --git a/app/src/main/java/app/pachli/MainActivity.kt b/app/src/main/java/app/pachli/MainActivity.kt index 4e851f40a..89643f5f3 100644 --- a/app/src/main/java/app/pachli/MainActivity.kt +++ b/app/src/main/java/app/pachli/MainActivity.kt @@ -624,6 +624,33 @@ class MainActivity : BottomSheetActivity(), ActionButtonActivity, MenuProvider { ) } }, + primaryDrawerItem { + nameRes = R.string.title_public_local + iconRes = R.drawable.ic_local_24dp + onClick = { + startActivityWithSlideInAnimation( + TimelineActivityIntent.publicLocal(context), + ) + } + }, + primaryDrawerItem { + nameRes = R.string.title_public_federated + iconRes = R.drawable.ic_public_24dp + onClick = { + startActivityWithSlideInAnimation( + TimelineActivityIntent.publicFederated(context), + ) + } + }, + primaryDrawerItem { + nameRes = R.string.title_direct_messages + iconRes = R.drawable.ic_reblog_direct_24dp + onClick = { + startActivityWithSlideInAnimation( + TimelineActivityIntent.conversations(context), + ) + } + }, primaryDrawerItem { nameRes = R.string.action_view_bookmarks iconicsIcon = GoogleMaterial.Icon.gmd_bookmark diff --git a/core/navigation/src/main/kotlin/app/pachli/core/navigation/Navigation.kt b/core/navigation/src/main/kotlin/app/pachli/core/navigation/Navigation.kt index 737bce9c2..0eec05716 100644 --- a/core/navigation/src/main/kotlin/app/pachli/core/navigation/Navigation.kt +++ b/core/navigation/src/main/kotlin/app/pachli/core/navigation/Navigation.kt @@ -25,9 +25,12 @@ import app.pachli.core.database.model.DraftAttachment import app.pachli.core.model.Timeline import app.pachli.core.navigation.LoginActivityIntent.LoginMode import app.pachli.core.navigation.TimelineActivityIntent.Companion.bookmarks +import app.pachli.core.navigation.TimelineActivityIntent.Companion.conversations import app.pachli.core.navigation.TimelineActivityIntent.Companion.favourites import app.pachli.core.navigation.TimelineActivityIntent.Companion.hashtag import app.pachli.core.navigation.TimelineActivityIntent.Companion.list +import app.pachli.core.navigation.TimelineActivityIntent.Companion.publicFederated +import app.pachli.core.navigation.TimelineActivityIntent.Companion.publicLocal import app.pachli.core.network.model.Attachment import app.pachli.core.network.model.Filter import app.pachli.core.network.model.NewPoll @@ -386,7 +389,8 @@ class ReportActivityIntent(context: Context, accountId: String, userName: String } /** - * Use one of [bookmarks], [favourites], [hashtag], or [list] to construct. + * Use one of [bookmarks], [conversations], [favourites], [hashtag], [list], [publicFederated], + * or [publicLocal] to construct. */ class TimelineActivityIntent private constructor(context: Context) : Intent() { init { @@ -405,6 +409,15 @@ class TimelineActivityIntent private constructor(context: Context) : Intent() { putExtra(EXTRA_TIMELINE, Timeline.Bookmarks) } + /** + * Show the user's conversations (direct messages). + * + * @param context + */ + fun conversations(context: Context) = TimelineActivityIntent(context).apply { + putExtra(EXTRA_TIMELINE, Timeline.Conversations) + } + /** * Show the user's favourites. * @@ -435,6 +448,24 @@ class TimelineActivityIntent private constructor(context: Context) : Intent() { putExtra(EXTRA_TIMELINE, Timeline.UserList(listId, title)) } + /** + * Show statuses from the Public Federated feed + * + * @param context + */ + fun publicFederated(context: Context) = TimelineActivityIntent(context).apply { + putExtra(EXTRA_TIMELINE, Timeline.PublicFederated) + } + + /** + * Show statuses from the Public Local feed + * + * @param context + */ + fun publicLocal(context: Context) = TimelineActivityIntent(context).apply { + putExtra(EXTRA_TIMELINE, Timeline.PublicLocal) + } + /** @return The [Timeline] to show */ fun getTimeline(intent: Intent) = IntentCompat.getParcelableExtra(intent, EXTRA_TIMELINE, Timeline::class.java)!! }