From 1fa923b235fe8358e70f5c3930703fdbacd3ba16 Mon Sep 17 00:00:00 2001 From: Cold-Mint Date: Thu, 2 Mar 2023 19:03:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rust/pro/fragments/AllUnitsFragment.kt | 37 +++++++++---------- .../rust/pro/fragments/ModFragment.kt | 8 ++-- app/src/main/res/values/strings.xml | 2 +- settings.gradle | 2 +- 4 files changed, 24 insertions(+), 25 deletions(-) diff --git a/app/src/main/java/com/coldmint/rust/pro/fragments/AllUnitsFragment.kt b/app/src/main/java/com/coldmint/rust/pro/fragments/AllUnitsFragment.kt index fadd122..1cf7e03 100644 --- a/app/src/main/java/com/coldmint/rust/pro/fragments/AllUnitsFragment.kt +++ b/app/src/main/java/com/coldmint/rust/pro/fragments/AllUnitsFragment.kt @@ -12,6 +12,7 @@ import android.text.style.ClickableSpan import android.util.Log import android.view.LayoutInflater import android.view.View +import android.widget.Toast import androidx.core.view.isVisible import androidx.fragment.app.FragmentActivity import androidx.recyclerview.widget.DividerItemDecoration @@ -157,8 +158,7 @@ class AllUnitsFragment( Regex(data?.sourceFileFilteringRule ?: ".+\\.ini|.+\\.template") fileFinder2.setFinderListener(object : FileFinderListener { override fun whenFindFile(file: File): Boolean { - if (fileDatabase == null || modClass == null) - { + if (fileDatabase == null || modClass == null) { return false } //此处在这里判断的目的是将所有文件录入数据库 @@ -168,7 +168,8 @@ class AllUnitsFragment( dataList.add(sourceFileClass) } val fileTable = FileDataBase.createFileInfoFromFile(file) - if (fileDatabase!!.getFileInfoDao().findFileInfoByPath(file.absolutePath) == null + if (fileDatabase!!.getFileInfoDao() + .findFileInfoByPath(file.absolutePath) == null ) { fileDatabase!!.getFileInfoDao().insert(fileTable) } else { @@ -190,24 +191,22 @@ class AllUnitsFragment( viewBinding.swipeRefreshLayout.isVisible = true viewBinding.progressBar.isVisible = false viewBinding.unitError.isVisible = false - if (isAdded) { - val adapter = UnitAdapter(requireContext(), dataList, "") - adapter.setItemEvent { i, unitItemBinding, viewHolder, sourceFileClass -> - unitItemBinding.root.setOnClickListener { - openEditActivity(sourceFileClass) - } + val adapter = UnitAdapter(requireContext(), dataList, "") + adapter.setItemEvent { i, unitItemBinding, viewHolder, sourceFileClass -> + unitItemBinding.root.setOnClickListener { + openEditActivity(sourceFileClass) } - adapter.setItemChangeEvent { changeType, i, sourceFileClass, i2 -> - whenNumberChanged?.invoke(i2) - if (i2 == 0) { - loadFiles() - } - } - FastScrollerBuilder(viewBinding.unitList).useMd2Style() - .setPopupTextProvider(adapter).build() - viewBinding.unitList.adapter = adapter - whenNumberChanged?.invoke(dataList.size) } + adapter.setItemChangeEvent { changeType, i, sourceFileClass, i2 -> + whenNumberChanged?.invoke(i2) + if (i2 == 0) { + loadFiles() + } + } + FastScrollerBuilder(viewBinding.unitList).useMd2Style() + .setPopupTextProvider(adapter).build() + viewBinding.unitList.adapter = adapter + whenNumberChanged?.invoke(dataList.size) } } } diff --git a/app/src/main/java/com/coldmint/rust/pro/fragments/ModFragment.kt b/app/src/main/java/com/coldmint/rust/pro/fragments/ModFragment.kt index 458fe40..e42864c 100644 --- a/app/src/main/java/com/coldmint/rust/pro/fragments/ModFragment.kt +++ b/app/src/main/java/com/coldmint/rust/pro/fragments/ModFragment.kt @@ -247,10 +247,10 @@ class ModFragment : BaseFragment() { configurationManager?.readData() val works: MutableList = ArrayList() if (modClass.modFile.isDirectory) { - val developerMode = AppSettings.getValue(AppSettings.Setting.DeveloperMode, false) - if (developerMode) { - works.add(getString(R.string.generate_error_report)) - } +// val developerMode = AppSettings.getValue(AppSettings.Setting.DeveloperMode, false) +// if (developerMode) { +// works.add(getString(R.string.generate_error_report)) +// } if (GlobalMethod.isActive) { works.add(getString(R.string.mod_action1)) if (modClass.hasInfo()) { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 5d226a8..2cda001 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -703,7 +703,7 @@ 续费 续费提醒 您的账号(%1$s)将于%2$d天后到期。 - 永久激活 + 赞助者 您已永久激活。 举报 举报-%1$s diff --git a/settings.gradle b/settings.gradle index 5b34888..d7d6933 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,4 +1,4 @@ include ':app' -rootProject.name = "铁锈助手" +rootProject.name = "RustedAssistant" include ':assistantCoreLibrary' include ':dialog'