Beispiel #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();
  }