Skip to content

Commit f999f9e

Browse files
Merge pull request #1 from Omega-R/develop
Develop
2 parents 7893528 + ec21787 commit f999f9e

28 files changed

+1081
-704
lines changed

.idea/codeStyles/Project.xml

Lines changed: 140 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/codeStyles/codeStyleConfig.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/main/java/com/omega_r/bind/app/MainActivity.kt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,41 @@ package com.omega_r.bind.app
22

33
import androidx.appcompat.app.AppCompatActivity
44
import android.os.Bundle
5+
import android.util.SparseArray
6+
import android.view.View
7+
import android.view.ViewGroup
8+
import android.view.ViewGroup.LayoutParams.MATCH_PARENT
9+
import com.omega_r.bind.OmegaAutoAdapter
10+
import com.omega_r.bind.OmegaBindView
11+
import com.omega_r.bind.model.BindModel
12+
import com.omega_r.bind.model.binders.*
513

614
class MainActivity : AppCompatActivity() {
15+
16+
private val bindModel = BindModel.create<String> {
17+
bindString(R.id.NO_DEBUG)
18+
bindVisible(R.id.NO_DEBUG) {
19+
true
20+
}
21+
bindMultiCustom(R.id.NO_DEBUG, R.id.NO_DEBUG) { sparseArray: SparseArray<View>, s: String ->
22+
sparseArray[R.id.NO_DEBUG]
23+
}
24+
}
25+
26+
private val adapter = OmegaAutoAdapter.create(R.layout.activity_main, bindModel)
27+
728
override fun onCreate(savedInstanceState: Bundle?) {
829
super.onCreate(savedInstanceState)
930
setContentView(R.layout.activity_main)
31+
32+
val bindView = OmegaBindView.create<String>(this, R.layout.activity_main) {
33+
bindString(R.id.textview_hello)
34+
}
35+
36+
37+
bindView.bind("Bind: Hello World!")
38+
39+
addContentView(bindView, ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT))
1040
}
41+
1142
}

app/src/main/res/layout/activity_main.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
tools:context=".MainActivity">
88

99
<TextView
10+
android:id="@+id/textview_hello"
1011
android:layout_width="wrap_content"
1112
android:layout_height="wrap_content"
12-
android:text="Hello World!"
13+
tools:text="Hello World!"
1314
app:layout_constraintBottom_toBottomOf="parent"
1415
app:layout_constraintLeft_toLeftOf="parent"
1516
app:layout_constraintRight_toRightOf="parent"

0 commit comments

Comments
 (0)