use of de.tum.in.tumcampusapp.component.ui.overview.MainActivity in project TumCampusApp by TCA-Team.
the class BaseActivity method setUpToolbar.
public void setUpToolbar() {
String parent = NavUtils.getParentActivityName(this);
Toolbar toolbar = findViewById(R.id.main_toolbar);
setSupportActionBar(toolbar);
if (getSupportActionBar() != null && (parent != null || this instanceof MainActivity)) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
}
}
use of de.tum.in.tumcampusapp.component.ui.overview.MainActivity in project TumCampusApp by TCA-Team.
the class StartupActivity method startApp.
/**
* Animates the TUM logo into place (left upper corner) and animates background up.
* Afterwards {@link MainActivity} gets started
*/
private void startApp() {
// Get views to be moved
final View background = findViewById(R.id.startup_background);
final ImageView tumLogo = findViewById(R.id.startup_tum_logo);
final TextView loadingText = findViewById(R.id.startup_loading);
final TextView first = findViewById(R.id.startup_loading_first);
// Make some position calculations
final int actionBarHeight = getActionBarHeight();
final float screenHeight = background.getHeight();
// Setup animation
AnimatorSet set = new AnimatorSet();
set.playTogether(ObjectAnimator.ofFloat(background, "translationY", background.getTranslationX(), actionBarHeight - screenHeight), ObjectAnimator.ofFloat(tumLogo, "alpha", 1, 0, 0), ObjectAnimator.ofFloat(loadingText, "alpha", 1, 0, 0), ObjectAnimator.ofFloat(first, "alpha", 1, 0, 0), ObjectAnimator.ofFloat(tumLogo, "translationY", 0, -screenHeight / 3), ObjectAnimator.ofFloat(loadingText, "translationY", 0, -screenHeight / 3), ObjectAnimator.ofFloat(first, "translationY", 0, -screenHeight / 3));
set.setInterpolator(new AccelerateDecelerateInterpolator());
set.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
// NOOP
}
@Override
public void onAnimationEnd(Animator animation) {
// Start the demo Activity if demo mode is set
Intent intent = new Intent(StartupActivity.this, MainActivity.class);
startActivity(intent);
finish();
overridePendingTransition(R.anim.fadein, R.anim.fadeout);
}
@Override
public void onAnimationCancel(Animator animation) {
// NOOP
}
@Override
public void onAnimationRepeat(Animator animation) {
// NOOP
}
});
set.start();
}
Aggregations