Skip to content

Conversation

@youxiachai
Copy link

I think it useful when sometimes show downloading persent;
Example:
private Handler handler = new Handler(){

    @Override
    public void handleMessage(Message msg) {
        super.handleMessage(msg);
        tv.setText("" + msg.obj);
    }

};

aq.id(R.id.button1).clicked(new OnClickListener() {

        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
            String imageurl = "http://jpp2.imghb.com/pic/pic/52/60/24/1396053752602447_a602x602.jpg";

            aq.id(R.id.imageView1).load(new LoadListener() {

                @Override
                public void onLoadProgress(int current, float max) {
                    float present = (float) (max - current)/ max;
                    Log.d("api", "present"+ String.format("%.2f", (present * 100)));
                    Message msg = new Message();
                    msg.obj =  String.format("%.2f%%", (present * 100));
                    handler.sendMessage(msg);
                \
                }
            }).image(imageurl, false, false);

        }
    });

support acquire downloading progress count
handle loadlistener
set the downloadlistener in ajaxCallback
set bitmapAjaxCallback listen downloading percent
update bitmapAjaxCallback set the downloading listener
@Malachiasz
Copy link

you could give more meaningful topic name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants