Ver código fonte

banner使用第三方的

zengjiebin 7 anos atrás
pai
commit
c50814bb79

+ 2 - 5
app/build.gradle

@@ -1,6 +1,5 @@
 apply plugin: 'com.android.application'
 apply plugin: 'com.jakewharton.butterknife'
-//apply plugin: 'com.appsee.appsee-plugin'
 android {
     compileSdkVersion androidConfigs.compileSdkVersion
     buildToolsVersion androidConfigs.buildToolsVersion
@@ -70,7 +69,6 @@ android {
             manifestPlaceholders = [DUANDUAN_GRAPH     : "sheeptest",
                                     DUANDUAN_DATASHARE : "sheeptest",
                                     jpush_appkey       : "4fea09bdbf9661a9689ee306",
-                                    appsee_app_key       : "1fd86378cdcf4bef8ff97ce63cdb86fb",
                                     umeng_app_key       : "5ab0a1da8f4a9d742900035f"
             ]
             buildConfigField "String", "DUANDUAN_DATASHARE", '"sheeptest"'
@@ -85,7 +83,6 @@ android {
             manifestPlaceholders = [DUANDUAN_GRAPH     : "sheeptestjiguang",
                                     DUANDUAN_DATASHARE : "sheeptestjiguang",
                                     jpush_appkey       : "4fea09bdbf9661a9689ee306",
-                                    appsee_app_key       : "1fd86378cdcf4bef8ff97ce63cdb86fb",
                                     umeng_app_key       : "5ab0a1da8f4a9d742900035f"
             ]
             buildConfigField "String", "DUANDUAN_DATASHARE", '"sheeptestjiguang"'
@@ -100,7 +97,6 @@ android {
             manifestPlaceholders = [DUANDUAN_GRAPH     : "sheep",
                                     DUANDUAN_DATASHARE : "sheep",
                                     jpush_appkey       : "28b74d520261c6f78e3e0921",
-                                    appsee_app_key       : "55ec0910667246d48c4c1dbdf266ff68",
                                     umeng_app_key       : "5ab0a1da8f4a9d742900035f"
             ]
             buildConfigField "String", "DUANDUAN_DATASHARE", '"sheep"'
@@ -254,12 +250,13 @@ dependencies {
     compile files('libs/jcore-android-1.2.0.jar')
     compile files('libs/jpush-android-3.1.2.jar')
 
-    compile 'com.appsee:appsee-android:+'
     //定位
     compile files('libs/BaiduLBS_Android.jar')
 
     //幂动科技
     compile files('libs/mdsdk.jar')
+    //轮播图
+    compile 'com.youth.banner:banner:1.4.10'  //最新版本
 
 }
 static def releaseTime() {

+ 4 - 6
app/proguard-rules.pro

@@ -449,9 +449,7 @@
 -dontwarn com.google.**
 -keep class com.google.gson.** {*;}
 -keep class com.google.protobuf.** {*;}
-#==================appsee && protobuf==========================
--keep class com.appsee.** { *; }
--dontwarn com.appsee.**
--keep class android.support.** { *; }
--keep interface android.support.** { *; }
--keepattributes SourceFile,LineNumberTable
+# banner 的混淆代码
+-keep class com.youth.banner.** {
+    *;
+ }

+ 0 - 5
app/src/main/AndroidManifest.xml

@@ -376,11 +376,6 @@
             android:screenOrientation="portrait" />
 
 
-        <!--appsee start-->
-        <meta-data
-            android:name="com.appsee.ApiKey"
-            android:value="${appsee_app_key}" />
-
         <!--友盟start-->
         <meta-data
             android:name="UMENG_APPKEY"

+ 3 - 2
app/src/main/java/com/kfzs/duanduan/KFZSApp.java

@@ -76,8 +76,9 @@ public class KFZSApp extends MultiDexApplication {
         KFZSNetwork.init(application);
         DisplayMetrics metric = getResources().getDisplayMetrics();
         G.DENSITY = metric.density;
-        G.HEIGHT = metric.heightPixels;
-        G.WIDTH = metric.widthPixels;
+        boolean isHeightBig = metric.heightPixels > metric.widthPixels;
+        G.HEIGHT = isHeightBig ? metric.heightPixels : metric.widthPixels;
+        G.WIDTH = isHeightBig ? metric.widthPixels : metric.heightPixels;
     }
 
     /**

+ 130 - 104
app/src/main/java/com/kfzs/duanduan/fragment/FgtSmallSheep.java

@@ -19,11 +19,8 @@ import android.view.LayoutInflater;
 import android.view.MotionEvent;
 import android.view.View;
 import android.view.ViewGroup;
-import android.widget.AdapterView;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
-import android.widget.RadioGroup;
-import android.widget.RelativeLayout;
 import android.widget.TextView;
 
 import com.alibaba.fastjson.JSON;
@@ -61,9 +58,7 @@ import com.sheep.gamegroup.presenter.SmallSheepPresenter;
 import com.sheep.gamegroup.presenter.TryMakeMoneyContract;
 import com.sheep.gamegroup.presenter.TryMakeMoneyPresenter;
 import com.sheep.gamegroup.util.CommonUtil;
-import com.sheep.gamegroup.util.Conversion2;
 import com.sheep.gamegroup.util.GlideImageLoader;
-import com.sheep.gamegroup.util.ImageGlarryDrawable;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.MyDbManager;
@@ -79,12 +74,15 @@ import com.sheep.gamegroup.view.activity.NotificationsUtils;
 import com.sheep.gamegroup.view.adapter.AdpHomeListGrideview;
 import com.sheep.gamegroup.view.adapter.AdpHomeListListview;
 import com.sheep.gamegroup.view.adapter.TryMakeMoneyAdp;
-import com.sheep.gamegroup.view.customview.SheepViewPager;
 import com.sheep.gamegroup.view.dialog.DialogNewbieTaskList;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sunfusheng.marqueeview.MarqueeView;
+import com.youth.banner.Banner;
+import com.youth.banner.BannerConfig;
+import com.youth.banner.listener.OnBannerListener;
+import com.youth.banner.loader.ImageLoader;
 
 import org.afinal.simplecache.ApiKey;
 import org.greenrobot.eventbus.EventBus;
@@ -116,8 +114,8 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
     MarqueeView homepageItemNoticeMv;
     @BindView(R.id.homepage_item_notice_layout)
     LinearLayout homepageItemNoticeLayout;
-    @BindView(R.id.homepage_item_banner_layout)
-    RelativeLayout homepage_item_banner_layout;
+    @BindView(R.id.banner)
+    Banner banner;
 
     @BindView(R.id.icon_img_iv)
     ImageView iconImgIv;
@@ -137,10 +135,6 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
     LinearLayout lyingLayout;
     @BindView(R.id.card_layout)
     LinearLayout card_layout;
-    @BindView(R.id.viewpager_banner)
-    SheepViewPager viewpager_banner;
-    @BindView(R.id.group_banner)
-    RadioGroup group_banner;
     @BindView(R.id.scrollView)
     NestedScrollView scrollView;
     @BindView(R.id.newbie_task)
@@ -175,6 +169,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
     private int position = 0;
     private List<TaskReleaseEty> releaseEtyLists = new ArrayList<>();
     private List<SlideshowEty> slideshowEtyLists = new ArrayList<>();
+    private List<String> slideshowTitleList = new ArrayList<>();
     private List<BulletinEnty> bulletinEntyLists = new ArrayList<>();
 
     private List<HomeListEntity> homeListEntitys = new ArrayList<>();
@@ -231,7 +226,9 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
                 .build()
                 .inject(this);
         recyclerInitView();
-
+        LinearLayout.LayoutParams bannerLayoutParams = (LinearLayout.LayoutParams) banner.getLayoutParams();
+        bannerLayoutParams.height = G.WIDTH * 25 / 72;
+        banner.setLayoutParams(bannerLayoutParams);
     }
 
 
@@ -387,12 +384,13 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
         //轮播
         List<SlideshowEty> cacheSlideshowEtyList = CommonUtil.getInstance().getCacheList(ApiKey.slideshow, SlideshowEty.class);
         if(ListUtil.isEmpty(cacheSlideshowEtyList)){
-            homepage_item_banner_layout.setVisibility(View.GONE);
+            banner.setVisibility(View.GONE);
             pagePresenter.slideshow(null);
         } else {
             for (SlideshowEty slideshowEty : cacheSlideshowEtyList) {
                 slideshowEty.setObjects(CommonUtil.getInstance().getValue(slideshowEty.getExt()));
                 slideshowEtyLists.add(slideshowEty);
+                slideshowTitleList.add(slideshowEty.getTitle());
             }
             bindBanner();
         }
@@ -695,11 +693,12 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
                 for (SlideshowEty slideshowEty : slideshowEtyList) {
                     slideshowEty.setObjects(CommonUtil.getInstance().getValue(slideshowEty.getExt()));
                     slideshowEtyLists.add(slideshowEty);
+                    slideshowTitleList.add(slideshowEty.getTitle());
                 }
 
                 bindBanner();
             } else {
-                homepage_item_banner_layout.setVisibility(View.GONE);
+                banner.setVisibility(View.GONE);
             }
 
         } catch (Exception e) {
@@ -928,105 +927,132 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
     @Override
     public void onStart() {
         super.onStart();
+        //开始轮播
+        banner.startAutoPlay();
     }
 
-    private Conversion2<SlideshowEty, String, String> conversion2 = new Conversion2<SlideshowEty, String, String>() {
-        @Override
-        public String convert1(SlideshowEty slideshowEty, int position) {
-            return slideshowEty.getTitle();
-        }
-
-        @Override
-        public String convert2(SlideshowEty slideshowEty, int position) {
-            return slideshowEty.getUrl();
-        }
-    };
-    private ImageGlarryDrawable<SlideshowEty> mImageGlarryStr;
+    @Override
+    public void onStop() {
+        super.onStop();
+        //结束轮播
+        banner.stopAutoPlay();
+    }
 
     private void bindBanner() {
-        homepage_item_banner_layout.setVisibility(View.VISIBLE);
-        if (mImageGlarryStr != null) {
-            mImageGlarryStr.init(slideshowEtyLists, ImageView.ScaleType.CENTER_CROP, conversion2);
+        banner.setVisibility(View.VISIBLE);
+        //设置图片加载器
+        banner.setImageLoader(new ImageLoader() {
+                    @Override
+                    public void displayImage(Context context, Object o, ImageView imageView) {
+                        if (o instanceof SlideshowEty)
+                            Glide.with(context).load(((SlideshowEty) o).getUrl()).apply(new RequestOptions().dontAnimate()).into(imageView);
+                    }
+                })
+                .setDelayTime(4000)
+                .setBannerStyle(BannerConfig.CIRCLE_INDICATOR_TITLE_INSIDE)
+                //设置图片集合
+                .setImages(slideshowEtyLists).setBannerTitles(slideshowTitleList)
+                .setOnBannerListener(new OnBannerListener() {
+                    @Override
+                    public void OnBannerClick(int i) {
+                        clickBanner(i);
+                    }
+                });
+
+        //banner设置方法全部调用完毕时最后调用
+        banner.start();
+//        //设置banner样式
+//        banner.setBannerStyle(BannerConfig.CIRCLE_INDICATOR_TITLE);
+//        //设置图片加载器
+//        banner.setImageLoader(new GlideImageLoader());
+//        //设置图片集合
+//        banner.setImages(images);
+//        //设置banner动画效果
+//        banner.setBannerAnimation(Transformer.DepthPage);
+//        //设置标题集合(当banner样式有显示title时)
+//        banner.setBannerTitles(titles);
+//        //设置自动轮播,默认为true
+//        banner.isAutoPlay(true);
+//        //设置轮播时间
+//        banner.setDelayTime(1500);
+//        //设置指示器位置(当banner模式中有指示器时)
+//        banner.setIndicatorGravity(BannerConfig.CENTER);
+//        //banner设置方法全部调用完毕时最后调用
+//        banner.start();
+    }
+
+    private void clickBanner(int position) {
+        SlideshowEty clickedGameObj = ListUtil.getIndex(slideshowEtyLists, position);
+        if (clickedGameObj == null) {
             return;
         }
-        mImageGlarryStr = new ImageGlarryDrawable<>((Activity) mContext, viewpager_banner, group_banner);
-        mImageGlarryStr.init(slideshowEtyLists, ImageView.ScaleType.CENTER_CROP, conversion2);
-        mImageGlarryStr.setOnItemClickListener(new AdapterView.OnItemClickListener() {
-            @Override
-            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
-                SlideshowEty clickedGameObj = ListUtil.getIndex(slideshowEtyLists, position);
-                if (clickedGameObj == null) {
-                    return;
+        UMConfigUtils.onEvent(UMConfigUtils.Event.BANNER_CLICK_HORIZONTAL);
+        UMConfigUtils.IdEvent.BANNER.commit(clickedGameObj.getId());
+        switch (clickedGameObj.getType()) {// 0,类型 1跳转试玩赚钱、2单个任务详情、3信用卡办理、4 H5页面、5 微信二维码任务
+            case 1:
+                Jump2View.getInstance()
+                        .goTryplayView(activity, null);
+                break;
+            case 2:
+                try {
+                    Jump2View.getInstance()
+                            .goTaskDetailView(activity, EntityUtils.getExtInfo(clickedGameObj.getExt()).getId());
+                } catch (Exception e) {
+                    e.printStackTrace();
                 }
-                UMConfigUtils.onEvent(UMConfigUtils.Event.BANNER_CLICK_HORIZONTAL);
-                UMConfigUtils.IdEvent.BANNER.commit(clickedGameObj.getId());
-                switch (clickedGameObj.getType()) {// 0,类型 1跳转试玩赚钱、2单个任务详情、3信用卡办理、4 H5页面、5 微信二维码任务
-                    case 1:
-                        Jump2View.getInstance()
-                                .goTryplayView(activity, null);
-                        break;
-                    case 2:
-                        try {
-                            Jump2View.getInstance()
-                                    .goTaskDetailView(activity, EntityUtils.getExtInfo(clickedGameObj.getExt()).getId());
-                        } catch (Exception e) {
-                            e.printStackTrace();
-                        }
-                        break;
-                    case 3:
-                        Jump2View.getInstance()
-                                .goCreditCardTaskList(activity, 3);
-                        break;
-                    case 4:
-                        if (!TextUtils.isEmpty(clickedGameObj.getObjects())) {
-                            Ext ext = EntityUtils.getExtInfo(clickedGameObj.getExt());
-                            if (ext.getTitle() == null)//外部浏览器加载H5
-                                Jump2View.getInstance().goWeb(activity, ext.getUrl());
-                            else//内部WebView加载H5
-                                Jump2View.getInstance().goWeb(activity, ext.getUrl(), ext.getTitle());
-
-                        }
+                break;
+            case 3:
+                Jump2View.getInstance()
+                        .goCreditCardTaskList(activity, 3);
+                break;
+            case 4:
+                if (!TextUtils.isEmpty(clickedGameObj.getObjects())) {
+                    Ext ext = EntityUtils.getExtInfo(clickedGameObj.getExt());
+                    if (ext.getTitle() == null)//外部浏览器加载H5
+                        Jump2View.getInstance().goWeb(activity, ext.getUrl());
+                    else//内部WebView加载H5
+                        Jump2View.getInstance().goWeb(activity, ext.getUrl(), ext.getTitle());
 
-                        break;
-                    case 5:
-                        if (!TextUtils.isEmpty(clickedGameObj.getObjects())) {
-
-                            Jump2View.getInstance()
-                                    .goWeb(
-                                            activity,
-                                            clickedGameObj.getObjects(),
-                                            "微信二维码辅助好友注册任务");
-                        }
+                }
 
-                        break;
-                    case 6://连续任务
-                        Jump2View.getInstance()
-                                .goTryplayView(activity, 1);
-                        break;
-                    case 9://打卡赚钱
-                        showToast("打卡赚钱");
-                        Jump2View.getInstance().goSignCardAct(activity, null);
-                        break;
-                    case 7://玩转游戏
-                        Jump2View.getInstance()
-                                .goMainGame(activity);
-                        break;
-                    case 11://游戏任务
-                        Jump2View.getInstance()
-                                .goGameMakeMoney(activity, 0);
-                        break;
-                    case 12://闲玩任务
-                        Jump2View.getInstance().goXianwanWeb(activity, null, null);
-                        break;
-                    case 13://游戏代充
-                        Jump2View.getInstance().goGameRecharge(activity, null);
-                        break;
-                    default:
-                        G.showToast(R.string.coming_soon);
-                        break;
+                break;
+            case 5:
+                if (!TextUtils.isEmpty(clickedGameObj.getObjects())) {
+
+                    Jump2View.getInstance()
+                            .goWeb(
+                                    activity,
+                                    clickedGameObj.getObjects(),
+                                    "微信二维码辅助好友注册任务");
                 }
-            }
-        });
+
+                break;
+            case 6://连续任务
+                Jump2View.getInstance()
+                        .goTryplayView(activity, 1);
+                break;
+            case 9://打卡赚钱
+                showToast("打卡赚钱");
+                Jump2View.getInstance().goSignCardAct(activity, null);
+                break;
+            case 7://玩转游戏
+                Jump2View.getInstance()
+                        .goMainGame(activity);
+                break;
+            case 11://游戏任务
+                Jump2View.getInstance()
+                        .goGameMakeMoney(activity, 0);
+                break;
+            case 12://闲玩任务
+                Jump2View.getInstance().goXianwanWeb(activity, null, null);
+                break;
+            case 13://游戏代充
+                Jump2View.getInstance().goGameRecharge(activity, null);
+                break;
+            default:
+                G.showToast(R.string.coming_soon);
+                break;
+        }
     }
 
     /**

+ 0 - 325
app/src/main/java/com/sheep/gamegroup/util/ImageGlarryDrawable.java

@@ -1,325 +0,0 @@
-package com.sheep.gamegroup.util;
-
-import android.app.Activity;
-import android.os.Handler;
-import android.os.Looper;
-import android.os.Message;
-import android.support.v4.view.PagerAdapter;
-import android.support.v4.view.ViewPager;
-import android.text.TextUtils;
-import android.view.Gravity;
-import android.view.MotionEvent;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.AdapterView;
-import android.widget.ImageView;
-import android.widget.LinearLayout;
-import android.widget.RadioButton;
-import android.widget.RadioGroup;
-import android.widget.RelativeLayout;
-import android.widget.TextView;
-
-import com.bumptech.glide.Glide;
-import com.bumptech.glide.request.RequestOptions;
-import com.sheep.gamegroup.model.entity.SlideshowEty;
-import com.sheep.jiuyan.samllsheep.R;
-import com.sheep.jiuyan.samllsheep.utils.G;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Created by ljy on 2018/4/2.
- */
-
-public class ImageGlarryDrawable<T> {
-    private Activity mActivity;
-    private ViewPager mViewPager;
-    private RadioGroup mRadioGroup;
-    private List<T> mList = new ArrayList<>();
-    private int mIntDelayTime = 4000;
-    private List<RelativeLayout> mListImages = new ArrayList<>();
-    private View mLastSelect;
-    private boolean mIsMoved = false;
-    private boolean isSetBackGround = true;//是否设置背景
-
-    public ImageGlarryDrawable(Activity activity, ViewPager viewPager, RadioGroup radioGroup) {
-        mActivity = activity;
-        mViewPager = viewPager;
-        mRadioGroup = radioGroup;
-    }
-
-
-    public void setmIntDelayTime(int mIntDelayTime) {
-        this.mIntDelayTime = mIntDelayTime;
-    }
-
-    public ImageGlarryDrawable init(List<T> pics, Conversion2<T,String,String> conversion2) {
-        return init(pics, ImageView.ScaleType.CENTER_INSIDE,conversion2);
-    }
-
-    /**
-     * 初始化组件
-     *
-     * @param pics 图片Url完整地址。
-     */
-    public ImageGlarryDrawable init(List<T> pics, ImageView.ScaleType scaleType, Conversion2<T,String,String> conversion2) {
-        int pos = 0;
-        mList.clear();
-        mListImages.clear();
-        mLastSelect = null;
-        mRadioGroup.removeAllViews();
-        //防止loading图案被放得很大很大
-        for (T pic : pics) {
-            mList.add(pic);
-            String title = conversion2.convert1(pic,pos);
-            title = title == null ? "" : title;
-            String url = conversion2.convert2(pic,pos);
-            RelativeLayout relativeLayout = new RelativeLayout(mActivity);
-            relativeLayout.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT , RelativeLayout.LayoutParams.WRAP_CONTENT));
-            TextView textView = new TextView(mActivity);
-
-            RelativeLayout.LayoutParams textViewLayoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
-            textViewLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
-            textView.setLayoutParams(textViewLayoutParams);
-            textView.setText(title);
-            textView.setTextColor(mActivity.getResources().getColor(R.color.white));
-            textView.setGravity(Gravity.START|Gravity.CENTER_VERTICAL);
-            textView.setLines(1);
-            textView.setEllipsize(TextUtils.TruncateAt.MARQUEE);
-            textView.setPadding(8, 3, 3, 3);
-            if(isSetBackGround) {
-                textView.setBackgroundColor(mActivity.getResources().getColor(R.color.dark));
-                textView.setBackground(mActivity.getResources().getDrawable(R.drawable.sp_bg_gradient_retangle_transe));
-                textView.getBackground().mutate().setAlpha(100);
-            }
-
-
-            ImageView imageView = new ImageView(mActivity);
-            imageView.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT , RelativeLayout.LayoutParams.MATCH_PARENT));
-            imageView.setOnClickListener(new ImageGlarryDrawable.cls_main(pos));
-            imageView.setScaleType(scaleType);
-            imageViewLoader.loadImageView(imageView, url);
-
-            relativeLayout.addView(imageView);
-            if(!TextUtils.isEmpty(title)){
-                relativeLayout.addView(textView);
-            }
-
-            mListImages.add(relativeLayout);
-
-
-            RadioButton radioButton = (RadioButton) View.inflate(mActivity, R.layout.rbt_dot, null);
-            mRadioGroup.addView(radioButton);
-            LinearLayout.LayoutParams layoutParams = new LinearLayout
-                    .LayoutParams(G.getRealPix(5
-            ), G.getRealPix(5));
-            layoutParams.setMargins(G.getRealPix(2), 0, G.getRealPix(2), 0);
-            radioButton.setLayoutParams(layoutParams);
-//            radioButton.setButtonDrawable(null);
-//            radioButton.setBackgroundResource(R.drawable.sel_circle_dot);
-
-            if (pos == 0) {
-                selectPosition(0);
-            }
-            pos = pos + 1;
-        }
-
-        if (mList.size() > 1) {//有两张或以上图片,开始轮播
-            mRadioGroup.setVisibility(View.VISIBLE);
-            if (!mIsMoved) {
-                mIsMoved = true;
-                handler.removeMessages(1);
-                handler.sendEmptyMessageDelayed(1, mIntDelayTime);
-            }
-            //handler.sendEmptyMessageDelayed(1, mIntDelayTime);
-        } else if (mList.size() == 1) {//如果只有一个或没有,就隐藏Group
-            mRadioGroup.setVisibility(View.GONE);
-        } else {//说明是空的。
-            if(isSetBackGround) {
-                mViewPager.setBackgroundColor(mActivity.getResources().getColor(R.color.white));
-            }
-            return this;
-        }
-        mViewPager.setAdapter(pagerAdapter);
-        pagerAdapter.notifyDataSetChanged();
-        mViewPager.setCurrentItem(0);
-        mViewPager.addOnPageChangeListener(onPageChangeListener);
-        mViewPager.setOnTouchListener(onTouchListener);
-        return this;
-    }
-
-    /**
-     * 设置当前选中项
-     *
-     * @param position
-     */
-    private void selectPosition(int position) {
-        mLastSelect = mRadioGroup.getChildAt(position);
-        mRadioGroup.check(mLastSelect.getId());
-        LinearLayout.LayoutParams layoutParams = new LinearLayout
-                .LayoutParams(G.getRealPix(10
-        ), G.getRealPix(5));
-        layoutParams.setMargins(G.getRealPix(2), 0, G.getRealPix(2), 0);
-        mRadioGroup.getChildAt(position).setLayoutParams(layoutParams);
-    }
-
-    private Handler handler = new Handler(Looper.getMainLooper()) {
-        @Override
-        public void handleMessage(Message msg) {
-            super.handleMessage(msg);
-            switch (msg.what){
-                case 1:
-                    if (mActivity.isFinishing() || ListUtil.size(mList) < 2) {
-                        return;
-                    }
-                    int lastIndex = (mViewPager.getCurrentItem() + 1) % ListUtil.size(mList);
-                    try {
-                        mViewPager.setCurrentItem(lastIndex, true);
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                    }
-                    pagerAdapter.notifyDataSetChanged();
-                    handler.removeMessages(1);
-                    sendEmptyMessageDelayed(1, mIntDelayTime);
-                    break;
-            }
-
-        }
-    };
-
-    /**
-     * 选取
-     */
-    private ViewPager.OnPageChangeListener onPageChangeListener = new ViewPager.OnPageChangeListener() {
-        @Override
-        public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
-
-        }
-
-        /**
-         * 改变dot的宽度等操作
-         * @param position
-         */
-        @Override
-        public void onPageSelected(int position) {
-            if (mLastSelect != null) {
-                LinearLayout.LayoutParams layoutParams = new LinearLayout
-                        .LayoutParams(G.getRealPix(5
-                ), G.getRealPix(5));
-                layoutParams.setMargins(G.getRealPix(2), 0, G.getRealPix(2), 0);
-                mLastSelect.setLayoutParams(layoutParams);
-            }
-            selectPosition(position);
-        }
-
-        @Override
-        public void onPageScrollStateChanged(int state) {
-
-        }
-    };
-
-    /**
-     * touch
-     */
-    private View.OnTouchListener onTouchListener = new View.OnTouchListener() {
-        @Override
-        public boolean onTouch(View v, MotionEvent event) {
-            switch (event.getAction()){
-                case MotionEvent.ACTION_DOWN:
-                    if(handler != null){
-                        handler.removeMessages(1);
-                    }
-
-                    break;
-                case MotionEvent.ACTION_CANCEL:
-                case MotionEvent.ACTION_MOVE:
-                    if (mList.size() > 1) {//有两张或以上图片,开始轮播
-                        mIsMoved = false;
-                        mIsMoved = true;
-                        handler.removeMessages(1);
-                        handler.sendEmptyMessageDelayed(1, mIntDelayTime);
-                    }
-                    break;
-            }
-            return false;
-        }
-    };
-
-
-    /**
-     * ViewPager
-     */
-    private PagerAdapter pagerAdapter = new PagerAdapter() {
-        @Override
-        public int getCount() {
-            return mList.size();
-        }
-
-        @Override
-        public boolean isViewFromObject(View view, Object object) {
-            return view.equals(object);
-        }
-
-        @Override
-        public void destroyItem(ViewGroup container, int position, Object object) {
-            container.removeView(mListImages.get(position));
-        }
-
-        @Override
-        public Object instantiateItem(ViewGroup container, int position) {
-            container.addView(mListImages.get(position));
-            return mListImages.get(position);
-        }
-    };
-
-
-    private AdapterView.OnItemClickListener onItemClickListener;
-
-    /**
-     * 设置点击回调,回调仅回传View和position
-     *
-     * @param onItemClickListener
-     */
-    public void setOnItemClickListener(AdapterView.OnItemClickListener onItemClickListener) {
-        this.onItemClickListener = onItemClickListener;
-    }
-
-    private class cls_main implements View.OnClickListener {
-        private int position;
-
-        public cls_main(int pos) {
-            position = pos;
-        }
-
-        @Override
-        public void onClick(View v) {
-            if (onItemClickListener != null) {
-                onItemClickListener.onItemClick(null, v, position, 0);
-            }
-        }
-    }
-    public void notifyDataSetChanged() {
-        if(pagerAdapter != null)
-            pagerAdapter.notifyDataSetChanged();
-    }
-
-    private ImageViewLoader imageViewLoader = new ImageViewLoader() {
-
-        @Override
-        public void loadImageView(ImageView imageView, String url) {
-            Glide.with(imageView.getContext()).load(url).apply(new RequestOptions().dontAnimate()).into(imageView);
-        }
-    };
-
-    public void setImageViewLoader(ImageViewLoader imageViewLoader) {
-        this.imageViewLoader = imageViewLoader;
-    }
-    public interface ImageViewLoader{
-        void loadImageView(ImageView imageView, String url);
-    }
-
-    public void setSetBackGround(boolean setBackGround) {
-        isSetBackGround = setBackGround;
-    }
-}

