How to Create a circular progressbar in Android which rotates on it?

Here are my two solutions. Short answer: Instead of creating a layer-list, I separated it into two files. One for ProgressBar and one for its background. This is the ProgressDrawable file (@drawable folder): circular_progress_bar.xml <?xml version=”1.0″ encoding=”utf-8″?> <rotate xmlns:android=”http://schemas.android.com/apk/res/android” android:fromDegrees=”270″ android:toDegrees=”270″> <shape android:innerRadiusRatio=”2.5″ android:shape=”ring” android:thickness=”1dp” android:useLevel=”true”><!– this line fixes the issue for lollipop api 21 … Read more

How to change ProgressBar’s progress indicator color in Android

I copied this from one of my apps, so there’s prob a few extra attributes, but should give you the idea. This is from the layout that has the progress bar: <ProgressBar android:id=”@+id/ProgressBar” style=”?android:attr/progressBarStyleHorizontal” android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:indeterminate=”false” android:maxHeight=”10dip” android:minHeight=”10dip” android:progress=”50″ android:progressDrawable=”@drawable/greenprogress” /> Then create a new drawable with something similar to the following (In this … Read more

ProgressDialog is deprecated.What is the alternate one to use?

Yes, in API level 26 it’s deprecated. Instead, you can use progressBar. To create it programmatically: First get a reference to the root layout RelativeLayout layout = findViewById(R.id.display); //specify here Root layout Id or RelativeLayout layout = findViewById(this); Then add the progress bar progressBar = new ProgressBar(youractivity.this, null, android.R.attr.progressBarStyleLarge); RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(100, 100); … Read more

How to change progress bar’s progress color in Android

For a horizontal ProgressBar, you can use a ColorFilter, too, like this: progressBar.getProgressDrawable().setColorFilter( Color.RED, android.graphics.PorterDuff.Mode.SRC_IN); Note: This modifies the appearance of all progress bars in your app. To only modify one specific progress bar, do this: Drawable progressDrawable = progressBar.getProgressDrawable().mutate(); progressDrawable.setColorFilter(Color.RED, android.graphics.PorterDuff.Mode.SRC_IN); progressBar.setProgressDrawable(progressDrawable); If progressBar is indeterminate then use getIndeterminateDrawable() instead of getProgressDrawable(). Since Lollipop … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)