Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,6 @@
android:exported="false"
android:label="@string/settings" />


<activity
android:name=".about.AboutActivity"
android:exported="false"
android:label="@string/title_activity_about" />

<service
android:name="androidx.work.impl.foreground.SystemForegroundService"
android:foregroundServiceType="dataSync"
Expand Down
11 changes: 11 additions & 0 deletions app/src/main/java/org/schabi/newpipe/ComposeActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ class ComposeActivity : ComponentActivity() {

private fun resolveStartDestination(intent: Intent): NavKey {
return when (intent.getStringExtra(EXTRA_SCREEN)) {
SCREEN_ABOUT -> Screen.About

SCREEN_ERROR -> Screen.Error

SCREEN_SETTINGS -> Screen.Settings.Home
Expand All @@ -60,12 +62,21 @@ class ComposeActivity : ComponentActivity() {
}

companion object {

const val SCREEN_ABOUT = "about"

const val EXTRA_SCREEN = "extra_screen"
const val EXTRA_ERROR_INFO = "extra_error_info"

const val SCREEN_ERROR = "error"
const val SCREEN_SETTINGS = "settings"

fun aboutIntent(context: Context): Intent {
return Intent(context, ComposeActivity::class.java).apply {
putExtra(EXTRA_SCREEN, SCREEN_ABOUT)
}
}

fun errorIntent(context: Context, errorInfo: ErrorInfo): Intent {
return Intent(context, ComposeActivity::class.java).apply {
putExtra(EXTRA_SCREEN, SCREEN_ERROR)
Expand Down
29 changes: 0 additions & 29 deletions app/src/main/java/org/schabi/newpipe/about/AboutActivity.kt

This file was deleted.

12 changes: 12 additions & 0 deletions app/src/main/java/org/schabi/newpipe/navigation/NavDisplay.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import org.schabi.newpipe.ComposeActivity
import org.schabi.newpipe.R
import org.schabi.newpipe.error.ErrorInfo
import org.schabi.newpipe.error.ErrorReportHelper
import org.schabi.newpipe.ui.components.common.ScaffoldWithToolbar
import org.schabi.newpipe.ui.screens.AboutScreen
import org.schabi.newpipe.ui.screens.ErrorReportEvent
import org.schabi.newpipe.ui.screens.ErrorReportScreen
import org.schabi.newpipe.ui.screens.settings.debug.DebugScreen
Expand Down Expand Up @@ -55,6 +57,16 @@ fun NavDisplay(startDestination: NavKey) {
rememberViewModelStoreNavEntryDecorator()
),
entryProvider = entryProvider {
// About
entry<Screen.About> {
ScaffoldWithToolbar(
title = stringResource(R.string.title_activity_about),
onBackClick = ::onNavigateUp
) { padding ->
AboutScreen(padding)
}
}

// Error Report
entry<Screen.Error> {
val errorInfo = remember {
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/java/org/schabi/newpipe/navigation/Screen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import kotlinx.serialization.Serializable
@Serializable
sealed interface Screen : NavKey {

@Serializable
data object About : Screen

@Serializable
data object Error : Screen

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.pager.HorizontalPager
import androidx.compose.foundation.pager.rememberPagerState
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.SecondaryTabRow
import androidx.compose.material3.Surface
import androidx.compose.material3.Tab
import androidx.compose.material3.TabRow
Expand Down Expand Up @@ -44,7 +45,7 @@ fun AboutScreen(padding: PaddingValues) {
tabIndex = pagerState.currentPage
}

TabRow(
SecondaryTabRow(
selectedTabIndex = tabIndex,
containerColor = MaterialTheme.colorScheme.primaryContainer
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.schabi.newpipe.NewPipeDatabase;
import org.schabi.newpipe.R;
import org.schabi.newpipe.RouterActivity;
import org.schabi.newpipe.about.AboutActivity;
import org.schabi.newpipe.database.feed.model.FeedGroupEntity;
import org.schabi.newpipe.download.DownloadActivity;
import org.schabi.newpipe.error.ErrorUtil;
Expand Down Expand Up @@ -635,7 +634,7 @@ public static void openRouterActivity(final Context context, final String url) {
}

public static void openAbout(final Context context) {
final Intent intent = new Intent(context, AboutActivity.class);
final Intent intent = ComposeActivity.Companion.aboutIntent(context);
context.startActivity(intent);
}

Expand Down
Loading