iis服务器助手广告广告
返回顶部
首页 > 资讯 > 移动开发 >Android实现水平带刻度的进度条
  • 453
分享到

Android实现水平带刻度的进度条

2024-04-02 19:04:59 453人浏览 独家记忆
摘要

本文实例为大家分享了Android实现水平带刻度进度条的具体代码,供大家参考,具体内容如下 效果 1、attrsl.xml <!-- 带刻度的 进度条 -->    

本文实例为大家分享了Android实现水平带刻度进度条的具体代码,供大家参考,具体内容如下

效果

1、attrsl.xml

<!-- 带刻度的 进度条 -->
    <declare-styleable name="HorizontalProgressSeekBar">
        <attr name="progressColor" />
        <attr name="max" />
        <attr name="progressContentIcon" fORMat="reference" />
        <attr name="progressGoalIcon" format="reference" />
        <attr name="progressGoalIconWidthHeight" format="dimension" />
        <attr name="progressContentIconHeight" format="dimension" />
        <attr name="progressContentIconWidth" format="dimension" />
        <attr name="progressDistance" format="dimension" />
</declare-styleable>

2、HorizontalProgressSeekBar.class 

public class HorizontalProgressSeekBar extends View {
    private int viewWidth;
    private int viewHeight;
    private Paint strokePain;
    private List<Integer> goalTimes;
    private int maxData = 80;
    private Bitmap progressGoalBitmap;
    private Bitmap progressContentBitmap;
    private float proceedTime;
    private int PROGRESS_COLOR = Color.parseColor("#FE78A6");
    private float goalProportion;
    private Paint backgroundPaint;
    private int distance = 10;
    private int distancePxMax;
    private int distancePxMin;
    private int distancePx;
    private RectF rectF;
    private List<Integer> bitmapType;
    private Bitmap bitmapHomeCornerKick;
    private Bitmap bitmapHomeTeamRedCard;
    private Bitmap bitmapHomeTeamScored;
    private Bitmap bitmapVisitinGCornerKick;
    private Bitmap bitmapVisitingTeamScored;
    private List<BollProgressDataBean> homeTeamIncidentList;
    private List<BollProgressDataBean> visitingTeamIncidentList;
    private BollProgressDataBean homeTeamIncidentListBean;
    private BollProgressDataBean visitingTeamIncidentListBean;
    private RectF rectFStrokePain;
    private int bitmapHomeCornerKickWidth;
    private int bitmapHomeTeamScoredWidth;
 
    
    private float incidentTimeNumber;
 
    public HorizontalProgressSeekBar(Context context) {
        this(context, null);
    }
 
    public HorizontalProgressSeekBar(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }
 
    public HorizontalProgressSeekBar(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.HorizontalProgressSeekBar);
        try {
            PROGRESS_COLOR = a.getColor(R.styleable.HorizontalProgressSeekBar_progressColor, PROGRESS_COLOR);
            maxData = a.getInt(R.styleable.HorizontalProgressSeekBar_max, maxData);
            int progressContentIconWidth = (int) a.getDimension(R.styleable.HorizontalProgressSeekBar_progressContentIconWidth, dipToPx(22));
            int progressContentIconHeight = (int) a.getDimension(R.styleable.HorizontalProgressSeekBar_progressContentIconHeight, dipToPx(25));
            progressContentBitmap = Bitmap.createScaledBitmap(BitmapFactory.decodeResource(getContext().getResources(),
                    a.getResourceId(R.styleable.HorizontalProgressSeekBar_progressContentIcon, R.mipmap.rest)), progressContentIconWidth, progressContentIconHeight, true);
            int progressGoalIconWidthHeight = (int) a.getDimension(R.styleable.HorizontalProgressSeekBar_progressGoalIconWidthHeight, dipToPx(22));
            progressGoalBitmap = Bitmap.createScaledBitmap(BitmapFactory.decodeResource(getContext().getResources(),
                    a.getResourceId(R.styleable.HorizontalProgressSeekBar_progressGoalIcon, R.drawable.share)), progressGoalIconWidthHeight, progressGoalIconWidthHeight, true);
 
            bitmapHomeCornerKick = Bitmap.createScaledBitmap(BitmapFactory.decodeResource(getContext().getResources(),
                    R.mipmap.home_corner_kick_xiao), progressGoalIconWidthHeight, progressGoalIconWidthHeight, true);
            bitmapHomeTeamRedCard = Bitmap.createScaledBitmap(BitmapFactory.decodeResource(getContext().getResources(),
                    R.mipmap.home_team_red_card_xiao), progressGoalIconWidthHeight, progressGoalIconWidthHeight, true);
            bitmapHomeTeamScored = Bitmap.createScaledBitmap(BitmapFactory.decodeResource(getContext().getResources(),
                    R.mipmap.home_team_scored_xiao), progressGoalIconWidthHeight, progressGoalIconWidthHeight, true);
            bitmapVisitingCornerKick = Bitmap.createScaledBitmap(BitmapFactory.decodeResource(getContext().getResources(),
                    R.mipmap.visiting_corner_kick_xiao), progressGoalIconWidthHeight, progressGoalIconWidthHeight, true);
            bitmapVisitingTeamScored = Bitmap.createScaledBitmap(BitmapFactory.decodeResource(getContext().getResources(),
                    R.mipmap.visiting_team_scored_xiao), progressGoalIconWidthHeight, progressGoalIconWidthHeight, true);
 
 
            distancePx =  a.getDimensionPixelOffset(R.styleable.HorizontalProgressSeekBar_progressDistance,dipToPx(distance));
 
 
            if (bitmapHomeCornerKick != null){
                bitmapHomeCornerKickWidth = bitmapHomeCornerKick.getWidth();
            }
 
            if (bitmapHomeTeamScored != null){
                bitmapHomeTeamScoredWidth = bitmapHomeTeamScored.getWidth();
            }
 
        } finally {
            a.recycle();
        }
 
