本文整理汇总了Java中com.kaopiz.kprogresshud.KProgressHUD类的典型用法代码示例。如果您正苦于以下问题:Java KProgressHUD类的具体用法?Java KProgressHUD怎么用?Java KProgressHUD使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
KProgressHUD类属于com.kaopiz.kprogresshud包,在下文中一共展示了KProgressHUD类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: clearCache
import com.kaopiz.kprogresshud.KProgressHUD; //导入依赖的package包/类
/**
* 清除缓存
*/
private void clearCache() {
// 清理新闻json数据 - 不清理json数据
// NewsDALManager.shared.clearCache();
// Fresco清除图片缓存
ImagePipeline imagePipeline = Fresco.getImagePipeline();
imagePipeline.clearCaches();
// 清除缓存目录 - 清除所有缓存目录文件
FileCacheUtils.clearAllCache(mContext);
final KProgressHUD hud = ProgressHUD.show(mContext, "正在清理...");
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
hud.dismiss();
ProgressHUD.showInfo(mContext, "清理缓存完成");
}
}, 2000);
}
示例2: clearCache
import com.kaopiz.kprogresshud.KProgressHUD; //导入依赖的package包/类
/**
* 清除缓存
*/
private void clearCache() {
// 清理新闻json数据 - 不清理json数据
// NewsDALManager.shared.clearCache();
// Fresco清除图片缓存
ImagePipeline imagePipeline = Fresco.getImagePipeline();
imagePipeline.clearCaches();
// 清除缓存目录 - 清除所有缓存目录文件
FileCacheUtils.clearAllCache(mContext);
final KProgressHUD hud = ProgressHUD.show(mContext, "正在清理...");
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
hud.dismiss();
ProgressHUD.showInfo(mContext, "清理缓存完成");
cacheTextView.setText(FileCacheUtils.getTotalCacheSize(mContext));
}
}, 2000);
}
示例3: onCreate
import com.kaopiz.kprogresshud.KProgressHUD; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_search);
ButterKnife.bind(this);
mHud = KProgressHUD.create(this)
.setStyle(KProgressHUD.Style.SPIN_INDETERMINATE)
.setLabel("正在拼命加载中...")
.setDimAmount(0.5f);
handleIntent();
mPresenter = new SearchPresenter(this, this);
initRecylerViews();
mRlBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
// 获取电影分类信息
mPresenter.getMovieTypeList();
// 根据条件进行筛选电影
mPresenter.getClassifySearchList(offset, catId, sourceId, yearId, sortId);
}
示例4: handleBtnRegistClick
import com.kaopiz.kprogresshud.KProgressHUD; //导入依赖的package包/类
private void handleBtnRegistClick() {
mHud = KProgressHUD.create(this)
.setStyle(KProgressHUD.Style.SPIN_INDETERMINATE)
.setLabel("正在请求服务器...")
.setDimAmount(0.5f);
mHud.show();
scheduleDismiss();
}
示例5: initProgress
import com.kaopiz.kprogresshud.KProgressHUD; //导入依赖的package包/类
/**
* 初始化重新连接进度条
*/
private void initProgress(){
mProgress = KProgressHUD.create(getContext())
.setStyle(KProgressHUD.Style.SPIN_INDETERMINATE)
.setCancellable(true)
.setAnimationSpeed(2)
.setDimAmount(0.5f)
.setLabel("连接中...");
}
示例6: showProgress
import com.kaopiz.kprogresshud.KProgressHUD; //导入依赖的package包/类
public static void showProgress(Context context){
if (mProgress == null) {
mProgress = KProgressHUD.create(context)
.setStyle(KProgressHUD.Style.SPIN_INDETERMINATE)
.setCancellable(true)
.setAnimationSpeed(2)
.setDimAmount(0.5f)
.show();
} else {
mProgress.show();
}
}
示例7: show
import com.kaopiz.kprogresshud.KProgressHUD; //导入依赖的package包/类
/**
* 显示加载HUD 需要手动取消
*
* @param context 上下文
* @return KProgressHUD
*/
public static KProgressHUD show(Context context) {
return KProgressHUD.create(context)
.setStyle(KProgressHUD.Style.SPIN_INDETERMINATE)
.setCancellable(true)
.setDimAmount(0.5f)
.show();
}
示例8: showWaitDialog
import com.kaopiz.kprogresshud.KProgressHUD; //导入依赖的package包/类
@Override
public KProgressHUD showWaitDialog(String message, boolean canBack) {
if (mWait == null)
mWait = KProgressHUD.create(mContext)
.setStyle(KProgressHUD.Style.SPIN_INDETERMINATE)
.setLabel("请稍等")
.setAnimationSpeed(2)
.setDimAmount(0.5f);
else if (mWait.isShowing()) mWait.dismiss();
mWait.setCancellable(canBack)
.setDetailsLabel(message)
.show();
return mWait;
}
示例9: initHUD
import com.kaopiz.kprogresshud.KProgressHUD; //导入依赖的package包/类
private void initHUD() {
mHud = KProgressHUD.create(this)
.setStyle(KProgressHUD.Style.SPIN_INDETERMINATE)
.setLabel("正在登陆...")
.setDimAmount(0.5f);
}
示例10: onClick
import com.kaopiz.kprogresshud.KProgressHUD; //导入依赖的package包/类
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.indeterminate:
hud = KProgressHUD.create(this)
.setStyle(KProgressHUD.Style.SPIN_INDETERMINATE);
scheduleDismiss();
break;
case R.id.label_indeterminate:
hud = KProgressHUD.create(this)
.setStyle(KProgressHUD.Style.SPIN_INDETERMINATE)
.setLabel("Please wait")
.setCancellable(true);
scheduleDismiss();
break;
case R.id.detail_indeterminate:
hud = KProgressHUD.create(this)
.setStyle(KProgressHUD.Style.SPIN_INDETERMINATE)
.setLabel("Please wait")
.setDetailsLabel("Downloading data");
scheduleDismiss();
break;
case R.id.determinate:
hud = KProgressHUD.create(MainActivity.this)
.setStyle(KProgressHUD.Style.PIE_DETERMINATE)
.setLabel("Please wait");
simulateProgressUpdate();
break;
case R.id.annular_determinate:
hud = KProgressHUD.create(MainActivity.this)
.setStyle(KProgressHUD.Style.ANNULAR_DETERMINATE)
.setLabel("Please wait");
simulateProgressUpdate();
break;
case R.id.bar_determinate:
hud = KProgressHUD.create(MainActivity.this)
.setStyle(KProgressHUD.Style.BAR_DETERMINATE)
.setLabel("Please wait");
simulateProgressUpdate();
break;
case R.id.custom_view:
ImageView imageView = new ImageView(this);
imageView.setImageResource(R.mipmap.ic_launcher);
hud = KProgressHUD.create(this)
.setCustomView(imageView)
.setLabel("This is a custom view");
scheduleDismiss();
break;
case R.id.dim_background:
hud = KProgressHUD.create(this)
.setStyle(KProgressHUD.Style.SPIN_INDETERMINATE)
.setDimAmount(0.5f);
scheduleDismiss();
break;
case R.id.custom_color_animate:
//noinspection deprecation
hud = KProgressHUD.create(this)
.setStyle(KProgressHUD.Style.SPIN_INDETERMINATE)
.setWindowColor(getResources().getColor(R.color.colorPrimary))
.setAnimationSpeed(2);
scheduleDismiss();
break;
}
hud.show();
}
示例11: showWaitDialog
import com.kaopiz.kprogresshud.KProgressHUD; //导入依赖的package包/类
/**
* 显示等待的对话框
*
* @param text
* @return
*/
KProgressHUD showWaitDialog(String text, boolean canBack);