+ 0 - 18
app/src/main/java/com/sheep/gamegroup/view/activity/ActFindGame.java

@@ -6,31 +6,21 @@ import android.os.Bundle;
 import android.support.annotation.Nullable;
 import android.support.design.widget.AppBarLayout;
 import android.support.v7.widget.AppCompatRatingBar;
-import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
 import android.support.v7.widget.Toolbar;
 import android.text.TextUtils;
 import android.view.View;
 import android.webkit.WebView;
 import android.widget.ImageView;
-import android.widget.LinearLayout;
 import android.widget.ProgressBar;
-import android.widget.RadioGroup;
 import android.widget.RatingBar;
 import android.widget.RelativeLayout;
 import android.widget.TextView;
 
-import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.arialyy.annotations.Download;
 import com.arialyy.aria.core.Aria;
 import com.arialyy.aria.core.download.DownloadTask;
-import com.bumptech.glide.Glide;
-import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
-import com.bumptech.glide.request.RequestOptions;
-import com.kfzs.appstore.utils.adapter.recyclerview.RecyclerViewAdapter;
-import com.kfzs.appstore.utils.adapter.recyclerview.ViewHolder;
-import com.kfzs.duanduan.fragment.FgtGameDetail;
 import com.kfzs.duanduan.services.DownloadTaskService;
 import com.kfzs.duanduan.utils.StatusBarUtils;
 import com.kfzs.duanduan.utils.dlg.HelperUtils;
