ActiveViewController.m 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. //
  2. // ActiveViewController.m
  3. // RedAnt ERP Mobile
  4. //
  5. // Created by Ray on 12/15/15.
  6. // Copyright © 2015 United Software Applications, Inc. All rights reserved.
  7. //
  8. #import "ActiveViewController.h"
  9. #import "config.h"
  10. #import "AppDelegate.h"
  11. @interface ActiveViewController ()
  12. @end
  13. @implementation ActiveViewController
  14. - (void)viewDidLoad {
  15. [super viewDidLoad];
  16. self.refresh_type = REFRESH_DATA;
  17. // Do any additional setup after loading the view.
  18. }
  19. - (void)didReceiveMemoryWarning {
  20. [super didReceiveMemoryWarning];
  21. // Dispose of any resources that can be recreated.
  22. }
  23. - (void)viewWillAppear:(BOOL)animated
  24. {
  25. [super viewWillAppear:animated];
  26. UIApplication * app = [UIApplication sharedApplication];
  27. AppDelegate *appDelegate = (AppDelegate *)[app delegate];
  28. appDelegate.active_controller = self;
  29. switch (self.refresh_type)
  30. {
  31. case REFRESH_VIEW:
  32. [self reload_container_getdata:false];
  33. break;
  34. case REFRESH_DATA:
  35. [self reload_container_getdata:true];
  36. break;
  37. }
  38. // [[self navigationController] setNavigationBarHidden:YES animated:NO];
  39. }
  40. -(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
  41. {
  42. UIApplication * app = [UIApplication sharedApplication];
  43. AppDelegate *appDelegate = (AppDelegate *)[app delegate];
  44. [appDelegate didRotated];
  45. // UIInterfaceOrientation orientation = [[UIApplication sharedApplication]statusBarOrientation];
  46. // if (UIInterfaceOrientationIsLandscape(orientation)|| UIInterfaceOrientationIsPortrait(orientation))
  47. // {
  48. // self.orientation = orientation;
  49. // [self.collectionview.collectionViewLayout invalidateLayout];
  50. // NSLog(@"routed");
  51. // }
  52. }
  53. -(void) logout
  54. {
  55. self.refresh_type=REFRESH_NONE;
  56. }
  57. -(void) showHidePrice
  58. {
  59. // [self reload_container_getdata:false];
  60. }
  61. -(void) refresh_on_login
  62. {
  63. UIApplication * app = [UIApplication sharedApplication];
  64. AppDelegate *appDelegate = (AppDelegate *)[app delegate];
  65. if(self==appDelegate.active_controller)
  66. {
  67. [self reload_container_getdata:true];
  68. }
  69. else
  70. self.refresh_type = REFRESH_DATA;
  71. }
  72. -(void) reload_container_getdata:(bool) update_data
  73. {
  74. self.refresh_type=REFRESH_NONE;
  75. }
  76. -(void)refresh_btn_click:(UILongPressGestureRecognizer*)gestureRecognizer
  77. {
  78. [self reload_container_getdata:true];
  79. }
  80. /*
  81. #pragma mark - Navigation
  82. // In a storyboard-based application, you will often want to do a little preparation before navigation
  83. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  84. // Get the new view controller using [segue destinationViewController].
  85. // Pass the selected object to the new view controller.
  86. }
  87. */
  88. #pragma mark - Support scanner
  89. -(void) OnUpdateDevicesList
  90. {
  91. }
  92. -(void) onDecodedData:(NSString*) value
  93. {
  94. }
  95. -(void) onErrorInfo:(NSString*) errorInfo
  96. {
  97. }
  98. -(void) onStatusChanged:(NSString*) status
  99. {
  100. }
  101. -(void) onLogUpdate
  102. {
  103. }
  104. @end