Android ProgressBar UI custom layout

The solution (feels weird answering your own): First, one problem was that progress drawable had a different size than background (stupid me!). Also, for progress drawable a clip xml was needed. Something like progressbar_progress_clip.xml: <?xml version=”1.0″ encoding=”utf-8″?> <clip xmlns:android=”http://schemas.android.com/apk/res/android” android:drawable=”https://stackoverflow.com/questions/9921621/@drawable/progressbar_progressing” android:clipOrientation=”horizontal” android:gravity=”left”/> Then, add the progress bar and two images in a relative layout, so … Read more

Endless RecyclerView with ProgressBar for pagination

HERE IS SIMPLER AND CLEANER APPROACH. Implement Endless Scrolling from this Codepath Guide and then follow the following steps. 1. Add progress bar under the RecyclerView. <android.support.v7.widget.RecyclerView android:id=”@+id/rv_movie_grid” android:layout_width=”0dp” android:layout_height=”0dp” android:paddingBottom=”50dp” android:clipToPadding=”false” android:background=”@android:color/black” app:layout_constraintBottom_toBottomOf=”parent” app:layout_constraintEnd_toEndOf=”parent” app:layout_constraintStart_toStartOf=”parent” app:layout_constraintTop_toTopOf=”parent”> </android.support.v7.widget.RecyclerView> <ProgressBar android:id=”@+id/progressBar” style=”?android:attr/progressBarStyle” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:visibility=”invisible” android:background=”@android:color/transparent” app:layout_constraintBottom_toBottomOf=”parent” app:layout_constraintEnd_toEndOf=”parent” app:layout_constraintStart_toStartOf=”parent” /> Here android:paddingBottom=”50dp” and android:clipToPadding=”false” are very … Read more

Android Circular Determinate ProgressBar

I have written detailed example on Android circular progress bar here on my blog demonuts.com You can also fond full source code and explanation there. Here’s how I made circular progressbar with percentage inside circle in pure code without any library. first create a drawable file called circular.xml <?xml version=”1.0″ encoding=”utf-8″?> <layer-list xmlns:android=”http://schemas.android.com/apk/res/android”> <item android:id=”@android:id/secondaryProgress”> … Read more

Progress bar with divider

replace ProgressDrawable from my answer with the modified one: class ProgressDrawable extends Drawable { private static final int NUM_SEGMENTS = 4; private final int mForeground; private final int mBackground; private final Paint mPaint = new Paint(); private final RectF mSegment = new RectF(); public ProgressDrawable(int fgColor, int bgColor) { mForeground = fgColor; mBackground = bgColor; … Read more

Add a Progress Bar in WebView

I have added few lines in your code and now its working fine with progress bar. getWindow().requestFeature(Window.FEATURE_PROGRESS); setContentView(R.layout.main ); // Makes Progress bar Visible getWindow().setFeatureInt( Window.FEATURE_PROGRESS, Window.PROGRESS_VISIBILITY_ON); webview = (WebView) findViewById(R.id.webview); webview.setWebChromeClient(new WebChromeClient() { public void onProgressChanged(WebView view, int progress) { //Make the bar disappear after URL is loaded, and changes string to Loading… setTitle(“Loading…”); … Read more