mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-02 00:17:02 +00:00
Move BITFeedbackActivity customization out from BITFeedbackManager
Also add first documentation parts
This commit is contained in:
parent
8120d9b2e4
commit
0fe87cf8c0
@ -10,6 +10,46 @@
|
|||||||
|
|
||||||
#import "BITFeedbackComposeViewControllerDelegate.h"
|
#import "BITFeedbackComposeViewControllerDelegate.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
UIActivity subclass allowing to use the feedback interface to share content with the developer
|
||||||
|
|
||||||
|
This activity can be added into an UIActivityViewController and it will use the activity data
|
||||||
|
objects to prefill the content of `BITFeedbackComposeViewController`.
|
||||||
|
|
||||||
|
This can be useful if you present some data that users can not only share but also
|
||||||
|
report back to the developer because they have some problems, e.g. webcams not working
|
||||||
|
any more.
|
||||||
|
|
||||||
|
The activity provide a default title and image that can be further customized
|
||||||
|
via `customActivityImage` and `customActivityTitle`.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
@interface BITFeedbackActivity : UIActivity <BITFeedbackComposeViewControllerDelegate>
|
@interface BITFeedbackActivity : UIActivity <BITFeedbackComposeViewControllerDelegate>
|
||||||
|
|
||||||
|
///-----------------------------------------------------------------------------
|
||||||
|
/// @name BITFeedbackActivity customisation
|
||||||
|
///-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Define the image shown when using `BITFeedbackActivity`
|
||||||
|
|
||||||
|
If not set a default icon is being used.
|
||||||
|
|
||||||
|
@see customActivityTitle
|
||||||
|
*/
|
||||||
|
@property (nonatomic, retain) UIImage *customActivityImage;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Define the title shown when using `BITFeedbackActivity`
|
||||||
|
|
||||||
|
If not set, a default string is shown by using the apps name
|
||||||
|
and adding the localized string "Feedback" to it.
|
||||||
|
|
||||||
|
@see customActivityImage
|
||||||
|
*/
|
||||||
|
@property (nonatomic, retain) NSString *customActivityTitle;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -27,6 +27,9 @@
|
|||||||
|
|
||||||
- (id)init {
|
- (id)init {
|
||||||
if ((self = [super init])) {
|
if ((self = [super init])) {
|
||||||
|
_customActivityImage = nil;
|
||||||
|
_customActivityTitle = nil;
|
||||||
|
|
||||||
self.items = [NSMutableArray array];;
|
self.items = [NSMutableArray array];;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,6 +39,9 @@
|
|||||||
- (void)dealloc {
|
- (void)dealloc {
|
||||||
[_items release]; _items = nil;
|
[_items release]; _items = nil;
|
||||||
|
|
||||||
|
[_customActivityImage release];
|
||||||
|
[_customActivityTitle release];
|
||||||
|
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,8 +53,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *)activityTitle {
|
- (NSString *)activityTitle {
|
||||||
if ([BITHockeyManager sharedHockeyManager].feedbackManager.activityTitle)
|
if (self.customActivityTitle)
|
||||||
return [BITHockeyManager sharedHockeyManager].feedbackManager.activityTitle;
|
return self.customActivityTitle;
|
||||||
|
|
||||||
NSString *appName = bit_appName(BITHockeyLocalizedString(@"HockeyFeedbackActivityAppPlaceholder"));
|
NSString *appName = bit_appName(BITHockeyLocalizedString(@"HockeyFeedbackActivityAppPlaceholder"));
|
||||||
|
|
||||||
@ -56,8 +62,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (UIImage *)activityImage {
|
- (UIImage *)activityImage {
|
||||||
if ([BITHockeyManager sharedHockeyManager].feedbackManager.activityImage)
|
if (self.customActivityImage)
|
||||||
return [BITHockeyManager sharedHockeyManager].feedbackManager.activityImage;
|
return self.customActivityImage;
|
||||||
|
|
||||||
return bit_imageNamed(@"feedbackActiviy.png", BITHOCKEYSDK_BUNDLE);
|
return bit_imageNamed(@"feedbackActiviy.png", BITHOCKEYSDK_BUNDLE);
|
||||||
}
|
}
|
||||||
|
@ -130,29 +130,4 @@ typedef enum {
|
|||||||
- (BITFeedbackComposeViewController *)feedbackComposeViewController;
|
- (BITFeedbackComposeViewController *)feedbackComposeViewController;
|
||||||
|
|
||||||
|
|
||||||
///-----------------------------------------------------------------------------
|
|
||||||
/// @name BITFeedbackActivity settings
|
|
||||||
///-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
Define the image shown when using `BITFeedbackActivity`
|
|
||||||
|
|
||||||
If not set a default icon is being used.
|
|
||||||
|
|
||||||
@see activityTitle
|
|
||||||
*/
|
|
||||||
@property (nonatomic, retain) UIImage *activityImage;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
Define the title shown when using `BITFeedbackActivity`
|
|
||||||
|
|
||||||
If not set, a default string is shown by using the apps name
|
|
||||||
and adding the localized string "Feedback" to it.
|
|
||||||
|
|
||||||
@see activityImage
|
|
||||||
*/
|
|
||||||
@property (nonatomic, retain) NSString *activityTitle;
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -79,9 +79,6 @@
|
|||||||
_token = nil;
|
_token = nil;
|
||||||
_lastMessageID = nil;
|
_lastMessageID = nil;
|
||||||
|
|
||||||
_activityImage = nil;
|
|
||||||
_activityTitle = nil;
|
|
||||||
|
|
||||||
self.feedbackList = [NSMutableArray array];
|
self.feedbackList = [NSMutableArray array];
|
||||||
|
|
||||||
_fileManager = [[NSFileManager alloc] init];
|
_fileManager = [[NSFileManager alloc] init];
|
||||||
@ -127,9 +124,6 @@
|
|||||||
[_feedbackDir release], _feedbackDir = nil;
|
[_feedbackDir release], _feedbackDir = nil;
|
||||||
[_settingsFile release], _settingsFile = nil;
|
[_settingsFile release], _settingsFile = nil;
|
||||||
|
|
||||||
[_activityImage release];
|
|
||||||
[_activityTitle release];
|
|
||||||
|
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user