From d2511112e18b1e7ee436ea974ea6ff85ef6fce81 Mon Sep 17 00:00:00 2001 From: yechao Date: Sat, 16 Oct 2021 22:11:54 +0800 Subject: [PATCH] optimized code --- .gitignore | 1 + .idea/runConfigurations.xml | 13 ------------- app/src/main/java/com/yechaoa/app/MainActivity.kt | 8 ++++---- app/src/main/res/layout/activity_main.xml | 8 ++++---- 4 files changed, 9 insertions(+), 21 deletions(-) delete mode 100644 .idea/runConfigurations.xml diff --git a/.gitignore b/.gitignore index b378be6..2583fd5 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ /gradle /gradlew /gradlew.bat +/.idea/ diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml deleted file mode 100644 index e497da9..0000000 --- a/.idea/runConfigurations.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/java/com/yechaoa/app/MainActivity.kt b/app/src/main/java/com/yechaoa/app/MainActivity.kt index bc9d943..46773b7 100644 --- a/app/src/main/java/com/yechaoa/app/MainActivity.kt +++ b/app/src/main/java/com/yechaoa/app/MainActivity.kt @@ -36,21 +36,21 @@ class MainActivity : AppCompatActivity() { set.add("-----" + array[i]) } - mBinding.button.setOnClickListener { + mBinding.btnStrSet.setOnClickListener { SpUtil.setStringSet("testStringSet", set) } - mBinding.button2.setOnClickListener { + mBinding.btnStrSet2.setOnClickListener { val stringSet = SpUtil.getStringSet("testStringSet") LogUtil.i(stringSet.toString()) } - mBinding.showLoading.setOnClickListener { + mBinding.btnShowLoading.setOnClickListener { YUtils.showLoading(this, "test") LogUtil.i("" + YUtils.loadingIsShowing()) } - mBinding.hideLoading.setOnClickListener { + mBinding.btnHideLoading.setOnClickListener { ToastUtil.show("取消loading") YUtils.hideLoading() LogUtil.i("" + YUtils.loadingIsShowing()) diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index d209eea..9646a78 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -14,25 +14,25 @@ android:text="Hello World!" />