mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-31 21:41:33 +00:00
Material circular progress indicator
This commit is contained in:
parent
ecd98e468d
commit
62c94b0181
5 changed files with 33 additions and 24 deletions
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/login_progress_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
@ -20,15 +21,16 @@
|
|||
android:text="@string/login_logging_in"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<ProgressBar
|
||||
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||
android:id="@+id/login_logging_in_progress"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
style="?circleProgressIndicator"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="15dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_toLeftOf="@id/login_logging_in"
|
||||
android:indeterminateOnly="true"
|
||||
android:visibility="visible" />
|
||||
android:indeterminate="true"
|
||||
app:indicatorSize="32dp"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/login_profile_picture"
|
||||
|
@ -50,18 +52,19 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:text="@string/login_retrieving_feeds"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<ProgressBar
|
||||
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||
android:id="@+id/login_feed_progress"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_toLeftOf="@id/login_retrieving_feeds"
|
||||
android:indeterminateOnly="true"
|
||||
android:visibility="invisible" />
|
||||
android:indeterminate="true"
|
||||
android:visibility="invisible"
|
||||
app:indicatorSize="32dp"/>
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ViewSwitcher xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/view_switcher"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
@ -15,11 +16,13 @@
|
|||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ProgressBar
|
||||
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||
style="?circleProgressIndicator"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:indeterminateOnly="true" />
|
||||
android:indeterminate="true"
|
||||
app:indicatorSize="32dp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="?selectorFeedBackground" >
|
||||
style="?selectorFeedBackground">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/row_feedcounters"
|
||||
|
@ -72,13 +73,15 @@
|
|||
style="?muteicon"
|
||||
android:background="@drawable/neutral_count_rect"/>
|
||||
|
||||
<ProgressBar
|
||||
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||
android:id="@+id/row_feedfetching"
|
||||
android:layout_width="21dp"
|
||||
android:layout_height="21dp"
|
||||
android:layout_marginRight="3dp"
|
||||
style="?circleProgressIndicator"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
android:visibility="gone"
|
||||
android:indeterminate="true" />
|
||||
app:trackThickness="2dp"
|
||||
app:indicatorSize="16dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@ import android.util.Log
|
|||
import android.view.KeyEvent
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.widget.ProgressBar
|
||||
import android.widget.SeekBar
|
||||
import android.widget.SeekBar.OnSeekBarChangeListener
|
||||
import android.widget.Toast
|
||||
|
@ -18,6 +17,7 @@ import androidx.loader.app.LoaderManager
|
|||
import androidx.loader.content.Loader
|
||||
import androidx.viewpager.widget.ViewPager
|
||||
import androidx.viewpager.widget.ViewPager.OnPageChangeListener
|
||||
import com.google.android.material.progressindicator.CircularProgressIndicator
|
||||
import com.newsblur.R
|
||||
import com.newsblur.database.ReadingAdapter
|
||||
import com.newsblur.databinding.ActivityReadingBinding
|
||||
|
@ -526,7 +526,7 @@ abstract class Reading : NbActivity(), OnPageChangeListener, OnSeekBarChangeList
|
|||
enableProgressCircle(binding.readingOverlayProgressLeft, enabled)
|
||||
}
|
||||
|
||||
private fun enableProgressCircle(view: ProgressBar, enabled: Boolean) {
|
||||
private fun enableProgressCircle(view: CircularProgressIndicator, enabled: Boolean) {
|
||||
runOnUiThread {
|
||||
if (enabled) {
|
||||
view.progress = 0
|
||||
|
|
|
@ -22,10 +22,10 @@ import android.widget.BaseExpandableListAdapter;
|
|||
import android.widget.ExpandableListView;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.google.android.material.progressindicator.CircularProgressIndicator;
|
||||
import com.newsblur.R;
|
||||
import com.newsblur.domain.Feed;
|
||||
import com.newsblur.domain.Folder;
|
||||
|
@ -311,7 +311,7 @@ public class FolderListAdapter extends BaseExpandableListAdapter {
|
|||
TextView posCounter = ((TextView) v.findViewById(R.id.row_feedpositive));
|
||||
TextView savedCounter = ((TextView) v.findViewById(R.id.row_feedsaved));
|
||||
ImageView muteIcon = ((ImageView) v.findViewById(R.id.row_feedmuteicon));
|
||||
ProgressBar fetchingIcon = ((ProgressBar) v.findViewById(R.id.row_feedfetching));
|
||||
CircularProgressIndicator fetchingIcon = ((CircularProgressIndicator) v.findViewById(R.id.row_feedfetching));
|
||||
if (!f.active) {
|
||||
muteIcon.setVisibility(View.VISIBLE);
|
||||
neutCounter.setVisibility(View.GONE);
|
||||
|
|
Loading…
Add table
Reference in a new issue