Skip to content

Commit edf388f

Browse files
committed
Fix Explicit API mode warnings; make explicit API strict on Android libs.
1 parent 067d509 commit edf388f

File tree

31 files changed

+135
-124
lines changed

31 files changed

+135
-124
lines changed

conventions/src/main/kotlin/ribs.kotlin-android-library-conventions.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ kotlin {
2727
jvmToolchain(11)
2828

2929
compilerOptions {
30-
explicitApiWarning()
30+
explicitApi()
3131
jvmTarget = JvmTarget.JVM_1_8
3232
optIn.add("kotlin.RequiresOptIn")
3333
freeCompilerArgs.add("-Xjvm-default=all")

libraries/rib-android-compose/src/main/kotlin/com/uber/rib/core/BasicComposeRouter.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ package com.uber.rib.core
1818
import androidx.compose.runtime.Composable
1919
import androidx.compose.runtime.MutableState
2020

21-
open class BasicComposeRouter<I : BasicInteractor<*, *>>(
22-
val presenter: ComposePresenter,
21+
public open class BasicComposeRouter<I : BasicInteractor<*, *>>(
22+
public val presenter: ComposePresenter,
2323
interactor: I,
24-
val slot: MutableState<(@Composable () -> Unit)>,
24+
public val slot: MutableState<@Composable () -> Unit>,
2525
) : BasicRouter<I>(interactor) {
2626
override fun willAttach() {
2727
slot.value = presenter.composable

libraries/rib-android-compose/src/main/kotlin/com/uber/rib/core/ComposePresenter.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ package com.uber.rib.core
1717

1818
import androidx.compose.runtime.Composable
1919

20-
abstract class ComposePresenter : Presenter() {
21-
abstract val composable: @Composable () -> Unit
20+
public abstract class ComposePresenter : Presenter() {
21+
public abstract val composable: @Composable () -> Unit
2222
}

libraries/rib-android-core/src/main/kotlin/com/uber/rib/core/ActivityDelegate.kt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,35 +25,35 @@ import androidx.annotation.IntRange
2525
* functionality. This allows [RibActivity] and any other type of [Activity] that you need to
2626
* support to share [CoreAppCompatActivity] as a common parent.
2727
*/
28-
interface ActivityDelegate {
28+
public interface ActivityDelegate {
2929
/** @see [Activity.onCreate] */
30-
fun onCreate(savedInstanceState: Bundle?) {}
30+
public fun onCreate(savedInstanceState: Bundle?) {}
3131

3232
/** @see [Activity.onStart] */
33-
fun onStart() {}
33+
public fun onStart() {}
3434

3535
/** @see [Activity.onResume] */
36-
fun onResume() {}
36+
public fun onResume() {}
3737

3838
/** @see [Activity.onPause] */
39-
fun onPause() {}
39+
public fun onPause() {}
4040

4141
/** @see [Activity.onStop] */
42-
fun onStop() {}
42+
public fun onStop() {}
4343

4444
/** @see [Activity.onDestroy] */
45-
fun onDestroy() {}
45+
public fun onDestroy() {}
4646

4747
/** @see [Activity.onActivityResult] */
48-
fun onActivityResult(
48+
public fun onActivityResult(
4949
activity: Activity,
5050
requestCode: Int,
5151
resultCode: Int,
5252
data: Intent?,
5353
) {}
5454

5555
/** @see [Activity.onRequestPermissionsResult] */
56-
fun onRequestPermissionsResult(
56+
public fun onRequestPermissionsResult(
5757
activity: Activity,
5858
@IntRange(from = 0, to = 255) requestCode: Int,
5959
permissions: Array<String>,

libraries/rib-android-core/src/main/kotlin/com/uber/rib/core/CoreAppCompatActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import androidx.lifecycle.ViewTreeViewModelStoreOwner
2525
import androidx.savedstate.ViewTreeSavedStateRegistryOwner
2626

2727
/** Core Support v7 AppCompat Activity. */
28-
abstract class CoreAppCompatActivity : AppCompatActivity() {
28+
public abstract class CoreAppCompatActivity : AppCompatActivity() {
2929

3030
private var activityDelegate: ActivityDelegate? = null
3131

libraries/rib-android-core/src/main/kotlin/com/uber/rib/core/HasActivityDelegate.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
package com.uber.rib.core
1717

1818
/** Interface to indicate an object has an [ActivityDelegate]. */
19-
interface HasActivityDelegate {
19+
public interface HasActivityDelegate {
2020
/**
2121
* Get the delegate.
2222
*
2323
* @return The delegate.
2424
*/
25-
fun activityDelegate(): ActivityDelegate
25+
public fun activityDelegate(): ActivityDelegate
2626
}

libraries/rib-android/src/main/kotlin/com/uber/rib/core/ActivityContext.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
*/
1616
package com.uber.rib.core
1717

18-
import java.lang.annotation.Retention
19-
import java.lang.annotation.RetentionPolicy.RUNTIME
2018
import javax.inject.Qualifier
2119

2220
/** Injection qualifier for an Activity Context. */
23-
@Qualifier @Retention(RUNTIME) annotation class ActivityContext
21+
@Qualifier @Retention(AnnotationRetention.RUNTIME) public annotation class ActivityContext

libraries/rib-android/src/main/kotlin/com/uber/rib/core/ActivityStarter.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ import android.content.Intent
2121
* Start activities. A much cleaner dependency than an entire activity or context, and easier to
2222
* inject and mock in tests.
2323
*/
24-
interface ActivityStarter {
24+
public interface ActivityStarter {
2525
/**
2626
* Start an activity with the given intent.
2727
*
2828
* @param intent The intent to open a new activity.
2929
*/
30-
fun startActivity(intent: Intent)
30+
public fun startActivity(intent: Intent)
3131

3232
/**
3333
* Start an activity with the given intent, to be notified when that activity finishes.
@@ -37,5 +37,5 @@ interface ActivityStarter {
3737
* from this request.
3838
*/
3939
@Deprecated("""use plain Activity instead""")
40-
fun startActivityForResult(intent: Intent, requestCode: Int)
40+
public fun startActivityForResult(intent: Intent, requestCode: Int)
4141
}

libraries/rib-android/src/main/kotlin/com/uber/rib/core/BasicViewRouter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import android.view.View
2222
*
2323
* @param <I> type of interactor.
2424
*/
25-
abstract class BasicViewRouter<V : View, I : Interactor<*, *>>(
25+
public abstract class BasicViewRouter<V : View, I : Interactor<*, *>>(
2626
view: V,
2727
interactor: I,
2828
) : ViewRouter<V, I>(view, interactor)

libraries/rib-android/src/main/kotlin/com/uber/rib/core/IntentCreator.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ package com.uber.rib.core
1818
import android.content.Intent
1919

2020
/** Creates intent objects. */
21-
interface IntentCreator {
21+
public interface IntentCreator {
2222
/**
2323
* Create an explicit intent targeted at a particular class, which is guaranteed to be limited to
2424
* your app's package.
2525
*
2626
* @param cls The class that you intend to receive this intent.
2727
* @return The intent.
2828
*/
29-
fun create(cls: Class<*>): Intent
29+
public fun create(cls: Class<*>): Intent
3030

3131
/**
3232
* Create an implicit intent targeted at an action, which may end up resolving to your app or to
@@ -37,5 +37,5 @@ interface IntentCreator {
3737
* @param action The intent action, which any app may register to receive.
3838
* @return The intent.
3939
*/
40-
fun create(action: String): Intent
40+
public fun create(action: String): Intent
4141
}

0 commit comments

Comments
 (0)