com.hss01248.dialog.StyledDialog Java Examples

The following examples show how to use com.hss01248.dialog.StyledDialog. 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: UpdateAppService.java    From AcgClub with MIT License 6 votes vote down vote up
public void showUpdateDialog(final VersionInfo versionInfo) {
  StyledDialog.buildMdAlert("版本更新", versionInfo.getDesc(), new MyDialogListener() {
    @Override
    public void onFirst() {
      //跳转更新APP版本
      if (versionInfo.getAppLink().startsWith("http")) {
        IntentUtils.go2Browser(getBaseContext(), versionInfo.getAppLink());
      } else if (versionInfo.getAppLink().startsWith("market")) {
        IntentUtils.go2Market(getBaseContext(), versionInfo.getAppLink());
      }
    }

    @Override
    public void onSecond() {
    }
  }).setBtnText("现在升级", "下次再说").show();
}
 
Example #2
Source File: ConfigBean.java    From DialogUtil with Apache License 2.0 6 votes vote down vote up
@Override
    public Dialog show() {
        if(Thread.currentThread().getId() == Looper.getMainLooper().getThread().getId()){
           return showInMainThread();
        }
//说明不是主线程,需要做处理
        final CountDownLatch latch = new CountDownLatch(1);
        final Dialog[] dialog = new Dialog[1];

        StyledDialog.getMainHandler().post(new Runnable() {
            @Override
            public void run() {
                dialog[0] =   showInMainThread();
                latch.countDown();
            }
        });
        try {
            latch.await();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return dialog[0];


    }
 
Example #3
Source File: SettingActivity.java    From AcgClub with MIT License 5 votes vote down vote up
@OnClick(R.id.tv_setting_about)
public void showAbout() {
  StyledDialog.buildCustom(
      LayoutInflater.from(
          this).inflate(R.layout.view_setting_about, null),
      Gravity.CENTER)
      .setCancelable(true, true)
      .show();
}
 
Example #4
Source File: BaseApp.java    From DialogUtil with Apache License 2.0 5 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();
    LeakCanary.install(this);
    StyledDialog.init(getApplicationContext());
    registCallback();
    initlog();
    //TestTool.openStickModeIfIsDebug();
}
 
Example #5
Source File: CommonApplicationLike.java    From AcgClub with MIT License 4 votes vote down vote up
@Override
public void onCreate() {
  mAppComponent = DaggerAppComponent
      .builder()
      .appModule(new AppModule(mApplication))////提供application
      .clientModule(new ClientModule())//用于提供okhttp和retrofit的单例
      .imageModule(new ImageModule())//图片加载框架默认使用glide
      .globeConfigModule(getGlobeConfigModule(mApplication, mModules))//全局配置
      .build();
  mAppComponent.inject(this);
  Utils.initAppComponent(mAppComponent);

  //router
  if (BuildConfig.DEBUG) {
    ARouter.openLog();
    ARouter.openDebug();
    ARouter.printStackTrace();
  }
  ARouter.init(mApplication);

  //db init
  Realm.init(mApplication);

  //init utils
  Utils.init(mApplication);

  //log
  LogUtil.init(BuildConfig.DEBUG);

  //loadsir init
  LoadSir.beginBuilder()
      .addCallback(new LoadingCallback())
      .addCallback(new EmptyCallback())
      .addCallback(new EmptyCollectionCallback())
      .addCallback(new PlaceholderCallback())
      .addCallback(new RetryCallback())
      .setDefaultCallback(LoadingCallback.class)
      .commit();

  mApplication.registerActivityLifecycleCallbacks(mActivityLifecycle);

  for (ConfigModule module : mModules) {
    module.registerComponents(mApplication, mAppComponent.repositoryManager());
  }

  for (Lifecycle lifecycle : mLifecycles) {
    lifecycle.onCreate(mApplication);
  }

  //初始化全局dialog
  StyledDialog.init(mApplication);

  //leakCanary内存泄露检查
  //LeakCanary.install(mApplication);

  //rx全局异常处理
  setRxJavaErrorHandler();
}