ソースを参照

天天更新、重点推荐列表图片显示优化

zengjiebin 7 年 前
コミット
7ea1c546a7

+ 3 - 2
app/src/main/java/com/sheep/gamegroup/util/GlideImageLoader.java

@@ -14,6 +14,7 @@ import com.bumptech.glide.request.RequestListener;
 import com.bumptech.glide.request.RequestOptions;
 import com.sheep.gamegroup.util.glide.BlurTransformation;
 import com.sheep.gamegroup.util.glide.GlideCircleTransformWithBorder;
+import com.sheep.gamegroup.util.glide.RoundedCornersTransformation;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.ClassFileHelper;
@@ -90,14 +91,14 @@ public class GlideImageLoader {
     public static void roundedCornersImage(ImageView imageView, String url, int radius, int id) {
         Glide.with(SheepApp.getInstance())
                 .load(url)
-                .apply(new RequestOptions().transform(new RoundedCorners(radius)).placeholder(id))
+                .apply(new RequestOptions().transform(new RoundedCornersTransformation(radius, 0)).placeholder(id))
                 .into(imageView);
     }
 
     public static void roundedCornersImage(ImageView imageView, String url, int radius) {
         Glide.with(SheepApp.getInstance())
                 .load(url)
-                .apply(new RequestOptions().transform(new RoundedCorners(radius)).placeholder(R.drawable.loading_01))
+                .apply(new RequestOptions().transform(new RoundedCornersTransformation(radius, 0)).placeholder(R.drawable.loading_01))
                 .into(imageView);
     }
     public static void roundedCornersImage1(ImageView imageView, String url, int radius) {

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/view/adapter/AdpGameCenter1_2List.java

@@ -68,7 +68,7 @@ public class AdpGameCenter1_2List extends RecyclerViewAdapter<ListTypeList<GameR
                     ViewUtil.setDefaultText(item_play_game_name);
                 } else {
                     ViewUtil.setText(item_play_game_name, item.getTitle());
-                    ViewUtil.setImage(item_play_game_iv, item.getUrl(), mContext.getResources().getDimensionPixelSize(R.dimen.content_padding_3));
+                    ViewUtil.setImage(item_play_game_iv, item.getUrl(), mContext.getResources().getDimensionPixelSize(R.dimen.content_padding_10));
                     holder.itemView.setOnClickListener(new View.OnClickListener() {
                         @Override
                         public void onClick(View view) {

+ 4 - 3
app/src/main/res/layout/item_play_game.xml

@@ -9,7 +9,7 @@
         android:layout_height="146dp" />
 
     <RelativeLayout
-        android:layout_width="270dp"
+        android:layout_width="wrap_content"
         android:layout_height="146dp"
         android:layout_marginTop="16dp"
         android:layout_marginBottom="16dp"
@@ -18,9 +18,10 @@
 
         <ImageView
             android:id="@+id/item_play_game_iv"
-            android:layout_width="match_parent"
+            android:layout_width="wrap_content"
             android:layout_height="match_parent"
-            android:scaleType="centerCrop"
+            android:adjustViewBounds="true"
+            android:scaleType="fitXY"
             android:src="@mipmap/home_blue_bg" />
 
         <TextView