        distancePxMax = dipToPx(distance + 2);
        distancePxMin = dipToPx(distance - 2);
        strokePain = new Paint();
        backgroundPaint = new Paint();
    }
 
    
    public void setGoalTime(int max, float proceedTime, List<Integer> goalTimes) {
        this.maxData = max;
        this.proceedTime = proceedTime;
        this.goalTimes = goalTimes;
        invalidateView();
    }
 
    
    public void setGoalTimeBitmap(int max, float proceedTime, List<BollProgressDataBean> homeTeamIncidentList, List<BollProgressDataBean> visitingTeamIncidentList) {
        this.maxData = max;
        this.proceedTime = proceedTime;
        this.homeTeamIncidentList = homeTeamIncidentList;
        this.visitingTeamIncidentList = visitingTeamIncidentList;
        invalidateView();
    }
 
    public void setBitmapType(List<Integer> bitmapType) {
        this.bitmapType = bitmapType;
        invalidateView();
    }
 
    @Override
    protected void onSizeChanged(int w, int h, int oldw, int oldh) {
        super.onSizeChanged(w, h, oldw, oldh);
        viewWidth = w;
        viewHeight = h;
    }
 
    @Override
    protected void onDraw(canvas canvas) {
        super.onDraw(canvas);
        drawProgress(canvas);
        drawBorder(canvas);
        drawMeasureBorder(canvas);
        drawImage(canvas);
        drawGoalTime(canvas);
        drawGoalTimeButton(canvas);
    }
 
    
    private void drawBorder(Canvas canvas) {
        strokePain.reset();
        strokePain.setStyle(Paint.Style.STROKE);
        strokePain.setAntiAlias(true);
        strokePain.setStrokeWidth(2);
        strokePain.setColor(Color.parseColor("#151515"));
        rectFStrokePain = new RectF(distancePx, viewHeight * 0.35f, viewWidth - distancePx, viewHeight * 0.65f);
        canvas.drawRect(rectFStrokePain, strokePain);
    }
 
    private void drawProgress(Canvas canvas) {
        strokePain.reset();
        strokePain.setStyle(Paint.Style.FILL);
        strokePain.setAntiAlias(true);
        strokePain.setStrokeWidth(2);
        strokePain.setColor(Color.parseColor("#258940"));
        if (proceedTime <= 45) {
            rectF = new RectF(distancePx, viewHeight * 0.35f, ((float) viewWidth - 2 * distancePx) * (proceedTime / maxData) + distancePx, viewHeight * 0.65f);
        } else {
            if (proceedTime >= 90) {
                rectF = new RectF(distancePx, viewHeight * 0.35f, ((float) viewWidth - 2 * distancePx) * ((proceedTime + distance) / maxData) + distancePx, viewHeight * 0.65f);
            } else {
                rectF = new RectF(distancePx, viewHeight * 0.35f, ((float) viewWidth - 2 * distancePx) * ((proceedTime + distance) / maxData) + distancePx, viewHeight * 0.65f);
            }
        }
 
        canvas.drawRect(rectF, strokePain);
    }
 
    
    private void drawMeasureBorder(Canvas canvas) {
        strokePain.setStyle(Paint.Style.STROKE);
        float eachWidth = (viewWidth - 2 * distancePx) / 20;
        strokePain.setStrokeWidth(2);
        int drawNoNumber = 20 / 2;
        strokePain.setColor(Color.parseColor("#FF424242"));
        for (int i = 1; i <= 19; i++) {
            //长短线条
            if (drawNoNumber != i && i != 9 && i != 11) {
                if (i % 2 == 0) {
                    canvas.drawLine(eachWidth * i + distancePx, viewHeight * 0.66f, eachWidth * i + distancePx, viewHeight * 0.45f, strokePain);
                } else {
                    canvas.drawLine(eachWidth * i + distancePx, viewHeight * 0.66f, eachWidth * i + distancePx, viewHeight * 0.55f, strokePain);
                }
            }
        }
    }
 
    
    private void drawImage(Canvas canvas) {
        if (progressContentBitmap != null) {
            canvas.drawBitmap(progressContentBitmap,  (int) (viewWidth / 2.0 - progressContentBitmap.getWidth() / 2.0 ), (int) (viewHeight / 2.0 - (progressContentBitmap.getHeight()) / 2.0f), strokePain);
        }
 
    }
 
 
    private void drawGoalTime(Canvas canvas) {
        //主队比赛中的事件  14角球 2红牌 1进球
 
        if (homeTeamIncidentList != null && homeTeamIncidentList.size() > 0) {
            for (int i = 0; i < homeTeamIncidentList.size(); i++) {
                homeTeamIncidentListBean = homeTeamIncidentList.get(i);
                String incidentTime = homeTeamIncidentListBean.getIncidentTime();
                String incidentType = homeTeamIncidentListBean.getIncidentType();
                if (incidentTime != null) {
                    try {
                        incidentTimeNumber = Float.parseFloat(incidentTime);
                    } catch (Exception e) {
 
                    }
 
                }
                if (incidentTimeNumber == 0) {
                    if (incidentType != null) {
                        if ("14".equals(incidentType)) {
                            homeIncidentZero(canvas, bitmapHomeCornerKick, incidentTimeNumber, 0.15f, incidentType);
                        } else if ("2".equals(incidentType)) {
                            homeIncidentZero(canvas, bitmapHomeTeamRedCard, incidentTimeNumber, 0.25f, incidentType);
                        } else if ("1".equals(incidentType)) {
                            homeIncidentZero(canvas, bitmapHomeTeamScored, incidentTimeNumber, 0.25f, incidentType);
                        }
                    }
                } else if (incidentTimeNumber <= 45 && incidentTimeNumber > 0) {
                    if (incidentType != null) {
                        if ("14".equals(incidentType)) {
                            homeTeamIncident(canvas, bitmapHomeCornerKick, incidentTimeNumber, 0.15f, incidentType);
                        } else if ("2".equals(incidentType)) {
                            homeTeamIncident(canvas, bitmapHomeTeamRedCard, incidentTimeNumber, 0.25f, incidentType);
                        } else if ("1".equals(incidentType)) {
                            homeTeamIncident(canvas, bitmapHomeTeamScored, incidentTimeNumber, 0.25f, incidentType);
                        }
                    }
 
                } else if (incidentTimeNumber > 45 && incidentTimeNumber < 90) {
                    if (incidentType != null) {
                        if ("14".equals(incidentType)) {
                            homeIncident(canvas, bitmapHomeCornerKick, incidentTimeNumber, 0.15f, incidentType);
                        } else if ("2".equals(incidentType)) {
                            homeIncident(canvas, bitmapHomeTeamRedCard, incidentTimeNumber, 0.25f, incidentType);
                        } else if ("1".equals(incidentType)) {
                            homeIncident(canvas, bitmapHomeTeamScored, incidentTimeNumber, 0.25f, incidentType);
                        }
                    }
                } else if (incidentTimeNumber >= 90) {
                    if (incidentType != null) {
                        incidentTimeNumber=90;
                        if ("14".equals(incidentType)) {
                            homeIncidentNinety(canvas, bitmapHomeCornerKick, incidentTimeNumber, 0.15f, incidentType);
                        } else if ("2".equals(incidentType)) {
                            homeIncidentNinety(canvas, bitmapHomeTeamRedCard, incidentTimeNumber, 0.25f, incidentType);
                        } else if ("1".equals(incidentType)) {
                            homeIncidentNinety(canvas, bitmapHomeTeamScored, incidentTimeNumber, 0.25f, incidentType);
                        }
                    }
                }
            }
        }
 
    }
 
    
    private void drawGoalTimeButton(Canvas canvas) {
 
        if (visitingTeamIncidentList != null && visitingTeamIncidentList.size() > 0) {
            for (int i = 0; i < visitingTeamIncidentList.size(); i++) {
                visitingTeamIncidentListBean = visitingTeamIncidentList.get(i);
                String incidentTime = visitingTeamIncidentListBean.getIncidentTime();
                String incidentType = visitingTeamIncidentListBean.getIncidentType();
                if (incidentTime != null) {
                    try {
                        incidentTimeNumber = Float.parseFloat(incidentTime);
                    } catch (Exception e) {
 
                    }
 
                }
                if (incidentTimeNumber == 0) {
                    if (incidentType != null) {
                        if ("14".equals(incidentType)) {
                            homeIncidentZero(canvas, bitmapVisitingCornerKick, incidentTimeNumber, 0.56f, incidentType);
                        } else if ("2".equals(incidentType)) {
                            homeIncidentZero(canvas, bitmapHomeTeamRedCard, incidentTimeNumber, 0.45f, incidentType);
                        } else if ("1".equals(incidentType)) {
                            homeIncidentZero(canvas, bitmapVisitingTeamScored, incidentTimeNumber, 0.45f, incidentType);
                        }
                    }
                } else if (incidentTimeNumber <= 45 && incidentTimeNumber > 0) {
                    if (incidentType != null) {
                        if ("14".equals(incidentType)) {
                            homeTeamIncident(canvas, bitmapVisitingCornerKick, incidentTimeNumber, 0.56f, incidentType);
                        } else if ("2".equals(incidentType)) {
                            homeTeamIncident(canvas, bitmapHomeTeamRedCard, incidentTimeNumber, 0.45f, incidentType);
                        } else if ("1".equals(incidentType)) {
                            homeTeamIncident(canvas, bitmapVisitingTeamScored, incidentTimeNumber, 0.45f, incidentType);
                        }
                    }
 
                } else if (incidentTimeNumber > 45 && incidentTimeNumber < 90) {
                    if (incidentType != null) {
                        if ("14".equals(incidentType)) {
                            homeIncident(canvas, bitmapVisitingCornerKick, incidentTimeNumber, 0.56f, incidentType);
                        } else if ("2".equals(incidentType)) {
                            homeIncident(canvas, bitmapHomeTeamRedCard, incidentTimeNumber, 0.45f, incidentType);
                        } else if ("1".equals(incidentType)) {
                            homeIncident(canvas, bitmapVisitingTeamScored, incidentTimeNumber, 0.45f, incidentType);
                        }
                    }
                } else if (incidentTimeNumber >= 90) {
                    if (incidentType != null) {
                        incidentTimeNumber=90;
                        if ("14".equals(incidentType)) {
                            homeIncidentNinety(canvas, bitmapVisitingCornerKick, incidentTimeNumber, 0.56f, incidentType);
                        } else if ("2".equals(incidentType)) {
                            homeIncidentNinety(canvas, bitmapHomeTeamRedCard, incidentTimeNumber, 0.45f, incidentType);
                        } else if ("1".equals(incidentType)) {
                            homeIncidentNinety(canvas, bitmapVisitingTeamScored, incidentTimeNumber, 0.45f, incidentType);
                        }
                    }
                }
            }
        }
    }
 
    private void homeIncidentZero(Canvas canvas, Bitmap bitmapHomeCornerKick, float incidentTimeNumber, float v, String incidentType) {
        if ("14".equals(incidentType)) {
            canvas.drawBitmap(bitmapHomeCornerKick, (int) ((viewWidth - 2 * distancePx) * incidentTimeNumber / maxData - bitmapHomeCornerKickWidth / 2 + distancePxMax), viewHeight * v, strokePain);
        } else {
            canvas.drawBitmap(bitmapHomeCornerKick, (int) ((viewWidth - 2 * distancePx) * incidentTimeNumber / maxData - bitmapHomeCornerKickWidth / 2 + distancePx), viewHeight * v, strokePain);
        }
 
    }
 
    private void homeIncidentNinety(Canvas canvas, Bitmap bitmapHomeTeamScored, float incidentTimeNumber, float v, String incidentType) {
        if ("14".equals(incidentType)) {
            canvas.drawBitmap(bitmapHomeTeamScored, (int) ((viewWidth) * (incidentTimeNumber + 10) / maxData - bitmapHomeTeamScoredWidth / 2) - distancePxMin, viewHeight * v, strokePain);
        } else {
            canvas.drawBitmap(bitmapHomeTeamScored, (int) ((viewWidth) * (incidentTimeNumber + 10) / maxData - bitmapHomeTeamScoredWidth / 2) - distancePx, viewHeight * v, strokePain);
        }
 
    }
 
    private void homeIncident(Canvas canvas, Bitmap bitmapHomeTeamScored, float incidentTimeNumber, float v, String incidentType) {
        if ("14".equals(incidentType)) {
            canvas.drawBitmap(bitmapHomeTeamScored, (int) ((viewWidth - 2 * distancePx) * (incidentTimeNumber + 10) / maxData - bitmapHomeTeamScoredWidth / 2) + distancePxMax, viewHeight * v, strokePain);
        } else {
            canvas.drawBitmap(bitmapHomeTeamScored, (int) ((viewWidth - 2 * distancePx) * (incidentTimeNumber + 10) / maxData - bitmapHomeTeamScoredWidth / 2) + distancePx, viewHeight * v, strokePain);
        }
    }
 
    private void homeTeamIncident(Canvas canvas, Bitmap bitmapHomeCornerKick, float incidentTimeNumber, float v, String incidentType) {
        if ("14".equals(incidentType)) {
            canvas.drawBitmap(bitmapHomeCornerKick, (int) ((viewWidth - 2 * distancePx) * (incidentTimeNumber) / maxData - bitmapHomeCornerKickWidth / 2) + distancePxMax, viewHeight * v, strokePain);
        } else {
            canvas.drawBitmap(bitmapHomeCornerKick, (int) ((viewWidth - 2 * distancePx) * (incidentTimeNumber) / maxData - bitmapHomeCornerKickWidth / 2) + distancePx, viewHeight * v, strokePain);
        }
 
    }
 
 
    private void invalidateView() {
        if (Looper.getMainLooper() == Looper.myLooper()) {
            invalidate();
        } else {
            postInvalidate();
        }
    }
 
    private int dipToPx(float dip) {
        float density = getResources().getDisplayMetrics().density;
        return (int) (dip * density + 0.5f * (dip >= 0 ? 1 : -1));
    }
}

