close drawer when clicking on own profile and adding account

closes #948
This commit is contained in:
Conny Duck 2018-12-05 22:37:04 +01:00
parent aae72205c3
commit f87b87bea3

View file

@ -21,6 +21,7 @@ import android.graphics.Color;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton; import android.support.design.widget.FloatingActionButton;
@ -393,11 +394,13 @@ public final class MainActivity extends BottomSheetActivity implements ActionBut
if (current && activeAccount != null) { if (current && activeAccount != null) {
Intent intent = AccountActivity.getIntent(this, activeAccount.getAccountId()); Intent intent = AccountActivity.getIntent(this, activeAccount.getAccountId());
startActivityWithSlideInAnimation(intent); startActivityWithSlideInAnimation(intent);
new Handler().postDelayed(() -> drawer.closeDrawer(), 100);
return true; return true;
} }
//open LoginActivity to add new account //open LoginActivity to add new account
if (profile.getIdentifier() == DRAWER_ITEM_ADD_ACCOUNT) { if (profile.getIdentifier() == DRAWER_ITEM_ADD_ACCOUNT) {
startActivityWithSlideInAnimation(LoginActivity.getIntent(this, true)); startActivityWithSlideInAnimation(LoginActivity.getIntent(this, true));
new Handler().postDelayed(() -> drawer.closeDrawer(), 100);
return true; return true;
} }
//change Account //change Account