QMUI-Android的一些尝试(圆形进度条、Loading、圆形图片、圆形按钮、椭圆图片)

Android QQ交流群:826464336

最近在看腾讯QMUI库,觉得有很多地方可以值得借鉴的……

 

QMUI-Android的一些尝试(圆形进度条、Loading、圆形图片、圆形按钮、椭圆图片)_第1张图片

 

布局文件:

 













 

 

 

代码:

 

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    QMUILoadingView loadingView = findViewById(R.id.loadView);
    QMUIProgressBar bar=findViewById(R.id.progressBar);
    QMUIRadiusImageView imageView=findViewById(R.id.iv_image);
    QMUIRoundButton btn=findViewById(R.id.btn);
    QMUITopBar topBar=findViewById(R.id.topBar);
    QMUITopBarLayout barLayout=findViewById(R.id.barLayout);

    loadingView.setVisibility(View.VISIBLE);
    loadingView.setColor(R.color.qmui_config_color_black);
    loadingView.setBackgroundColor(getResources().getColor(R.color.qmui_s_transparent));
    loadingView.setActivated(true);
    loadingView.setSize(100);
    loadingView.start();

    bar.setMaxValue(100);
    bar.setProgress(70);

    imageView.setImageResource(R.drawable.ic_launcher_background);
    imageView.setCircle(true);
    imageView.setCornerRadius(100);
    imageView.setOval(false);//是否椭圆
    imageView.setBorderWidth(10);//设置边缘宽度

   topBar.setTitle("你好");
   topBar.setBackgroundColor(getResources().getColor(R.color.qmui_config_color_10_pure_black));
   topBar.showTitleView(true);
   topBar.addLeftBackImageButton();

   barLayout.setTitle("撒地方");
   barLayout.addLeftTextButton("撒",R.drawable.ic_launcher_background);

}

 

你可能感兴趣的:(橘子---圆又圆)