@@ -25,9 +25,10 @@ import android.view.Gravity
25
25
import android.view.View
26
26
27
27
/* * Utility class that shows riblets name in its background. */
28
- class XRay private constructor() {
28
+ public class XRay private constructor() {
29
29
private var isEnabled = false
30
30
private var textPaint: Paint ? = null
31
+
31
32
private fun writeOnBitmap (bitmap : Bitmap , text : String ) {
32
33
val canvas = Canvas (bitmap)
33
34
val textPaint = getTextPaint()
@@ -47,7 +48,7 @@ class XRay private constructor() {
47
48
return textPaint!!
48
49
}
49
50
50
- companion object {
51
+ public companion object {
51
52
private val INSTANCE = XRay ()
52
53
private const val FRAME_WIDTH = 500
53
54
private const val FRAME_HEIGHT = 150
@@ -57,15 +58,12 @@ class XRay private constructor() {
57
58
58
59
/* * Toggles state of XRay. */
59
60
@JvmStatic
60
- fun toggle () {
61
+ public fun toggle () {
61
62
INSTANCE .isEnabled = ! INSTANCE .isEnabled
62
63
}
63
64
64
65
/* * @return `true` if XRay is enabled, `false` otherwise. */
65
- @JvmStatic
66
- fun isEnabled (): Boolean {
67
- return INSTANCE .isEnabled
68
- }
66
+ @JvmStatic public fun isEnabled (): Boolean = INSTANCE .isEnabled
69
67
70
68
/* *
71
69
* Puts [ViewBuilder]s riblet name in the background of the [View]
@@ -74,7 +72,7 @@ class XRay private constructor() {
74
72
* @param view a [View] to put the name behind.
75
73
*/
76
74
@JvmStatic
77
- fun apply (viewRouter : ViewRouter <* , * >, view : View ) {
75
+ public fun apply (viewRouter : ViewRouter <* , * >, view : View ) {
78
76
val oldBackground = view.background
79
77
val bitmap: Bitmap =
80
78
if (oldBackground != null ) {
@@ -110,8 +108,7 @@ class XRay private constructor() {
110
108
return bitmap
111
109
}
112
110
113
- private fun getRibletName (viewRouter : ViewRouter <* , * >): String {
114
- return viewRouter.javaClass.simpleName.replace(" Router" , " " )
115
- }
111
+ private fun getRibletName (viewRouter : ViewRouter <* , * >): String =
112
+ viewRouter.javaClass.simpleName.replace(" Router" , " " )
116
113
}
117
114
}
0 commit comments