android-progressbar

How to change the colour and pattern of the circualar progress in Android?

社会主义新天地 提交于 2019-12-06 23:30:28
I use the below code to generate the circular progress. But I don't know how to change the pattern and color of it. <rotate xmlns:android="http://schemas.android.com/apk/res/android" android:pivotX="10%" android:pivotY="10%" android:fromDegrees="0" android:toDegrees="360"> <shape android:shape="ring" android:innerRadiusRatio="0" android:thicknessRatio="6" android:useLevel="false"> <size android:width="10dip" android:height="10dip" /> <gradient android:type="linear" android:useLevel="false" android:startColor="#000000" android:endColor="#000000" android:angle="0" /> </shape> </rotate> It

Android: how to disable controls during progress bar is active

拟墨画扇 提交于 2019-12-06 18:05:28
问题 I show my infinte progress bar in the action bar "as usual": requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); ... setProgressBarIndeterminateVisibility(true); ... setProgressBarIndeterminateVisibility(false); and the real work is done in a background thread (AsyncTask) The problem: all controls on the UI are enabled, so the user can continue to modify the underlying data before the long lasting process is finished. Simply disabling all controls is not possible because when

Android - Downloading File by updating Progress Bar

筅森魡賤 提交于 2019-12-06 11:39:08
I have multiple files in dropbox account. I am successfully downloading files. But I want to show the progress bar with the percentage so when all files gets downloaded.The progress bar finishes.I am using AsyncTask for downloading files.here is my code. public void onPreExecute(){ mDialog = new ProgressDialog(mContext); mDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); mDialog.setMax(100); mDialog.show(); } public void downloadFiles(String filename){ Log.i("Item Name",filename); File dir = null; Boolean isSDPresent = android.os.Environment.getExternalStorageState().equals(android.os

Rounded gradient in custom Progress Bar

我们两清 提交于 2019-12-05 19:42:55
How would you make rounded gradient for ProgressBar like on screen? What I have now: pb_shape.xml : <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@android:id/background"> <shape> <corners android:radius="12dip" /> <stroke android:width="1dip" android:color="@color/primary_white" /> <gradient android:angle="270" android:centerColor="@color/primary_black" android:centerY="0.5" android:endColor="@color/primary_black" android:startColor="@color/primary_black"/> <padding android:bottom="4dp" android:left="4dp"

Show activity circle before loading webview - Android

社会主义新天地 提交于 2019-12-05 14:44:25
I am using webview to show a webpage in my app. The webpage takes about 2-3 seconds to load. Till the webpage loads, I want to show an activity circle progress bar like the one shown here . This is what an activity circle looks like : How can I accomplish it? I searched the web but couldn't find a satisfactory and proper explanation of how it is implemented. Thanks! WebViewPage.java public class Webpage extends Activity { WebView web; ProgressBar progressBar; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.web_page);

findViewById(android.R.id.progress) returns null

三世轮回 提交于 2019-12-05 05:58:43
The Android Developers reference lists R.id.progress among the built-in View resources available. Yet, when I issue (in my activity class) the statement: View pv = getWindow().findViewById(android.R.id.progress); It returns null. It returns null even when I use it in conjunction with the ProgressBar class: ProgressBar pv = (ProgressBar) getWindow().findViewById(android.R.id.progress); And it returns null even without the getWindow() : ProgressBar pv = (ProgressBar) findViewById(android.R.id.progress); Any idea why? To make sure I'm not hallucinating, I followed @Geobits's advice and created a

How to change ProgressDialog Spinner color in Android? [duplicate]

元气小坏坏 提交于 2019-12-05 04:10:54
This question already has an answer here: How to change color in circular progress bar? 18 answers I am trying to add a customized ProgressDialog to my Activity . I successfully changed the ProgressDialog font and the background colors, but I don't know how to change the spinner color without using a widget. Can anyone help me? This is my Activity code: myPd_bar=new ProgressDialog(Ratings.this,R.style.Theme_MyDialog); myPd_bar.setMessage("Loading...."); myPd_bar.setTitle(null); myPd_bar.show(); This is my styles.xml code: <style name="Theme.MyDialog" parent="@android:style/Theme.Dialog"> <item

Android custom circle progress bar

柔情痞子 提交于 2019-12-05 04:07:51
问题 I want to design Circle Progress like above image. Even names and percentage Has to shown inside circle. Please suggest me any library or method to do so. 回答1: finally I found the solution from here, https://github.com/ylyc/circular_progress_bar. It works fine. thanks to all.. 回答2: I don't know about any library that will do this for you, but I would just use the Path class for the circular view and plain TextViews for the percentages. 回答3: Write a custom view which would draw an Arc in the

How to create 'Horizontal style' progress bar programmatically in Android?

醉酒当歌 提交于 2019-12-04 22:19:03
I am creating a ProgressBar in my app programmatically it is of SPIN style by default however I want it in HORIZONTAL style. I don't see any method/constant to achieve this. And I don't want to use ProgressDialog as it'd be inconsistent with my App UI theme. Any suggestions please? waqaslam use this: ProgressBar pb = new ProgressBar(context, null, android.R.attr.progressBarStyleHorizontal); If you are using a ProgressDialog then, here is a way to change the style of the progressBar in the ProgressDialog. mProgressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); 来源: https:/

How to make custom Indeterminate ProgressBar

痞子三分冷 提交于 2019-12-04 17:15:57
How can I change style of indetermine ProgressBar in Android I need to change color to RED for this progressbar: Can anybody help me? I got the android source code so I saw how they build de spinner loader, and it's very eassy just two steps 1- create a drawable resource in your drawable folder with you image like below (and named it f.i my_loader) <animated-rotate xmlns:android="http://schemas.android.com/apk/res/android" android:drawable="@drawable/your_image_loader" android:pivotX="50%" android:pivotY="50%" /> 2- in your layout <LinearLayout android:layout_width="wrap_content" android