Forráskód Böngészése

优化游戏详情界面

zengjiebin 7 éve
szülő
commit
3461776ca4

+ 8 - 1
app/src/main/java/com/sheep/gamegroup/helper/ImageListHelper.java

@@ -10,9 +10,13 @@ import com.bumptech.glide.Glide;
 import com.bumptech.glide.request.RequestOptions;
 import com.kfzs.appstore.utils.adapter.recyclerview.RecyclerViewAdapter;
 import com.kfzs.appstore.utils.adapter.recyclerview.ViewHolder;
+import com.sheep.gamegroup.model.entity.Lp;
 import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.gamegroup.util.ListUtil;
+import com.sheep.gamegroup.util.viewHelper.LayoutParamsUtil;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.utils.G;
 
 import java.util.ArrayList; /**
  * Created by realicing on 2018/7/5.
@@ -28,9 +32,12 @@ public class ImageListHelper {
             @Override
             public void convert(ViewHolder viewHolder, String url, final int position) {
                 View view = viewHolder.getView(R.id.img_detail);
+                boolean isFirstPosition = position == 0;
+                boolean isLastPosition = position + 1 == ListUtil.size(pictureList);
+                LayoutParamsUtil.resetLayoutParams(view, new Lp(G.DENSITY).setLeftMargin(isFirstPosition ? 12 : 6).setRightMargin(isLastPosition ? 12 : 6));
                 if (view instanceof ImageView) {
                     try {
-                        Glide.with(SheepApp.getInstance()).load(url).apply(new RequestOptions().centerCrop()).into((ImageView) view);
+                        Glide.with(SheepApp.getInstance()).load(url).into((ImageView) view);
                     } catch (Exception e) {
                         e.printStackTrace();
                     }

+ 18 - 5
app/src/main/java/com/sheep/gamegroup/util/TestUtil.java

@@ -287,11 +287,7 @@ public class TestUtil {
         }
         switch (item) {
             case "测试升级对话框":
-                Version version = new Version();
-                version.setMd5_address("123456");
-                version.setVersion_name(BuildConfig.VERSION_NAME);
-                version.setUpdate_content("更新内容(测试):\n1.修复bug;\n2.优化界面;\n3.添加宠物模块");
-                SysAppUtil.showUpgradeByVersion(version, null);
+                testUpgradeDialog();
                 break;
             case "少数民族姓名":
                 G.showToast(Boolean.toString(StringUtils.isChineseName("麦麦提·阿尤甫")));
@@ -660,6 +656,23 @@ public class TestUtil {
         }
     }
 
+    private static void testUpgradeDialog() {
+        SheepApp.getInstance().getNetComponent().getApiService().getNewVersion(SheepApp.getInstance().getConnectAddress().getVersionType())
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        Version version = baseMessage.getData(Version.class);
+                        SysAppUtil.showUpgradeByVersion(version, null);
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                    }
+                });
+    }
+
     private static void testReadText(String msg, float pitch) {
        TextToSpeechUtil.get().speakMsg(msg, pitch);
     }

+ 0 - 1
app/src/main/res/layout/act_game_group_or_game_detail.xml

@@ -224,7 +224,6 @@
                     android:id="@+id/viewPager"
                     android:layout_width="match_parent"
                     android:layout_height="match_parent"
-                    android:layout_marginTop="@dimen/content_padding_15"
                     android:minHeight="@dimen/view_size_100"
                     app:layout_behavior="@string/appbar_scrolling_view_behavior" />
 

+ 2 - 2
app/src/main/res/layout/fgt_gc_game_app_detail.xml

@@ -8,8 +8,8 @@
         android:id="@+id/gc_game_app_detail_pic_list"
         android:layout_width="match_parent"
         android:layout_height="130dp"
-        android:layout_marginTop="20dp"
-        android:layout_marginBottom="20dp" />
+        android:layout_marginTop="16dp"
+        android:layout_marginBottom="16dp" />
 
     <android.support.v7.widget.RecyclerView
         android:id="@+id/gc_game_app_detail_info_list"

+ 0 - 1
app/src/main/res/layout/header_gc_game_app_comment.xml

@@ -9,7 +9,6 @@
         android:id="@+id/header_gc_game_app_comment_title_score"
         style="@style/style_wc_line_title"
         android:layout_marginStart="15dp"
-        android:layout_marginTop="18dp"
         android:text="游戏评分"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toTopOf="parent" />

+ 2 - 1
app/src/main/res/layout/item_image.xml

@@ -8,6 +8,7 @@
         android:id="@+id/img_detail"
         android:layout_width="wrap_content"
         android:layout_height="match_parent"
-        android:layout_marginEnd="12dp" />
+        android:scaleType="fitXY"
+        android:adjustViewBounds="true" />
 
 </LinearLayout>