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