Skip to content

Commit

Permalink
1.1.4 - Dark mode improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
香風智乃 authored and 香風智乃 committed Jan 27, 2019
1 parent 702a70a commit 8d244ec
Show file tree
Hide file tree
Showing 20 changed files with 421 additions and 291 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,14 +313,16 @@ + (NSArray *)KitsuEpisodesListtoAtarashii:(NSDictionary *)data withTitleId:(int)
continue;
}
@autoreleasepool {
AtarashiiEpisodeObject *episode = [AtarashiiEpisodeObject new];
episode.titleId = titleid;
episode.episodeId = ((NSNumber *)episodeEntry[@"id"]).intValue;
episode.episodeTitle = episodeEntry[@"attributes"][@"canonicalTitle"];
episode.episodeNumber = ((NSNumber *)episodeEntry[@"attributes"][@"number"]).intValue;
episode.thumbnail = episodeEntry[@"attributes"][@"thumbnail"] != [NSNull null] ? episodeEntry[@"attributes"][@"thumbnail"][@"original"] : @"";
episode.airDate = episodeEntry[@"attributes"][@"airdate"] != [NSNull null] ? episodeEntry[@"attributes"][@"airdate"] : @"";
[tmparray addObject:episode.NSDictionaryRepresentation];
if (episodeEntry[@"attributes"][@"canonicalTitle"] != [NSNull null]) {
AtarashiiEpisodeObject *episode = [AtarashiiEpisodeObject new];
episode.titleId = titleid;
episode.episodeId = ((NSNumber *)episodeEntry[@"id"]).intValue;
episode.episodeTitle = episodeEntry[@"attributes"][@"canonicalTitle"];
episode.episodeNumber = ((NSNumber *)episodeEntry[@"attributes"][@"number"]).intValue;
episode.thumbnail = episodeEntry[@"attributes"][@"thumbnail"] != [NSNull null] ? episodeEntry[@"attributes"][@"thumbnail"][@"original"] : @"";
episode.airDate = episodeEntry[@"attributes"][@"airdate"] != [NSNull null] ? episodeEntry[@"attributes"][@"airdate"] : @"";
[tmparray addObject:episode.NSDictionaryRepresentation];
}
}
}
return tmparray;
Expand Down
2 changes: 1 addition & 1 deletion Shukofukurou-IOS/Navigation/SideBarCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import <UIKit/UIKit.h>

