Skip to content

Commit

Permalink
Merge pull request #285 from ensan-hcl/refactoring/lint
Browse files Browse the repository at this point in the history
[refactoring] lintを適用
  • Loading branch information
ensan-hcl authored Sep 23, 2023
2 parents 035792e + 39cb168 commit d451185
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public enum AzooKeyKeyboardViewExtension: ApplicationSpecificKeyboardViewExtensi
public static var useBetaMoveCursorBar: Bool {
UseBetaMoveCursorBar.value
}

public static var useShiftKey: Bool {
false
}
Expand Down
2 changes: 1 addition & 1 deletion AzooKeyCore/Sources/KeyboardThemes/ThemeData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public struct ThemeShadowData<ColorData>: Codable, Equatable, Sendable where Col
self.x = x
self.y = y
}

public var color: ColorData
public var radius: CGFloat
public var x: CGFloat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ struct FlickKeyboardView<Extension: ApplicationSpecificKeyboardViewExtension>: V
private let models: [KeyPosition: (model: any FlickKeyModelProtocol, width: Int, height: Int)]
init(keyModels: [[any FlickKeyModelProtocol]], interfaceSize: CGSize, keyboardOrientation: KeyboardOrientation) {
self.tabDesign = TabDependentDesign(width: 5, height: 4, interfaceSize: interfaceSize, layout: .flick, orientation: keyboardOrientation)

var models: [KeyPosition: (model: any FlickKeyModelProtocol, width: Int, height: Int)] = [:]
for h in keyModels.indices {
for v in keyModels[h].indices {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// Created by miwa on 2023/08/20.
//


struct FlickSuggestState: Equatable, Hashable, Sendable {
/// 横:縦:サジェストタイプ
var items: [Int: [Int: FlickSuggestType]] = [:]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import CustardKit
import Foundation
import SwiftUI


struct FlickSuggestView<Extension: ApplicationSpecificKeyboardViewExtension>: View {
@EnvironmentObject private var variableStates: VariableStates
@Environment(Extension.Theme.self) private var theme
Expand All @@ -25,7 +24,7 @@ struct FlickSuggestView<Extension: ApplicationSpecificKeyboardViewExtension>: Vi
self.size = size
self.suggestType = suggestType
}

private func getSuggestView(for model: FlickedKeyModel, isHidden: Bool, isPointed: Bool = false) -> some View {
// 着せ替えが有効の場合、サジェストの背景色はwhiteにする。
var pointedColor: Color {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ struct QwertyKeyDoublePressState {
case secondPressStarted
case secondPressCompleted
}

private var state: State = .inactive
private(set) var updateDate: Date = Date()

var secondPressCompleted: Bool {
self.state == .secondPressCompleted
}
Expand Down Expand Up @@ -89,7 +89,7 @@ struct QwertyKeyDoublePressState {
}
self.updateDate = touchUpDate
}

mutating func reset() {
self.state = .inactive
self.updateDate = Date()
Expand All @@ -104,8 +104,8 @@ struct QwertyKeyView<Extension: ApplicationSpecificKeyboardViewExtension>: View
@State private var doublePressState = QwertyKeyDoublePressState()
@State private var suggest = false

@State private var longPressStartTask: Task<(), any Error>? = nil
@State private var longPressStartTask: Task<(), any Error>?

@Environment(Extension.Theme.self) private var theme
@Environment(\.userActionManager) private var action
private let tabDesign: TabDependentDesign
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct QwertyShiftKeyModel<Extension: ApplicationSpecificKeyboardViewExtension>:
return [.setBoolState(VariableStates.BoolStates.isCapsLockedKey, .on)]
}
}

func label<Extension: ApplicationSpecificKeyboardViewExtension>(width: CGFloat, states: VariableStates, color: Color?) -> KeyLabel<Extension> {
if states.boolStates.isCapsLocked {
return KeyLabel(.image("capslock.fill"), width: width, textColor: color)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ struct QwertyDataProvider<Extension: ApplicationSpecificKeyboardViewExtension> {
QwertyKeyModel<Extension>(labelType: .text("h"), pressActions: [.input("h")]),
QwertyKeyModel<Extension>(labelType: .text("j"), pressActions: [.input("j")]),
QwertyKeyModel<Extension>(labelType: .text("k"), pressActions: [.input("k")]),
QwertyKeyModel<Extension>(labelType: .text("l"), pressActions: [.input("l")]),
QwertyKeyModel<Extension>(labelType: .text("l"), pressActions: [.input("l")])
] : [
QwertyKeyModel<Extension>(labelType: .text("a"), pressActions: [.input("a")]),
QwertyKeyModel<Extension>(labelType: .text("s"), pressActions: [.input("s")]),
Expand All @@ -548,7 +548,7 @@ struct QwertyDataProvider<Extension: ApplicationSpecificKeyboardViewExtension> {
QwertyKeyModel<Extension>(labelType: .text("j"), pressActions: [.input("j")]),
QwertyKeyModel<Extension>(labelType: .text("k"), pressActions: [.input("k")]),
QwertyKeyModel<Extension>(labelType: .text("l"), pressActions: [.input("l")]),
QwertyAaKeyModel<Extension>.shared,
QwertyAaKeyModel<Extension>.shared
],
[
Self.tabKeys(rowInfo: (7, 2, 0, 0)).languageKey,
Expand Down
4 changes: 2 additions & 2 deletions MainApp/Customize/ManageCustardView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ struct ManageCustardView: View {
@ObservedObject private var data = ImportedCustardData()
@State private var urlString: String = ""
@State private var showAlert = false
@State private var alertType: AlertType? = nil
@State private var alertType: AlertType?
@Binding private var manager: CustardManager
@State private var webCustards: WebCustardList = .init(last_update: "", custards: [])
@State private var showDocumentPicker = false
Expand Down Expand Up @@ -372,7 +372,7 @@ struct ManageCustardView: View {
struct URLImportCustardView: View {
@ObservedObject private var data = ImportedCustardData()
@State private var showAlert = false
@State private var alertType: AlertType? = nil
@State private var alertType: AlertType?
@Binding private var manager: CustardManager
@Binding private var url: URL?
@State private var addTabBar = true
Expand Down
2 changes: 1 addition & 1 deletion MainApp/EnableAzooKeyView/EnableAzooKeyView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ struct EnableAzooKeyView: View {
}
}
}

private func checkActiveKeyboardIsAzooKey() -> Bool {
// キーボードが開いた時
// 参考:https://stackoverflow.com/questions/26153336/how-do-i-find-out-the-current-keyboard-used-on-ios8
Expand Down
2 changes: 1 addition & 1 deletion MainApp/Setting/BooleanSetting/BoolSettingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct BoolSettingView<SettingKey: BoolKeyboardSettingKey>: View {
@State private var showExplanation = false
@State private var showRequireFullAccessAlert = false
@State private var showOnEnabledMessageAlert = false
@State private var onEnabledAlertMessage: LocalizedStringKey? = nil
@State private var onEnabledAlertMessage: LocalizedStringKey?
@State private var setting: SettingUpdater<SettingKey>

@MainActor init(_ key: SettingKey) {
Expand Down

0 comments on commit d451185

Please sign in to comment.