Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] 新機能の紹介画面を追加・デザインの改善 #369

Merged
merged 1 commit into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions MainApp/General/IconNavigationLink.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// IconNavigationLink.swift
// azooKey
//
// Created by miwa on 2023/11/11.
// Copyright © 2023 DevEn3. All rights reserved.
//

import SwiftUI

struct IconNavigationLink<Destination: View>: View {
init(_ titleKey: LocalizedStringKey, systemImage: String, imageColor: Color? = nil, destination: Destination) {
self.titleKey = titleKey
self.systemImage = systemImage
self.imageColor = imageColor
self.destination = destination
}

var titleKey: LocalizedStringKey
var systemImage: String
var imageColor: Color?
var destination: Destination

var body: some View {
NavigationLink(destination: destination) {
Label(
title: {
Text(titleKey)
},
icon: {
Image(systemName: systemImage)
.foregroundStyle(imageColor ?? .primary)
.font(.caption)
})
}
}
}
26 changes: 0 additions & 26 deletions MainApp/Tips/Articles/DynamicTypeSettingFailureTips.swift

This file was deleted.

63 changes: 63 additions & 0 deletions MainApp/Tips/News/TipsNewsSection.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
//
// TipsNewsSection.swift
// azooKey
//
// Created by miwa on 2023/11/11.
// Copyright © 2023 DevEn3. All rights reserved.
//

import SwiftUI

struct TipsNewsSection: View {
@AppStorage("read_article_iOS15_service_termination") private var readArticle_iOS15_service_termination = false
@EnvironmentObject private var appStates: MainAppStates

@MainActor
private var needUseShiftKeySettingNews: Bool {
appStates.englishLayout == .qwerty
}

@MainActor
private var neadUseNextCandidateKeySettingNews: Bool {
if case .custard = appStates.japaneseLayout, case .custard = appStates.englishLayout {
false
} else {
true
}
}

var iOS15TerminationNewsViewLabel: some View {
Label(
title: {
Text("iOS15のサポートを終了します")
},
icon: {
Image(systemName: "exclamationmark.circle.fill")
.foregroundStyle(.red)
.font(.caption)
}
)
}
var body: some View {
if #unavailable(iOS 16) {
Section("お知らせ") {
NavigationLink(destination: iOS15TerminationNewsView($readArticle_iOS15_service_termination)) {
if !readArticle_iOS15_service_termination {
iOS15TerminationNewsViewLabel
} else {
iOS15TerminationNewsViewLabel.labelStyle(.titleOnly)
}
}
}
}
Section("新機能") {
if needUseShiftKeySettingNews {
IconNavigationLink("シフトキーが使えるようになりました!", systemImage: "shift", imageColor: .orange, destination: UseShiftKeyNews())
}
if neadUseNextCandidateKeySettingNews {
IconNavigationLink("次候補キーが使えるようになりました!", systemImage: "sparkles", imageColor: .orange, destination: UseNextCandidateKeyNews())
}
IconNavigationLink("連絡先情報を読み込めるようになりました!", systemImage: "person.text.rectangle", imageColor: .orange, destination: UseContactInfoSettingNews())
}
}
}
32 changes: 32 additions & 0 deletions MainApp/Tips/News/UseContactInfoSettingNews.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// UseContactInfoSettingNews.swift
// azooKey
//
// Created by miwa on 2023/11/11.
// Copyright © 2023 DevEn3. All rights reserved.
//

import SwiftUI
import class KeyboardViews.SemiStaticStates

struct UseContactInfoSettingNews: View {
@EnvironmentObject private var appStates: MainAppStates

var body: some View {
TipsContentView("変換に連絡先データを利用") {
TipsContentParagraph {
Text("「連絡先」アプリのデータを使って、家族や友人、職場の人の名前を素早く入力することができます。")
}
BoolSettingView(.enableContactImport)

TipsContentParagraph {
if !SemiStaticStates.shared.hasFullAccess {
Text("この機能を利用するには、「フルアクセス」の許可が必要です。詳しくはこちらをお読みください")
NavigationLink("フルアクセスが必要な機能を使う", destination: FullAccessTipsView())
}
Text("この機能を利用するには、連絡先データの利用の許可が必要です。機能を有効化しようとすると、許可を求める画面が表示されるので、「許可」を選んでください")
}

}
}
}
20 changes: 20 additions & 0 deletions MainApp/Tips/News/UseNextCandidateKeyNews.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// UseNextCandidateKeyNews.swift
// azooKey
//
// Created by miwa on 2023/11/11.
// Copyright © 2023 DevEn3. All rights reserved.
//

import SwiftUI

