Remove vertical padding from horizontal ProgressBar
I use the following as a workaround for this issue. android:layout_marginBottom=”-8dp” android:layout_marginTop=”-4dp”
I use the following as a workaround for this issue. android:layout_marginBottom=”-8dp” android:layout_marginTop=”-4dp”
try this custom Drawable: class ProgressDrawable extends Drawable { private static final int NUM_RECTS = 10; Paint mPaint = new Paint(); @Override protected boolean onLevelChange(int level) { invalidateSelf(); return true; } @Override public void draw(Canvas canvas) { int level = getLevel(); Rect b = getBounds(); float width = b.width(); for (int i = 0; i … Read more
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
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
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
I wasn’t fully satisfied with the accepted answer above, so I did some extra research myself. The trick I believe they used is that they retrieved the top view in the view hierarchy called DecorView and added the progress bar in there. That way, the progress bar displays both over the action bar AND the … Read more
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
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
For your first question try Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS); (available since API 8) To access individual files in this directory use either File.list() or File.listFiles(). Seems that reporting download progress is only possible in notification, see here.
For API 21 and Higher. Simply set the indeterminateTint property. Like: android:indeterminateTint=”@android:color/holo_orange_dark” To support pre-API 21 devices: mProgressSpin.getIndeterminateDrawable() .setColorFilter(ContextCompat.getColor(this, R.color.colorPrimary), PorterDuff.Mode.SRC_IN );