Pārlūkot izejas kodu

展示BUG修复

1.修复邀请界面分享图显示不完整的问题
2.修复邀请界面logo不在二维码正中心的问题
3.修复邀请界面二维码下的文字提示显示不完整的问题
zhoujuncai 7 gadi atpakaļ
vecāks
revīzija
789022ecae

+ 16 - 13
app/src/main/java/com/sheep/gamegroup/view/activity/ActInvitation.java

@@ -18,7 +18,6 @@ import android.view.View;
 import android.widget.ImageView;
 import android.widget.TextView;
 
-import com.alibaba.fastjson.JSONObject;
 import com.bumptech.glide.Glide;
 import com.bumptech.glide.load.DataSource;
 import com.bumptech.glide.load.engine.GlideException;
@@ -37,7 +36,6 @@ import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.transformer.ScaleTransformer;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.DataUtil;
-import com.sheep.gamegroup.util.FastJsonUtils;
 import com.sheep.gamegroup.util.GlideImageLoader;
 import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.StringUtils;
@@ -104,6 +102,7 @@ public class ActInvitation extends BaseActivity {
     protected int getLayoutId() {
         return R.layout.act_invitation;
     }
+
     private List<PictureInvitationEntity> mPictureList = new ArrayList<>();
     private List<View> viewArrayList = new ArrayList<>();
 
@@ -111,7 +110,7 @@ public class ActInvitation extends BaseActivity {
     @Override
     public void initView() {
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
-            main_layout.setPadding(0, 0, 0, G.getHasVirtualKey(this) -G.getNoHasVirtualKey(this) );
+            main_layout.setPadding(0, 0, 0, G.getHasVirtualKey(this) - G.getNoHasVirtualKey(this));
 
         }
     }
@@ -128,7 +127,7 @@ public class ActInvitation extends BaseActivity {
     @Override
     public void initData() {
         showProgress();
-        if(userEntity == null) {
+        if (userEntity == null) {
             CommonUtil.getInstance().callActionWithUserInfo(new Action1<UserEntity>() {
                 @Override
                 public void call(UserEntity userEntity) {
@@ -188,15 +187,17 @@ public class ActInvitation extends BaseActivity {
                     }
                 });
     }
+
     private int load = 0;
+
     private void checkLoadLinkAndDesFinish() {
-        if(userEntity  != null && friendAndAwardEntity != null){
+        if (userEntity != null && friendAndAwardEntity != null) {
             init(userEntity.getShareLink(), friendAndAwardEntity.getShare_desc());
         }
     }
 
     private void checkLoadFinish() {
-        if(load == 3){
+        if (load == 3) {
             hideProgress();
         }
     }
@@ -223,7 +224,7 @@ public class ActInvitation extends BaseActivity {
                             return false;
                         }
                     })
-                    .apply(new RequestOptions().centerCrop().transform(new RoundedCorners((int) getResources().getDimension(R.dimen.content_padding_8))))
+                    .apply(new RequestOptions().transform(new RoundedCorners((int) getResources().getDimension(R.dimen.content_padding_8))).fitCenter())
                     .into(image_full);
             GlideImageLoader.saveAndSetRqImage(image_bottom, item.getLink(), 800);
             viewArrayList.add(itemView);
@@ -250,9 +251,10 @@ public class ActInvitation extends BaseActivity {
 
             }
         });
-        if(size > 2)
-            viewPager.setCurrentItem((size-1) / 2, false);
+        if (size > 2)
+            viewPager.setCurrentItem((size - 1) / 2, false);
     }
+
     private int curPosition = 0;
     private SparseArray<View> viewList = new SparseArray<>();
 
@@ -297,11 +299,11 @@ public class ActInvitation extends BaseActivity {
                     @Override
                     public void onClick(View view) {
                         File file = null;
-                        switch (position){
+                        switch (position) {
                             case 2://qq
                             case 1://wx
                                 PictureInvitationEntity picItem = ListUtil.getItem(mPictureList, curPosition);
-                                if(picItem != null && picItem.isLoaded()) {
+                                if (picItem != null && picItem.isLoaded()) {
                                     try {
                                         String fileName = String.format(Locale.CHINA, "share%d%s%d.jpg", position, BuildConfig.FLAVOR, picItem.getPicture().hashCode());
                                         file = new File(ClassFileHelper.DIR, fileName);
@@ -392,7 +394,7 @@ public class ActInvitation extends BaseActivity {
                 break;
         }
         UMImage umImage;
-        switch (type){
+        switch (type) {
             case DialogShare.QQ:
             case DialogShare.WX:
                 umImage = new UMImage(activity, file);
@@ -405,7 +407,7 @@ public class ActInvitation extends BaseActivity {
         umWeb.setTitle(activity.getResources().getString(R.string.app_name));
         umWeb.setThumb(umImage);
         umWeb.setDescription(TextUtils.isEmpty(description) ? activity.getResources().getString(R.string.app_name) : description);
-        switch (type){
+        switch (type) {
             case DialogShare.QQ:
             case DialogShare.WX:
                 new ShareAction(activity)
@@ -423,6 +425,7 @@ public class ActInvitation extends BaseActivity {
                 break;
         }
     }
+
     @OnClick(R.id.img_baseactivity_title)
     public void onViewClicked(View view) {
         switch (view.getId()) {

+ 12 - 13
app/src/main/res/layout/item_image2.xml

@@ -1,16 +1,14 @@
 <?xml version="1.0" encoding="utf-8"?>
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/layout_view"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content">
 
     <ImageView
         android:id="@+id/image_full"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:layout_centerHorizontal="true"
-        android:adjustViewBounds="true"
-        android:scaleType="fitXY" />
+        android:layout_centerHorizontal="true" />
 
     <LinearLayout
         android:layout_width="70dp"
@@ -23,10 +21,11 @@
         <RelativeLayout
             android:layout_width="wrap_content"
             android:layout_height="0dp"
-            android:layout_weight="8"
-            android:paddingEnd="4dp"
-            android:paddingStart="4dp"
-            android:paddingTop="4dp">
+            android:layout_gravity="center_horizontal"
+            android:layout_marginLeft="4dp"
+            android:layout_marginTop="4dp"
+            android:layout_marginRight="4dp"
+            android:layout_weight="1">
 
             <ImageView
                 android:id="@+id/image_bottom"
@@ -44,10 +43,10 @@
 
         <TextView
             android:layout_width="match_parent"
-            android:layout_height="0dp"
-            android:layout_weight="1"
-            android:layout_marginTop="-3dp"
-            android:gravity="top|center_horizontal"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="1dp"
+            android:layout_marginBottom="3dp"
+            android:gravity="center"
             android:text="扫我开始赚钱"
             android:textColor="#ff999999"
             android:textSize="8sp" />