@@ -46,8 +46,6 @@ class VisibilityOutput(
46
46
val onVisibilityChange : VisibilityEventCallbackData ?
47
47
) {
48
48
49
- private var focusedRatio = 0f
50
-
51
49
constructor (
52
50
id: String ,
53
51
key: String ,
@@ -77,62 +75,6 @@ class VisibilityOutput(
77
75
onFullImpression,
78
76
onVisibilityChange)
79
77
80
- val visibilityTop: Float
81
- get() =
82
- if (visibleHeightRatio == 0f ) {
83
- bounds.top.toFloat()
84
- } else {
85
- bounds.top + visibleHeightRatio * (bounds.bottom - bounds.top)
86
- }
87
-
88
- val visibilityBottom: Float
89
- get() =
90
- if (visibleHeightRatio == 0f ) {
91
- bounds.bottom.toFloat()
92
- } else {
93
- bounds.bottom - visibleHeightRatio * (bounds.bottom - bounds.top)
94
- }
95
-
96
- val visibilityLeft: Float
97
- get() = bounds.left + visibleWidthRatio * (bounds.right - bounds.left)
98
-
99
- val visibilityRight: Float
100
- get() = bounds.right - visibleHeightRatio * (bounds.right - bounds.left)
101
-
102
- val fullImpressionTop: Float
103
- get() = bounds.bottom.toFloat()
104
-
105
- val fullImpressionBottom: Float
106
- get() = bounds.top.toFloat()
107
-
108
- val fullImpressionLeft: Float
109
- get() = bounds.right.toFloat()
110
-
111
- val fullImpressionRight: Float
112
- get() = bounds.left.toFloat()
113
-
114
- val focusedTop: Float
115
- get() = bounds.top + focusedRatio * (bounds.bottom - bounds.top)
116
-
117
- val focusedBottom: Float
118
- get() = bounds.bottom - focusedRatio * (bounds.bottom - bounds.top)
119
-
120
- val focusedLeft: Float
121
- get() = bounds.left + focusedRatio * (bounds.right - bounds.left)
122
-
123
- val focusedRight: Float
124
- get() = bounds.right - focusedRatio * (bounds.right - bounds.left)
125
-
126
- val componentArea: Int
127
- get() {
128
- val rect = bounds
129
- return if (rect.isEmpty) 0 else rect.width() * rect.height()
130
- }
131
-
132
- fun setFocusedRatio (focusedRatio : Float ) {
133
- this .focusedRatio = focusedRatio
134
- }
135
-
136
78
/* *
137
79
* The factory that client frameworks must implement to enable [VisibilityExtension] to create a
138
80
* [VisibilityOutput] for every visited [LayoutResult] during the layout pass.
@@ -148,7 +90,7 @@ class VisibilityOutput(
148
90
}
149
91
150
92
class VisibilityEventCallbackData (
151
- widthRatio : Float ,
152
- heightRatio : Float ,
93
+ val widthRatio : Float ,
94
+ val heightRatio : Float ,
153
95
val callback : Function <Void ?>,
154
96
)
0 commit comments