@@ -43,25 +33,17 @@ import com.sheep.gamegroup.model.entity.MyFindAppCore;
 import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.CommonUtil;
-import com.sheep.gamegroup.util.Conversion2;
 import com.sheep.gamegroup.util.GlideImageLoader;
-import com.sheep.gamegroup.util.ImageGlarryDrawable;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.ListUtil;
-import com.sheep.gamegroup.util.LogUtil;
-import com.sheep.gamegroup.util.MyDbManager;
 import com.sheep.gamegroup.util.TimeUtil;
 import com.sheep.gamegroup.util.ViewUtil;
-import com.sheep.gamegroup.view.customview.SheepViewPager;
-import com.sheep.jiuyan.samllsheep.BuildConfig;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.PackageUtil;
-import com.sheep.jiuyan.samllsheep.utils.SpUtils;
 import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
 
-import org.afinal.simplecache.ACache;
 import org.greenrobot.eventbus.EventBus;
 import org.greenrobot.eventbus.Subscribe;
 

+ 0 - 17
app/src/main/java/com/sheep/jiuyan/samllsheep/SheepApp.java

@@ -6,10 +6,8 @@ import android.os.Bundle;
 import android.support.multidex.MultiDex;
 import android.util.DisplayMetrics;
 
-import com.appsee.Appsee;
 import com.kfzs.duanduan.ActMain;
 import com.kfzs.duanduan.react.SharedPreferences;
