mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
misc: add ANIMATED macro
This commit is contained in:
parent
be3a94e20c
commit
9d4a76f0c2
10 changed files with 38 additions and 59 deletions
|
|
@ -285,7 +285,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
}
|
||||
|
||||
// Animation
|
||||
if (animation && [[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"] == true) {
|
||||
if (animation && ANIMATED) {
|
||||
CATransition *trans = [CATransition animation];
|
||||
[trans setType:kCATransitionPush];
|
||||
[trans setDuration:0.35];
|
||||
|
|
|
|||
|
|
@ -93,9 +93,9 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
- (IBAction)onRoutesClick:(id)sender {
|
||||
if ([_routesView isHidden]) {
|
||||
[self hideRoutes:FALSE animated:[[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"]];
|
||||
[self hideRoutes:FALSE animated:ANIMATED];
|
||||
} else {
|
||||
[self hideRoutes:TRUE animated:[[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"]];
|
||||
[self hideRoutes:TRUE animated:ANIMATED];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -674,9 +674,9 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
|
|||
|
||||
- (IBAction)onNumpadClick:(id)sender {
|
||||
if ([_numpadView isHidden]) {
|
||||
[self hidePad:FALSE animated:[[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"]];
|
||||
[self hidePad:FALSE animated:ANIMATED];
|
||||
} else {
|
||||
[self hidePad:TRUE animated:[[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"]];
|
||||
[self hidePad:TRUE animated:ANIMATED];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -703,9 +703,9 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
|
|||
|
||||
- (IBAction)onRoutesClick:(id)sender {
|
||||
if ([_routesView isHidden]) {
|
||||
[self hideRoutes:FALSE animated:[[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"]];
|
||||
[self hideRoutes:FALSE animated:ANIMATED];
|
||||
} else {
|
||||
[self hideRoutes:TRUE animated:[[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"]];
|
||||
[self hideRoutes:TRUE animated:ANIMATED];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -731,9 +731,9 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
|
|||
|
||||
- (IBAction)onOptionsClick:(id)sender {
|
||||
if ([_optionsView isHidden]) {
|
||||
[self hideOptions:FALSE animated:[[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"]];
|
||||
[self hideOptions:FALSE animated:ANIMATED];
|
||||
} else {
|
||||
[self hideOptions:TRUE animated:[[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"]];
|
||||
[self hideOptions:TRUE animated:ANIMATED];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -364,17 +364,13 @@
|
|||
|
||||
// advanced section
|
||||
{
|
||||
[self setBool:[lm lpConfigBoolForKey:@"debugenable_preference" withDefault:NO]
|
||||
forKey:@"debugenable_preference"];
|
||||
[self setBool:[lm lpConfigBoolForKey:@"animations_preference" withDefault:NO] forKey:@"animations_preference"];
|
||||
[self setBool:[lm lpConfigBoolForKey:@"backgroundmode_preference" withDefault:NO]
|
||||
forKey:@"backgroundmode_preference"];
|
||||
[self setBool:[lm lpConfigBoolForKey:@"start_at_boot_preference" withDefault:NO]
|
||||
forKey:@"start_at_boot_preference"];
|
||||
[self setBool:[lm lpConfigBoolForKey:@"autoanswer_notif_preference" withDefault:NO]
|
||||
forKey:@"autoanswer_notif_preference"];
|
||||
[self setBool:[lm lpConfigBoolForKey:@"debugenable_preference"] forKey:@"debugenable_preference"];
|
||||
[self setBool:ANIMATED forKey:@"animations_preference"];
|
||||
[self setBool:[lm lpConfigBoolForKey:@"backgroundmode_preference"] forKey:@"backgroundmode_preference"];
|
||||
[self setBool:[lm lpConfigBoolForKey:@"start_at_boot_preference"] forKey:@"start_at_boot_preference"];
|
||||
[self setBool:[lm lpConfigBoolForKey:@"autoanswer_notif_preference"] forKey:@"autoanswer_notif_preference"];
|
||||
[self setBool:[lm lpConfigBoolForKey:@"show_msg_in_notif" withDefault:YES] forKey:@"show_msg_in_notif"];
|
||||
[self setBool:[lm lpConfigBoolForKey:@"enable_first_login_view_preference" withDefault:NO]
|
||||
[self setBool:[lm lpConfigBoolForKey:@"enable_first_login_view_preference"]
|
||||
forKey:@"enable_first_login_view_preference"];
|
||||
LinphoneAddress *parsed = linphone_core_get_primary_contact_parsed(lc);
|
||||
if (parsed != NULL) {
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@
|
|||
: -selectedNewFrame.size.height /*hide it if none is selected*/))));
|
||||
}
|
||||
|
||||
CGFloat delay = [[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"] ? 0.3 : 0;
|
||||
CGFloat delay = ANIMATED ? 0.3 : 0;
|
||||
[UIView animateWithDuration:delay
|
||||
animations:^{
|
||||
_selectedButtonImage.frame = selectedNewFrame;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ INIT_WITH_COMMON_CF {
|
|||
}
|
||||
|
||||
- (void)settingsUpdate:(NSNotification *)notif {
|
||||
if ([[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"] == false) {
|
||||
if (ANIMATED == false) {
|
||||
[self stopAnimating:NO];
|
||||
} else {
|
||||
if (![self isHidden]) {
|
||||
|
|
@ -105,7 +105,7 @@ INIT_WITH_COMMON_CF {
|
|||
}
|
||||
|
||||
[self setHidden:FALSE];
|
||||
if ([[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"] == true) {
|
||||
if (ANIMATED) {
|
||||
if (animated) {
|
||||
[self appearAnimation:kAppearAnimation
|
||||
target:self
|
||||
|
|
|
|||
|
|
@ -26,8 +26,6 @@
|
|||
#define LOGE(...) LOGV(ORTP_ERROR, __VA_ARGS__)
|
||||
#define LOGF(...) LOGV(ORTP_FATAL, __VA_ARGS__)
|
||||
|
||||
#define IPAD (LinphoneManager.runningOnIpad)
|
||||
|
||||
@interface LinphoneLogger : NSObject {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ static RootViewManager *rootViewManagerInstance = nil;
|
|||
currentViewController = newMainView;
|
||||
LinphoneAppDelegate *delegate = (LinphoneAppDelegate *)[UIApplication sharedApplication].delegate;
|
||||
|
||||
if ([[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"] == true) {
|
||||
if (ANIMATED) {
|
||||
[UIView transitionWithView:delegate.window
|
||||
duration:0.3
|
||||
options:UIViewAnimationOptionTransitionFlipFromLeft | UIViewAnimationOptionAllowAnimatedContent
|
||||
|
|
@ -544,14 +544,26 @@ static RootViewManager *rootViewManagerInstance = nil;
|
|||
[mainViewController setFullscreen:enabled];
|
||||
}
|
||||
|
||||
- (UIViewController *)popCurrentView {
|
||||
NSMutableArray *viewStack = [RootViewManager instance].viewDescriptionStack;
|
||||
if ([viewStack count] > 1) {
|
||||
LOGI(@"PhoneMainView: Popping view %@, going to %@", currentView, viewStack.lastObject);
|
||||
[viewStack removeLastObject];
|
||||
[self _changeCurrentView:[viewStack lastObject]
|
||||
transition:[PhoneMainView getBackwardTransition]
|
||||
animated:ANIMATED];
|
||||
return [mainViewController getCurrentViewController];
|
||||
}
|
||||
LOGW(@"PhoneMainView: Trying to pop view but none stacked!");
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void)changeCurrentView:(UICompositeViewDescription *)view {
|
||||
[self changeCurrentView:view push:TRUE];
|
||||
}
|
||||
|
||||
- (void)changeCurrentView:(UICompositeViewDescription *)view push:(BOOL)push {
|
||||
[self changeCurrentView:view
|
||||
push:push
|
||||
animated:[[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"]];
|
||||
[self changeCurrentView:view push:push animated:ANIMATED];
|
||||
}
|
||||
|
||||
- (void)changeCurrentView:(UICompositeViewDescription *)view push:(BOOL)push animated:(BOOL)animated {
|
||||
|
|
@ -562,24 +574,10 @@ static RootViewManager *rootViewManagerInstance = nil;
|
|||
[self _changeCurrentView:view transition:nil animated:animated];
|
||||
}
|
||||
|
||||
- (BOOL)isUnauthorizedView:(UICompositeViewDescription *)view {
|
||||
return [[LinphoneManager.instance lpConfigStringForKey:@"unauthorized_views"] containsString:view.name];
|
||||
}
|
||||
|
||||
- (UIViewController *)_changeCurrentView:(UICompositeViewDescription *)view
|
||||
transition:(CATransition *)transition
|
||||
animated:(BOOL)animated {
|
||||
PhoneMainView *vc = [[RootViewManager instance] setViewControllerForDescription:view];
|
||||
|
||||
if ([self isUnauthorizedView:view]) {
|
||||
NSString *fallback = [LinphoneManager.instance lpConfigStringForKey:@"fallback_view"];
|
||||
UICompositeViewDescription *fallback_view = DialerView.compositeViewDescription;
|
||||
if (fallback && [NSClassFromString(fallback) respondsToSelector:@selector(compositeViewDescription)]) {
|
||||
fallback_view = [NSClassFromString(fallback) performSelector:@selector(compositeViewDescription)];
|
||||
}
|
||||
LOGW(@"Trying to access unauthorized view %@, going back to %@", view.name, fallback_view.name);
|
||||
view = fallback_view;
|
||||
}
|
||||
if (![view equal:vc.currentView] || vc != self) {
|
||||
LOGI(@"Change current view to %@", view.name);
|
||||
if (animated && transition == nil)
|
||||
|
|
@ -605,7 +603,7 @@ static RootViewManager *rootViewManagerInstance = nil;
|
|||
}
|
||||
return [self _changeCurrentView:[viewStack lastObject]
|
||||
transition:[PhoneMainView getBackwardTransition]
|
||||
animated:[[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"]];
|
||||
animated:ANIMATED];
|
||||
}
|
||||
|
||||
- (UICompositeViewDescription *)firstView {
|
||||
|
|
@ -617,20 +615,6 @@ static RootViewManager *rootViewManagerInstance = nil;
|
|||
return view;
|
||||
}
|
||||
|
||||
- (UIViewController *)popCurrentView {
|
||||
NSMutableArray *viewStack = [RootViewManager instance].viewDescriptionStack;
|
||||
if ([viewStack count] > 1) {
|
||||
LOGI(@"PhoneMainView: Pop view");
|
||||
[viewStack removeLastObject];
|
||||
[self _changeCurrentView:[viewStack lastObject]
|
||||
transition:[PhoneMainView getBackwardTransition]
|
||||
animated:[[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"]];
|
||||
return [mainViewController getCurrentViewController];
|
||||
}
|
||||
LOGW(@"PhoneMainView: Trying to pop view but none stacked!");
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void)displayCallError:(LinphoneCall *)call message:(NSString *)message {
|
||||
const char *lUserNameChars = linphone_address_get_username(linphone_call_get_remote_address(call));
|
||||
NSString *lUserName =
|
||||
|
|
|
|||
|
|
@ -19,6 +19,9 @@
|
|||
|
||||
#import "LinphoneManager.h"
|
||||
|
||||
#define IPAD (LinphoneManager.runningOnIpad)
|
||||
#define ANIMATED ([LinphoneManager.instance lpConfigBoolForKey:@"animations_preference"])
|
||||
|
||||
@interface LinphoneUtils : NSObject
|
||||
|
||||
+ (BOOL)findAndResignFirstResponder:(UIView*)view;
|
||||
|
|
|
|||
|
|
@ -17,8 +17,6 @@ display_filter_auto_rotate=0
|
|||
#contact_filter_on_default_domain=1
|
||||
#use_phone_number=0
|
||||
send_logs_include_linphonerc_and_chathistory=0
|
||||
fallback_view=DialerView
|
||||
unauthorized_views=FirstView
|
||||
|
||||
[assistant]
|
||||
username_regex=^[a-z0-9_.\-]*$
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue