Skip to content

Commit

Permalink
Merge pull request #53 from TwidereProject/feature/accessibility
Browse files Browse the repository at this point in the history
Add post interaction accessibility supports and new shortcut for accounts switch
  • Loading branch information
MainasuK committed Feb 28, 2022
2 parents f9c3733 + 8911ce5 commit 3010973
Show file tree
Hide file tree
Showing 170 changed files with 3,594 additions and 1,573 deletions.
4 changes: 2 additions & 2 deletions ShareExtension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.2.4</string>
<string>1.2.6</string>
<key>CFBundleVersion</key>
<string>74</string>
<string>77</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
Expand Down
6 changes: 3 additions & 3 deletions TwidereSDK/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ let package = Package(
.package(url: "https://github.com/apple/swift-nio.git", from: "2.34.0"),
.package(url: "https://github.com/Flipboard/FLAnimatedImage.git", from: "1.0.0"),
.package(url: "https://github.com/MainasuK/CommonOSLog", from: "0.1.1"),
.package(url: "https://github.com/TwidereProject/MetaTextKit.git", .exact("3.2.1")),
.package(url: "https://github.com/Alamofire/Alamofire.git", from: "5.4.0"),
.package(url: "https://github.com/TwidereProject/MetaTextKit.git", .exact("3.3.1")),
.package(url: "https://github.com/Alamofire/Alamofire.git", from: "5.5.0"),
.package(url: "https://github.com/Alamofire/AlamofireImage.git", from: "4.1.0"),
.package(url: "https://github.com/onevcat/Kingfisher.git", from: "7.1.1"),
.package(url: "https://github.com/SDWebImage/SDWebImage.git", from: "5.12.1"),
.package(url: "https://github.com/SDWebImage/SDWebImage.git", from: "5.12.0"),
.package(url: "https://github.com/MainasuK/UITextView-Placeholder.git", from: "1.4.1"),
.package(url: "https://github.com/TimOliver/TOCropViewController.git", from: "2.6.0"),
.package(url: "https://github.com/MainasuK/KeyboardLayoutGuide.git", branch: "fix/iOS15"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="19574" systemVersion="21C52" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="19574" systemVersion="21D62" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
<entity name="AuthenticationIndex" representedClassName="CoreDataStack.AuthenticationIndex" syncable="YES">
<attribute name="activeAt" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="createdAt" attributeType="Date" usesScalarValueType="NO"/>
Expand Down Expand Up @@ -85,7 +85,7 @@
<attribute name="domain" attributeType="String"/>
<attribute name="emojis" optional="YES" attributeType="Binary"/>
<attribute name="id" attributeType="String"/>
<attribute name="isContentReveal" transient="YES" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
<attribute name="isContentSensitiveToggled" transient="YES" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
<attribute name="isMediaSensitive" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
<attribute name="isMediaSensitiveToggled" transient="YES" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
<attribute name="language" optional="YES" attributeType="String"/>
Expand Down Expand Up @@ -179,6 +179,7 @@
<attribute name="id" attributeType="String"/>
<attribute name="likeCount" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="location" optional="YES" attributeType="Binary"/>
<attribute name="quoteCount" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="replyCount" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="replyToStatusID" optional="YES" attributeType="String"/>
<attribute name="replyToUserID" optional="YES" attributeType="String"/>
Expand Down Expand Up @@ -243,7 +244,7 @@
<element name="MastodonUser" positionX="-63" positionY="-153" width="128" height="584"/>
<element name="TwitterAuthentication" positionX="-109.453125" positionY="275.71875" width="128" height="209"/>
<element name="TwitterSavedSearch" positionX="90" positionY="-18" width="128" height="104"/>
<element name="TwitterStatus" positionX="-63" positionY="-153" width="128" height="404"/>
<element name="TwitterStatus" positionX="-63" positionY="-153" width="128" height="419"/>
<element name="TwitterUser" positionX="281.5234375" positionY="201.703125" width="128" height="509"/>
</elements>
</model>
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ final public class MastodonStatus: NSManagedObject {
@NSManaged public private(set) var isMediaSensitive: Bool

// sourcery: autoUpdatableObject
@NSManaged public private(set) var isContentReveal: Bool
@NSManaged public private(set) var isContentSensitiveToggled: Bool
// sourcery: autoUpdatableObject
@NSManaged public private(set) var isMediaSensitiveToggled: Bool

Expand Down Expand Up @@ -382,9 +382,9 @@ extension MastodonStatus: AutoUpdatableObject {
self.isMediaSensitive = isMediaSensitive
}
}
public func update(isContentReveal: Bool) {
if self.isContentReveal != isContentReveal {
self.isContentReveal = isContentReveal
public func update(isContentSensitiveToggled: Bool) {
if self.isContentSensitiveToggled != isContentSensitiveToggled {
self.isContentSensitiveToggled = isContentSensitiveToggled
}
}
public func update(isMediaSensitiveToggled: Bool) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ final public class TwitterStatus: NSManagedObject {
@NSManaged public private(set) var replyCount: Int64
// sourcery: autoUpdatableObject, autoGenerateProperty
@NSManaged public private(set) var repostCount: Int64
// sourcery: autoGenerateProperty
@NSManaged public private(set) var quoteCount: Int64

// Note: not mark `autoUpdatableObject` for `replyCount` and `quoteCount`
// to avoid V1 API update the exists value to 0

// sourcery: autoUpdatableObject, autoGenerateProperty
@NSManaged public private(set) var source: String?
Expand Down Expand Up @@ -191,6 +196,7 @@ extension TwitterStatus: AutoGenerateProperty {
public let likeCount: Int64
public let replyCount: Int64
public let repostCount: Int64
public let quoteCount: Int64
public let source: String?
public let replyToStatusID: TwitterStatus.ID?
public let replyToUserID: TwitterUser.ID?
Expand All @@ -203,6 +209,7 @@ extension TwitterStatus: AutoGenerateProperty {
likeCount: Int64,
replyCount: Int64,
repostCount: Int64,
quoteCount: Int64,
source: String?,
replyToStatusID: TwitterStatus.ID?,
replyToUserID: TwitterUser.ID?,
Expand All @@ -214,6 +221,7 @@ extension TwitterStatus: AutoGenerateProperty {
self.likeCount = likeCount
self.replyCount = replyCount
self.repostCount = repostCount
self.quoteCount = quoteCount
self.source = source
self.replyToStatusID = replyToStatusID
self.replyToUserID = replyToUserID
Expand All @@ -228,6 +236,7 @@ extension TwitterStatus: AutoGenerateProperty {
self.likeCount = property.likeCount
self.replyCount = property.replyCount
self.repostCount = property.repostCount
self.quoteCount = property.quoteCount
self.source = property.source
self.replyToStatusID = property.replyToStatusID
self.replyToUserID = property.replyToUserID
Expand Down Expand Up @@ -351,6 +360,18 @@ extension TwitterStatus: AutoUpdatableObject {
}
// sourcery:end

public func update(replyCount: Int64) {
if self.replyCount != replyCount {
self.replyCount = replyCount
}
}

public func update(quoteCount: Int64) {
if self.quoteCount != quoteCount {
self.quoteCount = quoteCount
}
}

public func update(isRepost: Bool, by user: TwitterUser) {
if isRepost {
if !repostBy.contains(user) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "circle.mask.44.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "badge.mastodon.pdf",
"filename" : "circle.mastodon.pdf",
"idiom" : "universal"
}
],
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "badge.twitter.pdf",
"filename" : "circle.twitter.pdf",
"idiom" : "universal"
}
],
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "robot.mask.44.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "verified.mask.44.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "person.large.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "bell.large.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "bell.ringing.large.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "home.large.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "magnifyingglass.large.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Binary file not shown.
14 changes: 11 additions & 3 deletions TwidereSDK/Sources/TwidereAsset/Generated/Assets.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,16 @@ public enum Asset {
public static let trendingUp = ImageAsset(name: "Arrows/trending.up")
}
public enum Badge {
public static let circleMask = ImageAsset(name: "Badge/circle.mask")
public static let circleMask44 = ImageAsset(name: "Badge/circle.mask.44")
public static let circleMask88 = ImageAsset(name: "Badge/circle.mask.88")
public static let circleMastodon = ImageAsset(name: "Badge/circle.mastodon")
public static let circleTwitter = ImageAsset(name: "Badge/circle.twitter")
public static let robot = ImageAsset(name: "Badge/robot")
public static let robotMask = ImageAsset(name: "Badge/robot.mask")
public static let robotMask44 = ImageAsset(name: "Badge/robot.mask.44")
public static let robotMask88 = ImageAsset(name: "Badge/robot.mask.88")
public static let verified = ImageAsset(name: "Badge/verified")
public static let verifiedMask = ImageAsset(name: "Badge/verified.mask")
public static let verifiedMask44 = ImageAsset(name: "Badge/verified.mask.44")
public static let verifiedMask88 = ImageAsset(name: "Badge/verified.mask.88")
}
public enum Colors {
public enum Banner {
Expand Down Expand Up @@ -105,6 +108,7 @@ public enum Asset {
public static let person2 = ImageAsset(name: "Human/person.2")
public static let personExclamationMini = ImageAsset(name: "Human/person.exclamation.mini")
public static let person = ImageAsset(name: "Human/person")
public static let personLarge = ImageAsset(name: "Human/person.large")
public static let personMini = ImageAsset(name: "Human/person.mini")
public static let personPlusMini = ImageAsset(name: "Human/person.plus.mini")
}
Expand Down Expand Up @@ -138,7 +142,9 @@ public enum Asset {
}
public enum ObjectTools {
public static let bell = ImageAsset(name: "Object&Tools/bell")
public static let bellLarge = ImageAsset(name: "Object&Tools/bell.large")
public static let bellRinging = ImageAsset(name: "Object&Tools/bell.ringing")
public static let bellRingingLarge = ImageAsset(name: "Object&Tools/bell.ringing.large")
public static let blockedBadge = ImageAsset(name: "Object&Tools/blocked.badge")
public static let bookmarks = ImageAsset(name: "Object&Tools/bookmarks")
public static let camera = ImageAsset(name: "Object&Tools/camera")
Expand All @@ -149,13 +155,15 @@ public enum Asset {
public static let globeMini = ImageAsset(name: "Object&Tools/globe.mini")
public static let globeMiniInline = ImageAsset(name: "Object&Tools/globe.mini.inline")
public static let house = ImageAsset(name: "Object&Tools/house")
public static let houseLarge = ImageAsset(name: "Object&Tools/house.large")
public static let icRoundRefresh = ImageAsset(name: "Object&Tools/ic.round.refresh")
public static let lock = ImageAsset(name: "Object&Tools/lock")
public static let lockMini = ImageAsset(name: "Object&Tools/lock.mini")
public static let lockMiniInline = ImageAsset(name: "Object&Tools/lock.mini.inline")
public static let lockOpen = ImageAsset(name: "Object&Tools/lock.open")
public static let lockOpenMiniInline = ImageAsset(name: "Object&Tools/lock.open.mini.inline")
public static let magnifyingglass = ImageAsset(name: "Object&Tools/magnifyingglass")
public static let magnifyingglassLarge = ImageAsset(name: "Object&Tools/magnifyingglass.large")
public static let mappin = ImageAsset(name: "Object&Tools/mappin")
public static let mappinMini = ImageAsset(name: "Object&Tools/mappin.mini")
public static let note = ImageAsset(name: "Object&Tools/note")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ final public class ComposeInputTableViewCell: UITableViewCell {

public let avatarView: ProfileAvatarView = {
let imageView = ProfileAvatarView()
imageView.dimension = ComposeInputTableViewCell.avatarImageViewSize.width
imageView.setup(dimension: .inline)
return imageView
}()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ extension ComposeContentViewController {
guard let self = self else { return nil }
guard isRequestLocation, let currentLocation = currentLocation else { return nil }

guard let authenticationContext = self.viewModel.configurationContext.authenticationService.activeAuthenticationContext.value,
guard let authenticationContext = self.viewModel.configurationContext.authenticationService.activeAuthenticationContext,
case let .twitter(twitterAuthenticationContext) = authenticationContext
else { return nil }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,7 @@ extension ComposeContentViewModel {
tableView: tableView,
viewModel: ComposeReplyTableViewCell.ViewModel(
status: status,
statusViewConfigureContext: StatusView.ConfigurationContext(
dateTimeProvider: configurationContext.dateTimeProvider,
twitterTextProvider: configurationContext.twitterTextProvider,
activeAuthenticationContext: Just(nil).eraseToAnyPublisher()
)
statusViewConfigureContext: configurationContext.statusViewConfigureContext
)
)
return composeReplyTableViewCell
Expand Down
Loading

0 comments on commit 3010973

Please sign in to comment.