mirror of
https://github.com/k0shk0sh/FastHub.git
synced 2026-01-25 14:47:05 +00:00
removed join slack from login and added to mainActivity
This commit is contained in:
parent
094b6d96e8
commit
dc6bcf3a04
@ -123,7 +123,11 @@ public class LoginActivity extends BaseActivity<LoginMvp.View, LoginPresenter> i
|
||||
|
||||
@Override public void onSuccessfullyLoggedIn() {
|
||||
hideProgress();
|
||||
new SlackBottomSheetDialog().show(getSupportFragmentManager(), "SlackBottomSheetDialog");
|
||||
Intent intent = new Intent(this, MainActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
intent.putExtra(SlackBottomSheetDialog.TAG, true);
|
||||
startActivity(intent);
|
||||
finishAffinity();
|
||||
}
|
||||
|
||||
@Override protected void onCreate(Bundle savedInstanceState) {
|
||||
@ -182,13 +186,6 @@ public class LoginActivity extends BaseActivity<LoginMvp.View, LoginPresenter> i
|
||||
login.show();
|
||||
}
|
||||
|
||||
@Override public void onDismissed() {
|
||||
Intent intent = new Intent(this, MainActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
startActivity(intent);
|
||||
finishAffinity();
|
||||
}
|
||||
|
||||
private void doLogin() {
|
||||
if (progress == null || twoFactor == null || username == null || password == null) return;
|
||||
if (progress.getVisibility() == View.GONE) {
|
||||
|
||||
@ -8,7 +8,6 @@ import android.support.annotation.Nullable;
|
||||
import com.fastaccess.data.dao.AccessTokenModel;
|
||||
import com.fastaccess.data.dao.model.Login;
|
||||
import com.fastaccess.ui.base.mvp.BaseMvp;
|
||||
import com.fastaccess.ui.modules.settings.SlackBottomSheetDialog;
|
||||
|
||||
/**
|
||||
* Created by Kosh on 09 Nov 2016, 9:41 PM
|
||||
@ -16,7 +15,7 @@ import com.fastaccess.ui.modules.settings.SlackBottomSheetDialog;
|
||||
|
||||
public interface LoginMvp {
|
||||
|
||||
interface View extends BaseMvp.FAView, SlackBottomSheetDialog.SlackDialogListener {
|
||||
interface View extends BaseMvp.FAView {
|
||||
|
||||
void onRequire2Fa();
|
||||
|
||||
|
||||
@ -21,6 +21,7 @@ import com.fastaccess.ui.modules.main.issues.pager.MyIssuesPagerFragment;
|
||||
import com.fastaccess.ui.modules.main.pullrequests.pager.MyPullsPagerFragment;
|
||||
import com.fastaccess.ui.modules.notification.NotificationActivity;
|
||||
import com.fastaccess.ui.modules.search.SearchActivity;
|
||||
import com.fastaccess.ui.modules.settings.SlackBottomSheetDialog;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.OnClick;
|
||||
@ -59,6 +60,11 @@ public class MainActivity extends BaseActivity<MainMvp.View, MainPresenter> impl
|
||||
|
||||
@Override protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
if (savedInstanceState == null) {
|
||||
if (getIntent() != null && getIntent().getBooleanExtra(SlackBottomSheetDialog.TAG, false)) {
|
||||
new SlackBottomSheetDialog().show(getSupportFragmentManager(), SlackBottomSheetDialog.TAG);
|
||||
}
|
||||
}
|
||||
selectHome(false);
|
||||
hideShowShadow(navType == MainMvp.FEEDS);
|
||||
setToolbarIcon(R.drawable.ic_menu);
|
||||
|
||||
@ -21,11 +21,12 @@ import butterknife.OnClick;
|
||||
*/
|
||||
|
||||
public class SlackBottomSheetDialog extends BaseBottomSheetDialog {
|
||||
|
||||
public interface SlackDialogListener {
|
||||
void onDismissed();
|
||||
}
|
||||
|
||||
public static final String TAG = SlackBottomSheetDialog.class.getSimpleName();
|
||||
|
||||
@BindView(R.id.title) FontTextView title;
|
||||
@BindView(R.id.message) FontTextView message;
|
||||
@BindView(R.id.cancel) FontButton cancel;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user