我正在显示一个水平样式,不确定的 ProgressDialog 如下:
progressDialog.setMessage("My progress dialog message");
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progressDialog.setIndeterminate(true);
progressDialog.show();
Run Code Online (Sandbox Code Playgroud)
不确定的水平进度图形/动画显示正常。但是,鉴于这是一个不确定的进度对话框,我希望分别隐藏左下角和右下角的“0%”和“0/100”标签。有人知道如何隐藏这些吗?
android android-ui android-progressbar android-asynctask android-alertdialog
我正在研究一个项目,它需要填写图像.意味着我想将图像形状用作进度条.我不知道如何使用自定义进度条.这是一个图像,它是一个图像按钮.
所以这是进度为100%的时候:
这为0%的进展:
我面临与progressBar.setProgress()和的问题progressBar.setMax()。
我有两个项目,通常需要像附加的屏幕截图一样显示视频的进度。仅对于第一个项目,在设置了进度之后,我有一些进度数据,我需要将第二个项目的进度设置为0(零)。但是第二项ProgressBar不会重置为零,而是显示为第一项的进度长度。
我在这里打印了Items的值:
// Item1
Media List total Duration : 84063
Media List total ProgressDuration : 19380
// Item2
Media List total Duration : 0
Media List total ProgressDuration : 0
Run Code Online (Sandbox Code Playgroud)
适配器代码:
class ViewHolder extends RecyclerView.ViewHolder {
TextView fileName;
ImageView ivThumbNail;
ProgressBar progressBar;
View mainContainer;
View view;
ViewHolder(View itemView) {
super(itemView);
view = itemView;
mainContainer = itemView.findViewById(R.id.main_container);
fileName = (TextView) itemView.findViewById(R.id.tv_file_name);
ivThumbNail = (ImageView) itemView.findViewById(R.id.iv_thumbnail);
progressBar = (ProgressBar) itemView.findViewById(R.id.progress_bar);
}
}
@Override
public ViewHolder …Run Code Online (Sandbox Code Playgroud) java android android-progressbar recycler-adapter android-recyclerview
我有一个默认进度条
对我来说,它的边界非常大。我怎样才能制作这样的进度条(带有细边框)?
我有一个简单的布局
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<ProgressBar
android:id="@+id/hello_progress_bar"
android:layout_width="210dp"
android:layout_height="210dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
Run Code Online (Sandbox Code Playgroud) 这应该是一个非常容易定制的样式......
我想要一个非常粗的水平进度条(或者我可以自定义厚度)并且颜色与应用程序颜色相匹配
如果我做
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_below="@id/textLoading"
android:layout_centerHorizontal="true"
android:indeterminate="true"
/>
Run Code Online (Sandbox Code Playgroud)
进度条是水平的,与应用程序的视觉标识相匹配……但是太薄了……这个人需要眼镜才能看到它
如果我做
<ProgressBar
android:id="@+id/progressBar"
style="android:Widget.ProgressBar.Horizontal"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_below="@id/textLoading"
android:layout_centerHorizontal="true"
android:indeterminate="true"
/>
Run Code Online (Sandbox Code Playgroud)
进度条的厚度很好,但颜色是愚蠢的黄色,与此 plannet 中的任何内容都不匹配
我如何自定义单个参数???
如何在Android中更改不确定的ProgressBar样式
我需要将此进度栏的颜色更改为红色:

有谁能够帮助我?
layout android android-widget android-progressbar progress-bar
我有一个复杂布局的列表R.layout.menu_row.它由一个ProgressBar和一个文本字段组成.我使用的适配器:
SimpleAdapter simpleAdapter = new SimpleAdapter(this, getData(path),
R.layout.menu_row, new String[] { "title", "progress" },
new int[] { R.id.text1,R.id.progressBar1});
Run Code Online (Sandbox Code Playgroud)
适配器知道如何自己处理TextViews但不是ProgressBars,所以我编写了一个复杂的数据绑定器:
SimpleAdapter.ViewBinder viewBinder = new SimpleAdapter.ViewBinder() {
@Override
public boolean setViewValue(View view, Object data, String textRepresentation) {
//here goes the code
if () {
return true;
}
return false;
}
Run Code Online (Sandbox Code Playgroud)
现在我被困在函数内填充映射.我需要将string的值设置progress为setProgress方法ProgressBar.但我没有得到字符串progress和句子的句柄ProgressBar.
android android-progressbar simpleadapter android-viewbinder
我有一个在xml中定义的进度条(swirly waiting style):
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@android:style/Widget.Holo.ProgressBar.Large"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:id="@+id/progress"
/>
Run Code Online (Sandbox Code Playgroud)
我隐藏它在活动onCreate方法中的可见性,使用,
progressBar.setVisibility(View.GONE);
Run Code Online (Sandbox Code Playgroud)
并onClick使用按钮的事件启动它
progressBar.setVisibility(View.VISIBLE);
Run Code Online (Sandbox Code Playgroud)
现在,如果我更改屏幕,则进度条会消失.我知道活动在方向更改时被销毁并重新创建,活动的状态将在保存的新方向中重新创建Bundle savedInstanceState.所以我认为Bundleandroid保存的默认值不包括对ProgressBarView对象所做的任何更改吗?
如果是这种情况,是否正确地说,在ProgressBar方向改变之后恢复正确可见性的唯一方法是boolean pbState = false/true通过覆盖方法onSaveInstanceState并检查此标志onRestoreInstanceState并相应地设置可见性来保存标志(例如)?或者,我遗漏了一些关于保存视图对象状态的明显信息.
谢谢
以下提供的解决方案都有效.我决定选择放入android:configChanges="orientation|screenSize"清单xml文件.但是,文档声明此方法应仅用作最后的手段.我的活动相当简单,因此清单xml方法减少了主活动所需的代码量,即没有onRestoreInstanceState方法.我认为如果你的活动更复杂,你可能想要使用后一种方法明确定义任何状态变化.

我想像上面的图像一样设计Circle Progress.
甚至名称和百分比必须显示在圈内.
请建议我这样做的任何库或方法.
在xml布局中,当我点击进度条时,我确实看到它位于我希望它的位置,但实时,我看不到它,感觉就像隐藏在按钮下方.

我试过了 :
似乎没有什么工作.
这是我的xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="match_parent">
<Button
android:id="@+id/button_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:elevation="1dp"
android:text="test button" />
<ProgressBar
android:id="@+id/progress"
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/button_id"
android:layout_alignTop="@+id/button_id"
android:layout_centerHorizontal="true"
android:indeterminate="true"
android:indeterminateTint="@android:color/holo_blue_dark"
android:visibility="visible" />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud) android android-layout android-progressbar android-xml android-button