Example #1
0
  @Override
  public void onStart() {
    super.onStart();
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    ViewUtils.setToolbarAndStatusBarColor(getSupportActionBar(), getWindow(), mToolbarColor);
  }
Example #2
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    if (MizLib.hasKitKat()) {
      setTheme(R.style.Mizuu_Theme_Translucent_FullScreen);
    } else {
      setTheme(R.style.Mizuu_Theme_Transparent_FullScreen);
    }

    ViewUtils.setupWindowFlagsForStatusbarOverlay(getWindow(), true);

    mToolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(mToolbar);

    ViewUtils.setProperToolbarSize(this, mToolbar);

    getSupportActionBar()
        .setBackgroundDrawable(getResources().getDrawable(R.drawable.transparent_actionbar));

    mBus = MizuuApplication.getBus();

    mPortraitPhotos = getIntent().getBooleanExtra("portraitPhotos", true);
    mPhotos = getIntent().getStringArrayExtra("photos");

    getSupportActionBar()
        .setTitle(
            (getIntent().getIntExtra("selectedIndex", 0) + 1)
                + " "
                + getString(R.string.of)
                + " "
                + mPhotos.length);

    mViewPager = (ViewPager) findViewById(R.id.awesomepager);
    mViewPager.setPageMargin(MizLib.convertDpToPixels(getApplicationContext(), 16));
    mViewPager.setAdapter(new ActorPhotosAdapter(getSupportFragmentManager()));
    mViewPager.setOnPageChangeListener(
        new SimpleOnPageChangeListener() {
          @Override
          public void onPageSelected(int arg0) {
            getSupportActionBar()
                .setTitle((arg0 + 1) + " " + getString(R.string.of) + " " + mPhotos.length);
          }
        });
    mViewPager.setCurrentItem(getIntent().getIntExtra("selectedIndex", 0));

    View decorView = getWindow().getDecorView();
    decorView.setOnSystemUiVisibilityChangeListener(
        new OnSystemUiVisibilityChangeListener() {
          @Override
          public void onSystemUiVisibilityChange(int visibility) {
            if (visibility == 0) {
              // The UI is visible due to user interaction - let's hide it again after three seconds
              mHandler.postDelayed(mHideSystemUiRunnable, 3000);
            }
          }
        });
  }
Example #3
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    String movieId = getIntent().getExtras().getString("movieId");
    String title = getIntent().getExtras().getString("title");
    mToolbarColor = getIntent().getExtras().getInt(IntentKeys.TOOLBAR_COLOR);

    getSupportActionBar().setSubtitle(title);

    Fragment frag = getSupportFragmentManager().findFragmentByTag(TAG);
    if (frag == null && savedInstanceState == null) {
      final FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
      ft.replace(R.id.content, ActorBrowserFragment.newInstance(movieId), TAG);
      ft.commit();
    }
  }
Example #4
0
 @Override
 public void onStart() {
   super.onStart();
   getSupportActionBar().setDisplayHomeAsUpEnabled(true);
 }
Example #5
0
  @Override
  public void onPause() {
    super.onPause();

    mBus.unregister(this);
  }
Example #6
0
  @Override
  public void onResume() {
    super.onResume();

    mBus.register(this);
  }