@interface SideBarCell : UITableViewCell
@interface SideBarCell : UITableViewCell <UIAppearance>
@property (assign, nonatomic) IBOutlet UILabel *titleLabel;
@property (assign, nonatomic) IBOutlet UIView *separatorView;
@property (assign, nonatomic) IBOutlet UIImageView *image;
Expand Down
10 changes: 5 additions & 5 deletions Shukofukurou-IOS/Storyboards/Base.lproj/Airing.storyboard
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand Down Expand Up @@ -129,13 +129,13 @@
<scene sceneID="Qfd-nE-3oB">
<objects>
<tableViewController storyboardIdentifier="dayselector" useStoryboardIdentifierAsRestorationIdentifier="YES" id="Vgq-RE-9wl" customClass="AiringDayTableViewController" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" id="FLM-IE-bfy">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" id="FLM-IE-bfy">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="daycell" textLabel="YHq-D9-eI9" style="IBUITableViewCellStyleDefault" id="MgD-NC-9C9">
<rect key="frame" x="0.0" y="28" width="375" height="44"/>
<rect key="frame" x="0.0" y="55.5" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="MgD-NC-9C9" id="GW3-fV-E30">
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
Expand Down
6 changes: 3 additions & 3 deletions Shukofukurou-IOS/Storyboards/Base.lproj/InfoView.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -1208,13 +1208,13 @@
<scene sceneID="n7d-He-mIA">
<objects>
<tableViewController storyboardIdentifier="episodestbvc" title="Episodes" useStoryboardIdentifierAsRestorationIdentifier="YES" id="gFM-cF-D5o" customClass="EpisodesTableViewController" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" id="3DB-C7-cwE">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" id="3DB-C7-cwE">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="episodecell" rowHeight="88" id="wfg-gJ-1TJ" customClass="EpisodesTableViewCell">
<rect key="frame" x="0.0" y="28" width="320" height="88"/>
<rect key="frame" x="0.0" y="55.5" width="320" height="88"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="wfg-gJ-1TJ" id="ark-7j-hz3">
<rect key="frame" x="0.0" y="0.0" width="286" height="87.5"/>
Expand Down
16 changes: 8 additions & 8 deletions Shukofukurou-IOS/Storyboards/Base.lproj/Seasons.storyboard
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Scv-et-0S8">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Scv-et-0S8">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand Down Expand Up @@ -117,13 +117,13 @@
<scene sceneID="Twb-U7-657">
<objects>
<tableViewController storyboardIdentifier="seasonselector" useStoryboardIdentifierAsRestorationIdentifier="YES" id="RQ4-vv-cmc" customClass="SeasonSelectorTableViewController" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" id="EsV-gn-Z6U">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" id="EsV-gn-Z6U">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="daycell" textLabel="qbH-9l-gIN" style="IBUITableViewCellStyleDefault" id="aeu-gV-gfA">
<rect key="frame" x="0.0" y="28" width="375" height="44"/>
<rect key="frame" x="0.0" y="55.5" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="aeu-gV-gfA" id="n3N-dX-FbI">
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
Expand Down Expand Up @@ -163,8 +163,8 @@
</scene>
</scenes>
<resources>
<image name="Menu" width="25" height="25"/>
<image name="day" width="30" height="30"/>
<image name="season" width="25" height="25"/>
<image name="Menu" width="50" height="50"/>
<image name="day" width="60" height="60"/>
<image name="season" width="50" height="50"/>
</resources>
</document>
2 changes: 1 addition & 1 deletion Shukofukurou-IOS/Table View Cells/ReviewTableViewCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ NS_ASSUME_NONNULL_BEGIN

@end

