@@ -27,7 +27,7 @@ import android.os.Bundle
2727import android.view.Gravity
2828import android.widget.LinearLayout
2929import android.widget.TextView
30- import androidx.appcompat.app.AppCompatActivity
30+ import com.highcapable.betterandroid.ui.component.activity.AppViewsActivity
3131import com.highcapable.betterandroid.ui.extension.view.toast
3232import com.highcapable.betterandroid.ui.extension.view.updateMargins
3333import com.highcapable.hikage.extension.setContentView
@@ -36,67 +36,82 @@ import com.highcapable.hikage.widget.android.widget.ImageView
3636import com.highcapable.hikage.widget.android.widget.LinearLayout
3737import com.highcapable.hikage.widget.android.widget.TextView
3838import com.highcapable.hikage.widget.androidx.core.widget.NestedScrollView
39+ import com.highcapable.hikage.widget.com.google.android.material.appbar.MaterialToolbar
3940import com.highcapable.yukihookapi.demo_app.R
4041import com.highcapable.yukihookapi.demo_app.test.Main
4142import android.R as Android_R
4243
43- class MainActivity : AppCompatActivity () {
44+ class MainActivity : AppViewsActivity () {
4445
4546 override fun onCreate (savedInstanceState : Bundle ? ) {
4647 super .onCreate(savedInstanceState)
4748 val hikage = setContentView {
48- NestedScrollView (
49- lparams = LayoutParams (matchParent = true ),
49+ LinearLayout (
50+ lparams = LayoutParams (widthMatchParent = true ),
5051 init = {
51- isFillViewport = true
52- isVerticalScrollBarEnabled = false
52+ orientation = LinearLayout .VERTICAL
5353 }
5454 ) {
55- LinearLayout (
56- lparams = LayoutParams (widthMatchParent = true ) {
57- updateMargins(vertical = 20 .dp)
58- },
55+ MaterialToolbar (
56+ lparams = LayoutParams (widthMatchParent = true ),
5957 init = {
60- orientation = LinearLayout .VERTICAL
61- gravity = Gravity .CENTER
58+ title = stringResource(R .string.app_name)
59+ }
60+ )
61+ NestedScrollView (
62+ lparams = LayoutParams (matchParent = true ),
63+ init = {
64+ isFillViewport = true
65+ isVerticalScrollBarEnabled = false
66+ isVerticalFadingEdgeEnabled = true
6267 }
6368 ) {
64- ImageView (
65- lparams = LayoutParams (50 .dp, 50 .dp) {
66- bottomMargin = 15 .dp
69+ LinearLayout (
70+ lparams = LayoutParams (widthMatchParent = true ) {
71+ updateMargins(vertical = 20 .dp)
72+ },
73+ init = {
74+ orientation = LinearLayout .VERTICAL
75+ gravity = Gravity .CENTER
6776 }
6877 ) {
69- setImageResource(R .mipmap.ic_face_unhappy)
70- }
71- TextView (
72- lparams = LayoutParams {
73- bottomMargin = 25 .dp
78+ ImageView (
79+ lparams = LayoutParams (50 .dp, 50 .dp) {
80+ bottomMargin = 15 .dp
81+ }
82+ ) {
83+ setImageResource(R .mipmap.ic_face_unhappy)
7484 }
75- ) {
76- text = stringResource(R .string.test_string)
77- textSize = 17.5f
78- }
79- repeat(11 ) {
8085 TextView (
81- id = " sample_text_$it " ,
8286 lparams = LayoutParams {
83- bottomMargin = 15 .dp
87+ bottomMargin = 25 .dp
8488 }
8589 ) {
8690 text = stringResource(R .string.test_string)
8791 textSize = 17.5f
8892 }
89- }
90- ImageView (
91- lparams = LayoutParams (30 .dp, 30 .dp) {
92- bottomMargin = 15 .dp
93+ repeat(11 ) {
94+ TextView (
95+ id = " sample_text_$it " ,
96+ lparams = LayoutParams {
97+ bottomMargin = 15 .dp
98+ }
99+ ) {
100+ text = stringResource(R .string.test_string)
101+ textSize = 17.5f
102+ }
103+ }
104+ ImageView (
105+ lparams = LayoutParams (30 .dp, 30 .dp) {
106+ bottomMargin = 15 .dp
107+ }
108+ ) {
109+ setImageResource(Android_R .mipmap.sym_def_app_icon)
110+ }
111+ Button {
112+ text = " Click Me!"
113+ setOnClickListener { toast() }
93114 }
94- ) {
95- setImageResource(Android_R .mipmap.sym_def_app_icon)
96- }
97- Button {
98- text = " Click Me!"
99- setOnClickListener { toast() }
100115 }
101116 }
102117 }
0 commit comments