mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 12:31:52 +01:00
Use Compose for OAuth login loading indicator
This commit is contained in:
parent
891406cc7f
commit
ccff333123
@ -19,8 +19,7 @@ class MigrationSourcesController : ComposeController<MigrationSourcesPresenter>(
|
||||
setHasOptionsMenu(true)
|
||||
}
|
||||
|
||||
override fun createPresenter(): MigrationSourcesPresenter =
|
||||
MigrationSourcesPresenter()
|
||||
override fun createPresenter() = MigrationSourcesPresenter()
|
||||
|
||||
@Composable
|
||||
override fun ComposeContent(nestedScrollInterop: NestedScrollConnection) {
|
||||
@ -38,7 +37,7 @@ class MigrationSourcesController : ComposeController<MigrationSourcesPresenter>(
|
||||
onLongClickItem = { source ->
|
||||
val sourceId = source.id.toString()
|
||||
activity?.copyToClipboard(sourceId, sourceId)
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -3,10 +3,9 @@ package eu.kanade.tachiyomi.ui.setting.track
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.view.Gravity
|
||||
import android.view.ViewGroup
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.ProgressBar
|
||||
import androidx.activity.compose.setContent
|
||||
import eu.kanade.presentation.components.LoadingScreen
|
||||
import eu.kanade.presentation.theme.TachiyomiTheme
|
||||
import eu.kanade.tachiyomi.data.track.TrackManager
|
||||
import eu.kanade.tachiyomi.ui.base.activity.BaseActivity
|
||||
import eu.kanade.tachiyomi.ui.main.MainActivity
|
||||
@ -21,15 +20,11 @@ abstract class BaseOAuthLoginActivity : BaseActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
val view = ProgressBar(this)
|
||||
setContentView(
|
||||
view,
|
||||
FrameLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||
Gravity.CENTER,
|
||||
),
|
||||
)
|
||||
setContent {
|
||||
TachiyomiTheme {
|
||||
LoadingScreen()
|
||||
}
|
||||
}
|
||||
|
||||
handleResult(intent.data)
|
||||
}
|
||||
@ -37,8 +32,9 @@ abstract class BaseOAuthLoginActivity : BaseActivity() {
|
||||
internal fun returnToSettings() {
|
||||
finish()
|
||||
|
||||
val intent = Intent(this, MainActivity::class.java)
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP)
|
||||
val intent = Intent(this, MainActivity::class.java).apply {
|
||||
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP)
|
||||
}
|
||||
startActivity(intent)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user