diff --git a/FCL/src/main/java/com/tungsten/fcl/ui/download/RemoteModInfoPage.java b/FCL/src/main/java/com/tungsten/fcl/ui/download/RemoteModInfoPage.java index 679f8d03..e4901812 100644 --- a/FCL/src/main/java/com/tungsten/fcl/ui/download/RemoteModInfoPage.java +++ b/FCL/src/main/java/com/tungsten/fcl/ui/download/RemoteModInfoPage.java @@ -7,6 +7,7 @@ import android.graphics.BitmapFactory; import android.view.View; import android.widget.ListView; +import com.bumptech.glide.Glide; import com.tungsten.fcl.R; import com.tungsten.fcl.setting.Profile; import com.tungsten.fcl.ui.PageManager; @@ -100,19 +101,7 @@ public class RemoteModInfoPage extends FCLTempPage implements View.OnClickListen super.onStart(); icon.setImageDrawable(null); - new Thread(() -> { - try { - URL url = new URL(addon.getIconUrl()); - HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection(); - httpURLConnection.setDoInput(true); - httpURLConnection.connect(); - InputStream inputStream = httpURLConnection.getInputStream(); - Bitmap icon = BitmapFactory.decodeStream(inputStream); - Schedulers.androidUIThread().execute(() -> RemoteModInfoPage.this.icon.setImageBitmap(icon)); - } catch (IOException e) { - e.printStackTrace(); - } - }).start(); + Glide.with(getContext()).load(addon.getIconUrl()).into(icon); ModTranslations.Mod mod = translations.getModByCurseForgeId(addon.getSlug()); name.setText(mod != null && LocaleUtils.isChinese(getContext()) ? mod.getDisplayName() : addon.getTitle()); description.setText(addon.getDescription()); diff --git a/FCL/src/main/res/layout/page_download.xml b/FCL/src/main/res/layout/page_download.xml index b92f03c1..9cc107d4 100644 --- a/FCL/src/main/res/layout/page_download.xml +++ b/FCL/src/main/res/layout/page_download.xml @@ -1,232 +1,231 @@ + android:layout_height="match_parent" + android:background="@color/ui_bg_color" + android:paddingStart="10dp" + android:paddingTop="10dp" + android:paddingEnd="10dp"> + android:layout_weight="1" + android:background="@drawable/bg_container_white"> + android:orientation="vertical" + android:padding="10dp"> + app:auto_text_tint="true" /> + app:auto_edit_tint="true" /> + app:auto_text_tint="true" /> + android:layout_marginTop="10dp" /> + app:auto_text_tint="true" /> + android:layout_marginTop="10dp" /> + app:auto_text_tint="true" /> + android:layout_marginTop="10dp" /> + app:auto_text_tint="true" /> + android:layout_marginTop="10dp" /> + android:layout_marginTop="10dp" + android:text="@string/install_modpack" + android:visibility="gone" + app:ripple="true" /> + android:layout_marginTop="10dp" + android:text="@string/search" + app:ripple="true" /> - + android:orientation="horizontal" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@+id/left"> - + - - - - - - - - - - - - - - - - - - - + android:layout_gravity="center" + android:layout_marginStart="10dp" + android:padding="10dp" + android:text="@string/search_previous_page" + app:auto_padding="false" + app:ripple="true" /> - + android:layout_gravity="center" + android:layout_marginStart="10dp" + android:padding="10dp" + android:text="@string/search_next_page" + app:auto_padding="false" + app:ripple="true" /> - + + + + + + + + + + + \ No newline at end of file