@interface ReactionTableViewCell : UITableViewCell
@interface ReactionTableViewCell : UITableViewCell <UIAppearance>
@property (weak, nonatomic) IBOutlet UIImageView *avatar;
@property (weak, nonatomic) IBOutlet UILabel *likes;
@property (weak, nonatomic) IBOutlet UILabel *rating;
Expand Down
3 changes: 2 additions & 1 deletion Shukofukurou-IOS/Themes/DarkTheme.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ - (instancetype)init {
if (self = [super init]) {
self.viewBackgroundColor = [UIColor colorWithRed:0.22 green:0.22 blue:0.23 alpha:1.0];;
self.viewAltBackgroundColor = [UIColor colorWithRed:0.27 green:0.27 blue:0.24 alpha:1.0];
self.tableCellSelectionBackgroundColor = [UIColor colorWithRed:0.40 green:0.40 blue:0.40 alpha:1.0];;
self.tableCellSelectionBackgroundColor = [UIColor colorWithRed:0.43 green:0.43 blue:0.43 alpha:1.0];
self.tableHeaderBackgroundColor = [UIColor colorWithRed:0.42 green:0.42 blue:0.43 alpha:1.0];
self.textColor = [UIColor whiteColor];
self.tintColor = [UIColor colorWithRed:0.27 green:0.44 blue:0.99 alpha:1.0];
self.thumbTintColor = [UISwitch new].thumbTintColor.copy;
Expand Down
1 change: 1 addition & 0 deletions Shukofukurou-IOS/Themes/DefaultTheme.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ - (instancetype)init {
self.viewBackgroundColor = UIColor.whiteColor;
self.viewAltBackgroundColor = [UIColor colorWithRed:0.94 green:0.94 blue:0.96 alpha:1.0];;
self.tableCellSelectionBackgroundColor = [UITableViewCell new].selectedBackgroundView.backgroundColor.copy;
self.tableHeaderBackgroundColor = [UIColor colorWithRed:0.97 green:0.97 blue:0.97 alpha:1.0];
self.textColor = [UITextField new].textColor.copy;
self.tintColor = [UIView new].tintColor.copy;
self.thumbTintColor = [UISwitch new].thumbTintColor.copy;
Expand Down
16 changes: 15 additions & 1 deletion Shukofukurou-IOS/Themes/ThemeManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
#import "ThemeManager.h"
#import "DefaultTheme.h"
#import "DarkTheme.h"
#import "AnimeEntryTableViewCell.h"
#import "MangaEntryTableViewCell.h"
#import "SearchTableViewCell.h"
#import "TitleInfoTableViewCell.h"
#import "ReviewTableViewCell.h"
#import "SideBarCell.h"

@interface ThemeManager ()
@property ThemeManagerTheme *lightTheme;
Expand Down Expand Up @@ -49,7 +55,15 @@ - (void)setTheme {
[UITableView appearance].backgroundColor = darkmode ? _currentTheme.viewBackgroundColor : _currentTheme.viewAltBackgroundColor;
[UICollectionView appearance].backgroundColor = _currentTheme.viewBackgroundColor;
[UITableViewCell appearance].backgroundColor = darkmode ? _currentTheme.viewAltBackgroundColor : _currentTheme.viewBackgroundColor;
[UITableViewCell appearance].backgroundView.backgroundColor = _currentTheme.tableCellSelectionBackgroundColor;
[UITableViewCell appearance].selectedBackgroundView.backgroundColor = _currentTheme.tableCellSelectionBackgroundColor;
[UISegmentedControl appearance].tintColor = _currentTheme.tintColor;
[UIImageView appearanceWhenContainedInInstancesOfClasses:@[[SideBarCell class]]].tintColor = darkmode ? _currentTheme.tintColor: _currentTheme.textColor;
[UIImageView appearanceWhenContainedInInstancesOfClasses:@[[AnimeEntryTableViewCell class]]].tintColor = darkmode ? _currentTheme.tintColor: _currentTheme.textColor;
[UIImageView appearanceWhenContainedInInstancesOfClasses:@[[MangaEntryTableViewCell class]]].tintColor = darkmode ? _currentTheme.tintColor: _currentTheme.textColor;
[UIImageView appearanceWhenContainedInInstancesOfClasses:@[[AnimeEntryTableViewCell class]]].tintColor = darkmode ? _currentTheme.tintColor: _currentTheme.textColor;
[UIImageView appearanceWhenContainedInInstancesOfClasses:@[[SearchTableViewCell class]]].tintColor = darkmode ? _currentTheme.tintColor: _currentTheme.textColor;
[UIImageView appearanceWhenContainedInInstancesOfClasses:@[[ReactionTableViewCell class]]].tintColor = darkmode ? _currentTheme.tintColor: _currentTheme.textColor;
[UITableViewHeaderFooterView appearance].tintColor = _currentTheme.tableHeaderBackgroundColor;
[UILabel appearance].textColor = _currentTheme.textColor;
[UITextField appearance].textColor = _currentTheme.textColor;
[UITextView appearance].textColor = _currentTheme.textColor;;
Expand Down
1 change: 1 addition & 0 deletions Shukofukurou-IOS/Themes/ThemeManagerTheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (strong) UIColor *viewBackgroundColor;
@property (strong) UIColor *viewAltBackgroundColor;
@property (strong) UIColor *tableCellSelectionBackgroundColor;
@property (strong) UIColor *tableHeaderBackgroundColor;
@property (strong) UIColor *textColor;
@property (strong) UIColor *tintColor;
@property (strong) UIColor *thumbTintColor;
Expand Down
Loading

0 comments on commit 8d244ec

Please sign in to comment.