Search in sources :

Example 1 with MagicBottomNavigationController

use of com.nextcloud.talk.controllers.MagicBottomNavigationController in project talk-android by nextcloud.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    NextcloudTalkApplication.getSharedApplication().getComponentApplication().inject(this);
    ButterKnife.bind(this);
    setSupportActionBar(toolbar);
    router = Conductor.attachRouter(this, container, savedInstanceState);
    boolean hasDb = true;
    try {
        sqlCipherDatabaseSource.getWritableDatabase();
    } catch (Exception exception) {
        hasDb = false;
    }
    if (!router.hasRootController()) {
        if (hasDb) {
            if (userUtils.anyUserExists()) {
                router.setRoot(RouterTransaction.with(new MagicBottomNavigationController()).pushChangeHandler(new HorizontalChangeHandler()).popChangeHandler(new HorizontalChangeHandler()));
            } else {
                router.setRoot(RouterTransaction.with(new ServerSelectionController()).pushChangeHandler(new HorizontalChangeHandler()).popChangeHandler(new HorizontalChangeHandler()));
            }
        } else {
            router.setRoot(RouterTransaction.with(new ServerSelectionController()).pushChangeHandler(new HorizontalChangeHandler()).popChangeHandler(new HorizontalChangeHandler()));
        }
    }
}
Also used : ServerSelectionController(com.nextcloud.talk.controllers.ServerSelectionController) MagicBottomNavigationController(com.nextcloud.talk.controllers.MagicBottomNavigationController) HorizontalChangeHandler(com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler) CertificateParsingException(java.security.cert.CertificateParsingException)

Aggregations

HorizontalChangeHandler (com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler)1 MagicBottomNavigationController (com.nextcloud.talk.controllers.MagicBottomNavigationController)1 ServerSelectionController (com.nextcloud.talk.controllers.ServerSelectionController)1 CertificateParsingException (java.security.cert.CertificateParsingException)1