struct UseNextCandidateKeyNews: View {
var body: some View {
TipsContentView("シフトキーを使う") {
TipsContentParagraph {
Text("空白キーに「次候補」ボタンを表示するには、次の設定をオンにしてください")
}
BoolSettingView(.useNextCandidateKey)
}
}
}
20 changes: 20 additions & 0 deletions MainApp/Tips/News/UseShiftKeyNews.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// UseShiftKeyNews.swift
// azooKey
//
// Created by miwa on 2023/11/10.
// Copyright © 2023 DevEn3. All rights reserved.
//

import SwiftUI

struct UseShiftKeyNews: View {
var body: some View {
TipsContentView("シフトキーを使う") {
TipsContentParagraph {
Text("Qwerty英語キーボードでシフトキーを使いたい場合、次の設定をオンにしてください")
}
BoolSettingView(.useShiftKey)
}
}
}
41 changes: 14 additions & 27 deletions MainApp/Tips/TipsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ import SwiftUI

struct TipsTabView: View {
@EnvironmentObject private var appStates: MainAppStates
@AppStorage("read_article_iOS15_service_termination") private var readArticle_iOS15_service_termination = false

var body: some View {
NavigationView {
Form {
Section(header: Text("キーボードを使えるようにする")) {
Section("キーボードを使えるようにする") {
if !appStates.isKeyboardActivated {
Text("キーボードを有効化する")
.onTapGesture {
Expand All @@ -25,36 +23,25 @@ struct TipsTabView: View {
}
NavigationLink("入力方法を選ぶ", destination: SelctInputStyleTipsView())
}
if #unavailable(iOS 16) {
Section(header: Text("お知らせ")) {
HStack {
if !readArticle_iOS15_service_termination {
Image(systemName: "exclamationmark.circle.fill")
.foregroundStyle(.red)
}
NavigationLink("iOS15のサポートを終了します", destination: iOS15TerminationNewsView($readArticle_iOS15_service_termination))
}
}
}

Section(header: Text("便利な使い方")) {
NavigationLink("片手モードを使う", destination: OneHandedModeTipsView())
NavigationLink("カーソルを自由に移動する", destination: CursorMoveTipsView())
NavigationLink("文頭まで一気に消す", destination: SmoothDeleteTipsView())
NavigationLink("漢字を拡大表示する", destination: KanjiLargeTextTipsView())
NavigationLink("大文字に固定する", destination: CapsLockTipsView())
NavigationLink("タイムスタンプを使う", destination: TemplateSettingTipsView())
NavigationLink("キーをカスタマイズする", destination: CustomKeyTipsView())
NavigationLink("フルアクセスが必要な機能を使う", destination: FullAccessTipsView())
TipsNewsSection()
Section("便利な使い方") {
let imageColor = Color.blue
IconNavigationLink("片手モードを使う", systemImage: "aspectratio", imageColor: imageColor, destination: OneHandedModeTipsView())
IconNavigationLink("カーソルを自由に移動する", systemImage: "arrowtriangle.left.and.line.vertical.and.arrowtriangle.right", imageColor: imageColor, destination: CursorMoveTipsView())
IconNavigationLink("文頭まで一気に消す", systemImage: "xmark", imageColor: imageColor, destination: SmoothDeleteTipsView())
IconNavigationLink("漢字を拡大表示する", systemImage: "plus.magnifyingglass", imageColor: imageColor, destination: KanjiLargeTextTipsView())
IconNavigationLink("大文字に固定する", systemImage: "capslock.fill", imageColor: imageColor, destination: CapsLockTipsView())
IconNavigationLink("タイムスタンプを使う", systemImage: "clock", imageColor: imageColor, destination: TemplateSettingTipsView())
IconNavigationLink("キーをカスタマイズする", systemImage: "hammer", imageColor: imageColor, destination: CustomKeyTipsView())
IconNavigationLink("フルアクセスが必要な機能を使う", systemImage: "lock.open", imageColor: imageColor, destination: FullAccessTipsView())
if SemiStaticStates.shared.hasFullAccess {
NavigationLink("「ほかのAppからペースト」について", destination: PasteFromOtherAppsPermissionTipsView())
IconNavigationLink("「ほかのAppからペースト」について", systemImage: "doc.on.clipboard", imageColor: imageColor, destination: PasteFromOtherAppsPermissionTipsView())
}
}

Section(header: Text("困ったときは")) {
Section("困ったときは") {
NavigationLink("インストール直後、特定のアプリでキーボードが開かない", destination: KeyboardBehaviorIssueAfterInstallTipsView())
NavigationLink("特定のアプリケーションで入力がおかしくなる", destination: UseMarkedTextTipsView())
NavigationLink("端末の文字サイズ設定が反映されない", destination: DynamicTypeSettingFailureTipsView())
NavigationLink("絵文字や顔文字の変換候補を表示したい", destination: EmojiKaomojiTipsView())
NavigationLink("バグの報告や機能のリクエストをしたい", destination: ContactView())
}
Expand Down
Loading