Skip to content

Commit

Permalink
style: reformat files
Browse files Browse the repository at this point in the history
  • Loading branch information
sds100 committed Sep 24, 2023
1 parent 3faa7ec commit 34cb107
Show file tree
Hide file tree
Showing 174 changed files with 1,428 additions and 702 deletions.
16 changes: 8 additions & 8 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<uses-permission android:name="com.termux.permission.RUN_COMMAND" />
<uses-permission android:name="com.termux.permission.RUN_COMMAND" />

<!-- This permission is in each build variant's AndroidManifest -->
<!-- <permission android:name="io.github.sds100.keymapper.KEY_EVENT_RECEIVER">-->
Expand Down Expand Up @@ -58,7 +58,7 @@
<uses-feature
android:name="android.hardware.telephony"
android:required="false" />

<uses-feature
android:name="android.hardware.bluetooth"
android:required="false" />
Expand Down Expand Up @@ -102,10 +102,10 @@
<activity
android:name=".api.LaunchKeyMapShortcutActivity"
android:excludeFromRecents="true"
android:exported="true"
android:finishOnTaskLaunch="true"
android:launchMode="singleInstance"
android:taskAffinity=""
android:exported="true"
android:theme="@android:style/Theme.NoDisplay">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand All @@ -115,8 +115,8 @@
<!-- Use a different task affinity so this activity can be opened at the same time as others -->
<activity
android:name=".mappings.keymaps.CreateKeyMapShortcutActivity"
android:label="@string/shortcut_label_action"
android:exported="true"
android:label="@string/shortcut_label_action"
android:taskAffinity="">
<intent-filter>
<action android:name="android.intent.action.CREATE_SHORTCUT" />
Expand Down Expand Up @@ -189,8 +189,8 @@

<service
android:name=".system.inputmethod.KeyMapperImeService"
android:label="@string/ime_service_label"
android:exported="true"
android:label="@string/ime_service_label"
android:permission="android.permission.BIND_INPUT_METHOD">
<intent-filter>
<action android:name="android.view.InputMethod" />
Expand All @@ -202,9 +202,9 @@

<service
android:name=".system.tiles.ToggleMappingsTile"
android:exported="true"
android:icon="@drawable/ic_tile_pause"
android:label="@string/tile_pause"
android:exported="true"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE" />
Expand All @@ -213,9 +213,9 @@

<service
android:name=".system.tiles.ToggleKeyMapperKeyboardTile"
android:exported="true"
android:icon="@drawable/ic_tile_keyboard"
android:label="@string/tile_toggle_keymapper_keyboard"
android:exported="true"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE" />
Expand All @@ -224,8 +224,8 @@

