Пример #1
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow()
        .addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); // TODO only if setting says so

    mRideUri = getIntent().getData();

    setContentView(R.layout.display);

    mChkRecord = (CheckableRelativeLayout) findViewById(R.id.chkRecord);
    mChkRecord.setEnabled(false);
    mChkRecordText = (TextView) findViewById(R.id.chkRecord_text);
    mChkRecordTextAnimator = AnimatorInflater.loadAnimator(this, R.animator.blink);
    mChkRecordTextAnimator.setTarget(mChkRecordText);
    mImgGpsStatus = (ImageView) findViewById(R.id.imgGpsStatus);
    ((AnimationDrawable) mImgGpsStatus.getDrawable()).start();
    findViewById(R.id.vieFragmentCycle).setOnTouchListener(mFragmentCycleOnTouchListener);
    mConTabsA = findViewById(R.id.conTabsA);
    mConTabsB = findViewById(R.id.conTabsB);
    mConFragments = findViewById(R.id.conFragments);
    mTxtTitle = (TextView) findViewById(R.id.txtTitle);

    setupFragments(
        savedInstanceState == null
            ? 0
            : savedInstanceState.getInt("mFragmentCycler.currentVisibleIndex"));

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
      setupNavigationBarHiding();
    }
    scheduleHideControls();

    setupFragmentContainer();
  }
Пример #2
0
  @Override
  protected void onStop() {
    // GPS status
    LocationManager.get().removeStatusListener(mGpsStatusListener);

    // Ride
    RideManager.get().removeListener(mRideListener);

    super.onStop();
  }
Пример #3
0
  @Override
  protected void onStart() {
    super.onStart();

    toggleRecordingIfActive();

    // GPS status
    LocationManager.get().addStatusListener(mGpsStatusListener);

    // Ride
    RideManager.get().addListener(mRideListener);
  }
Пример #4
0
 @Override
 protected void onSaveInstanceState(Bundle outState) {
   outState.putInt(
       "mFragmentCycler.currentVisibleIndex", mFragmentCycler.getCurrentVisibleIndex());
   super.onSaveInstanceState(outState);
 }