BollProgressDataBean.class

public class BollProgressDataBean {
    private String incidentType;  //主队比赛中的事件  0 角球 1红牌 2进球
    private String incidentTime;  //主队比赛中发生事件的时间
 
    public String getIncidentType() {
        return incidentType;
    }
 
    public void setIncidentType(String incidentType) {
        this.incidentType = incidentType;
    }
 
    public String getIncidentTime() {
        return incidentTime;
    }
 
    public void setIncidentTime(String incidentTime) {
        this.incidentTime = incidentTime;
    }
}

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持编程网。

--结束END--

本文标题: Android实现水平带刻度的进度条

本文链接: https://www.lsjlt.com/news/144728.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • Android实现水平带刻度的进度条
    本文实例为大家分享了Android实现水平带刻度进度条的具体代码,供大家参考,具体内容如下 效果 1、attrsl.xml <!-- 带刻度的 进度条 -->     ...
    99+
    2024-04-02
  • Android studio实现水平进度条
    原文 ProgressBar 用于显示某个耗时操作完成的百分比的组件称为进度条。ProgressBar默认产生圆形进度条。 实现效果图: MainActivity import android.os.Bundle;import andro...
    99+
    2023-08-30
    android studio android ide
  • android怎么实现水平进度条
    在Android中,可以使用ProgressBar控件来实现水平进度条。下面是一种简单的实现方法:1. 首先,在XML布局文件中添加...
    99+
    2023-08-12
    android
  • Android新建水平节点进度条示例
    目录前言效果图圆圈和文字状态文字居中代码声明下style接着创建布局文件再Activity中使用它mTextList数据集合前言 效果图 前几天在网上没有找到合适的横向节点进度条,自...
    99+
    2024-04-02
  • Android怎么新建水平节点进度条
    本文小编为大家详细介绍“Android怎么新建水平节点进度条”,内容详细,步骤清晰,细节处理妥当,希望这篇“Android怎么新建水平节点进度条”文章能帮助大家解决疑惑,下面跟着小编的思路慢慢深入,一起来学习新知识吧。效果图前几天在网上没有...
    99+
    2023-07-02
  • Android如何实现带进度条的WebView
    这篇文章将为大家详细讲解有关Android如何实现带进度条的WebView,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。Android 实现带进度条的WebView的实例1. WebView加载网页方法/...
    99+
    2023-05-30
    android webview
  • Android实现带有指示器的进度条
    目录背景开干自定义View的流程(按照上述部分进行)测量绘制1. 指示器绘制2. 文字的绘制总结背景 当我们看到UI给我们设计的效果的时候,我们习惯性的思路就是看看google有...
    99+
    2024-04-02
  • Android中怎么自定义水平渐变进度条
    本篇文章给大家分享的是有关Android中怎么自定义水平渐变进度条,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。具体实现:新建类,继承自View,在onDraw中进行绘制:im...
    99+
    2023-05-30
    android
  • Android怎么实现进度条
    在Android中可以通过ProgressBar控件来实现进度条的显示和更新。下面是一个简单的例子,演示了如何在Android中使用...
    99+
    2023-08-12
    Android
  • android中实现OkHttp下载文件并带进度条
    OkHttp是比较火的网络框架,它支持同步与异步请求,支持缓存,可以拦截,更方便下载大文件与上传文件的操作。下面我们用OkHttp来下载文件并带进度条!相关资料: 官网地址:http://square.github.io/okhttp/gi...
    99+
    2023-05-30
    okhttp 下载 文件
  • Android如何实现pk进度条
    要实现Android上的PK进度条,可以使用ProgressBar控件来实现。以下是一个简单的示例:1. 在XML布局文件中添加Pr...
    99+
    2023-08-12
    Android
  • Android Studio实现进度条效果
    本文实例为大家分享了Android Studio实现进度条效果的具体代码,供大家参考,具体内容如下 实验作业 要求一个进度条,进度随机 效果图 xml代码 <?x...
    99+
    2024-04-02
  • Android Canva实现渐变进度条
    目录前言1、拆分2、绘制圆环3、我要圆圆的头4、渐变来啦5、不能严丝合缝?逼死强迫症6、治理调皮的小圆前言 标题说渐变进度条是为了方便理解,这里本身的项目背景是一款表盘的分针。 先上...
    99+
    2024-04-02
  • Android View实现圆形进度条
    本文实例为大家分享了Android View实现圆形进度条的具体代码,供大家参考,具体内容如下 主要涉及到下面几个方法: // 画圆 canvas.drawCircle // 画...
    99+
    2024-04-02
  • Android实现简单的加载进度条
    本文实例为大家分享了Android实现简单的加载进度条的具体代码,供大家参考,具体内容如下 1.效果图 2.自定义progressBar package com.example...
    99+
    2024-04-02
  • android如何实现圆形进度条
    要实现圆形进度条,可以使用Android的自定义控件来实现。首先,在layout文件中定义一个圆形进度条的布局,例如circle_p...
    99+
    2023-08-20
    android
  • Android实现蜗牛进度条效果
    友好的界面可以给用户留下深刻印象,为APP加分,今天实现的这个进度条,以蜗牛爬动的方式告诉用户当前进度,体验比较棒,这里分享一下。这里创建一组帧动画作为进度条的标志,如下:<?xml version="1.0" encodin...
    99+
    2023-05-31
    android 进度条 蜗牛
  • android实现动态显隐进度条
    本文实例为大家分享了android实现动态显隐进度条的具体代码,供大家参考,具体内容如下 调用 ProgressUtil.startProgress(this, new Prog...
    99+
    2024-04-02
  • android圆形进度条怎么实现
    要实现一个圆形进度条,你可以使用`ProgressBar`控件来实现,并将其样式设置为圆形。首先,在布局文件中添加以下代码:```x...
    99+
    2023-08-30
    android
  • Android实现下载进度条效果
    目录最终效果和对比vivo商店效果分析1 - 计算进度分析2 - 绘制圆角矩形解决方案分析3 - 绘制文字和交汇手势拓展完整代码具体使用最终效果和对比vivo商店效果 vivo应用商...
    99+
    2024-04-02
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作