@@ -17,10 +17,10 @@ import com.facebook.react.module.annotations.ReactModule
17
17
18
18
/* * [NativeModule] that allows JS to show an Android Toast. */
19
19
@ReactModule(name = NativeToastAndroidSpec .NAME )
20
- public class ToastModule (reactContext : ReactApplicationContext ) :
20
+ internal class ToastModule (reactContext : ReactApplicationContext ) :
21
21
NativeToastAndroidSpec (reactContext) {
22
22
23
- public override fun getTypedExportedConstants (): Map <String , Any > =
23
+ override fun getTypedExportedConstants (): Map <String , Any > =
24
24
mutableMapOf (
25
25
DURATION_SHORT_KEY to Toast .LENGTH_SHORT ,
26
26
DURATION_LONG_KEY to Toast .LENGTH_LONG ,
@@ -29,17 +29,13 @@ public class ToastModule(reactContext: ReactApplicationContext) :
29
29
GRAVITY_CENTER to (Gravity .CENTER_HORIZONTAL or Gravity .CENTER_VERTICAL ),
30
30
)
31
31
32
- public override fun show (message : String? , durationDouble : Double ) {
32
+ override fun show (message : String? , durationDouble : Double ) {
33
33
val duration = durationDouble.toInt()
34
34
UiThreadUtil .runOnUiThread(
35
35
Runnable { Toast .makeText(getReactApplicationContext(), message, duration).show() })
36
36
}
37
37
38
- public override fun showWithGravity (
39
- message : String? ,
40
- durationDouble : Double ,
41
- gravityDouble : Double
42
- ) {
38
+ override fun showWithGravity (message : String? , durationDouble : Double , gravityDouble : Double ) {
43
39
val duration = durationDouble.toInt()
44
40
val gravity = gravityDouble.toInt()
45
41
UiThreadUtil .runOnUiThread(
@@ -50,7 +46,7 @@ public class ToastModule(reactContext: ReactApplicationContext) :
50
46
})
51
47
}
52
48
53
- public override fun showWithGravityAndOffset (
49
+ override fun showWithGravityAndOffset (
54
50
message : String? ,
55
51
durationDouble : Double ,
56
52
gravityDouble : Double ,
@@ -69,8 +65,8 @@ public class ToastModule(reactContext: ReactApplicationContext) :
69
65
})
70
66
}
71
67
72
- public companion object {
73
- public const val NAME : String = NativeToastAndroidSpec .NAME
68
+ companion object {
69
+ const val NAME : String = NativeToastAndroidSpec .NAME
74
70
private const val DURATION_SHORT_KEY = " SHORT"
75
71
private const val DURATION_LONG_KEY = " LONG"
76
72
private const val GRAVITY_TOP_KEY = " TOP"
0 commit comments