Skip to content

Commit

Permalink
* fix demo
Browse files Browse the repository at this point in the history
  • Loading branch information
angcyo committed Feb 23, 2022
1 parent 23dd73b commit 43c78e4
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 71 deletions.
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.3.72'
ext.kotlin_version = '1.6.10'
repositories {
google()
jcenter()
mavenCentral()

}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
classpath 'com.android.tools.build:gradle:4.2.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
Expand All @@ -19,7 +19,7 @@ buildscript {
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Expand Down
17 changes: 8 additions & 9 deletions demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
compileSdkVersion 32

defaultConfig {
applicationId "com.angcyo.dslitem.demo"
minSdkVersion 16
targetSdkVersion 29
targetSdkVersion 32
versionCode 1
versionName "1.0"

Expand All @@ -28,12 +27,12 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

implementation project(":dslitem")
}
1 change: 1 addition & 0 deletions demo/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<activity
android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden|screenSize|fontScale|smallestScreenSize|density|screenLayout"
android:exported="true"
android:windowSoftInputMode="adjustResize|stateAlwaysHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
113 changes: 57 additions & 56 deletions demo/src/main/java/com/angcyo/dslitem/demo/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,79 +13,80 @@ class MainActivity : AppCompatActivity() {
setContentView(R.layout.activity_main)

findViewById<RecyclerView>(R.id.recycler_view)?.initDslAdapter {
DslBaseEditItem()() {
itemEditText = this::class.java.simpleName
_lastEditSelectionStart = itemEditText?.length ?: -1

configEditTextStyle {
hint = "请输入..."
render {
DslBaseEditItem()() {
itemEditText = this::class.java.simpleName
_lastEditSelectionStart = itemEditText?.length ?: -1

configEditTextStyle {
hint = "请输入..."
}
}
}

DslBaseInfoItem()() {
itemInfoText = this::class.java.simpleName
}
DslBaseInfoItem()() {
itemInfoText = this::class.java.simpleName
}

DslBaseLabelItem()() {
itemLabelText = this::class.java.simpleName
}
DslBaseLabelItem()() {
itemLabelText = this::class.java.simpleName
}

DslButtonItem()() {
itemButtonText = this::class.java.simpleName
}
DslButtonItem()() {
itemButtonText = this::class.java.simpleName
}

DslButtonItem()() {
itemButtonText = this::class.java.simpleName
configButtonStyle {
themeStyle()
DslButtonItem()() {
itemButtonText = this::class.java.simpleName
configButtonStyle {
themeStyle()
}
}
}
DslButtonItem()() {
itemButtonText = this::class.java.simpleName
configButtonStyle {
fillStyle()
DslButtonItem()() {
itemButtonText = this::class.java.simpleName
configButtonStyle {
fillStyle()
}
}
}
DslButtonItem()() {
itemButtonText = this::class.java.simpleName
configButtonStyle {
solidStyle()
DslButtonItem()() {
itemButtonText = this::class.java.simpleName
configButtonStyle {
solidStyle()
}
}
}

DslGridItem()() {
itemText = this::class.java.simpleName
itemIcon = R.drawable.png
}
DslGridItem()() {
itemText = this::class.java.simpleName
itemIcon = R.drawable.png
}

DslLabelEditItem()() {
itemLabelText = "Label"
itemEditText = this::class.java.simpleName
_lastEditSelectionStart = itemEditText?.length ?: -1
DslLabelEditItem()() {
itemLabelText = "Label"
itemEditText = this::class.java.simpleName
_lastEditSelectionStart = itemEditText?.length ?: -1

configEditTextStyle {
hint = "请输入..."
configEditTextStyle {
hint = "请输入..."
}
}
}

DslLabelTextItem()() {
itemLabelText = "Label"
itemText = this::class.java.simpleName
}
DslLabelTextItem()() {
itemLabelText = "Label"
itemText = this::class.java.simpleName
}

DslSwitchInfoItem()() {
itemInfoText = this::class.java.simpleName
}
DslSwitchInfoItem()() {
itemInfoText = this::class.java.simpleName
}

DslTextInfoItem()() {
itemInfoText = this::class.java.simpleName
itemDarkText = "DarkText"
}
DslTextInfoItem()() {
itemInfoText = this::class.java.simpleName
itemDarkText = "DarkText"
}

DslTextItem()() {
itemText = this::class.java.simpleName
DslTextItem()() {
itemText = this::class.java.simpleName
}
}

}
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip

0 comments on commit 43c78e4

Please sign in to comment.