mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
UI improvements
This commit is contained in:
parent
c462b92952
commit
fb0c10e29f
@ -18,5 +18,6 @@ typedef NS_ENUM(NSInteger, STPCardBrand) {
|
||||
STPCardBrandDiscover,
|
||||
STPCardBrandJCB,
|
||||
STPCardBrandDinersClub,
|
||||
STPCardBrandOther,
|
||||
STPCardBrandUnknown,
|
||||
};
|
||||
|
@ -19,6 +19,7 @@
|
||||
case STPCardBrandMasterCard: return @"MasterCard";
|
||||
case STPCardBrandUnknown: return @"Unknown";
|
||||
case STPCardBrandVisa: return @"Visa";
|
||||
case STPCardBrandOther: return @"Other";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -66,7 +66,7 @@
|
||||
@[@"492937", @"492937", @13, @(STPCardBrandVisa)],
|
||||
@[@"492939", @"492939", @13, @(STPCardBrandVisa)],
|
||||
@[@"492960", @"492960", @13, @(STPCardBrandVisa)],
|
||||
@[@"2", @"2", @16, @(STPCardBrandVisa)],
|
||||
@[@"2", @"2", @16, @(STPCardBrandOther)],
|
||||
];
|
||||
NSMutableArray *binRanges = [NSMutableArray array];
|
||||
for (NSArray *range in ranges) {
|
||||
|
@ -64,6 +64,8 @@
|
||||
return STPCardBrandJCB;
|
||||
} else if ([brand isEqualToString:@"diners club"]) {
|
||||
return STPCardBrandDinersClub;
|
||||
} else if ([brand isEqualToString:@"other"]) {
|
||||
return STPCardBrandOther;
|
||||
} else {
|
||||
return STPCardBrandUnknown;
|
||||
}
|
||||
@ -114,6 +116,8 @@
|
||||
return @"MasterCard";
|
||||
case STPCardBrandVisa:
|
||||
return @"Visa";
|
||||
case STPCardBrandOther:
|
||||
return @"Other";
|
||||
default:
|
||||
return @"Unknown";
|
||||
}
|
||||
|
@ -51,6 +51,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* An icon representing Visa.
|
||||
*/
|
||||
+ (UIImage *)visaCardImage;
|
||||
+ (UIImage *)otherCardImage;
|
||||
|
||||
/**
|
||||
* An icon to use when the type of the card is unknown.
|
||||
|
@ -48,6 +48,10 @@
|
||||
return [self brandImageForCardBrand:STPCardBrandUnknown];
|
||||
}
|
||||
|
||||
+ (UIImage *)otherCardCardImage {
|
||||
return [self brandImageForCardBrand:STPCardBrandUnknown];
|
||||
}
|
||||
|
||||
+ (UIImage *)brandImageForCardBrand:(STPCardBrand)brand {
|
||||
return [self brandImageForCardBrand:brand template:NO];
|
||||
}
|
||||
@ -140,6 +144,9 @@
|
||||
break;
|
||||
case STPCardBrandVisa:
|
||||
imageName = shouldUseTemplate ? @"stp_card_visa_template" : @"stp_card_visa";
|
||||
case STPCardBrandOther:
|
||||
shouldUseTemplate = YES;
|
||||
imageName = @"stp_card_placeholder_template";
|
||||
break;
|
||||
}
|
||||
UIImage *image = [self safeImageNamed:imageName
|
||||
|
@ -377,7 +377,7 @@ final class ChatPinnedMessageTitlePanelNode: ChatTitleAccessoryPanelNode {
|
||||
self.listButton.layer.animateScale(from: 1.0, to: 0.01, duration: 0.2, removeOnCompletion: false)
|
||||
}
|
||||
} else {
|
||||
self.listButton.isHidden = !displayCloseButton
|
||||
self.listButton.isHidden = !displayListButton
|
||||
self.listButton.layer.removeAllAnimations()
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user