Commit 1f60f29b cgx

完善社区列表页面夜间模式

1 个父辈 9c1476c8
正在显示 27 个修改的文件 包含 140 行增加20 行删除
......@@ -1444,8 +1444,8 @@
children = (
D0A3BB8D28D959F800F58781 /* View */,
D0A3BB8F28D95A0C00F58781 /* Model */,
D0A3BB9328D9B3E000F58781 /* ViewModel */,
D0A3BB8E28D95A0200F58781 /* Controller */,
D0A3BB9328D9B3E000F58781 /* ViewModel */,
);
path = CommunityModule;
sourceTree = "<group>";
......
......@@ -41,7 +41,7 @@
UIButton *messageBtn = [UIButton new];
[messageBtn addTarget:self action:@selector(messageAction) forControlEvents:UIControlEventTouchUpInside];
[messageBtn dk_setImage:DKImagePickerWithNames(@"ic_message_shequ", @"ic_message_shequ", @"ic_message_shequ") forState:UIControlStateNormal];
[messageBtn dk_setImage:DKImagePickerWithNames(@"ic_message_shequ", @"dk_ic_message_shequ", @"ic_message_shequ") forState:UIControlStateNormal];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:messageBtn];
}
......
......@@ -28,7 +28,7 @@
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
[self cornerRadius:24.0];
self.selectionStyle = UITableViewCellSelectionStyleNone;
self.dk_backgroundColorPicker = DKColorPickerWithColors(DSWhite, CornerViewDarkColor, DSWhite);
self.dk_backgroundColorPicker = DKColorPickerWithColors(DSWhite, AlertDarkColor, DSWhite);
self.photos = [NSMutableArray array];
......@@ -159,7 +159,7 @@
- (UILabel *)userNameLab {
if (!_userNameLab) {
_userNameLab = [UILabel labWithFont:BoldFont(15)];
_userNameLab.dk_textColorPicker = DKColorPickerWithColors(MainTextColor, ColorFromHex(0xE8E9E9), DSWhite);
_userNameLab.dk_textColorPicker = DKColorPickerWithColors(MainTextColor, DkTitleColor, DSWhite);
}
return _userNameLab;
}
......@@ -167,7 +167,7 @@
- (UILabel *)timeLab {
if (!_timeLab) {
_timeLab = [UILabel labWithFont:SysFont(12)];
_timeLab.dk_textColorPicker = DKColorPickerWithColors(SmallTextColor, ColorFromHex(0x5C6274), DSWhite);
_timeLab.dk_textColorPicker = DKColorPickerWithColors(SmallTextColor, ColorFromHexA(0xFFFFFF, .3), DSWhite);
}
return _timeLab;
}
......@@ -192,7 +192,7 @@
- (UILabel *)contentLab {
if (!_contentLab) {
_contentLab = [UILabel labWithFont:SysFont(14)];
_contentLab.dk_textColorPicker = DKColorPickerWithColors(MainTextColor, DkTitleColor, DSWhite);
_contentLab.dk_textColorPicker = DKColorPickerWithColors(MainTextColor, SubTitleColor, DSWhite);
_contentLab.numberOfLines = 0;
}
return _contentLab;
......@@ -210,7 +210,7 @@
- (LikeButton *)likeBtn {
if (!_likeBtn) {
_likeBtn = [[LikeButton alloc] initWithNormalImg:nil selectedImg:nil];
_likeBtn = [[LikeButton alloc] initWithNormalImg:nil nightNormalImg:nil selectedImg:nil nightSelectedImg:nil];
_likeBtn.tag = 2;
[_likeBtn addTarget:self action:@selector(informOrlikeOrRemarkAction:) forControlEvents:UIControlEventTouchUpInside];
}
......@@ -221,8 +221,8 @@
if (!_remarkCountBtn) {
_remarkCountBtn = [UIButton btnWithTitle:@"0" font:SysFont(12)];
_remarkCountBtn.tag = 3;
[_remarkCountBtn dk_setTitleColorPicker:DKColorPickerWithColors(SmallTextColor, DSWhite, DSWhite) forState:UIControlStateNormal];
[_remarkCountBtn setImage:[UIImage imageNamed:@"ic_shequ_pinlun"] forState:UIControlStateNormal];
[_remarkCountBtn dk_setTitleColorPicker:DKColorPickerWithColors(SmallTextColor, ColorFromHexA(0xFFFFFF, .3), DSWhite) forState:UIControlStateNormal];
[_remarkCountBtn dk_setImage:DKImagePickerWithNames(@"ic_shequ_pinlun", @"dk_ic_shequ_pinlun", @"ic_shequ_pinlun") forState:UIControlStateNormal];
_remarkCountBtn.titleEdgeInsets = UIEdgeInsetsMake(0, 2, 0, 0);
[_remarkCountBtn addTarget:self action:@selector(informOrlikeOrRemarkAction:) forControlEvents:UIControlEventTouchUpInside];
}
......
......@@ -27,6 +27,7 @@
UIButton *publishBtn = [UIButton new];
[publishBtn setImage:[UIImage imageNamed:@"ic_fabu"] forState:UIControlStateNormal];
publishBtn.imageView.dk_alphaPicker = DKAlphaPickerWithAlphas(1.0, .5, 1);
[publishBtn addTarget:self action:@selector(publishAction) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:publishBtn];
[publishBtn mas_makeConstraints:^(MASConstraintMaker *make) {
......@@ -189,8 +190,8 @@
_headView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.listView.width, articleH + 2*aroundMargin)];
_headView.backgroundColor = DSClearColor;
UIImageView *articleIV = [self plateWithFrame:CGRectMake(0, 15, articleW, articleH) title:@"#睡眠文章" desc:@"精选海量好文" imgName:@"btn_shequ_shuimianwenzhang" tag:1];
[self plateWithFrame:CGRectMake(articleW + 12, articleIV.y, evaluationW, articleH) title:@"#人气测评" desc:@"玩转趣味测试" imgName:@"btn_shequ_ceping" tag:2];
UIImageView *articleIV = [self plateWithFrame:CGRectMake(0, 15, articleW, articleH) title:@"#睡眠文章" desc:@"精选海量好文" imgName:@"btn_shequ_shuimianwenzhang" nightImgName:@"dk_btn_shequ_shuimianwenzhang" tag:1];
[self plateWithFrame:CGRectMake(articleW + 12, articleIV.y, evaluationW, articleH) title:@"#人气测评" desc:@"玩转趣味测试" imgName:@"btn_shequ_ceping" nightImgName:@"dk_btn_shequ_ceping" tag:2];
}
return _headView;
}
......@@ -202,10 +203,9 @@
return _informCancelView;
}
- (UIImageView *)plateWithFrame:(CGRect)frame title:(NSString *)title desc:(NSString *)desc imgName:(NSString *)imgName tag:(NSInteger)tag {
- (UIImageView *)plateWithFrame:(CGRect)frame title:(NSString *)title desc:(NSString *)desc imgName:(NSString *)imgName nightImgName:(NSString *)nightImgName tag:(NSInteger)tag {
UIImageView *imgView = [[UIImageView alloc] initWithFrame:frame];
[imgView dk_setAlphaPicker:DKAlphaPickerWithAlphas(1.0, .5, .5)];
imgView.image = [UIImage imageNamed:imgName];
imgView.dk_imagePicker = DKImagePickerWithNames(imgName, nightImgName, imgName);
imgView.tag = tag;
imgView.userInteractionEnabled = YES;
[self.headView addSubview:imgView];
......
......@@ -67,7 +67,7 @@
if (!_likeBtn) {
_likeBtn = [UIButton btnWithTitle:@"23" font:SysFont(12)];
[_likeBtn dk_setTitleColorPicker:DKColorPickerWithColors(SmallTextColor, DSWhite, DSWhite) forState:UIControlStateNormal];
[_likeBtn setImage:[UIImage imageNamed:@"ic_shequ_dianza"] forState:UIControlStateNormal];
[_likeBtn dk_setImage:DKImagePickerWithNames(@"ic_shequ_dianza", @"dk_ic_shequ_dianza", @"ic_shequ_dianza") forState:UIControlStateNormal];
_likeBtn.titleEdgeInsets = UIEdgeInsetsMake(0, 9, 0, 0);
}
return _likeBtn;
......
......@@ -14,7 +14,7 @@ typedef void (^LikeBlock)(void);
@property (nonatomic, copy) LikeBlock likeBlock;
- (instancetype)initWithNormalImg:(UIImage *)normalImg selectedImg:(UIImage *)selectedImg;
- (instancetype)initWithNormalImg:(UIImage *)normalImg nightNormalImg:(UIImage *)nightNormalImg selectedImg:(UIImage *)selectedImg nightSelectedImg:(UIImage *)nightSelectedImg;
- (void)updateLikeBtnState:(BOOL)isLike likeCount:(int)likeCount;
......
......@@ -13,15 +13,19 @@
@property (nonatomic, strong) CAEmitterLayer *emitterLayer;
@property (nonatomic, strong) UIView *explodeAnimationView;
@property (nonatomic, strong) UIImage *normalIcon;
@property (nonatomic, strong) UIImage *nightNormalIcon;
@property (nonatomic, strong) UIImage *selectedIcon;
@property (nonatomic, strong) UIImage *nightSelectedIcon;
@end
@implementation LikeButton
- (instancetype)initWithNormalImg:(UIImage *)normalImg selectedImg:(UIImage *)selectedImg {
- (instancetype)initWithNormalImg:(UIImage *)normalImg nightNormalImg:(UIImage *)nightNormalImg selectedImg:(UIImage *)selectedImg nightSelectedImg:(UIImage *)nightSelectedImg {
if (self = [super init]) {
self.normalIcon = normalImg ?: [UIImage imageNamed:@"ic_shequ_dianza"];
self.nightNormalIcon = nightNormalImg ?: [UIImage imageNamed:@"dk_ic_shequ_dianza"];
self.selectedIcon = selectedImg ?: [UIImage imageNamed:@"ic_shequ_yidianza"];
self.nightSelectedIcon = nightSelectedImg ?: [UIImage imageNamed:@"ic_shequ_yidianza"];
[self addSubview:self.aniIcon];
[self addSubview:self.countLab];
......@@ -50,7 +54,8 @@
self.aniIcon.selected = isLike;
UIColor *dayColor = self.aniIcon.selected ? ColorFromHex(0xF04B77) : SmallTextColor;
self.countLab.dk_textColorPicker = DKColorPickerWithColors(dayColor, DSWhite, DSWhite);
UIColor *nightColor = self.aniIcon.selected ? ColorFromHex(0xF04B77) : ColorFromHexA(0xFFFFFF, .3);
self.countLab.dk_textColorPicker = DKColorPickerWithColors(dayColor, nightColor, DSWhite);
self.countLab.text = [NSString stringWithFormat:@"%d", likeCount];
}
......@@ -127,8 +132,8 @@
if (!_aniIcon) {
_aniIcon = [UIButton new];
_aniIcon.userInteractionEnabled = NO;
[_aniIcon setImage:self.normalIcon forState:UIControlStateNormal];
[_aniIcon setImage:self.selectedIcon forState: UIControlStateSelected];
[_aniIcon dk_setImage:DKImagePickerWithImages(self.normalIcon, self.nightNormalIcon, self.normalIcon) forState:UIControlStateNormal];
[_aniIcon dk_setImage:DKImagePickerWithImages(self.selectedIcon, self.nightSelectedIcon, self.selectedIcon) forState:UIControlStateSelected];
}
return _aniIcon;
}
......
{
"images" : [
{
"filename" : "dk_btn_shequ_ceping.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "dk_btn_shequ_ceping@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "dk_btn_shequ_ceping@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "dk_btn_shequ_shuimianwenzhang.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "dk_btn_shequ_shuimianwenzhang@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "dk_btn_shequ_shuimianwenzhang@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "dk_ic_message_shequ.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "dk_ic_message_shequ@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "dk_ic_message_shequ@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "dk_ic_shequ_dianza.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "dk_ic_shequ_dianza@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "dk_ic_shequ_dianza@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "dk_ic_shequ_pinlun.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "dk_ic_shequ_pinlun@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "dk_ic_shequ_pinlun@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!