-import com.mdad.sdk.mdsdk.AdManager;
 import com.sheep.gamegroup.di.components.DaggerNetComponent;
 import com.sheep.gamegroup.di.components.NetComponent;
 import com.sheep.gamegroup.di.modules.NetModule;
@@ -21,7 +19,6 @@ import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.util.SysAppUtil;
 import com.sheep.gamegroup.util.UMConfigUtils;
-import com.sheep.gamegroup.view.activity.ActWeb;
 import com.sheep.gamegroup.view.activity.LoginAct;
 import com.sheep.gamegroup.view.activity.PhoneAct;
 import com.sheep.gamegroup.view.activity.SplashAct;
@@ -92,7 +89,6 @@ public class SheepApp extends BaseApplication {
             mSheepApp = this;
             connectAddress = ConnectAddress.sheep.getDefultConnectAddress();
             registerActivityLifecycleCallbacks(activityLifecycleCallbacks);
-            initGoble();
             initNet();
         }
     }
@@ -102,16 +98,6 @@ public class SheepApp extends BaseApplication {
     }
 
 
-    /**
-     * 初始化系统常用参数
-     */
-    private void initGoble() {
-        DisplayMetrics metric = getResources().getDisplayMetrics();
-        G.HEIGHT = metric.heightPixels;
-        G.WIDTH = metric.widthPixels;
-        G.DENSITY = metric.density;
-    }
-
     public int mActivityAount;
     private boolean notStop = false;
     /**
@@ -120,9 +106,6 @@ public class SheepApp extends BaseApplication {
     ActivityLifecycleCallbacks activityLifecycleCallbacks = new ActivityLifecycleCallbacks() {
         @Override
         public void onActivityCreated(final Activity activity, Bundle savedInstanceState) {
-            if(!(activity instanceof ActWeb || activity instanceof com.kfzs.duanduan.ActWeb)){//非h5界面才使用触摸热力图sdk,因为webview中的输入框有问题,会在弹出输入法后不停的闪烁
-                Appsee.start();
-            }
             ActivityManager.getInstance().pushActivity(activity);
             if(activity instanceof SplashAct || activity instanceof LoginAct || activity instanceof PhoneAct){
                 SysAppUtil.showVersionInfo(activity, SpUtils.getIgnoreMd5());

+ 6 - 0
app/src/main/res/drawable/shape_circle_select.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <corners android:radius="5dp" />
+    <solid android:color="@color/theme_app_main" />
+</shape>

+ 11 - 21
app/src/main/res/layout/homepage_item_banner.xml

@@ -1,24 +1,14 @@
 <?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/homepage_item_banner_layout"
+<com.youth.banner.Banner xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:id="@+id/banner"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:visibility="gone">
-
-
-    <com.sheep.gamegroup.view.customview.SheepViewPager
-        android:id="@+id/viewpager_banner"
-        android:layout_width="match_parent"
-        android:layout_height="@dimen/app_group_height_135"
-        android:minHeight="@dimen/app_group_height_120" />
-
-    <RadioGroup
-        android:id="@+id/group_banner"
-        android:layout_width="match_parent"
-        android:layout_height="14dp"
-        android:layout_alignParentBottom="true"
-        android:gravity="center|right"
-        android:orientation="horizontal"
-        android:layout_marginRight="@dimen/content_padding_small"
-        android:paddingTop="4dp" />
-</RelativeLayout>
+    app:indicator_margin="2dp"
+    app:indicator_height="5dp"
+    app:indicator_width="5dp"
+    app:title_background="@color/transparent"
+    app:title_textcolor="@color/transparent"
+    app:title_height="10dp"
+    app:indicator_drawable_selected="@drawable/shape_circle_select"
+    app:indicator_drawable_unselected="@drawable/shape_circle_gray" />

+ 0 - 2
build.gradle

@@ -22,8 +22,6 @@ buildscript {
         // NOTE: Do not place your application dependencies here; they belong
         // in the individual module build.gradle files
 
-        //appsee
-        classpath 'com.appsee:appsee-plugin:+'
     }
 }