티스토리 뷰
반응형
1. drawable/circle_progressbar 을 만들어주자
<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromDegrees="0"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="360">
<shape
android:innerRadiusRatio="3"
android:shape="ring"
android:thicknessRatio="8"
android:useLevel="false">
<size
android:width="76dp"
android:height="76dp"/>
<gradient
android:angle="0"
android:endColor="@color/selected_color"
android:startColor="@color/transparent"
android:type="sweep"
android:useLevel="false"/>
</shape>
</rotate>
2. progressbar 설정
android:indeterminateDuration="1000" 원이 돌아가는 속도값
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:clickable="true"
android:background="@color/function_fragment_bg"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ProgressBar
android:visibility="gone"
android:layout_centerInParent="true"
android:indeterminateDrawable="@drawable/circle_progress"
android:indeterminateDuration="1000"
android:id="@+id/agree_progress_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</RelativeLayout>
3. View 설정
visible, gone, invisible 을 활용하여 사용
private ProgressBar progressBar;
progressBar = v.findViewById(R.id.progress_bar);
progressBar.setVisibility(View.VISIBLE);
반응형
'Android' 카테고리의 다른 글
[Android] 이미지 슬라이드 + Retrofit2 (AdapterViewFlipper) (0) | 2020.11.25 |
---|---|
Collection Framework (0) | 2020.11.25 |
[Android] Broadcast Receiver 를 이용한 App 자동 실행(전원이 켜질때) (0) | 2020.10.19 |
[Android] GLSurfaceView 캡처 → Bitmap → JPEG 변환 후, Retrofit2 post 이미지 전송(2) (0) | 2020.10.19 |
[Android] GLSurfaceView 캡처 → Bitmap → JPEG 변환 후, Retrofit2 post 이미지 전송(1) (0) | 2020.10.19 |
댓글