Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2018-06-06 17:41:19 +02:00
parent 464a697082
commit 5b93317440
3 changed files with 6 additions and 21 deletions

View File

@ -53,7 +53,6 @@ import org.greenrobot.eventbus.ThreadMode;
import java.security.cert.CertificateParsingException;
import java.security.cert.X509Certificate;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
@ -109,6 +108,11 @@ public final class MainActivity extends AppCompatActivity implements ActionBarPr
}
if (getIntent().hasExtra(BundleKeys.KEY_FROM_NOTIFICATION_START_CALL)) {
if (!router.hasRootController()) {
router.setRoot(RouterTransaction.with(new MagicBottomNavigationController())
.pushChangeHandler(new HorizontalChangeHandler())
.popChangeHandler(new HorizontalChangeHandler()));
}
onNewIntent(getIntent());
} else if (!router.hasRootController()) {
if (hasDb) {
@ -136,14 +140,6 @@ public final class MainActivity extends AppCompatActivity implements ActionBarPr
super.onNewIntent(intent);
if (intent.hasExtra(BundleKeys.KEY_FROM_NOTIFICATION_START_CALL)) {
List<RouterTransaction> newBackstack = new ArrayList<>();
newBackstack.add(RouterTransaction.with(new MagicBottomNavigationController())
.pushChangeHandler(new HorizontalChangeHandler())
.popChangeHandler(new HorizontalChangeHandler()));
router.setBackstack(newBackstack, new HorizontalChangeHandler());
router.pushController(RouterTransaction.with(new ChatController(intent.getExtras()))
.pushChangeHandler(new HorizontalChangeHandler())
.popChangeHandler(new HorizontalChangeHandler()));

View File

@ -48,9 +48,6 @@ import android.widget.AbsListView;
import android.widget.ImageView;
import com.amulyakhare.textdrawable.TextDrawable;
import com.bluelinelabs.conductor.RouterTransaction;
import com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler;
import com.bluelinelabs.conductor.changehandler.VerticalChangeHandler;
import com.bumptech.glide.load.DataSource;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.load.engine.GlideException;
@ -494,13 +491,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
@Override
public void onNext(GenericOverall genericOverall) {
if (getRouter().hasRootController()) {
getRouter().popToRoot(new VerticalChangeHandler());
} else {
getRouter().setRoot(RouterTransaction.with(new MagicBottomNavigationController())
.pushChangeHandler(new HorizontalChangeHandler())
.popChangeHandler(new HorizontalChangeHandler()));
}
getRouter().popToRoot();
}
@Override

View File

@ -125,10 +125,8 @@ public class NotificationJob extends Job {
if (hasChatSupport) {
intent = new Intent(context, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
} else {
intent = new Intent(context, CallActivity.class);
bundle.putBoolean(BundleKeys.KEY_FROM_NOTIFICATION_START_CALL, true);
}
bundle.putString(BundleKeys.KEY_ROOM_ID, decryptedPushMessage.getId());