zoukankan      html  css  js  c++  java
  • 一手遮天 Android

    项目地址 https://github.com/webabcd/AndroidDemo
    作者 webabcd

    一手遮天 Android - view(进度类): ProgressBar 基础

    示例如下:

    /view/progress/ProgressBarDemo1.java

    /**
     * ProgressBar - 进度条控件
     */
    
    package com.webabcd.androiddemo.view.progress;
    
    import androidx.appcompat.app.AppCompatActivity;
    import android.os.Bundle;
    
    import com.webabcd.androiddemo.R;
    
    public class ProgressBarDemo1 extends AppCompatActivity {
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_view_progress_progressbardemo1);
        }
    }
    
    

    /layout/activity_view_progress_progressbardemo1.xml

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">
    
        <!--
            ProgressBar - 进度条控件
                min - 最小值
                max - 最大值
                progress - 进度值(相当于播放器的当前播放位置)
                secondaryProgress - 第二进度的进度值(相当于播放器的当前已缓冲位置)
                indeterminate - 进度是否不可知
        -->
    
        <!--
            圈圈
        -->
        <ProgressBar
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>
    
        <!--
            小圈圈(style="@android:style/Widget.ProgressBar.Small")
        -->
        <ProgressBar
            style="@android:style/Widget.ProgressBar.Small"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"/>
    
        <!--
            大圈圈(style="@android:style/Widget.ProgressBar.Large")
        -->
        <ProgressBar
            style="@android:style/Widget.ProgressBar.Large"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"/>
    
        <!--
            长条(style="@android:style/Widget.ProgressBar.Horizontal")
            进度可知(indeterminate 默认值为 false)
        -->
        <ProgressBar
            style="@android:style/Widget.ProgressBar.Horizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:min="0"
            android:max="100"
            android:progress="30"
            android:secondaryProgress="50"/>
    
        <!--
            长条(style="@android:style/Widget.ProgressBar.Horizontal")
            进度不可知(indeterminate="true")
        -->
        <ProgressBar
            style="@android:style/Widget.ProgressBar.Horizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:indeterminate="true" />
    
    </LinearLayout>
    
    

    项目地址 https://github.com/webabcd/AndroidDemo
    作者 webabcd

  • 相关阅读:
    第二十七节(多线程、线程的创建和启动、生命周期、调度、控制、同步)
    第二十六节(对象流,File类)
    第二十五节(转换流,打印流)
    第二十四节(Java文件流,缓冲流)
    第二十三节(String,StringBuffer,基础类型对应的 8 个包装类,日期相关类、 Random 数字 ,Enum枚举)下
    【转】perl如何避免脚本在windows中闪一下就关闭
    计算机基础(二)
    计算机基础(一)
    04 数据结构
    03 逻辑与结构
  • 原文地址:https://www.cnblogs.com/webabcd/p/android_view_progress_ProgressBarDemo1.html
Copyright © 2011-2022 走看看