| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- //
- // ActiveViewController.m
- // RedAnt ERP Mobile
- //
- // Created by Ray on 12/15/15.
- // Copyright © 2015 United Software Applications, Inc. All rights reserved.
- //
- #import "ActiveViewController.h"
- #import "config.h"
- #import "AppDelegate.h"
- @interface ActiveViewController ()
- @end
- @implementation ActiveViewController
- - (void)viewDidLoad {
- [super viewDidLoad];
-
- self.refresh_type = REFRESH_DATA;
- // Do any additional setup after loading the view.
- }
- - (void)didReceiveMemoryWarning {
- [super didReceiveMemoryWarning];
- // Dispose of any resources that can be recreated.
- }
- - (void)viewWillAppear:(BOOL)animated
- {
- [super viewWillAppear:animated];
-
- UIApplication * app = [UIApplication sharedApplication];
- AppDelegate *appDelegate = (AppDelegate *)[app delegate];
-
- appDelegate.active_controller = self;
-
-
- switch (self.refresh_type)
- {
- case REFRESH_VIEW:
- [self reload_container_getdata:false];
-
- break;
- case REFRESH_DATA:
- [self reload_container_getdata:true];
-
- break;
- }
- // [[self navigationController] setNavigationBarHidden:YES animated:NO];
-
-
- }
- -(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
- {
- UIApplication * app = [UIApplication sharedApplication];
- AppDelegate *appDelegate = (AppDelegate *)[app delegate];
- [appDelegate didRotated];
-
- // UIInterfaceOrientation orientation = [[UIApplication sharedApplication]statusBarOrientation];
- // if (UIInterfaceOrientationIsLandscape(orientation)|| UIInterfaceOrientationIsPortrait(orientation))
- // {
- // self.orientation = orientation;
- // [self.collectionview.collectionViewLayout invalidateLayout];
- // DebugLog(@"routed");
- // }
-
-
-
-
- }
- -(void) logout
- {
- self.refresh_type=REFRESH_NONE;
- }
- -(void) showHidePrice
- {
- // [self reload_container_getdata:false];
- }
- -(void) refresh_on_login
- {
- UIApplication * app = [UIApplication sharedApplication];
- AppDelegate *appDelegate = (AppDelegate *)[app delegate];
- if(self==appDelegate.active_controller)
- {
- [self reload_container_getdata:true];
- }
- else
- self.refresh_type = REFRESH_DATA;
- }
- -(void) reload_container_getdata:(bool) update_data
- {
- self.refresh_type=REFRESH_NONE;
-
- }
- -(void)refresh_btn_click:(UILongPressGestureRecognizer*)gestureRecognizer
- {
- [self reload_container_getdata:true];
- }
- /*
- #pragma mark - Navigation
-
- // In a storyboard-based application, you will often want to do a little preparation before navigation
- - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
- // Get the new view controller using [segue destinationViewController].
- // Pass the selected object to the new view controller.
- }
- */
- #pragma mark - Support scanner
- -(void) OnUpdateDevicesList
- {
-
- }
- -(void) onDecodedData:(NSString*) value
- {
-
- }
- -(void) onErrorInfo:(NSString*) errorInfo
- {
-
- }
- -(void) onStatusChanged:(NSString*) status
- {
-
- }
- -(void) onLogUpdate
- {
-
- }
- @end
|