com.kaopiz.kprogresshud.KProgressHUD Java Examples

The following examples show how to use com.kaopiz.kprogresshud.KProgressHUD. 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: OrdersFragment.java    From bitshares_wallet with MIT License 6 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {

    View view = inflater.inflate(R.layout.fragment_orders, container, false);

    adapterOrders = new OrderListAdapter();

    listOrders = (RecyclerView) view.findViewById(R.id.fo_list);
    listOrders.setAdapter(adapterOrders);
    listOrders.setLayoutManager(new LinearLayoutManager(getContext()));
    listOrders.setItemAnimator(null);

    txtNone = (TextView)view.findViewById(R.id.fo_txt_none);

    mProcessHud = KProgressHUD.create(getActivity())
            .setStyle(KProgressHUD.Style.SPIN_INDETERMINATE)
            .setLabel("Please Wait")
            .setCancellable(false)
            .setAnimationSpeed(2)
            .setDimAmount(0.5f);

    return view;
}
 
Example #2
Source File: MainActivity.java    From LiuAGeAndroid with MIT License 6 votes vote down vote up
/**
     * 清除缓存
     */
    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);

    }
 
Example #3
Source File: ProfileFragment.java    From BaoKanAndroid with MIT License 6 votes vote down vote up
/**
     * 清除缓存
     */
    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);

    }
 
Example #4
Source File: ProgressHUD.java    From LiuAGeAndroid with MIT License 5 votes vote down vote up
/**
 * 显示加载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();
}
 
Example #5
Source File: ProgressHUD.java    From LiuAGeAndroid with MIT License 5 votes vote down vote up
/**
 * 显示带文字的加载HUD 需要手动取消
 *
 * @param context   上下文
 * @param tipString 提示文字
 * @return KProgressHUD
 */
public static KProgressHUD show(Context context, String tipString) {
    return KProgressHUD.create(context)
            .setStyle(KProgressHUD.Style.SPIN_INDETERMINATE)
            .setLabel(tipString)
            .setCancellable(true)
            .setDimAmount(0.5f)
            .show();
}
 
Example #6
Source File: ProgressHUD.java    From BaoKanAndroid with MIT License 5 votes vote down vote up
/**
 * 显示加载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();
}
 
Example #7
Source File: ProgressHUD.java    From BaoKanAndroid with MIT License 5 votes vote down vote up
/**
 * 显示带文字的加载HUD 需要手动取消
 *
 * @param context   上下文
 * @param tipString 提示文字
 * @return KProgressHUD
 */
public static KProgressHUD show(Context context, String tipString) {
    return KProgressHUD.create(context)
            .setStyle(KProgressHUD.Style.SPIN_INDETERMINATE)
            .setLabel(tipString)
            .setCancellable(true)
            .setDimAmount(0.5f)
            .show();
}
 
Example #8
Source File: BaseActivity.java    From MarkdownEditors with Apache License 2.0 5 votes vote down vote up
@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;
}
 
Example #9
Source File: TransactionSellBuyFragment.java    From bitshares_wallet with MIT License 4 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_buy_sell, container, false);

    Button okButton = (Button) view.findViewById(R.id.okButton);
    okButton.setOnClickListener(this);
    if (isBuy()) {
        okButton.setText(getResources().getString(R.string.title_buy));
    } else {
        okButton.setText(getResources().getString(R.string.title_sell));
    }

    mProcessHud = KProgressHUD.create(getActivity())
            .setStyle(KProgressHUD.Style.SPIN_INDETERMINATE)
            .setLabel("Please Wait")
            .setCancellable(false)
            .setAnimationSpeed(2)
            .setDimAmount(0.5f);

    Button restButton = (Button) view.findViewById(R.id.restButton);
    restButton.setOnClickListener(this);

    qEditText = (EditText) view.findViewById(R.id.qEditText);
    pEditText = (EditText) view.findViewById(R.id.pEditText);
    pEditText.addTextChangedListener(this);
    qEditText.addTextChangedListener(this);

    tEditText = (EditText) view.findViewById(R.id.tEditText);
    fEditText = (EditText) view.findViewById(R.id.fEditText);
    pTextLastView = (TextView) view.findViewById(R.id.pTextLastView);
    qTextLastView = (TextView) view.findViewById(R.id.qTextLastView);
    tTextLastView = (TextView) view.findViewById(R.id.tTextLastView);

    balanceText = (TextView) view.findViewById(R.id.balanceText);
    askText = (TextView) view.findViewById(R.id.askText);

    balanceTextBase = (TextView) view.findViewById(R.id.balanceTextBase);
    askTextBase = (TextView) view.findViewById(R.id.askTextBase);
    askTextInfo = (TextView) view.findViewById(R.id.askTextInfo);

    buyRecyclerView = (RecyclerView) view.findViewById(R.id.buy_recycler);
    buyRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
    buyRecyclerViewAdapter = new TransactionSellBuyRecyclerViewAdapter();
    buyRecyclerView.setAdapter(buyRecyclerViewAdapter);
    buyRecyclerView.setItemAnimator(null);

    sellRecyclerView = (RecyclerView) view.findViewById(R.id.sell_recycler);
    sellRecyclerViewAdapter = new TransactionSellBuyRecyclerViewAdapter();
    sellRecyclerView.setAdapter(sellRecyclerViewAdapter);
    sellRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
    sellRecyclerView.setItemAnimator(null);

    return view;
}
 
Example #10
Source File: MainActivity.java    From android-loading-dialog with Apache License 2.0 4 votes vote down vote up
@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();
}
 
Example #11
Source File: WaitDialogInterface.java    From MarkdownEditors with Apache License 2.0 2 votes vote down vote up
/**
 * 显示等待的对话框
 *
 * @param text
 * @return
 */
KProgressHUD showWaitDialog(String text, boolean canBack);