<service
android:name="io.github.sds100.keymapper.system.notifications.NotificationReceiver"
android:label="Key Mapper Notification Receiver"
android:exported="true"
android:label="Key Mapper Notification Receiver"
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
<intent-filter>
<action android:name="android.service.notification.NotificationListenerService" />
Expand Down
62 changes: 31 additions & 31 deletions app/src/main/java/io/github/sds100/keymapper/KeyMapperApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,18 @@ class KeyMapperApp : MultiDexApplication() {

val packageManagerAdapter by lazy {
AndroidPackageManagerAdapter(
this,
this,
appCoroutineScope
)
}

val inputMethodAdapter by lazy {
AndroidInputMethodAdapter(
this,
appCoroutineScope,
accessibilityServiceAdapter,
permissionAdapter,
suAdapter
this,
appCoroutineScope,
accessibilityServiceAdapter,
permissionAdapter,
suAdapter
)
}
val devicesAdapter by lazy {
Expand All @@ -103,10 +103,10 @@ class KeyMapperApp : MultiDexApplication() {
val cameraAdapter by lazy { AndroidCameraAdapter(this) }
val permissionAdapter by lazy {
AndroidPermissionAdapter(
this,
appCoroutineScope,
suAdapter,
notificationReceiverAdapter
this,
appCoroutineScope,
suAdapter,
notificationReceiverAdapter
)
}

Expand Down Expand Up @@ -144,18 +144,18 @@ class KeyMapperApp : MultiDexApplication() {

val autoGrantPermissionController by lazy {
AutoGrantPermissionController(
appCoroutineScope,
permissionAdapter,
popupMessageAdapter,
resourceProvider
appCoroutineScope,
permissionAdapter,
popupMessageAdapter,
resourceProvider
)
}

private val loggingTree by lazy {
KeyMapperLoggingTree(
appCoroutineScope,
ServiceLocator.settingsRepository(this),
ServiceLocator.logRepository(this)
appCoroutineScope,
ServiceLocator.settingsRepository(this),
ServiceLocator.logRepository(this)
)
}

Expand All @@ -167,10 +167,10 @@ class KeyMapperApp : MultiDexApplication() {
Thread.setDefaultUncaughtExceptionHandler { thread, exception ->
//log in a blocking manner and always log regardless of whether the setting is turned on
val entry = LogEntryEntity(
id = 0,
time = Calendar.getInstance().timeInMillis,
severity = LogEntryEntity.SEVERITY_ERROR,
message = exception.stackTraceToString()
id = 0,
time = Calendar.getInstance().timeInMillis,
severity = LogEntryEntity.SEVERITY_ERROR,
message = exception.stackTraceToString()
)

runBlocking {
Expand All @@ -195,8 +195,8 @@ class KeyMapperApp : MultiDexApplication() {
else -> AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
}
}
.onEach { mode -> AppCompatDelegate.setDefaultNightMode(mode) }
.launchIn(appCoroutineScope)
.onEach { mode -> AppCompatDelegate.setDefaultNightMode(mode) }
.launchIn(appCoroutineScope)

if (BuildConfig.BUILD_TYPE == "debug" || BuildConfig.BUILD_TYPE == "debug_release") {
Timber.plant(Timber.DebugTree())
Expand All @@ -222,14 +222,14 @@ class KeyMapperApp : MultiDexApplication() {
)

autoSwitchImeController = AutoSwitchImeController(
appCoroutineScope,
ServiceLocator.settingsRepository(this),
ServiceLocator.inputMethodAdapter(this),
UseCases.pauseMappings(this),
devicesAdapter,
popupMessageAdapter,
resourceProvider,
ServiceLocator.accessibilityServiceAdapter(this)
appCoroutineScope,
ServiceLocator.settingsRepository(this),
ServiceLocator.inputMethodAdapter(this),
UseCases.pauseMappings(this),
devicesAdapter,
popupMessageAdapter,
resourceProvider,
ServiceLocator.accessibilityServiceAdapter(this)
)

processLifecycleOwner.lifecycle.addObserver(object : LifecycleObserver {
Expand Down
18 changes: 9 additions & 9 deletions app/src/main/java/io/github/sds100/keymapper/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class MainActivity : AppCompatActivity() {

companion object {
const val ACTION_SHOW_ACCESSIBILITY_SETTINGS_NOT_FOUND_DIALOG =
"$PACKAGE_NAME.ACTION_SHOW_ACCESSIBILITY_SETTINGS_NOT_FOUND_DIALOG"
"$PACKAGE_NAME.ACTION_SHOW_ACCESSIBILITY_SETTINGS_NOT_FOUND_DIALOG"
}

private val viewModel by viewModels<ActivityViewModel> {
Expand All @@ -51,14 +51,14 @@ class MainActivity : AppCompatActivity() {
requestPermissionDelegate = RequestPermissionDelegate(this, showDialogs = true)

ServiceLocator.permissionAdapter(this@MainActivity).request
.flowWithLifecycle(lifecycle, Lifecycle.State.STARTED)
.onEach { permission ->
requestPermissionDelegate.requestPermission(
permission,
findNavController(R.id.container)
)
}
.launchIn(lifecycleScope)
.flowWithLifecycle(lifecycle, Lifecycle.State.STARTED)
.onEach { permission ->
requestPermissionDelegate.requestPermission(
permission,
findNavController(R.id.container)
)
}
.launchIn(lifecycleScope)

if (intent.action == ACTION_SHOW_ACCESSIBILITY_SETTINGS_NOT_FOUND_DIALOG) {
viewModel.onCantFindAccessibilitySettings()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ import io.github.sds100.keymapper.actions.sound.SoundsManagerImpl
import io.github.sds100.keymapper.backup.BackupManager
import io.github.sds100.keymapper.backup.BackupManagerImpl
import io.github.sds100.keymapper.data.db.AppDatabase
import io.github.sds100.keymapper.data.repositories.*
import io.github.sds100.keymapper.data.repositories.PreferenceRepository
import io.github.sds100.keymapper.data.repositories.RoomFingerprintMapRepository
import io.github.sds100.keymapper.data.repositories.RoomKeyMapRepository
import io.github.sds100.keymapper.data.repositories.RoomLogRepository
import io.github.sds100.keymapper.data.repositories.SettingsPreferenceRepository
import io.github.sds100.keymapper.logging.LogRepository
import io.github.sds100.keymapper.mappings.fingerprintmaps.FingerprintMapRepository
import io.github.sds100.keymapper.shizuku.ShizukuAdapter
Expand Down
6 changes: 5 additions & 1 deletion app/src/main/java/io/github/sds100/keymapper/UseCases.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ import io.github.sds100.keymapper.mappings.DisplaySimpleMappingUseCaseImpl
import io.github.sds100.keymapper.mappings.PauseMappingsUseCaseImpl
import io.github.sds100.keymapper.mappings.fingerprintmaps.AreFingerprintGesturesSupportedUseCaseImpl
import io.github.sds100.keymapper.mappings.fingerprintmaps.DetectFingerprintMapsUseCaseImpl
import io.github.sds100.keymapper.mappings.keymaps.*
import io.github.sds100.keymapper.mappings.keymaps.ConfigKeyMapUseCase
import io.github.sds100.keymapper.mappings.keymaps.ConfigKeyMapUseCaseImpl
import io.github.sds100.keymapper.mappings.keymaps.CreateKeyMapShortcutUseCaseImpl
import io.github.sds100.keymapper.mappings.keymaps.DisplayKeyMapUseCase
import io.github.sds100.keymapper.mappings.keymaps.DisplayKeyMapUseCaseImpl
import io.github.sds100.keymapper.mappings.keymaps.detection.DetectKeyMapsUseCaseImpl
import io.github.sds100.keymapper.onboarding.OnboardingUseCaseImpl
import io.github.sds100.keymapper.reroutekeyevents.RerouteKeyEventsUseCaseImpl
Expand Down
Loading

0 comments on commit 34cb107

Please sign in to comment.