Skip to content

Commit f89d438

Browse files
committed
style: set max line length to 100 in ktlint and reformat
1 parent 2616a43 commit f89d438

File tree

194 files changed

+2407
-1377
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

194 files changed

+2407
-1377
lines changed

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ ktlint_function_naming_ignore_when_annotated_with = Composable
44
ktlint_ignore_back_ticked_identifier = true
55
ktlint_code_style = intellij_idea # Use IntelliJ style because it has trailing commas
66
ij_kotlin_indent_before_arrow_on_new_line = true
7+
max_line_length = 100
78

89
[base/src/main/java/io/github/sds100/keymapper/base/utils/ui/compose/icons/*.{kt,kts}]
910
ktlint_standard_property-naming = disabled

api/src/main/java/io/github/sds100/keymapper/api/KeyEventRelayService.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@ class KeyEventRelayService : Service() {
117117
val sourcePackageName = getCallerPackageName() ?: return
118118

119119
if (client == null || !permittedPackages.contains(sourcePackageName)) {
120-
Timber.d("An unrecognized package $sourcePackageName tried to register a key event relay callback.")
120+
Timber.d(
121+
"An unrecognized package $sourcePackageName tried to register a key event relay callback.",
122+
)
121123
return
122124
}
123125

app/src/main/java/io/github/sds100/keymapper/MainFragment.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,11 @@ class MainFragment : Fragment() {
105105
modifier = Modifier
106106
.windowInsetsPadding(
107107
WindowInsets.systemBars.only(sides = WindowInsetsSides.Horizontal)
108-
.add(WindowInsets.displayCutout.only(sides = WindowInsetsSides.Horizontal)),
108+
.add(
109+
WindowInsets.displayCutout.only(
110+
sides = WindowInsetsSides.Horizontal,
111+
),
112+
),
109113
),
110114
navController = navController,
111115
setupAccessibilityServiceDelegate = setupAccessibilityServiceDelegate,

app/src/main/java/io/github/sds100/keymapper/trigger/AdvancedTriggersScreenFoss.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,7 @@ import io.github.sds100.keymapper.base.utils.ui.compose.openUriSafe
3838

3939
@OptIn(ExperimentalMaterial3Api::class)
4040
@Composable
41-
fun AdvancedTriggersScreenFoss(
42-
modifier: Modifier = Modifier,
43-
onBack: () -> Unit,
44-
) {
41+
fun AdvancedTriggersScreenFoss(modifier: Modifier = Modifier, onBack: () -> Unit) {
4542
Scaffold(
4643
modifier = modifier,
4744
topBar = {
@@ -56,7 +53,9 @@ fun AdvancedTriggersScreenFoss(
5653
IconButton(onClick = onBack) {
5754
Icon(
5855
Icons.AutoMirrored.Filled.ArrowBack,
59-
contentDescription = stringResource(R.string.bottom_app_bar_back_content_description),
56+
contentDescription = stringResource(
57+
R.string.bottom_app_bar_back_content_description,
58+
),
6059
)
6160
}
6261
},

app/src/main/java/io/github/sds100/keymapper/trigger/TriggerScreen.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ import io.github.sds100.keymapper.base.trigger.TriggerDiscoverScreen
1111
@OptIn(ExperimentalMaterial3Api::class)
1212
@Composable
1313
fun TriggerScreen(modifier: Modifier = Modifier, viewModel: ConfigTriggerViewModel) {
14-
val showFingerprintGestures: Boolean by viewModel.showFingerprintGesturesShortcut.collectAsStateWithLifecycle()
14+
val showFingerprintGestures: Boolean by
15+
viewModel.showFingerprintGesturesShortcut.collectAsStateWithLifecycle()
1516

1617
BaseTriggerScreen(modifier, viewModel, discoverScreenContent = {
1718
TriggerDiscoverScreen(

base/src/main/java/io/github/sds100/keymapper/base/BaseKeyMapperApp.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,9 @@ abstract class BaseKeyMapperApp : MultiDexApplication() {
202202
// when the user returns to the app let everything know that the permissions could have changed
203203
notificationController.onOpenApp()
204204

205-
if (BuildConfig.DEBUG && permissionAdapter.isGranted(Permission.WRITE_SECURE_SETTINGS)) {
205+
if (BuildConfig.DEBUG &&
206+
permissionAdapter.isGranted(Permission.WRITE_SECURE_SETTINGS)
207+
) {
206208
accessibilityServiceAdapter.start()
207209
}
208210
}

base/src/main/java/io/github/sds100/keymapper/base/BaseMainActivity.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,9 @@ abstract class BaseMainActivity : AppCompatActivity() {
191191
override fun onResume() {
192192
super.onResume()
193193

194-
Timber.i("MainActivity: onResume. Version: ${buildConfigProvider.version} ${buildConfigProvider.versionCode}")
194+
Timber.i(
195+
"MainActivity: onResume. Version: ${buildConfigProvider.version} ${buildConfigProvider.versionCode}",
196+
)
195197

196198
// This must be after onResume to ensure all the fragment lifecycles' have also
197199
// resumed which are observing these events.

base/src/main/java/io/github/sds100/keymapper/base/BaseMainNavHost.kt

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,18 @@ fun BaseMainNavHost(
5050
modifier = modifier,
5151
navController = navController,
5252
startDestination = NavDestination.Home,
53-
enterTransition = { slideIntoContainer(towards = AnimatedContentTransitionScope.SlideDirection.Left) },
54-
exitTransition = { slideOutOfContainer(towards = AnimatedContentTransitionScope.SlideDirection.Right) },
55-
popEnterTransition = { slideIntoContainer(towards = AnimatedContentTransitionScope.SlideDirection.Right) },
56-
popExitTransition = { slideOutOfContainer(towards = AnimatedContentTransitionScope.SlideDirection.Right) },
53+
enterTransition = {
54+
slideIntoContainer(towards = AnimatedContentTransitionScope.SlideDirection.Left)
55+
},
56+
exitTransition = {
57+
slideOutOfContainer(towards = AnimatedContentTransitionScope.SlideDirection.Right)
58+
},
59+
popEnterTransition = {
60+
slideIntoContainer(towards = AnimatedContentTransitionScope.SlideDirection.Right)
61+
},
62+
popExitTransition = {
63+
slideOutOfContainer(towards = AnimatedContentTransitionScope.SlideDirection.Right)
64+
},
5765
) {
5866
composable<NavDestination.InteractUiElement> { backStackEntry ->
5967
val viewModel: InteractUiElementViewModel = hiltViewModel()
@@ -132,7 +140,11 @@ fun BaseMainNavHost(
132140
.fillMaxSize()
133141
.windowInsetsPadding(
134142
WindowInsets.systemBars.only(sides = WindowInsetsSides.Horizontal)
135-
.add(WindowInsets.displayCutout.only(sides = WindowInsetsSides.Horizontal)),
143+
.add(
144+
WindowInsets.displayCutout.only(
145+
sides = WindowInsetsSides.Horizontal,
146+
),
147+
),
136148
),
137149
viewModel = hiltViewModel(),
138150
)

base/src/main/java/io/github/sds100/keymapper/base/BaseSingletonHiltModule.kt

Lines changed: 39 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ abstract class BaseSingletonHiltModule {
7171

7272
@Singleton
7373
@Binds
74-
abstract fun provideAccessibilityAdapter(impl: AccessibilityServiceAdapterImpl): AccessibilityServiceAdapter
74+
abstract fun provideAccessibilityAdapter(
75+
impl: AccessibilityServiceAdapterImpl,
76+
): AccessibilityServiceAdapter
7577

7678
@Singleton
7779
@Binds
@@ -87,23 +89,33 @@ abstract class BaseSingletonHiltModule {
8789

8890
@Binds
8991
@Singleton
90-
abstract fun bindShowInputMethodPickerUseCase(impl: ShowInputMethodPickerUseCaseImpl): ShowInputMethodPickerUseCase
92+
abstract fun bindShowInputMethodPickerUseCase(
93+
impl: ShowInputMethodPickerUseCaseImpl,
94+
): ShowInputMethodPickerUseCase
9195

9296
@Binds
9397
@Singleton
94-
abstract fun bindControlAccessibilityServiceUseCase(impl: ControlAccessibilityServiceUseCaseImpl): ControlAccessibilityServiceUseCase
98+
abstract fun bindControlAccessibilityServiceUseCase(
99+
impl: ControlAccessibilityServiceUseCaseImpl,
100+
): ControlAccessibilityServiceUseCase
95101

96102
@Binds
97103
@Singleton
98-
abstract fun bindToggleCompatibleImeUseCase(impl: ToggleCompatibleImeUseCaseImpl): ToggleCompatibleImeUseCase
104+
abstract fun bindToggleCompatibleImeUseCase(
105+
impl: ToggleCompatibleImeUseCaseImpl,
106+
): ToggleCompatibleImeUseCase
99107

100108
@Binds
101109
@Singleton
102-
abstract fun bindInteractUiElementUseCase(impl: InteractUiElementController): InteractUiElementUseCase
110+
abstract fun bindInteractUiElementUseCase(
111+
impl: InteractUiElementController,
112+
): InteractUiElementUseCase
103113

104114
@Binds
105115
@Singleton
106-
abstract fun bindShowHideInputMethodUseCase(impl: ShowHideInputMethodUseCaseImpl): ShowHideInputMethodUseCase
116+
abstract fun bindShowHideInputMethodUseCase(
117+
impl: ShowHideInputMethodUseCaseImpl,
118+
): ShowHideInputMethodUseCase
107119

108120
@Binds
109121
@Singleton
@@ -115,23 +127,31 @@ abstract class BaseSingletonHiltModule {
115127

116128
@Binds
117129
@Singleton
118-
abstract fun bindRecordTriggerUseCase(impl: RecordTriggerControllerImpl): RecordTriggerController
130+
abstract fun bindRecordTriggerUseCase(
131+
impl: RecordTriggerControllerImpl,
132+
): RecordTriggerController
119133

120134
@Binds
121135
@Singleton
122-
abstract fun bindFingerprintGesturesSupportedUseCase(impl: FingerprintGesturesSupportedUseCaseImpl): FingerprintGesturesSupportedUseCase
136+
abstract fun bindFingerprintGesturesSupportedUseCase(
137+
impl: FingerprintGesturesSupportedUseCaseImpl,
138+
): FingerprintGesturesSupportedUseCase
123139

124140
@Binds
125141
@Singleton
126142
abstract fun bindGetActionErrorUseCase(impl: GetActionErrorUseCaseImpl): GetActionErrorUseCase
127143

128144
@Binds
129145
@Singleton
130-
abstract fun bindGetConstraintErrorUseCase(impl: GetConstraintErrorUseCaseImpl): GetConstraintErrorUseCase
146+
abstract fun bindGetConstraintErrorUseCase(
147+
impl: GetConstraintErrorUseCaseImpl,
148+
): GetConstraintErrorUseCase
131149

132150
@Binds
133151
@Singleton
134-
abstract fun bindManageNotificationsUseCase(impl: ManageNotificationsUseCaseImpl): ManageNotificationsUseCase
152+
abstract fun bindManageNotificationsUseCase(
153+
impl: ManageNotificationsUseCaseImpl,
154+
): ManageNotificationsUseCase
135155

136156
@Binds
137157
@Singleton
@@ -151,7 +171,9 @@ abstract class BaseSingletonHiltModule {
151171

152172
@Binds
153173
@Singleton
154-
abstract fun keyEventRelayServiceWrapper(impl: KeyEventRelayServiceWrapperImpl): KeyEventRelayServiceWrapper
174+
abstract fun keyEventRelayServiceWrapper(
175+
impl: KeyEventRelayServiceWrapperImpl,
176+
): KeyEventRelayServiceWrapper
155177

156178
@Binds
157179
@Singleton
@@ -163,7 +185,9 @@ abstract class BaseSingletonHiltModule {
163185

164186
@Binds
165187
@Singleton
166-
abstract fun bindGetDefaultKeyMapOptionsUseCas(impl: GetDefaultKeyMapOptionsUseCaseImpl): GetDefaultKeyMapOptionsUseCase
188+
abstract fun bindGetDefaultKeyMapOptionsUseCas(
189+
impl: GetDefaultKeyMapOptionsUseCaseImpl,
190+
): GetDefaultKeyMapOptionsUseCase
167191

168192
@Binds
169193
@Singleton
@@ -175,5 +199,7 @@ abstract class BaseSingletonHiltModule {
175199

176200
@Binds
177201
@Singleton
178-
abstract fun bindSetupAccessibilityServiceDelegate(impl: SetupAccessibilityServiceDelegateImpl): SetupAccessibilityServiceDelegate
202+
abstract fun bindSetupAccessibilityServiceDelegate(
203+
impl: SetupAccessibilityServiceDelegateImpl,
204+
): SetupAccessibilityServiceDelegate
179205
}

base/src/main/java/io/github/sds100/keymapper/base/BaseViewModelHiltModule.kt

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,25 @@ abstract class BaseViewModelHiltModule {
7171

7272
@Binds
7373
@ViewModelScoped
74-
abstract fun bindDisplayConstraintUseCase(impl: DisplayKeyMapUseCaseImpl): DisplayConstraintUseCase
74+
abstract fun bindDisplayConstraintUseCase(
75+
impl: DisplayKeyMapUseCaseImpl,
76+
): DisplayConstraintUseCase
7577

7678
@Binds
7779
@ViewModelScoped
7880
abstract fun bindListKeyMapsUseCase(impl: ListKeyMapsUseCaseImpl): ListKeyMapsUseCase
7981

8082
@Binds
8183
@ViewModelScoped
82-
abstract fun bindBackupRestoreMappingsUseCase(impl: BackupRestoreMappingsUseCaseImpl): BackupRestoreMappingsUseCase
84+
abstract fun bindBackupRestoreMappingsUseCase(
85+
impl: BackupRestoreMappingsUseCaseImpl,
86+
): BackupRestoreMappingsUseCase
8387

8488
@Binds
8589
@ViewModelScoped
86-
abstract fun bindShowHomeScreenAlertsUseCase(impl: ShowHomeScreenAlertsUseCaseImpl): ShowHomeScreenAlertsUseCase
90+
abstract fun bindShowHomeScreenAlertsUseCase(
91+
impl: ShowHomeScreenAlertsUseCaseImpl,
92+
): ShowHomeScreenAlertsUseCase
8793

8894
@Binds
8995
@ViewModelScoped
@@ -99,19 +105,25 @@ abstract class BaseViewModelHiltModule {
99105

100106
@Binds
101107
@ViewModelScoped
102-
abstract fun bindChooseBluetoothDeviceUseCase(impl: ChooseBluetoothDeviceUseCaseImpl): ChooseBluetoothDeviceUseCase
108+
abstract fun bindChooseBluetoothDeviceUseCase(
109+
impl: ChooseBluetoothDeviceUseCaseImpl,
110+
): ChooseBluetoothDeviceUseCase
103111

104112
@Binds
105113
@ViewModelScoped
106-
abstract fun bindChooseSoundFileUseCase(impl: ChooseSoundFileUseCaseImpl): ChooseSoundFileUseCase
114+
abstract fun bindChooseSoundFileUseCase(
115+
impl: ChooseSoundFileUseCaseImpl,
116+
): ChooseSoundFileUseCase
107117

108118
@Binds
109119
@ViewModelScoped
110120
abstract fun bindConfigKeyEventUseCase(impl: ConfigKeyEventUseCaseImpl): ConfigKeyEventUseCase
111121

112122
@Binds
113123
@ViewModelScoped
114-
abstract fun bindDisplayAppShortcutsUseCase(impl: DisplayAppShortcutsUseCaseImpl): DisplayAppShortcutsUseCase
124+
abstract fun bindDisplayAppShortcutsUseCase(
125+
impl: DisplayAppShortcutsUseCaseImpl,
126+
): DisplayAppShortcutsUseCase
115127

116128
@Binds
117129
@ViewModelScoped
@@ -123,23 +135,31 @@ abstract class BaseViewModelHiltModule {
123135

124136
@Binds
125137
@ViewModelScoped
126-
abstract fun bindCreateKeyMapShortcutUseCase(impl: CreateKeyMapShortcutUseCaseImpl): CreateKeyMapShortcutUseCase
138+
abstract fun bindCreateKeyMapShortcutUseCase(
139+
impl: CreateKeyMapShortcutUseCaseImpl,
140+
): CreateKeyMapShortcutUseCase
127141

128142
@Binds
129143
@ViewModelScoped
130144
abstract fun bindCreateActionUseCase(impl: CreateActionUseCaseImpl): CreateActionUseCase
131145

132146
@Binds
133147
@ViewModelScoped
134-
abstract fun bindCreateConstraintUseCase(impl: CreateConstraintUseCaseImpl): CreateConstraintUseCase
148+
abstract fun bindCreateConstraintUseCase(
149+
impl: CreateConstraintUseCaseImpl,
150+
): CreateConstraintUseCase
135151

136152
@Binds
137153
@ViewModelScoped
138-
abstract fun bindProModeSetupUseCase(impl: SystemBridgeSetupUseCaseImpl): SystemBridgeSetupUseCase
154+
abstract fun bindProModeSetupUseCase(
155+
impl: SystemBridgeSetupUseCaseImpl,
156+
): SystemBridgeSetupUseCase
139157

140158
@Binds
141159
@ViewModelScoped
142-
abstract fun bindConfigConstraintsUseCase(impl: ConfigConstraintsUseCaseImpl): ConfigConstraintsUseCase
160+
abstract fun bindConfigConstraintsUseCase(
161+
impl: ConfigConstraintsUseCaseImpl,
162+
): ConfigConstraintsUseCase
143163

144164
@Binds
145165
@ViewModelScoped
@@ -155,7 +175,9 @@ abstract class BaseViewModelHiltModule {
155175

156176
@Binds
157177
@ViewModelScoped
158-
abstract fun bindSetupInputMethodUseCase(impl: SetupInputMethodUseCaseImpl): SetupInputMethodUseCase
178+
abstract fun bindSetupInputMethodUseCase(
179+
impl: SetupInputMethodUseCaseImpl,
180+
): SetupInputMethodUseCase
159181

160182
@Binds
161183
@ViewModelScoped
@@ -167,5 +189,7 @@ abstract class BaseViewModelHiltModule {
167189

168190
@Binds
169191
@ViewModelScoped
170-
abstract fun bindFixKeyEventActionDelegate(impl: FixKeyEventActionDelegateImpl): FixKeyEventActionDelegate
192+
abstract fun bindFixKeyEventActionDelegate(
193+
impl: FixKeyEventActionDelegateImpl,
194+
): FixKeyEventActionDelegate
171195
}

0 commit comments

Comments
 (0)