change: Remove unnecessary types

This commit is contained in:
Nik Clayton 2024-04-30 16:08:08 +02:00
parent 01887d427b
commit 1f50a9cbe7
4 changed files with 8 additions and 8 deletions

View File

@ -132,7 +132,7 @@ data class TabViewData(
} }
}, },
) { context -> ) { context ->
val tag = (timeline as Timeline.Hashtags).tags.first() val tag = timeline.tags.first()
ComposeActivityIntent( ComposeActivityIntent(
context, context,
ComposeActivityIntent.ComposeOptions( ComposeActivityIntent.ComposeOptions(

View File

@ -136,7 +136,7 @@ abstract class ViewMediaFragment : Fragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
attachment = arguments?.getParcelable<Attachment>(ARG_ATTACHMENT) attachment = arguments?.getParcelable(ARG_ATTACHMENT)
?: throw IllegalArgumentException("ARG_ATTACHMENT has to be set") ?: throw IllegalArgumentException("ARG_ATTACHMENT has to be set")
shouldCallMediaReady = arguments?.getBoolean(ARG_SHOULD_CALL_MEDIA_READY) shouldCallMediaReady = arguments?.getBoolean(ARG_SHOULD_CALL_MEDIA_READY)

View File

@ -190,8 +190,8 @@ class MediaPreviewLayout(context: Context, attrs: AttributeSet? = null) :
val wrapper = getChildAt(index) val wrapper = getChildAt(index)
action( action(
index, index,
wrapper.findViewById(R.id.preview_image_view) as MediaPreviewImageView, wrapper.findViewById(R.id.preview_image_view)!!,
wrapper.findViewById(R.id.preview_media_description_indicator) as TextView, wrapper.findViewById(R.id.preview_media_description_indicator)!!,
) )
} }
} }

View File

@ -34,17 +34,17 @@ import org.junit.rules.ExternalResource
class LazyActivityScenarioRule<A : Activity> : ExternalResource { class LazyActivityScenarioRule<A : Activity> : ExternalResource {
constructor(launchActivity: Boolean, startActivityIntentSupplier: () -> Intent) { constructor(launchActivity: Boolean, startActivityIntentSupplier: () -> Intent) {
this.launchActivity = launchActivity this.launchActivity = launchActivity
scenarioSupplier = { ActivityScenario.launch<A>(startActivityIntentSupplier()) } scenarioSupplier = { ActivityScenario.launch(startActivityIntentSupplier()) }
} }
constructor(launchActivity: Boolean, startActivityIntent: Intent) { constructor(launchActivity: Boolean, startActivityIntent: Intent) {
this.launchActivity = launchActivity this.launchActivity = launchActivity
scenarioSupplier = { ActivityScenario.launch<A>(startActivityIntent) } scenarioSupplier = { ActivityScenario.launch(startActivityIntent) }
} }
constructor(launchActivity: Boolean, startActivityClass: Class<A>) { constructor(launchActivity: Boolean, startActivityClass: Class<A>) {
this.launchActivity = launchActivity this.launchActivity = launchActivity
scenarioSupplier = { ActivityScenario.launch<A>(startActivityClass) } scenarioSupplier = { ActivityScenario.launch(startActivityClass) }
} }
private var launchActivity: Boolean private var launchActivity: Boolean
@ -68,7 +68,7 @@ class LazyActivityScenarioRule<A : Activity> : ExternalResource {
fun launch(newIntent: Intent? = null) { fun launch(newIntent: Intent? = null) {
if (scenarioLaunched) throw IllegalStateException("Scenario has already been launched!") if (scenarioLaunched) throw IllegalStateException("Scenario has already been launched!")
newIntent?.let { scenarioSupplier = { ActivityScenario.launch<A>(it) } } newIntent?.let { scenarioSupplier = { ActivityScenario.launch(it) } }
scenario = scenarioSupplier() scenario = scenarioSupplier()
scenarioLaunched = true scenarioLaunched = true
} }