billyyoyo před 6 roky
rodič
revize
d04fd51843

+ 1 - 1
app/build.gradle

@@ -305,7 +305,7 @@ dependencies {
     //    implementation 'com.github.zhangkexpz:LayoutScroll:v1.0'
 
     //    implementation 'me.iwf.photopicker:PhotoPicker:0.9.12@aar'
-    implementation(name: 'PhotoPicker-release-201810081154', ext: 'aar')
+    implementation(name: 'PhotoPicker-release-20200506', ext: 'aar')
     implementation('com.github.bumptech.glide:glide:4.9.0') {
         exclude group: 'com.android.support', module: 'support-fragment'
 //        exclude group: 'com.github.bumptech.glide', module: 'gifdecoder'

binární
app/libs/PhotoPicker-release-201810081154.aar


binární
app/libs/PhotoPicker-release-20200506.aar


+ 3 - 4
app/src/main/java/com/sheep/gamegroup/absBase/AbsChooseImageActivity.java

@@ -78,7 +78,7 @@ public abstract class AbsChooseImageActivity extends BaseActivity implements UpF
                     .setShowCamera(showCamera)
                     .setShowGif(false)
                     .setPreviewEnabled(true)
-                    .setPicker(ListUtil.asList(new ListUtil.CallBack<File, String>() {
+                    .setSelected(ListUtil.asList(new ListUtil.CallBack<File, String>() {
                         @Override
                         public String call(File file) {
                             return file.getAbsolutePath();
@@ -105,7 +105,7 @@ public abstract class AbsChooseImageActivity extends BaseActivity implements UpF
                     .setShowCamera(showCamera)
                     .setShowGif(false)
                     .setPreviewEnabled(true)
-                    .setPicker(imageUriList)
+                    .setSelected(imageUriList)
                     .start(this, PhotoPicker.REQUEST_CODE);
         } else {
             G.showToast("暂无截图(若您已经截图,请查看是否开启查看应用使用情况等权限!)");
@@ -127,8 +127,7 @@ public abstract class AbsChooseImageActivity extends BaseActivity implements UpF
                 .setShowCamera(showCamera)
                 .setShowGif(false)
                 .setPreviewEnabled(true)
-                .setPickerAll(true)
-                .setPicker(imageUriList)
+                .setSelected(imageUriList)
                 .start(this, PhotoPicker.REQUEST_CODE);
     }
 

+ 17 - 0
app/src/main/java/com/sheep/gamegroup/module/home/adapter/BannerImageLoader.java

@@ -0,0 +1,17 @@
+package com.sheep.gamegroup.module.home.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.ImageView;
+
+import com.sheep.jiuyan.samllsheep.R;
+import com.youth.banner.loader.ImageLoaderInterface;
+
+public abstract class BannerImageLoader implements ImageLoaderInterface<View> {
+
+    @Override
+    public View createImageView(Context context) {
+        return LayoutInflater.from(context).inflate(R.layout.banner_image_layout, null, false);
+    }
+}

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/util/Jump2View.java

@@ -1443,7 +1443,7 @@ public class Jump2View {
                 .setShowCamera(false)
                 .setShowGif(false)
                 .setPreviewEnabled(true)
-                .setPicker(ListUtil.asList(new ListUtil.CallBack<File, String>() {
+                .setSelected(ListUtil.asList(new ListUtil.CallBack<File, String>() {
                     @Override
                     public String call(File file) {
                         return file.getAbsolutePath();

+ 13 - 6
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtSmallSheep.java

@@ -78,6 +78,7 @@ import com.sheep.gamegroup.module.game.util.HpRefreshWelfareHelper;
 import com.sheep.gamegroup.module.guide.NewbieGuideHelper;
 import com.sheep.gamegroup.module.home.GoodsRecommendsBarHelper;
 import com.sheep.gamegroup.module.home.adapter.AdpHomeList;
+import com.sheep.gamegroup.module.home.adapter.BannerImageLoader;
 import com.sheep.gamegroup.module.home.fragment.FgtDailyPlayList;
 import com.sheep.gamegroup.module.home.fragment.FgtPromoteGoodsList;
 import com.sheep.gamegroup.module.skin.util.SkinUtil;
@@ -564,7 +565,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
     private int bannerHeight;
 
     private void initBannerHeight() {
-        bannerHeight = ScreenUtil.getScreenWidth(getContext()) * 17 / 40;
+        bannerHeight = (ScreenUtil.getScreenWidth(getContext())) * 17 / 40;
     }
 
     //游戏福利专区入口与刷新福利
@@ -592,7 +593,6 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
 //        bannerLayoutParams.height = G.WIDTH * 25 / 72;
 //        banner.setLayoutParams(bannerLayoutParams);
         LayoutParamsUtil.resetLayoutParams(banner, new Lp().setHeight(bannerHeight));
-        banner.setPadding(G.getRealPix(8), G.getRealPix(8), G.getRealPix(8), G.getRealPix(8));
         /**
          * tablayout
          */
@@ -1295,13 +1295,20 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
         });
         //设置图片加载器
         banner
-                .setImageLoader(new ImageLoader() {
+                .setImageLoader(new BannerImageLoader() {
                     @Override
-                    public void displayImage(Context context, Object o, ImageView imageView) {
+                    public void displayImage(Context context, Object o, View view) {
                         try {
                             if (activity != null && !activity.isDestroyed()) {
-//                        GlideImageLoader.roundedCornersImage(imageView, ((SlideshowEty) o).getUrl(), G.getRealPix(10));
-                                Glide.with(context).load(o.toString()).apply(new RequestOptions().centerCrop().transform(new RoundedCorners(G.getRealPix(8)))).into(imageView);
+//                                GlideImageLoader.roundedCornersImage(imageView, o.toString(), G.getRealPix(10));
+//                                imageView.setPadding(G.getRealPix(8), G.getRealPix(8), G.getRealPix(8), G.getRealPix(8));
+                                ImageView iv = view.findViewById(R.id.banner_image_iv);
+                                Glide.with(context)
+                                        .load(o.toString())
+//                                        .override(ScreenUtil.getScreenWidth(getContext()) - G.getRealPix(16), bannerHeight)
+                                        .apply(new RequestOptions()
+                                                .transform(new RoundedCorners(G.getRealPix(8))))
+                                        .into(iv);
                             }
                         } catch (Exception e) {
                             e.printStackTrace();

+ 13 - 0
app/src/main/res/layout/banner_image_layout.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:gravity="center"
+    android:orientation="vertical">
+    <ImageView
+        android:id="@+id/banner_image_iv"
+        android:scaleType="centerInside"
+        android:adjustViewBounds="true"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content" />
+</LinearLayout>

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

@@ -4,6 +4,7 @@
     android:id="@+id/banner"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
+    android:padding="@dimen/content_padding_8"
     app:indicator_margin="2dp"
     app:indicator_height="5dp"
     app:indicator_width="5dp"