com.alibaba.android.arouter.launcher.ARouter Java Examples
The following examples show how to use
com.alibaba.android.arouter.launcher.ARouter.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SplashActivity.java From JD-Test with Apache License 2.0 | 6 votes |
@Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_splash); new Handler().postDelayed(new Runnable() { @Override public void run() { if(BuildConfig.DEBUG && !BuildConfig.DEBUG_ALL){ ARouter.getInstance().build("/app/ModuleTestActivity").greenChannel().navigation(SplashActivity.this); }else{ ARouter.getInstance().build("/main/MainActivity").greenChannel().navigation(SplashActivity.this); } finish(); } },2000); }
Example #2
Source File: WebViewClientEx.java From NGA-CLIENT-VER-OPEN-SOURCE with GNU General Public License v2.0 | 6 votes |
private boolean overrideProfileUrlLoading(Context context, String url) { for (String profileStart : NGA_USER_PROFILE_START) if (url.startsWith(profileStart)) { String data = StringUtils.getStringBetween(url, 0, profileStart, NGA_USER_PROFILE_END).result; try { data = URLDecoder.decode(data, "utf-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } if (!StringUtils.isEmpty(data)) { ARouter.getInstance() .build(ARouterConstants.ACTIVITY_PROFILE) .withString("mode", "username") .withString("username", data) .navigation(context); } return true; } return false; }
Example #3
Source File: WelcomeActivity.java From AndroidWallet with GNU General Public License v3.0 | 6 votes |
@SuppressLint("CheckResult") @Override public void initData() { try { Intent intent = getIntent(); BaseInvokeModel baseInvokeModel = new BaseInvokeModel(); baseInvokeModel.setPackageName(intent.getStringExtra("packageName")); baseInvokeModel.setClassName(intent.getStringExtra("className")); baseInvokeModel.setAppName(intent.getStringExtra("appName")); baseInvokeModel.setAction(intent.getStringExtra("action")); Uri uri = intent.getData(); if (uri != null) { baseInvokeModel.setParam(uri.getQueryParameter("param")); } Bundle bundle = new Bundle(); bundle.putSerializable(IntentKeyGlobal.INVOKE_SENDER_INFO, baseInvokeModel); ARouter.getInstance().build(RouterActivityPath.ACTIVITY_MAIN_PATH).with(bundle).navigation(); finish(); } catch (Exception e) { ARouter.getInstance().build(RouterActivityPath.ACTIVITY_MAIN_PATH).navigation(); finish(); } }
Example #4
Source File: TestModuleApplication.java From JD-Test with Apache License 2.0 | 6 votes |
@Override public void onCreate() { super.onCreate(); if (LeakCanary.isInAnalyzerProcess(this)) { return; } if(CommonConfig.DEBUG){ LeakCanary.install(this); ARouter.openLog(); // 打印日志 ARouter.openDebug(); // 开启调试模式(如果在InstantRun模式下运行,必须开启调试模式!线上版本需要关闭,否则有安全风险) } ARouter.init(this); //CrashReport.initCrashReport(getApplicationContext(), "93f0e37549", CommonConfig.DEBUG); Fresco.initialize(this); GlobalAppComponent.init(this); }
Example #5
Source File: SystemSettingActivity.java From AndroidWallet with GNU General Public License v3.0 | 6 votes |
@Override public void onHandleEvent(EventBusCarrier busCarrier) { try { if (TextUtils.equals(EventTypeGlobal.DIALOG_DISMISS_TYPE, busCarrier.getEventType())) { languageDialog.dismiss(); nodeNetDialog.dismiss(); coinTypeDialog.dismiss(); viewModel.languageType.set(LocalManageUtil.getSetLanguageString(Utils.getContext())); } else if (TextUtils.equals(EventTypeGlobal.SWITCH_LANGUAGE, busCarrier.getEventType())) { languageDialog.dismiss(); viewModel.languageType.set(LocalManageUtil.getSetLanguageString(Utils.getContext())); ActivityContainer.finishAllActivity(); ARouter.getInstance().build(RouterActivityPath.ACTIVITY_MAIN_PATH).navigation(); } else if (TextUtils.equals(EventTypeGlobal.SWITCH_NODE_WORK, busCarrier.getEventType())) { NodeInfoModel.DataBean dataBean = (NodeInfoModel.DataBean) busCarrier.getObject(); showDialogEachTime(Utils.getString(R.string.module_mine_node_switching)); reconnect(dataBean); } else if (TextUtils.equals(EventTypeGlobal.SWITCH_COIN_TYPE, busCarrier.getEventType())) { int coinType = (int) busCarrier.getObject(); viewModel.coinType.set(coinType == 0 ? Utils.getString(R.string.module_mine_coin_cny) : Utils.getString(R.string.module_mine_coin_usd)); coinTypeDialog.dismiss(); } } catch (Exception e) { } }
Example #6
Source File: CommonModule.java From JD-Test with Apache License 2.0 | 6 votes |
public static void init(Application application){ if (LeakCanary.isInAnalyzerProcess(application)) { return; } if(BuildConfig.DEBUG){ LeakCanary.install(application); ARouter.openLog(); // 打印日志 ARouter.openDebug(); // 开启调试模式(如果在InstantRun模式下运行,必须开启调试模式!线上版本需要关闭,否则有安全风险) } ARouter.init(application); //CrashReport.initCrashReport(getApplicationContext(), "93f0e37549", CommonConfig.DEBUG); Fresco.initialize(application); GlobalAppComponent.init(application); //平行module初始化 ARouter.getInstance().build("/MainModule/MainModule").navigation(); ARouter.getInstance().build("/TestModule/TestModule").navigation(); }
Example #7
Source File: PublishActivity.java From star-zone-android with Apache License 2.0 | 6 votes |
private void showSelectPhotoPopup() { if (mSelectPhotoMenuPopup == null) { mSelectPhotoMenuPopup = new SelectPhotoMenuPopup(this); mSelectPhotoMenuPopup.setOnSelectPhotoMenuClickListener(new SelectPhotoMenuPopup.OnSelectPhotoMenuClickListener() { @Override public void onShootClick() { PhotoHelper.fromCamera(PublishActivity.this, false); } @Override public void onAlbumClick() { ARouter.getInstance() .build(RouterList.PhotoSelectActivity.path) .withInt(RouterList.PhotoSelectActivity.key_maxSelectCount, mPreviewImageView.getRestPhotoCount()) .navigation(PublishActivity.this, RouterList.PhotoSelectActivity.requestCode); } }); } mSelectPhotoMenuPopup.showPopupWindow(); }
Example #8
Source File: PublishActivity.java From star-zone-android with Apache License 2.0 | 6 votes |
private void initPreviewImageView() { mPreviewImageView.setOnPhotoClickListener(new PreviewImageView.OnPhotoClickListener<ImageInfo>() { @Override public void onPhotoClickListener(int pos, ImageInfo data, @NonNull ImageView imageView) { PhotoBrowserInfo info = PhotoBrowserInfo.create(pos, null, selectedPhotos); ARouter.getInstance() .build(RouterList.PhotoMultiBrowserActivity.path) .withParcelable(RouterList.PhotoMultiBrowserActivity.key_browserinfo, info) .withInt(RouterList.PhotoMultiBrowserActivity.key_maxSelectCount, selectedPhotos.size()) .navigation(PublishActivity.this, RouterList.PhotoMultiBrowserActivity.requestCode); } }); mPreviewImageView.setOnAddPhotoClickListener(new View.OnClickListener() { @Override public void onClick(View v) { showSelectPhotoPopup(); } }); }
Example #9
Source File: AddProfileActivity.java From star-zone-android with Apache License 2.0 | 6 votes |
private void showSelectPhotoPopup() { if (mSelectPhotoMenuPopup == null) { mSelectPhotoMenuPopup = new SelectPhotoMenuPopup(this); mSelectPhotoMenuPopup.setOnSelectPhotoMenuClickListener(new SelectPhotoMenuPopup.OnSelectPhotoMenuClickListener() { @Override public void onShootClick() { PhotoHelper.fromCamera(AddProfileActivity.this, false); } @Override public void onAlbumClick() { ARouter.getInstance() .build(RouterList.PhotoSelectActivity.path) .withInt(RouterList.PhotoSelectActivity.key_maxSelectCount, 1) .navigation(AddProfileActivity.this, RouterList.PhotoSelectActivity.requestCode); } }); } mSelectPhotoMenuPopup.showPopupWindow(); }
Example #10
Source File: L3PostActivity.java From smart-farmer-android with Apache License 2.0 | 6 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_l3_post); ARouter.getInstance().inject(this); initView(); disableSlideBack(); AlbumFile albumFile = getIntent().getParcelableExtra("media"); if (albumFile != null) { defaultContent.pictures.add(albumFile); mPresenter.upload(albumFile); } initContent(); initKeyBoard(); currentPostContent = defaultContent; }
Example #11
Source File: PasswordLoginViewModel.java From AndroidWallet with GNU General Public License v3.0 | 5 votes |
@Override public void call() { if (TextUtils.isEmpty(accountName.get())) { ToastUtils.showShort(R.string.module_login_account_info); return; } if (TextUtils.isEmpty(password.get())) { ToastUtils.showShort(R.string.module_login_password_empty); return; } showDialog(); CocosBcxApiWrapper.getBcxInstance().password_login(accountName.get(), password.get(), new IBcxCallBack() { @Override public void onReceiveValue(final String s) { MainHandler.getInstance().post(new Runnable() { @Override public void run() { Log.i("password_login", s); LoginModel loginModel = GsonSingleInstance.getGsonInstance().fromJson(s, LoginModel.class); if (loginModel.code == 105 || loginModel.code == 104) { ToastUtils.showShort(R.string.module_login_password_error); dismissDialog(); return; } if (!loginModel.isSuccess()) { ToastUtils.showShort(com.cocos.library_base.R.string.net_work_failed); dismissDialog(); return; } AccountHelperUtils.setCurrentAccountName(loginModel.getData().getName()); ARouter.getInstance().build(RouterActivityPath.ACTIVITY_MAIN_PATH).navigation(); finish(); dismissDialog(); } }); } }); }
Example #12
Source File: RoutingHelper.java From Mysplash with GNU Lesser General Public License v3.0 | 5 votes |
public static void startCollectionActivity(Activity a, View avatar, View background, Collection c) { Bundle b = new Bundle(); ActivityOptionsCompat optionsCompat; if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { optionsCompat = ActivityOptionsCompat.makeScaleUpAnimation( background, (int) background.getX(), (int) background.getY(), background.getMeasuredWidth(), background.getMeasuredHeight() ); } else { Recolor.addExtraProperties(background, b); RoundCornerTransition.addExtraProperties(background, b); optionsCompat = ActivityOptionsCompat.makeSceneTransitionAnimation( a, Pair.create(avatar, a.getString(R.string.transition_collection_avatar)), Pair.create(background, a.getString(R.string.transition_collection_background)) ); } ARouter.getInstance() .build(CollectionActivity.COLLECTION_ACTIVITY) .withParcelable(CollectionActivity.KEY_COLLECTION_ACTIVITY_COLLECTION, c) .withBundle(a.getString(R.string.transition_collection_background), b) .withOptionsCompat(optionsCompat) .navigation(a); }
Example #13
Source File: KeyLoginViewModel.java From AndroidWallet with GNU General Public License v3.0 | 5 votes |
@Override public void call() { if (from == 1) { ARouter.getInstance().build(RouterActivityPath.ACTIVITY_REGISTER).navigation(); } else if (from == 2) { ARouter.getInstance().build(RouterActivityPath.ACTIVITY_PASSWORD_LOGIN).navigation(); } finish(); }
Example #14
Source File: HomeMultipleRecycleAdapter.java From JD-Test with Apache License 2.0 | 5 votes |
@Override public boolean onItemChildClick(BaseQuickAdapter adapter, View view, int position) { int id = view.getId(); if(id == R.id.icon_list_one){ ARouter.getInstance().build("/test1/activity").navigation(view.getContext()); } return false; }
Example #15
Source File: RegisterActivity.java From AndroidWallet with GNU General Public License v3.0 | 5 votes |
@Override public void onBackPressed() { super.onBackPressed(); if (from == 3) { ARouter.getInstance().build(RouterActivityPath.ACTIVITY_PASSWORD_LOGIN).navigation(); } finish(); }
Example #16
Source File: AccountManageViewModel.java From AndroidWallet with GNU General Public License v3.0 | 5 votes |
@Override public void call() { Bundle bundle = new Bundle(); bundle.putSerializable(IntentKeyGlobal.DAO_ACCOUNT_MODEL, daoAccount); if (TextUtils.equals(daoAccount.getAccount_type(), "ACCOUNT")) { ARouter.getInstance().build(RouterActivityPath.ACTIVITY_MODIFY_PASSWORD).with(bundle).navigation(); } else { ARouter.getInstance().build(RouterActivityPath.ACTIVITY_RESET_PASSWORD).with(bundle).navigation(); } }
Example #17
Source File: AccountManagerListActivity.java From AndroidWallet with GNU General Public License v3.0 | 5 votes |
@Override public void initViewObservable() { super.initViewObservable(); viewModel.uc.loginViewObservable.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() { @Override public void onPropertyChanged(Observable sender, int propertyId) { ARouter.getInstance().build(RouterActivityPath.ACTIVITY_PASSWORD_LOGIN).navigation(); finish(); } }); }
Example #18
Source File: RoutingHelper.java From Mysplash with GNU Lesser General Public License v3.0 | 5 votes |
public static void startMeActivity(Activity a, View avatar, View background, @ProfilePager.ProfilePagerRule int page) { if (!AuthManager.getInstance().isAuthorized()) { startLoginActivity(a); } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { Bundle b = new Bundle(); RoundCornerTransition.addExtraProperties(background, b); ARouter.getInstance() .build(MeActivity.ME_ACTIVITY) .withInt(MeActivity.KEY_ME_ACTIVITY_PAGE_POSITION, page) .withBundle(a.getString(R.string.transition_me_background), b) .withOptionsCompat( ActivityOptionsCompat.makeSceneTransitionAnimation( a, Pair.create(avatar, a.getString(R.string.transition_me_avatar)), Pair.create(background, a.getString(R.string.transition_me_background)) ) ).navigation(a); } else { ARouter.getInstance() .build(MeActivity.ME_ACTIVITY) .withInt(MeActivity.KEY_ME_ACTIVITY_PAGE_POSITION, page) // .withTransition(R.anim.activity_slide_in, R.anim.none) .navigation(a); } }
Example #19
Source File: ScreenshotWarningViewModel.java From AndroidWallet with GNU General Public License v3.0 | 5 votes |
@Override public void call() { Bundle bundle = new Bundle(); bundle.putString(IntentKeyGlobal.ACCOUNT_PASSWORD, password); ARouter.getInstance().build(RouterActivityPath.ACTIVITY_BACKUP_WALLET).with(bundle).navigation(); finish(); }
Example #20
Source File: MainHomeFragment.java From LQRBiliBlili with MIT License | 5 votes |
@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.main_active: ARouter.getInstance().build("/app/web").withString("url", "http://www.qq.com").navigation(); break; case R.id.main_game: break; case R.id.main_download: break; case R.id.main_search: break; } return super.onOptionsItemSelected(item); }
Example #21
Source File: L4Application.java From smart-farmer-android with Apache License 2.0 | 5 votes |
@Override public void onCreate() { super.onCreate(); if (getApplicationContext().getPackageName().equals(processName)) { //Log日志 KLog.init(BuildConfig.DEBUG); ARouter.init(this); } }
Example #22
Source File: FoundNavItemViewModel.java From AndroidWallet with GNU General Public License v3.0 | 5 votes |
@Override public void call() { if (TextUtils.isEmpty(foundNavModel.getNavUrl())) { ToastUtils.showShort(R.string.module_found_to_be_expected); return; } WebViewModel webViewModel = new WebViewModel(); webViewModel.setTitle(foundNavModel.getNavTitle()); webViewModel.setUrl(foundNavModel.getNavUrl()); Bundle bundle = new Bundle(); bundle.putSerializable(IntentKeyGlobal.WEB_MODEL, webViewModel); ARouter.getInstance().build(RouterActivityPath.ACTIVITY_JS_WEB).with(bundle).navigation(); }
Example #23
Source File: AboutModuleIMP.java From Mysplash with GNU Lesser General Public License v3.0 | 5 votes |
@Override public void startAboutActivity(Activity a) { ARouter.getInstance() .build(AboutActivity.ABOUT_ACTIVITY) // .withTransition(R.anim.activity_slide_in, R.anim.none) .navigation(a); }
Example #24
Source File: SearchViewModel.java From AndroidWallet with GNU General Public License v3.0 | 5 votes |
@Override public void call() { if (!RegexUtils.isURL(linkUrl.get())) { ToastUtils.showShort(Utils.getString(R.string.module_found_illegal_dapp_link_url)); return; } WebViewModel webViewModel = new WebViewModel(); webViewModel.setTitle(""); webViewModel.setUrl(linkUrl.get()); Bundle bundle = new Bundle(); bundle.putSerializable(IntentKeyGlobal.WEB_MODEL, webViewModel); bundle.putBoolean(IntentKeyGlobal.FROM_SEARCH, true); ARouter.getInstance().build(RouterActivityPath.ACTIVITY_JS_WEB).with(bundle).navigation(); }
Example #25
Source File: SwitchAccountViewModel.java From AndroidWallet with GNU General Public License v3.0 | 5 votes |
@Override public void call() { ARouter.getInstance().build(RouterActivityPath.ACTIVITY_CREATE_ACCOUNT).navigation(); EventBusCarrier eventBusCarrier = new EventBusCarrier(); eventBusCarrier.setEventType(EventTypeGlobal.DIALOG_DISMISS_TYPE); eventBusCarrier.setObject(null); EventBus.getDefault().post(eventBusCarrier); }
Example #26
Source File: RoutingHelper.java From Mysplash with GNU Lesser General Public License v3.0 | 5 votes |
public static void startUserActivity(Activity a, View avatar, View background, User u, @ProfilePager.ProfilePagerRule int page) { if (AuthManager.getInstance().isAuthorized() && !TextUtils.isEmpty(AuthManager.getInstance().getUsername()) && u.username.equals(AuthManager.getInstance().getUsername())) { ComponentFactory.getMeModule().startMeActivity(a, avatar, background, page); } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { Bundle b = new Bundle(); RoundCornerTransition.addExtraProperties(background, b); ARouter.getInstance() .build(UserActivity.USER_ACTIVITY) .withParcelable(UserActivity.KEY_USER_ACTIVITY_USER, u) .withInt(UserActivity.KEY_USER_ACTIVITY_PAGE_POSITION, page) .withBundle(a.getString(R.string.transition_user_background), b) .withOptionsCompat( ActivityOptionsCompat.makeSceneTransitionAnimation( a, Pair.create(avatar, a.getString(R.string.transition_user_avatar)), Pair.create(background, a.getString(R.string.transition_user_background)) ) ).navigation(a); } else { ARouter.getInstance() .build(UserActivity.USER_ACTIVITY) .withParcelable(UserActivity.KEY_USER_ACTIVITY_USER, u) .withInt(UserActivity.KEY_USER_ACTIVITY_PAGE_POSITION, page) // .withTransition(R.anim.activity_slide_in, R.anim.none) .navigation(a); } }
Example #27
Source File: SearchResultViewBinder.java From smart-farmer-android with Apache License 2.0 | 5 votes |
private void bind(final SearchResultModel item) { mTxtContent.setText(item.getTitle()); if (!TextUtils.isEmpty(item.getImgUrl())) { Glide.with(itemView.getContext()).load(item.getImgUrl()).into(mImg); } mItemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { switch (item.getType()) { case 0://图书 ARouter.getInstance().build("/app/book/detail").withString("bookId", item.getId()).navigation(); break; case 1://资讯 ARouter.getInstance().build("/app/news/detail").withString("newsId", item.getId()).navigation(); break; case 2://直播课 ARouter.getInstance().build("/app/liveLesson/detail").withString("lessonId", item.getId()) .navigation(); break; case 3://高清网课 ARouter.getInstance().build("/app/onlineLesson/detail").withString("lessonId", item.getId()) .navigation(); break; default: break; } } }); }
Example #28
Source File: MysplashApplication.java From Mysplash with GNU Lesser General Public License v3.0 | 5 votes |
@Override public void onCreate() { super.onCreate(); instance = this; activityList = new ArrayList<>(); if (isDebug(this)) { ARouter.openLog(); ARouter.openDebug(); } ARouter.init(this); CrashReportHelper.init(this); }
Example #29
Source File: AboutUsViewModel.java From AndroidWallet with GNU General Public License v3.0 | 5 votes |
@Override public void call() { WebViewModel webViewModel = new WebViewModel(); webViewModel.setTitle(Utils.getString(R.string.fragment_mine_about_us_use_protocol)); webViewModel.setUrl(Utils.getString(R.string.fragment_mine_about_us_privacy_policy_url)); Bundle bundle = new Bundle(); bundle.putSerializable(IntentKeyGlobal.WEB_MODEL, webViewModel); ARouter.getInstance().build(RouterActivityPath.ACTIVITY_HTML_WEB).with(bundle).navigation(); }
Example #30
Source File: ContactItemViewModel.java From AndroidWallet with GNU General Public License v3.0 | 5 votes |
@Override public void call() { if (IntentKeyGlobal.GET_CONTACT == type) { EventBusCarrier eventBusCarrier = new EventBusCarrier(); eventBusCarrier.setEventType(EventTypeGlobal.SET_CONTACT); eventBusCarrier.setObject(contactModel); EventBus.getDefault().post(eventBusCarrier); return; } Bundle bundle = new Bundle(); bundle.putSerializable(IntentKeyGlobal.CONTACT_ENTITY, contactModel); ARouter.getInstance().build(RouterActivityPath.ACTIVITY_EDIT_CONTACT).with(bundle).navigation(); }