您当前的位置: 首页 > 

baso

发布时间:2016-10-27 09:20:16 ,浏览量:0

baso
项目地址: gitsindonesia/baso
简介:Progress view with retry button

Maven Central

ProgressBar with button and text below it.

Progressing Stopped without image Stopped with image

Sample Usage XML Layout Without styles.xml

			
				With styles.xml
			


			
				How to start and stop the progress
			
			
				Start the progress
			
final BasoProgressView basoProgressView = (BasoProgressView) findViewById(R.id.baso_ProgressView);   
basoProgressView.startProgress();
Stop progress and show the button

The button will be automatically visible if you had written baso_finishButtonText on xml layout. Once you have completed the action and you wanted to stop the progress and show a message (or error message), you can just call stop or stopAndError method.

// set message on the TextView or you can set baso_finishText on your xml layout.
basoProgressView.setFinishedText("Something happened");

// stop the progress
basoProgressView.stop();

Or you can simply call stopAndError.

basoProgressView.stopAndError("Oops. Something happened.");
Stop progress and show both image and button

You have to declare baso_finishSrc either on your xml layout or programmatically withsetFinishedImageResource method.

basoProgressView.setFinishedImageResource(R.drawable.baso_sample_error);
basoProgressView.stopAndError("Oops. Something happened.");
Complete the progress and make it invisible

Once you have completed the action and you wanted to hide BasoProgressView, you can just call stopAndGoneand use startProgress to start progressing again.

basoProgressView.stopAndGone();
Set the button click listener

Don't forget to create click listener for the button.

basoProgressView.setOnButtonClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        basoProgressView.startProgress();
        //TODO: your action here such as call api
    }
});
For complete sample usage, you can take a look at the sample project. Install
dependencies {
   compile 'id.gits:baso:1.0'
}
About GITS Indonesia

GITS Indonesia has been active in IT Industry since 2010. Since then, we have developed a lot of applications, both initiative projects and client requests. Our developers are familiar with desktop, website, and mobile programming, but we are currently focusing in mobile.

http://gits.co.id

关注
打赏
1688896170
查看更多评论

暂无认证

  • 0浏览

    0关注

    111043博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.0784s