1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2026-07-11 05:32:42 +00:00
Files
2026-06-30 00:30:18 +01:00

34 lines
1.1 KiB
Plaintext

package org.schabi.newpipe
import android.content.Context
import android.os.Bundle
import net.newpipe.app.ComposeActivity
import net.newpipe.app.platform.AndroidLegacyHooks
import org.koin.dsl.module
import org.schabi.newpipe.platform.AppLegacyHooks
import org.schabi.newpipe.platform.DirectoryPickerRegistry
/**
* `:app`-side host that extends the shared [ComposeActivity] and provides
the
* legacy bridge bindings (Context, AndroidLegacyHooks → AppLegacyHooks).
*
* Required while parts of NewPipe still live as Views in `:app`. Once the
* migration completes this class is deleted and the manifest entry points
* directly at [net.newpipe.app.ComposeActivity].
*/
class NewPipeComposeActivity : ComposeActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
DirectoryPickerRegistry.bindTo(this)
super.onCreate(savedInstanceState)
}
override fun platformModules(): List<Module> = listOf(
module {
single<Context> { applicationContext }
single<AndroidLegacyHooks> { AppLegacyHooks(application) }
}
)
}