์๋
์น๊ตฌ๋ค,
๋ด ์ฑ์์ SimpleDraweeView๋ฅผ ์ฌ์ฉํ๊ณ SimpleDraweeView๊ฐ ์ด๋ฏธ์ง๋ฅผ ๋ก๋ํ ๋ ๋ผ์ด๋ ์งํ ํ์์ค ์ฌ์ ์๋ฅผ ์ฌ์ฉํ๊ณ ์ถ์ต๋๋ค.
๋์์ฃผ์ธ์.
๋ด ์ฝ๋:
android:layout_height="wrap_content">
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/adapter_detail_iv"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:visibility="gone"
fresco:placeholderImage="@drawable/bg_default_loading_image" />
<LinearLayout
android:id="@+id/layout_progressbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:background="#33000000"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone">
<ProgressBar
android:id="@+id/indeterminate_progress_large_library"
style="@style/Widget.MaterialProgressBar.ProgressBar.Small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:indeterminate="true"
android:visibility="gone" />
</LinearLayout>
</FrameLayout>
์๋ง๋ ์ด๊ฒ์ด ๋น์ ์ ๋์ธ ๊ฒ์
๋๋ค.
https://github.com/facebook/fresco/pull/775
๋๋ ํ๋ ์ค์ฝ์๋ ์ด๋ฏธ ๋ถํ์คํ ์งํ๋ฅ ํ์๊ธฐ๊ฐ ์์ต๋๋ค. U๋ ProgressBarDrawable์ AutoRotateDrawable์ ์ฌ์ฉํ ์ ์์ต๋๋ค.
@cazador4 CircleProgressBarDrawable ์ ๊ตฌํํ๋ ค๊ณ ์๋ํ์ง๋ง ์ ๋ชจ์ ๋์ ํ์ํ์ด ๋ํ๋ฉ๋๋ค. ๋ฌด์์ด ๋ฌธ์ ๊ฐ ๋ ์ ์์ต๋๊น? ๋ด DraweeView๊ฐ ์ ์ฌ๊ฐํ์ด ์๋๊ธฐ ๋๋ฌธ์ผ๊น์?
@cazador4 CircleProgressBarDrawable ์ ๊ตฌํํ๋ ค๊ณ ์๋ํ์ง๋ง ์ ๋ชจ์ ๋์ ํ์ํ์ด ๋ํ๋ฉ๋๋ค. ๋ฌด์์ด ๋ฌธ์ ๊ฐ ๋ ์ ์์ต๋๊น? ๋ด DraweeView๊ฐ ์ ์ฌ๊ฐํ์ด ์๋๊ธฐ ๋๋ฌธ์ผ๊น์?
๊ทธ๊ฒ์ด ๋ฌธ์ ์ผ ์ ์์ต๋๋ค.
์ด์จ๋ ์ฌ์ฉ
setPlaceholderImage(
AutoRotateDrawable(
ContextCompat.getDrawable(
postMediaHolder.context,
R.drawable.ic_refresh
), 1000
), ScalingUtils.ScaleType.CENTER
)
๊ทธ๋ฆฌ๊ณ ์ค์์ ์์ด์ผ ํ๊ณ ๋๋ก์ด๋ธ์ ์ข ํก๋น์ ๋ฐฐ์จ์ ์์ ํด์ผ ํฉ๋๋ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
@cazador4 CircleProgressBarDrawable ์ ๊ตฌํํ๋ ค๊ณ ์๋ํ์ง๋ง ์ ๋ชจ์ ๋์ ํ์ํ์ด ๋ํ๋ฉ๋๋ค. ๋ฌด์์ด ๋ฌธ์ ๊ฐ ๋ ์ ์์ต๋๊น? ๋ด DraweeView๊ฐ ์ ์ฌ๊ฐํ์ด ์๋๊ธฐ ๋๋ฌธ์ผ๊น์?