Skip to content

Commit

Permalink
chore: 通知のグループ化のルール設定 (β) 画面を SwiftUI に移行
Browse files Browse the repository at this point in the history
  • Loading branch information
rinsuki committed Sep 28, 2023
1 parent beb3c92 commit 848706e
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 95 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
//
// PushSettingsGroupNotifyTableViewController.swift
// iMast
//
// Created by rinsuki on 2018/09/18.
//
// ------------------------------------------------------------------------
//
// Copyright 2017-2019 rinsuki and other contributors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

import UIKit
import SwiftUI
import iMastiOSCore

struct PushSettingsGroupNotifyTableView: View {
@AppStorage(defaults: .$groupNotifyAccounts) var groupNotifyAccounts
@AppStorage(defaults: .$groupNotifyTypeBoost) var groupBoost
@AppStorage(defaults: .$groupNotifyTypeFavourite) var groupFavourite
@AppStorage(defaults: .$groupNotifyTypeMention) var groupMention
@AppStorage(defaults: .$groupNotifyTypeFollow) var groupFollow
@AppStorage(defaults: .$groupNotifyTypeUnknown) var groupUnknown

var body: some View {
Form {
Section {
Toggle(isOn: $groupNotifyAccounts) {
Text(L10n.Preferences.Push.Shared.GroupRules.byAccount)
}
}
Section {
Toggle(isOn: $groupBoost) { Text("ブースト") }
Toggle(isOn: $groupFavourite) { Text("お気に入り") }
Toggle(isOn: $groupMention) { Text("メンション") }
Toggle(isOn: $groupFollow) { Text("フォロー") }
Toggle(isOn: $groupUnknown) { Text("その他") }
} header: {
Text(L10n.Preferences.Push.Shared.GroupRules.ByType.title)
} footer: {
Text(L10n.Preferences.Push.Shared.GroupRules.ByType.description)
}
}
.navigationTitle(L10n.Preferences.Push.Shared.GroupRules.title)
.navigationBarTitleDisplayMode(.inline)
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class PushSettingsTableViewController: FormViewController {
cell.textLabel?.textAlignment = .left
cell.accessoryType = .disclosureIndicator
}.onCellSelection { (cell, row) in
self.navigationController?.pushViewController(PushSettingsGroupNotifyTableViewController(), animated: true)
self.navigationController?.pushViewController(UIHostingController(rootView: PushSettingsGroupNotifyTableView()), animated: true)
}
ButtonRow { row in
row.title = L10n.Preferences.Push.Shared.CustomSounds.title
Expand Down
8 changes: 4 additions & 4 deletions iMast.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
CE7ABB421FC5C1610087B387 /* ListsTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE7ABB411FC5C1610087B387 /* ListsTableViewController.swift */; };
CE7B1646238A8B23006E899E /* HelpAndFeedbackTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE7B1645238A8B23006E899E /* HelpAndFeedbackTableViewController.swift */; };
CE7DBED021843141008727D4 /* SearchViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE7DBECF21843141008727D4 /* SearchViewController.swift */; };
CE8209982150EC390064FC93 /* PushSettingsGroupNotifyTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE8209972150EC390064FC93 /* PushSettingsGroupNotifyTableViewController.swift */; };
CE8209982150EC390064FC93 /* PushSettingsGroupNotifyTableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE8209972150EC390064FC93 /* PushSettingsGroupNotifyTableView.swift */; };
CE83C85E2A74103900D97E3E /* CodableViewDescriptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE83C85D2A74103900D97E3E /* CodableViewDescriptor.swift */; };
CE83C85F2A74103900D97E3E /* CodableViewDescriptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE83C85D2A74103900D97E3E /* CodableViewDescriptor.swift */; };
CE84AB19209526C500A3C4D2 /* NSFWGuardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE84AB18209526C500A3C4D2 /* NSFWGuardView.swift */; };
Expand Down Expand Up @@ -787,7 +787,7 @@
CE7B1645238A8B23006E899E /* HelpAndFeedbackTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HelpAndFeedbackTableViewController.swift; sourceTree = "<group>"; };
CE7DBECF21843141008727D4 /* SearchViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchViewController.swift; sourceTree = "<group>"; };
CE818B90218570B800948309 /* ThirdpartyTrendTags.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThirdpartyTrendTags.swift; sourceTree = "<group>"; };
CE8209972150EC390064FC93 /* PushSettingsGroupNotifyTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PushSettingsGroupNotifyTableViewController.swift; sourceTree = "<group>"; };
CE8209972150EC390064FC93 /* PushSettingsGroupNotifyTableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PushSettingsGroupNotifyTableView.swift; sourceTree = "<group>"; };
CE83C85D2A74103900D97E3E /* CodableViewDescriptor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CodableViewDescriptor.swift; sourceTree = "<group>"; };
CE84AB18209526C500A3C4D2 /* NSFWGuardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NSFWGuardView.swift; sourceTree = "<group>"; };
CE854B8A25D4C0AB00C30BD7 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Timeline.strings; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1496,7 +1496,7 @@
CE3DB68520FB07FE005CFD77 /* PushService.swift */,
CECD756620FD92C1000D059A /* PushSettingsTableViewController.swift */,
CE9D54A823BBA1D50030BF71 /* PushSettingsChangeSoundView.swift */,
CE8209972150EC390064FC93 /* PushSettingsGroupNotifyTableViewController.swift */,
CE8209972150EC390064FC93 /* PushSettingsGroupNotifyTableView.swift */,
CE2D2AEF210C5CAF003B92B8 /* PushSettingsAccountTableViewController.swift */,
CE11D6E12859190800F6A0AF /* OpenPushSettingsButton.swift */,
);
Expand Down Expand Up @@ -3510,7 +3510,7 @@
5D337B0226C952F600258CD1 /* UserProfileFieldViewController.swift in Sources */,
CE7DBED021843141008727D4 /* SearchViewController.swift in Sources */,
CE5895622240D2A50024FDBF /* AttachedMediaListViewController.swift in Sources */,
CE8209982150EC390064FC93 /* PushSettingsGroupNotifyTableViewController.swift in Sources */,
CE8209982150EC390064FC93 /* PushSettingsGroupNotifyTableView.swift in Sources */,
CEF9C9E72AC139AF009ACFD9 /* OpenSafariButton.swift in Sources */,
CEA528D528527DE70095EB1F /* SettingsView.swift in Sources */,
CEF6DCC122EF2C030008B64D /* MastodonPostDetailBoostedUserViewController.swift in Sources */,
Expand Down

0 comments on commit 848706e

Please sign in to comment.