Skip to content

Commit 5b28d47

Browse files
committed
Kotlin conversion
1 parent 2909b04 commit 5b28d47

File tree

4 files changed

+1262
-1449
lines changed

4 files changed

+1262
-1449
lines changed

demo/src/main/java/com/sothree/slidinguppanel/demo/DemoActivity.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class DemoActivity : AppCompatActivity() {
7171
Log.i(TAG, "onPanelStateChanged $newState")
7272
}
7373
})
74-
sliding_layout.setFadeOnClickListener { sliding_layout.setPanelState(PanelState.COLLAPSED) }
74+
sliding_layout.setFadeOnClickListener { sliding_layout.panelState = PanelState.COLLAPSED }
7575
val textName = findViewById<TextView>(R.id.name)
7676
textName.text = Html.fromHtml(getString(R.string.hello))
7777
val followButton = findViewById<Button>(R.id.follow)
@@ -113,12 +113,12 @@ class DemoActivity : AppCompatActivity() {
113113
return true
114114
}
115115
R.id.action_anchor -> {
116-
if (sliding_layout.anchorPoint == 1.0f) {
117-
sliding_layout.anchorPoint = 0.7f
116+
if (sliding_layout.getAnchorPoint() == 1.0f) {
117+
sliding_layout.setAnchorPoint(0.7f)
118118
sliding_layout.panelState = PanelState.ANCHORED
119119
item.setTitle(R.string.action_anchor_disable)
120120
} else {
121-
sliding_layout.anchorPoint = 1.0f
121+
sliding_layout.setAnchorPoint(1.0f)
122122
sliding_layout.panelState = PanelState.COLLAPSED
123123
item.setTitle(R.string.action_anchor_enable)
124124
}

library/src/main/java/com/sothree/slidinguppanel/LayoutWeightParams.kt

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import android.view.ViewGroup
66
import android.util.AttributeSet
77

88
class LayoutWeightParams : MarginLayoutParams {
9-
@JvmField
109
var weight = 0f
1110

1211
constructor() : super(MATCH_PARENT, MATCH_PARENT)

0 commit comments

Comments
 (0)