Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public class AppSplashActivity extends Activity

private Subscription subscribe;

private AnimatorSet mSplashSet;

@Override
protected void onCreate(Bundle savedInstanceState)
{
Expand Down Expand Up @@ -65,11 +67,11 @@ private void startAnim()
ObjectAnimator animatorX = ObjectAnimator.ofFloat(mSplashImage, "scaleX", 1f, SCALE_END);
ObjectAnimator animatorY = ObjectAnimator.ofFloat(mSplashImage, "scaleY", 1f, SCALE_END);

AnimatorSet set = new AnimatorSet();
set.setDuration(ANIMATION_TIME).play(animatorX).with(animatorY);
set.start();
mSplashSet = new AnimatorSet();
mSplashSet.setDuration(ANIMATION_TIME).play(animatorX).with(animatorY);
mSplashSet.start();

set.addListener(new AnimatorListenerAdapter()
mSplashSet.addListener(new AnimatorListenerAdapter()
{

@Override
Expand All @@ -92,6 +94,9 @@ public void onBackPressed()
{
subscribe.unsubscribe();
}
if (mSplashSet != null) {
mSplashSet.removeAllListeners();
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.widget.Toolbar;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.MenuItem;
import android.view.View;
Expand Down Expand Up @@ -198,7 +199,7 @@ public void changIndex(int changNum, String title, MenuItem item)
}


public void switchFragment(Fragment fragment)
private void switchFragment(Fragment fragment)
{

FragmentTransaction trx = getSupportFragmentManager().beginTransaction();
Expand All @@ -218,7 +219,12 @@ public boolean onKeyDown(int keyCode, KeyEvent event)

if (keyCode == KeyEvent.KEYCODE_BACK)
{
logoutApp();

if (mNavigationView.isShown()) {
mDrawerLayout.closeDrawer(Gravity.START);
} else {
logoutApp();
}
}

return true;
Expand Down