From 5891e36fa566f5c8be0efd89e86aa0a5f4989f8d Mon Sep 17 00:00:00 2001 From: Linfye <3158203624@qq.com> Date: Tue, 10 Sep 2024 14:33:47 +0800 Subject: [PATCH 1/2] Fix import issues --- .editorconfig | 2 +- .../be/scri/activities/BaseSimpleActivity.kt | 54 +++++++++++++++- .../be/scri/activities/BaseSplashActivity.kt | 8 ++- .../dialogs/CustomIntervalPickerDialog.kt | 6 +- .../main/java/be/scri/extensions/Activity.kt | 44 +++++++++++-- app/src/main/java/be/scri/extensions/App.kt | 2 +- .../java/be/scri/extensions/CommonsContext.kt | 61 +++++++++++++++++-- .../be/scri/extensions/Context-storage.kt | 20 ++++-- .../be/scri/extensions/Context-styling.kt | 6 +- .../java/be/scri/extensions/ExifInterface.kt | 2 +- app/src/main/java/be/scri/extensions/File.kt | 7 ++- app/src/main/java/be/scri/extensions/Int.kt | 4 +- app/src/main/java/be/scri/extensions/Long.kt | 3 +- .../main/java/be/scri/extensions/String.kt | 10 ++- .../be/scri/fragments/SettingsFragment.kt | 4 +- .../main/java/be/scri/helpers/BaseConfig.kt | 4 +- app/src/main/java/be/scri/helpers/Config.kt | 2 +- .../java/be/scri/helpers/MyContextWrapper.kt | 2 +- .../main/java/be/scri/helpers/MyKeyboard.kt | 1 - .../main/java/be/scri/models/FileDirItem.kt | 36 ++++++++++- .../be/scri/services/SimpleKeyboardIME.kt | 5 +- .../main/java/be/scri/views/MyKeyboardView.kt | 37 +++++++++-- .../BottomActionMenuItemPopup.kt | 6 +- 23 files changed, 285 insertions(+), 41 deletions(-) diff --git a/.editorconfig b/.editorconfig index 01a0bff0..dde8f79e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -20,7 +20,7 @@ continuation_indent_size = 4 wildcard_import_limit = 999 ij_kotlin_name_count_to_use_star_import = 999 ij_kotlin_name_count_to_use_star_import_for_members = 999 -ktlint_standard_no-wildcard-imports = disabled +#ktlint_standard_no-wildcard-imports = disabled ktlint_standard_backing-property-naming = disabled ktlint_standard_filename = disabled diff --git a/app/src/main/java/be/scri/activities/BaseSimpleActivity.kt b/app/src/main/java/be/scri/activities/BaseSimpleActivity.kt index 670af3d1..c61f4fc2 100644 --- a/app/src/main/java/be/scri/activities/BaseSimpleActivity.kt +++ b/app/src/main/java/be/scri/activities/BaseSimpleActivity.kt @@ -30,9 +30,59 @@ import be.scri.R import be.scri.dialogs.ConfirmationDialog import be.scri.dialogs.WritePermissionDialog import be.scri.dialogs.WritePermissionDialog.Mode -import be.scri.extensions.* +import be.scri.extensions.addBit +import be.scri.extensions.baseConfig +import be.scri.extensions.buildDocumentUriSdk30 +import be.scri.extensions.createAndroidDataOrObbPath +import be.scri.extensions.createAndroidDataOrObbUri +import be.scri.extensions.createFirstParentTreeUri +import be.scri.extensions.getAppIconColors +import be.scri.extensions.getColoredDrawableWithColor +import be.scri.extensions.getContrastColor +import be.scri.extensions.getFirstParentLevel +import be.scri.extensions.getFirstParentPath +import be.scri.extensions.getPermissionString +import be.scri.extensions.getProperStatusBarColor +import be.scri.extensions.getProperTextColor +import be.scri.extensions.getThemeId +import be.scri.extensions.hasPermission +import be.scri.extensions.hideKeyboard +import be.scri.extensions.humanizePath +import be.scri.extensions.isAppInstalledOnSDCard +import be.scri.extensions.isPathOnOTG +import be.scri.extensions.isPathOnSD +import be.scri.extensions.isShowingAndroidSAFDialog +import be.scri.extensions.isShowingOTGDialog +import be.scri.extensions.isShowingSAFCreateDocumentDialogSdk30 +import be.scri.extensions.isShowingSAFDialog +import be.scri.extensions.isShowingSAFDialogSdk30 +import be.scri.extensions.removeBit +import be.scri.extensions.showErrorToast +import be.scri.extensions.storeAndroidTreeUri +import be.scri.extensions.toast +import be.scri.extensions.updateActionBarTitle +import be.scri.extensions.updateOTGPathFromPartition import be.scri.fragments.AboutFragment -import be.scri.helpers.* +import be.scri.helpers.APP_ICON_IDS +import be.scri.helpers.APP_LAUNCHER_NAME +import be.scri.helpers.APP_LICENSES +import be.scri.helpers.APP_NAME +import be.scri.helpers.APP_VERSION_NAME +import be.scri.helpers.CREATE_DOCUMENT_SDK_30 +import be.scri.helpers.EXTERNAL_STORAGE_PROVIDER_AUTHORITY +import be.scri.helpers.INVALID_NAVIGATION_BAR_COLOR +import be.scri.helpers.MyContextWrapper +import be.scri.helpers.OPEN_DOCUMENT_TREE_FOR_ANDROID_DATA_OR_OBB +import be.scri.helpers.OPEN_DOCUMENT_TREE_FOR_SDK_30 +import be.scri.helpers.OPEN_DOCUMENT_TREE_OTG +import be.scri.helpers.OPEN_DOCUMENT_TREE_SD +import be.scri.helpers.REQUEST_CODE_SET_DEFAULT_DIALER +import be.scri.helpers.SD_OTG_SHORT +import be.scri.helpers.SHOW_FAQ_BEFORE_MAIL +import be.scri.helpers.isMarshmallowPlus +import be.scri.helpers.isOreoPlus +import be.scri.helpers.isQPlus +import be.scri.helpers.isRPlus import java.util.regex.Pattern abstract class BaseSimpleActivity : AppCompatActivity() { diff --git a/app/src/main/java/be/scri/activities/BaseSplashActivity.kt b/app/src/main/java/be/scri/activities/BaseSplashActivity.kt index d0c7f799..f6ac64a7 100644 --- a/app/src/main/java/be/scri/activities/BaseSplashActivity.kt +++ b/app/src/main/java/be/scri/activities/BaseSplashActivity.kt @@ -4,7 +4,13 @@ import android.graphics.Color import android.os.Bundle import androidx.appcompat.app.AppCompatActivity import be.scri.R -import be.scri.extensions.* +import be.scri.extensions.baseConfig +import be.scri.extensions.checkAppIconColor +import be.scri.extensions.checkAppSideloading +import be.scri.extensions.getSharedTheme +import be.scri.extensions.isThankYouInstalled +import be.scri.extensions.isUsingSystemDarkTheme +import be.scri.extensions.showSideloadingDialog import be.scri.helpers.SIDELOADING_TRUE import be.scri.helpers.SIDELOADING_UNCHECKED diff --git a/app/src/main/java/be/scri/dialogs/CustomIntervalPickerDialog.kt b/app/src/main/java/be/scri/dialogs/CustomIntervalPickerDialog.kt index c2ab444a..4bb2ed55 100644 --- a/app/src/main/java/be/scri/dialogs/CustomIntervalPickerDialog.kt +++ b/app/src/main/java/be/scri/dialogs/CustomIntervalPickerDialog.kt @@ -4,7 +4,11 @@ import android.app.Activity import androidx.appcompat.app.AlertDialog import be.scri.R import be.scri.databinding.DialogCustomIntervalPickerBinding -import be.scri.extensions.* +import be.scri.extensions.beVisibleIf +import be.scri.extensions.hideKeyboard +import be.scri.extensions.setupDialogStuff +import be.scri.extensions.showKeyboard +import be.scri.extensions.value import be.scri.helpers.DAY_SECONDS import be.scri.helpers.HOUR_SECONDS import be.scri.helpers.MINUTE_SECONDS diff --git a/app/src/main/java/be/scri/extensions/Activity.kt b/app/src/main/java/be/scri/extensions/Activity.kt index 5d11f8ef..d9c87a7b 100644 --- a/app/src/main/java/be/scri/extensions/Activity.kt +++ b/app/src/main/java/be/scri/extensions/Activity.kt @@ -3,7 +3,11 @@ package be.scri.extensions import android.annotation.SuppressLint import android.app.Activity import android.app.TimePickerDialog -import android.content.* +import android.content.ActivityNotFoundException +import android.content.ComponentName +import android.content.ContentValues +import android.content.Context +import android.content.Intent import android.content.Intent.EXTRA_STREAM import android.content.pm.ApplicationInfo import android.content.pm.PackageManager @@ -38,16 +42,46 @@ import androidx.fragment.app.FragmentActivity import be.scri.R import be.scri.activities.BaseSimpleActivity import be.scri.databinding.DialogTitleBinding -import be.scri.dialogs.* +import be.scri.dialogs.AppSideloadedDialog +import be.scri.dialogs.ConfirmationAdvancedDialog +import be.scri.dialogs.CustomIntervalPickerDialog +import be.scri.dialogs.RadioGroupDialog +import be.scri.dialogs.WritePermissionDialog import be.scri.dialogs.WritePermissionDialog.Mode -import be.scri.helpers.* -import be.scri.models.* +import be.scri.helpers.CREATE_DOCUMENT_SDK_30 +import be.scri.helpers.EXTRA_SHOW_ADVANCED +import be.scri.helpers.INVALID_NAVIGATION_BAR_COLOR +import be.scri.helpers.IS_FROM_GALLERY +import be.scri.helpers.MINUTE_SECONDS +import be.scri.helpers.MyContentProvider +import be.scri.helpers.OPEN_DOCUMENT_TREE_FOR_ANDROID_DATA_OR_OBB +import be.scri.helpers.OPEN_DOCUMENT_TREE_FOR_SDK_30 +import be.scri.helpers.OPEN_DOCUMENT_TREE_OTG +import be.scri.helpers.OPEN_DOCUMENT_TREE_SD +import be.scri.helpers.PERMISSION_CALL_PHONE +import be.scri.helpers.PERMISSION_READ_STORAGE +import be.scri.helpers.PROTECTION_FINGERPRINT +import be.scri.helpers.REAL_FILE_PATH +import be.scri.helpers.REQUEST_EDIT_IMAGE +import be.scri.helpers.REQUEST_SET_AS +import be.scri.helpers.SIDELOADING_FALSE +import be.scri.helpers.SIDELOADING_TRUE +import be.scri.helpers.SILENT +import be.scri.helpers.ensureBackgroundThread +import be.scri.helpers.isMarshmallowPlus +import be.scri.helpers.isOnMainThread +import be.scri.helpers.isRPlus +import be.scri.models.AlarmSound +import be.scri.models.Android30RenameFormat +import be.scri.models.FileDirItem +import be.scri.models.RadioItem +import be.scri.models.SharedTheme import be.scri.views.MyTextView import java.io.File import java.io.FileNotFoundException import java.io.FileOutputStream import java.io.OutputStream -import java.util.* +import java.util.TreeSet private lateinit var binding: DialogTitleBinding diff --git a/app/src/main/java/be/scri/extensions/App.kt b/app/src/main/java/be/scri/extensions/App.kt index 588d13cc..803e64fe 100644 --- a/app/src/main/java/be/scri/extensions/App.kt +++ b/app/src/main/java/be/scri/extensions/App.kt @@ -2,7 +2,7 @@ package be.scri.extensions import android.app.Application import be.scri.helpers.isNougatPlus -import java.util.* +import java.util.Locale fun Application.checkUseEnglish() { if (baseConfig.useEnglish && !isNougatPlus()) { diff --git a/app/src/main/java/be/scri/extensions/CommonsContext.kt b/app/src/main/java/be/scri/extensions/CommonsContext.kt index 4667351b..b96107be 100644 --- a/app/src/main/java/be/scri/extensions/CommonsContext.kt +++ b/app/src/main/java/be/scri/extensions/CommonsContext.kt @@ -5,7 +5,13 @@ import android.annotation.TargetApi import android.app.Activity import android.app.NotificationManager import android.app.role.RoleManager -import android.content.* +import android.content.ActivityNotFoundException +import android.content.ClipData +import android.content.ClipboardManager +import android.content.ContentUris +import android.content.ContentValues +import android.content.Context +import android.content.Intent import android.content.pm.PackageManager import android.content.pm.ShortcutManager import android.content.res.Configuration @@ -24,7 +30,11 @@ import android.provider.BlockedNumberContract.BlockedNumbers import android.provider.ContactsContract.CommonDataKinds.BaseTypes import android.provider.ContactsContract.CommonDataKinds.Phone import android.provider.DocumentsContract -import android.provider.MediaStore.* +import android.provider.MediaStore.Audio +import android.provider.MediaStore.Files +import android.provider.MediaStore.Images +import android.provider.MediaStore.MediaColumns +import android.provider.MediaStore.Video import android.provider.OpenableColumns import android.provider.Settings import android.telecom.TelecomManager @@ -39,7 +49,49 @@ import androidx.core.content.FileProvider import androidx.exifinterface.media.ExifInterface import androidx.loader.content.CursorLoader import be.scri.R -import be.scri.helpers.* +import be.scri.helpers.BaseConfig +import be.scri.helpers.DAY_SECONDS +import be.scri.helpers.FONT_SIZE_LARGE +import be.scri.helpers.FONT_SIZE_MEDIUM +import be.scri.helpers.FONT_SIZE_SMALL +import be.scri.helpers.FRIDAY_BIT +import be.scri.helpers.HOUR_SECONDS +import be.scri.helpers.MINUTE_SECONDS +import be.scri.helpers.MONDAY_BIT +import be.scri.helpers.MONTH_SECONDS +import be.scri.helpers.MyContentProvider +import be.scri.helpers.PERMISSION_CALL_PHONE +import be.scri.helpers.PERMISSION_CAMERA +import be.scri.helpers.PERMISSION_GET_ACCOUNTS +import be.scri.helpers.PERMISSION_READ_CALENDAR +import be.scri.helpers.PERMISSION_READ_CALL_LOG +import be.scri.helpers.PERMISSION_READ_CONTACTS +import be.scri.helpers.PERMISSION_READ_PHONE_STATE +import be.scri.helpers.PERMISSION_READ_SMS +import be.scri.helpers.PERMISSION_READ_STORAGE +import be.scri.helpers.PERMISSION_RECORD_AUDIO +import be.scri.helpers.PERMISSION_SEND_SMS +import be.scri.helpers.PERMISSION_WRITE_CALENDAR +import be.scri.helpers.PERMISSION_WRITE_CALL_LOG +import be.scri.helpers.PERMISSION_WRITE_CONTACTS +import be.scri.helpers.PERMISSION_WRITE_STORAGE +import be.scri.helpers.PREFS_KEY +import be.scri.helpers.SATURDAY_BIT +import be.scri.helpers.SUNDAY_BIT +import be.scri.helpers.THURSDAY_BIT +import be.scri.helpers.TIME_FORMAT_12 +import be.scri.helpers.TIME_FORMAT_24 +import be.scri.helpers.TUESDAY_BIT +import be.scri.helpers.WEDNESDAY_BIT +import be.scri.helpers.WEEK_SECONDS +import be.scri.helpers.YEAR_SECONDS +import be.scri.helpers.YOUR_ALARM_SOUNDS_MIN_ID +import be.scri.helpers.ensureBackgroundThread +import be.scri.helpers.isMarshmallowPlus +import be.scri.helpers.isNougatPlus +import be.scri.helpers.isOnMainThread +import be.scri.helpers.isQPlus +import be.scri.helpers.proPackages import be.scri.models.AlarmSound import be.scri.models.BlockedNumber import com.github.ajalt.reprint.core.Reprint @@ -47,7 +99,8 @@ import com.google.gson.Gson import com.google.gson.reflect.TypeToken import java.io.File import java.text.SimpleDateFormat -import java.util.* +import java.util.Date +import java.util.Locale fun Context.getSharedPrefs() = getSharedPreferences(PREFS_KEY, Context.MODE_PRIVATE) diff --git a/app/src/main/java/be/scri/extensions/Context-storage.kt b/app/src/main/java/be/scri/extensions/Context-storage.kt index 35851c07..44b409a6 100644 --- a/app/src/main/java/be/scri/extensions/Context-storage.kt +++ b/app/src/main/java/be/scri/extensions/Context-storage.kt @@ -14,20 +14,32 @@ import android.os.Handler import android.os.Looper import android.provider.DocumentsContract import android.provider.DocumentsContract.Document -import android.provider.MediaStore.* +import android.provider.MediaStore +import android.provider.MediaStore.Audio +import android.provider.MediaStore.Files +import android.provider.MediaStore.Images +import android.provider.MediaStore.MediaColumns +import android.provider.MediaStore.Video import android.text.TextUtils import androidx.annotation.RequiresApi import androidx.core.content.FileProvider import androidx.core.net.toUri import androidx.documentfile.provider.DocumentFile import be.scri.R -import be.scri.helpers.* +import be.scri.helpers.EXTERNAL_STORAGE_PROVIDER_AUTHORITY +import be.scri.helpers.ExternalStorageProviderHack +import be.scri.helpers.SD_OTG_PATTERN +import be.scri.helpers.SD_OTG_SHORT +import be.scri.helpers.ensureBackgroundThread +import be.scri.helpers.isMarshmallowPlus +import be.scri.helpers.isNougatPlus +import be.scri.helpers.isRPlus import be.scri.models.FileDirItem import java.io.File import java.io.FileInputStream import java.io.InputStream import java.net.URLDecoder -import java.util.* +import java.util.Collections import java.util.regex.Pattern private const val ANDROID_DATA_DIR = "/Android/data/" @@ -428,7 +440,7 @@ fun getPaths(file: File): ArrayList { fun Context.getFileUri(path: String) = when { - path.isImageSlow() -> Images.Media.EXTERNAL_CONTENT_URI + path.isImageSlow() -> MediaStore.Images.Media.EXTERNAL_CONTENT_URI path.isVideoSlow() -> Video.Media.EXTERNAL_CONTENT_URI path.isAudioSlow() -> Audio.Media.EXTERNAL_CONTENT_URI else -> Files.getContentUri("external") diff --git a/app/src/main/java/be/scri/extensions/Context-styling.kt b/app/src/main/java/be/scri/extensions/Context-styling.kt index 44db02c4..992b2b1e 100644 --- a/app/src/main/java/be/scri/extensions/Context-styling.kt +++ b/app/src/main/java/be/scri/extensions/Context-styling.kt @@ -8,7 +8,11 @@ import android.graphics.Color import android.view.ViewGroup import androidx.loader.content.CursorLoader import be.scri.R -import be.scri.helpers.* +import be.scri.helpers.DARK_GREY +import be.scri.helpers.INVALID_NAVIGATION_BAR_COLOR +import be.scri.helpers.MyContentProvider +import be.scri.helpers.appIconColorStrings +import be.scri.helpers.ensureBackgroundThread import be.scri.models.SharedTheme import be.scri.views.MyAppCompatCheckbox import be.scri.views.MyEditText diff --git a/app/src/main/java/be/scri/extensions/ExifInterface.kt b/app/src/main/java/be/scri/extensions/ExifInterface.kt index 7ce978a1..8bab37fd 100644 --- a/app/src/main/java/be/scri/extensions/ExifInterface.kt +++ b/app/src/main/java/be/scri/extensions/ExifInterface.kt @@ -5,7 +5,7 @@ import android.content.Context import android.os.Build import androidx.exifinterface.media.ExifInterface import java.text.SimpleDateFormat -import java.util.* +import java.util.Locale fun ExifInterface.copyTo( destination: ExifInterface, diff --git a/app/src/main/java/be/scri/extensions/File.kt b/app/src/main/java/be/scri/extensions/File.kt index 34186419..010af159 100644 --- a/app/src/main/java/be/scri/extensions/File.kt +++ b/app/src/main/java/be/scri/extensions/File.kt @@ -1,7 +1,12 @@ package be.scri.extensions import android.content.Context -import be.scri.helpers.* +import be.scri.helpers.MD5 +import be.scri.helpers.NOMEDIA +import be.scri.helpers.audioExtensions +import be.scri.helpers.photoExtensions +import be.scri.helpers.rawExtensions +import be.scri.helpers.videoExtensions import be.scri.models.FileDirItem import java.io.File diff --git a/app/src/main/java/be/scri/extensions/Int.kt b/app/src/main/java/be/scri/extensions/Int.kt index 7d45e846..6cca6bcb 100644 --- a/app/src/main/java/be/scri/extensions/Int.kt +++ b/app/src/main/java/be/scri/extensions/Int.kt @@ -9,7 +9,9 @@ import android.text.format.DateUtils import android.text.format.Time import be.scri.helpers.DARK_GREY import java.text.DecimalFormat -import java.util.* +import java.util.Calendar +import java.util.Locale +import java.util.Random fun Int.getContrastColor(): Int { val y = (299 * Color.red(this) + 587 * Color.green(this) + 114 * Color.blue(this)) / 1000 diff --git a/app/src/main/java/be/scri/extensions/Long.kt b/app/src/main/java/be/scri/extensions/Long.kt index fed4045a..12c196f0 100644 --- a/app/src/main/java/be/scri/extensions/Long.kt +++ b/app/src/main/java/be/scri/extensions/Long.kt @@ -3,7 +3,8 @@ package be.scri.extensions import android.content.Context import android.text.format.DateFormat import java.text.DecimalFormat -import java.util.* +import java.util.Calendar +import java.util.Locale fun Long.formatSize(): String { if (this <= 0) { diff --git a/app/src/main/java/be/scri/extensions/String.kt b/app/src/main/java/be/scri/extensions/String.kt index 85a63aa5..e53f41ec 100644 --- a/app/src/main/java/be/scri/extensions/String.kt +++ b/app/src/main/java/be/scri/extensions/String.kt @@ -12,7 +12,13 @@ import android.text.SpannableString import android.text.TextUtils import android.text.style.ForegroundColorSpan import android.widget.TextView -import be.scri.helpers.* +import be.scri.helpers.audioExtensions +import be.scri.helpers.extensionsSupportingEXIF +import be.scri.helpers.getDateFormats +import be.scri.helpers.normalizeRegex +import be.scri.helpers.photoExtensions +import be.scri.helpers.rawExtensions +import be.scri.helpers.videoExtensions import com.bumptech.glide.signature.ObjectKey import org.joda.time.DateTime import org.joda.time.Years @@ -21,7 +27,7 @@ import java.io.File import java.text.DateFormat import java.text.Normalizer import java.text.SimpleDateFormat -import java.util.* +import java.util.Locale import java.util.regex.Pattern fun String.getFilenameFromPath() = substring(lastIndexOf("/") + 1) diff --git a/app/src/main/java/be/scri/fragments/SettingsFragment.kt b/app/src/main/java/be/scri/fragments/SettingsFragment.kt index d3c12597..17448a5d 100644 --- a/app/src/main/java/be/scri/fragments/SettingsFragment.kt +++ b/app/src/main/java/be/scri/fragments/SettingsFragment.kt @@ -8,7 +8,9 @@ import android.os.Bundle import android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS import android.provider.Settings.ACTION_APP_LOCALE_SETTINGS import android.provider.Settings.ACTION_INPUT_METHOD_SETTINGS -import android.view.* +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup import android.view.inputmethod.InputMethodManager import androidx.activity.addCallback import androidx.appcompat.app.AppCompatDelegate diff --git a/app/src/main/java/be/scri/helpers/BaseConfig.kt b/app/src/main/java/be/scri/helpers/BaseConfig.kt index d45b184b..2bec0a87 100644 --- a/app/src/main/java/be/scri/helpers/BaseConfig.kt +++ b/app/src/main/java/be/scri/helpers/BaseConfig.kt @@ -7,7 +7,9 @@ import be.scri.extensions.getInternalStoragePath import be.scri.extensions.getSDCardPath import be.scri.extensions.getSharedPrefs import java.text.SimpleDateFormat -import java.util.* +import java.util.Calendar +import java.util.LinkedList +import java.util.Locale open class BaseConfig( val context: Context, diff --git a/app/src/main/java/be/scri/helpers/Config.kt b/app/src/main/java/be/scri/helpers/Config.kt index e5d1ba83..2f7d9da5 100644 --- a/app/src/main/java/be/scri/helpers/Config.kt +++ b/app/src/main/java/be/scri/helpers/Config.kt @@ -1,7 +1,7 @@ package be.scri.helpers import android.content.Context -import java.util.* +import java.util.Locale class Config( context: Context, diff --git a/app/src/main/java/be/scri/helpers/MyContextWrapper.kt b/app/src/main/java/be/scri/helpers/MyContextWrapper.kt index 71709580..b500983c 100644 --- a/app/src/main/java/be/scri/helpers/MyContextWrapper.kt +++ b/app/src/main/java/be/scri/helpers/MyContextWrapper.kt @@ -5,7 +5,7 @@ import android.content.Context import android.content.ContextWrapper import android.content.res.Configuration import android.os.Build -import java.util.* +import java.util.Locale // language forcing used at "Use english language", taken from https://stackoverflow.com/a/40704077/1967672 class MyContextWrapper( diff --git a/app/src/main/java/be/scri/helpers/MyKeyboard.kt b/app/src/main/java/be/scri/helpers/MyKeyboard.kt index 71f0829e..9445d718 100644 --- a/app/src/main/java/be/scri/helpers/MyKeyboard.kt +++ b/app/src/main/java/be/scri/helpers/MyKeyboard.kt @@ -12,7 +12,6 @@ import android.view.inputmethod.EditorInfo import android.view.inputmethod.EditorInfo.IME_ACTION_NONE import androidx.annotation.XmlRes import be.scri.R -import java.util.* /** * Loads an XML description of a keyboard and stores the attributes of the keys. A keyboard consists of rows of keys. diff --git a/app/src/main/java/be/scri/models/FileDirItem.kt b/app/src/main/java/be/scri/models/FileDirItem.kt index 9f40846f..d20720fa 100644 --- a/app/src/main/java/be/scri/models/FileDirItem.kt +++ b/app/src/main/java/be/scri/models/FileDirItem.kt @@ -2,8 +2,40 @@ package be.scri.models import android.content.Context import android.net.Uri -import be.scri.extensions.* -import be.scri.helpers.* +import be.scri.extensions.formatDate +import be.scri.extensions.formatSize +import be.scri.extensions.getAlbum +import be.scri.extensions.getAndroidSAFDirectChildrenCount +import be.scri.extensions.getAndroidSAFFileCount +import be.scri.extensions.getAndroidSAFFileSize +import be.scri.extensions.getAndroidSAFLastModified +import be.scri.extensions.getArtist +import be.scri.extensions.getDirectChildrenCount +import be.scri.extensions.getDocumentFile +import be.scri.extensions.getDuration +import be.scri.extensions.getFastDocumentFile +import be.scri.extensions.getFileCount +import be.scri.extensions.getFormattedDuration +import be.scri.extensions.getImageResolution +import be.scri.extensions.getItemSize +import be.scri.extensions.getMediaStoreLastModified +import be.scri.extensions.getParentPath +import be.scri.extensions.getProperSize +import be.scri.extensions.getResolution +import be.scri.extensions.getSizeFromContentUri +import be.scri.extensions.getTitle +import be.scri.extensions.getVideoResolution +import be.scri.extensions.isPathOnOTG +import be.scri.extensions.isRestrictedSAFOnlyRoot +import be.scri.extensions.normalizeString +import be.scri.helpers.AlphanumericComparator +import be.scri.helpers.SORT_BY_DATE_MODIFIED +import be.scri.helpers.SORT_BY_EXTENSION +import be.scri.helpers.SORT_BY_NAME +import be.scri.helpers.SORT_BY_SIZE +import be.scri.helpers.SORT_DESCENDING +import be.scri.helpers.SORT_USE_NUMERIC_VALUE +import be.scri.helpers.isNougatPlus import com.bumptech.glide.signature.ObjectKey import java.io.File diff --git a/app/src/main/java/be/scri/services/SimpleKeyboardIME.kt b/app/src/main/java/be/scri/services/SimpleKeyboardIME.kt index 2faaaf63..c3ceecbb 100644 --- a/app/src/main/java/be/scri/services/SimpleKeyboardIME.kt +++ b/app/src/main/java/be/scri/services/SimpleKeyboardIME.kt @@ -16,7 +16,10 @@ import android.view.inputmethod.EditorInfo.IME_MASK_ACTION import android.view.inputmethod.ExtractedTextRequest import be.scri.R import be.scri.databinding.KeyboardViewKeyboardBinding -import be.scri.helpers.* +import be.scri.helpers.MyKeyboard +import be.scri.helpers.SHIFT_OFF +import be.scri.helpers.SHIFT_ON_ONE_CHAR +import be.scri.helpers.SHIFT_ON_PERMANENT import be.scri.views.MyKeyboardView // based on https://www.androidauthority.com/lets-build-custom-keyboard-android-832362/ diff --git a/app/src/main/java/be/scri/views/MyKeyboardView.kt b/app/src/main/java/be/scri/views/MyKeyboardView.kt index 5e99f6a6..a9d318b3 100644 --- a/app/src/main/java/be/scri/views/MyKeyboardView.kt +++ b/app/src/main/java/be/scri/views/MyKeyboardView.kt @@ -3,8 +3,15 @@ package be.scri.views import android.annotation.SuppressLint import android.content.Context import android.content.res.Configuration -import android.graphics.* +import android.graphics.Bitmap +import android.graphics.Canvas +import android.graphics.Color +import android.graphics.Paint import android.graphics.Paint.Align +import android.graphics.PorterDuff +import android.graphics.Rect +import android.graphics.RectF +import android.graphics.Typeface import android.graphics.drawable.ColorDrawable import android.graphics.drawable.Drawable import android.graphics.drawable.LayerDrawable @@ -12,7 +19,11 @@ import android.os.Handler import android.os.Message import android.util.AttributeSet import android.util.TypedValue -import android.view.* +import android.view.Gravity +import android.view.LayoutInflater +import android.view.MotionEvent +import android.view.View +import android.view.ViewConfiguration import android.view.accessibility.AccessibilityEvent import android.view.accessibility.AccessibilityManager import android.widget.PopupWindow @@ -20,15 +31,29 @@ import android.widget.TextView import be.scri.R import be.scri.databinding.KeyboardPopupKeyboardBinding import be.scri.databinding.KeyboardViewKeyboardBinding -import be.scri.extensions.* -import be.scri.helpers.* +import be.scri.extensions.adjustAlpha +import be.scri.extensions.applyColorFilter +import be.scri.extensions.beGoneIf +import be.scri.extensions.config +import be.scri.extensions.darkenColor +import be.scri.extensions.getContrastColor +import be.scri.extensions.getProperBackgroundColor +import be.scri.extensions.getProperKeyColor +import be.scri.extensions.getProperPrimaryColor +import be.scri.extensions.getProperTextColor +import be.scri.extensions.getStrokeColor +import be.scri.extensions.performHapticFeedback +import be.scri.helpers.MAX_KEYS_PER_MINI_ROW +import be.scri.helpers.MyKeyboard import be.scri.helpers.MyKeyboard.Companion.KEYCODE_DELETE import be.scri.helpers.MyKeyboard.Companion.KEYCODE_ENTER import be.scri.helpers.MyKeyboard.Companion.KEYCODE_MODE_CHANGE import be.scri.helpers.MyKeyboard.Companion.KEYCODE_SHIFT import be.scri.helpers.MyKeyboard.Companion.KEYCODE_SPACE -import be.scri.services.SimpleKeyboardIME.* -import java.util.* +import be.scri.helpers.SHIFT_OFF +import be.scri.helpers.SHIFT_ON_ONE_CHAR +import be.scri.helpers.SHIFT_ON_PERMANENT +import java.util.Arrays @SuppressLint("UseCompatLoadingForDrawables") class MyKeyboardView diff --git a/app/src/main/java/be/scri/views/bottomactionmenu/BottomActionMenuItemPopup.kt b/app/src/main/java/be/scri/views/bottomactionmenu/BottomActionMenuItemPopup.kt index 394ccc0b..e83eeee3 100644 --- a/app/src/main/java/be/scri/views/bottomactionmenu/BottomActionMenuItemPopup.kt +++ b/app/src/main/java/be/scri/views/bottomactionmenu/BottomActionMenuItemPopup.kt @@ -3,8 +3,12 @@ package be.scri.views.bottomactionmenu import android.content.Context import android.graphics.Color import android.graphics.Rect -import android.view.* +import android.view.Gravity +import android.view.LayoutInflater +import android.view.View import android.view.View.MeasureSpec +import android.view.ViewGroup +import android.view.WindowManager import android.widget.ArrayAdapter import android.widget.FrameLayout import android.widget.ListView From c540c6b85fb017d24710771cb970f3db79b7b2ba Mon Sep 17 00:00:00 2001 From: Linfye <3158203624@qq.com> Date: Tue, 10 Sep 2024 14:34:30 +0800 Subject: [PATCH 2/2] Delete ktlint config file line --- .editorconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index dde8f79e..1c204a5d 100644 --- a/.editorconfig +++ b/.editorconfig @@ -20,7 +20,6 @@ continuation_indent_size = 4 wildcard_import_limit = 999 ij_kotlin_name_count_to_use_star_import = 999 ij_kotlin_name_count_to_use_star_import_for_members = 999 -#ktlint_standard_no-wildcard-imports = disabled ktlint_standard_backing-property-naming = disabled ktlint_standard_filename = disabled