MainPage.ets 1014 Bytes
import { BottomNavigationComponent} from 'wdComponent';
import { BreakpointConstants } from 'wdConstant';

import { BreakpointSystem, Logger } from 'wdKit';

const TAG = 'MainPage';

@Entry
@Component
struct MainPage {
  private breakpointSystem: BreakpointSystem = new BreakpointSystem()
  @StorageLink('currentBreakpoint') @Watch('watchCurrentBreakpoint') currentBreakpoint: string = BreakpointConstants.BREAKPOINT_XS;

  watchCurrentBreakpoint() {
    Logger.info(TAG, `watchCurrentBreakpoint, this.currentBreakpoint: ${this.currentBreakpoint}`);
  }

  aboutToAppear() {
    this.breakpointSystem.register()
    Logger.info(TAG, `aboutToAppear `);
  }

  aboutToDisappear() {
    this.breakpointSystem.unregister()
    Logger.info(TAG, 'aboutToDisappear');
  }

  onPageShow() {
    Logger.info(TAG, 'onPageShow');
  }

  onPageHide() {
    Logger.info(TAG, 'onPageHide');
  }

  onBackPress() {
    Logger.info(TAG, 'onBackPress');
  }

  build() {
    Column() {
      BottomNavigationComponent()
    }
  }
}