android-progressbar

How does ProgressBar drawable work?

独自空忆成欢 提交于 2019-12-17 20:38:06
问题 Background I wanted to make a rounded progress bar that is determinate (meaning android:indeterminate="false" ), so I searched the Internet and found a short answer of Romain Guy, here. So I grabbed the code and used it in a sample project: the (part of the) layout file: <ProgressBar android:layout_width="50dp" android:layout_height="50dp" android:background="@color/backColor" android:indeterminate="false" android:indeterminateOnly="false" android:max="100" android:progress="33" android

Android 5.0 - ProgressBar cannot be displayed over a Button

耗尽温柔 提交于 2019-12-17 19:58:14
问题 I think the title is pretty explicit about my problem... So here is my layout : <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content"> <Button android:id="@+id/button_action" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Login" /> <ProgressBar android:id="@+id/progress_bar" android:layout_width="50dp" android:layout_height="50dp" android:layout_centerInParent="true"/> </RelativeLayout> On android SDKs < 21, no problem

Android progress bar with padding

泄露秘密 提交于 2019-12-17 16:26:42
问题 I want to make my progress bar looks something like that: I dont want to use images, so I have tried to make this with the shapes: <item android:id="@android:id/background"> <shape> <corners android:radius="50dp" /> <gradient android:angle="270" android:centerColor="#2a2723" android:centerY="0.75" android:endColor="#2a2723" android:startColor="#2a2723" /> </shape> </item> <item android:id="@android:id/secondaryProgress"> <clip> <shape> <corners android:radius="50dp" /> <gradient android:angle

Create a progressDialog only with the spinner (in the middle)

北战南征 提交于 2019-12-17 15:39:16
问题 I need to create a progressDialog only with the spinner and without the box (or at least with a smaller box and the image in the middle). I don't want to add a spinner to my .xml (layout file) to load the spinner. Is there any way to accomplish this? Thanks! 回答1: try this way: pd = new ProgressDialog(Login.this,R.style.MyTheme); pd.setCancelable(false); pd.setProgressStyle(android.R.style.Widget_ProgressBar_Small); pd.show(); And create Theme in values\styles.xml <style name="MyTheme" parent=

how to access downloads folder in android?

守給你的承諾、 提交于 2019-12-17 08:10:23
问题 I am new android, i'm making an app in which one can download files to downloads folder (using Download Manager). I can see pictures if i go to downloads folder in emulator. So if i want to show a slideshow of downloaded files how can i get the access to that folder? Secondly how to add progress bar to this code:-- import java.util.Arrays; import android.app.Activity; import android.app.DownloadManager; import android.app.DownloadManager.Query; import android.app.DownloadManager.Request;

How to display progress dialog before starting an activity in Android?

核能气质少年 提交于 2019-12-17 02:36:11
问题 How do you display a progress dialog before starting an activity (i.e., while the activity is loading some data) in Android? 回答1: You should load data in an AsyncTask and update your interface when the data finishes loading. You could even start a new activity in your AsyncTask's onPostExecute() method. More specifically, you will need a new class that extends AsyncTask: public class MyTask extends AsyncTask<Void, Void, Void> { public MyTask(ProgressDialog progress) { this.progress = progress

How to change ProgressBar's progress indicator color in Android

随声附和 提交于 2019-12-17 02:28:24
问题 I have set Horizontal ProgressBar . I would like to change the progress color to yellow. <ProgressBar android:id="@+id/progressbar" android:layout_width="80dip" android:layout_height="20dip" android:focusable="false" style="?android:attr/progressBarStyleHorizontal" /> The problem is, the progress color is different in different devices. So, I want it to fix the progress color. 回答1: I copied this from one of my apps, so there's prob a few extra attributes, but should give you the idea. This is

How to Customize a Progress Bar In Android

寵の児 提交于 2019-12-16 20:06:14
问题 I am working on an app in which I want to show a ProgressBar , but I want to replace the default Android ProgressBar . So how can I customize the ProgressBar ? Do I need some graphics and animation for that? I read the following post but could not get it to work: Custom Progress bar Android 回答1: Customizing a ProgressBar requires defining the attribute or properties for the background and progress of your progress bar. Create an XML file named customprogressbar.xml in your res->drawable

How to get ProgressBar to show while OnClickListener is running?

你。 提交于 2019-12-13 18:42:20
问题 I have a simple Android program that calculates how long it takes the phone to compute a certain mathematical problem. I want the mathematical problem to start when I hit the button, and while it is running I want a spinning progress bar to be displayed, and I want it to disappear after the math problem is done. This is the code I currently have: public class main extends AppCompatActivity { private TextView mScore; private Button mRunButton; private TextView mScoreText; private ProgressBar

Android use progressBar for the Audio [closed]

拈花ヽ惹草 提交于 2019-12-13 11:29:36
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 years ago . in my app many sounds . its run by Internet by url >> I want to set progress Bar in my app ? How I do it ? this is sound Activity: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android