|
@@ -5,11 +5,14 @@ import android.app.Activity;
|
|
|
import android.content.Context;
|
|
import android.content.Context;
|
|
|
import android.content.DialogInterface;
|
|
import android.content.DialogInterface;
|
|
|
import android.graphics.Color;
|
|
import android.graphics.Color;
|
|
|
|
|
+import android.os.Build;
|
|
|
import android.os.Bundle;
|
|
import android.os.Bundle;
|
|
|
import android.os.Handler;
|
|
import android.os.Handler;
|
|
|
import android.os.Looper;
|
|
import android.os.Looper;
|
|
|
import android.os.Message;
|
|
import android.os.Message;
|
|
|
-import android.support.v4.widget.NestedScrollView;
|
|
|
|
|
|
|
+import android.support.annotation.RequiresApi;
|
|
|
|
|
+import android.support.design.widget.TabLayout;
|
|
|
|
|
+import android.support.v4.view.ViewPager;
|
|
|
import android.support.v4.widget.SwipeRefreshLayout;
|
|
import android.support.v4.widget.SwipeRefreshLayout;
|
|
|
import android.support.v7.app.AlertDialog;
|
|
import android.support.v7.app.AlertDialog;
|
|
|
import android.support.v7.widget.LinearLayoutManager;
|
|
import android.support.v7.widget.LinearLayoutManager;
|
|
@@ -21,18 +24,17 @@ import android.view.View;
|
|
|
import android.view.ViewGroup;
|
|
import android.view.ViewGroup;
|
|
|
import android.widget.ImageView;
|
|
import android.widget.ImageView;
|
|
|
import android.widget.LinearLayout;
|
|
import android.widget.LinearLayout;
|
|
|
-import android.widget.PopupWindow;
|
|
|
|
|
import android.widget.TextView;
|
|
import android.widget.TextView;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.bumptech.glide.Glide;
|
|
import com.bumptech.glide.Glide;
|
|
|
import com.bumptech.glide.request.RequestOptions;
|
|
import com.bumptech.glide.request.RequestOptions;
|
|
|
-import com.google.gson.Gson;
|
|
|
|
|
import com.kfzs.duanduan.BaseCompatFragment;
|
|
import com.kfzs.duanduan.BaseCompatFragment;
|
|
|
import com.kfzs.duanduan.event.BigEvent;
|
|
import com.kfzs.duanduan.event.BigEvent;
|
|
|
import com.kfzs.duanduan.react.ConfigUtil;
|
|
import com.kfzs.duanduan.react.ConfigUtil;
|
|
|
import com.kfzs.duanduan.react.SharedPreferences;
|
|
import com.kfzs.duanduan.react.SharedPreferences;
|
|
|
import com.kfzs.duanduan.utils.NumberFormatUtils;
|
|
import com.kfzs.duanduan.utils.NumberFormatUtils;
|
|
|
|
|
+import com.kfzs.duanduan.view.ViewPagerAutoHeigh;
|
|
|
import com.sheep.gamegroup.di.components.DaggerSmallSheepComponent;
|
|
import com.sheep.gamegroup.di.components.DaggerSmallSheepComponent;
|
|
|
import com.sheep.gamegroup.di.modules.SmallSheepModule;
|
|
import com.sheep.gamegroup.di.modules.SmallSheepModule;
|
|
|
import com.sheep.gamegroup.di.modules.TryMakeMoneyModule;
|
|
import com.sheep.gamegroup.di.modules.TryMakeMoneyModule;
|
|
@@ -46,12 +48,10 @@ import com.sheep.gamegroup.model.entity.RecyleType;
|
|
|
import com.sheep.gamegroup.model.entity.RequestParameEty;
|
|
import com.sheep.gamegroup.model.entity.RequestParameEty;
|
|
|
import com.sheep.gamegroup.model.entity.SlideshowEty;
|
|
import com.sheep.gamegroup.model.entity.SlideshowEty;
|
|
|
import com.sheep.gamegroup.model.entity.TaskAcceptedEty;
|
|
import com.sheep.gamegroup.model.entity.TaskAcceptedEty;
|
|
|
-import com.sheep.gamegroup.model.entity.TaskEty;
|
|
|
|
|
import com.sheep.gamegroup.model.entity.TaskReleaseEty;
|
|
import com.sheep.gamegroup.model.entity.TaskReleaseEty;
|
|
|
import com.sheep.gamegroup.model.entity.UserEntity;
|
|
import com.sheep.gamegroup.model.entity.UserEntity;
|
|
|
import com.sheep.gamegroup.model.util.AutoTaskListUtil;
|
|
import com.sheep.gamegroup.model.util.AutoTaskListUtil;
|
|
|
import com.sheep.gamegroup.model.util.EntityUtils;
|
|
import com.sheep.gamegroup.model.util.EntityUtils;
|
|
|
-import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
|
|
|
import com.sheep.gamegroup.presenter.SmallSheepContract;
|
|
import com.sheep.gamegroup.presenter.SmallSheepContract;
|
|
|
import com.sheep.gamegroup.presenter.SmallSheepPresenter;
|
|
import com.sheep.gamegroup.presenter.SmallSheepPresenter;
|
|
|
import com.sheep.gamegroup.presenter.TryMakeMoneyContract;
|
|
import com.sheep.gamegroup.presenter.TryMakeMoneyContract;
|
|
@@ -61,9 +61,9 @@ import com.sheep.gamegroup.util.DataUtil;
|
|
|
import com.sheep.gamegroup.util.GlideImageLoader;
|
|
import com.sheep.gamegroup.util.GlideImageLoader;
|
|
|
import com.sheep.gamegroup.util.Jump2View;
|
|
import com.sheep.gamegroup.util.Jump2View;
|
|
|
import com.sheep.gamegroup.util.ListUtil;
|
|
import com.sheep.gamegroup.util.ListUtil;
|
|
|
-import com.sheep.gamegroup.util.LogUtil;
|
|
|
|
|
import com.sheep.gamegroup.util.MyGridview;
|
|
import com.sheep.gamegroup.util.MyGridview;
|
|
|
import com.sheep.gamegroup.util.MyListview;
|
|
import com.sheep.gamegroup.util.MyListview;
|
|
|
|
|
+import com.sheep.gamegroup.util.NestedScrollView;
|
|
|
import com.sheep.gamegroup.util.SysAppUtil;
|
|
import com.sheep.gamegroup.util.SysAppUtil;
|
|
|
import com.sheep.gamegroup.util.TestUtil;
|
|
import com.sheep.gamegroup.util.TestUtil;
|
|
|
import com.sheep.gamegroup.util.UMConfigUtils;
|
|
import com.sheep.gamegroup.util.UMConfigUtils;
|
|
@@ -71,8 +71,12 @@ import com.sheep.gamegroup.util.ViewUtil;
|
|
|
import com.sheep.gamegroup.view.activity.NotificationsUtils;
|
|
import com.sheep.gamegroup.view.activity.NotificationsUtils;
|
|
|
import com.sheep.gamegroup.view.adapter.AdpHomeListGrideview;
|
|
import com.sheep.gamegroup.view.adapter.AdpHomeListGrideview;
|
|
|
import com.sheep.gamegroup.view.adapter.AdpHomeListListview;
|
|
import com.sheep.gamegroup.view.adapter.AdpHomeListListview;
|
|
|
|
|
+import com.sheep.gamegroup.view.adapter.AdpTryMakemoney;
|
|
|
import com.sheep.gamegroup.view.adapter.TryMakeMoneyAdp;
|
|
import com.sheep.gamegroup.view.adapter.TryMakeMoneyAdp;
|
|
|
import com.sheep.gamegroup.view.dialog.DialogNewbieTaskList;
|
|
import com.sheep.gamegroup.view.dialog.DialogNewbieTaskList;
|
|
|
|
|
+import com.sheep.gamegroup.view.fragment.FgtAskGetMoneyRank;
|
|
|
|
|
+import com.sheep.gamegroup.view.fragment.FgtMyGame;
|
|
|
|
|
+import com.sheep.gamegroup.view.fragment.FgtTryMakeMoney;
|
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.G;
|
|
import com.sheep.jiuyan.samllsheep.utils.G;
|
|
@@ -98,9 +102,7 @@ import butterknife.BindView;
|
|
|
import butterknife.ButterKnife;
|
|
import butterknife.ButterKnife;
|
|
|
import butterknife.OnClick;
|
|
import butterknife.OnClick;
|
|
|
import butterknife.Unbinder;
|
|
import butterknife.Unbinder;
|
|
|
-import rx.android.schedulers.AndroidSchedulers;
|
|
|
|
|
import rx.functions.Action1;
|
|
import rx.functions.Action1;
|
|
|
-import rx.schedulers.Schedulers;
|
|
|
|
|
|
|
|
|
|
import static com.sheep.gamegroup.util.UMConfigUtils.Event.NEWBIE_TASK;
|
|
import static com.sheep.gamegroup.util.UMConfigUtils.Event.NEWBIE_TASK;
|
|
|
|
|
|
|
@@ -158,6 +160,10 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
View viewRobDuty;
|
|
View viewRobDuty;
|
|
|
@BindView(R.id.iv_rob_duty)
|
|
@BindView(R.id.iv_rob_duty)
|
|
|
ImageView ivDuty;
|
|
ImageView ivDuty;
|
|
|
|
|
+ @BindView(R.id.viewpager_act_game_details)
|
|
|
|
|
+ ViewPagerAutoHeigh mViewPager;
|
|
|
|
|
+ @BindView(R.id.tabLayout)
|
|
|
|
|
+ TabLayout tabLayout;
|
|
|
|
|
|
|
|
|
|
|
|
|
@Inject
|
|
@Inject
|
|
@@ -182,6 +188,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
private AdpHomeListGrideview adpHomeListGrideview;
|
|
private AdpHomeListGrideview adpHomeListGrideview;
|
|
|
private AdpHomeListListview adpHomeListListview;
|
|
private AdpHomeListListview adpHomeListListview;
|
|
|
private TaskReleaseEty taskEty;
|
|
private TaskReleaseEty taskEty;
|
|
|
|
|
+ private AdpTryMakemoney adpViewPagerDetail;
|
|
|
|
|
|
|
|
private static final int LIST_COUNT = 2;//tryMakeMoneyAdp 总共有2条数据
|
|
private static final int LIST_COUNT = 2;//tryMakeMoneyAdp 总共有2条数据
|
|
|
private static final RecyleObj NULL = RecyleObj.make(RecyleType.NONE, null);//空数据
|
|
private static final RecyleObj NULL = RecyleObj.make(RecyleType.NONE, null);//空数据
|
|
@@ -241,6 +248,36 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
LinearLayout.LayoutParams bannerLayoutParams = (LinearLayout.LayoutParams) banner.getLayoutParams();
|
|
LinearLayout.LayoutParams bannerLayoutParams = (LinearLayout.LayoutParams) banner.getLayoutParams();
|
|
|
bannerLayoutParams.height = G.WIDTH * 25 / 72;
|
|
bannerLayoutParams.height = G.WIDTH * 25 / 72;
|
|
|
banner.setLayoutParams(bannerLayoutParams);
|
|
banner.setLayoutParams(bannerLayoutParams);
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * tablayout
|
|
|
|
|
+ */
|
|
|
|
|
+ adpViewPagerDetail = new AdpTryMakemoney(getChildFragmentManager(), activity);
|
|
|
|
|
+ adpViewPagerDetail.add(FgtTryMakeMoney.newInstance(0), "每日必做");
|
|
|
|
|
+ adpViewPagerDetail.add(FgtTryMakeMoney.newInstance(0), "即将开始");
|
|
|
|
|
+
|
|
|
|
|
+ mViewPager.setOffscreenPageLimit(2);
|
|
|
|
|
+ mViewPager.setAdapter(adpViewPagerDetail);
|
|
|
|
|
+
|
|
|
|
|
+ tabLayout.addOnTabSelectedListener(new TabLayout.ViewPagerOnTabSelectedListener(mViewPager));
|
|
|
|
|
+ mViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onPageSelected(int position) {
|
|
|
|
|
+ mViewPager.reSetHeight();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onPageScrollStateChanged(int state) {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ tabLayout.setupWithViewPager(mViewPager);
|
|
|
|
|
+ CommonUtil.getInstance().reflex(tabLayout, activity);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -261,6 +298,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ @RequiresApi(api = Build.VERSION_CODES.M)
|
|
|
@SuppressLint("ClickableViewAccessibility")
|
|
@SuppressLint("ClickableViewAccessibility")
|
|
|
public void initListener() {
|
|
public void initListener() {
|
|
|
scrollView.setOnTouchListener(new View.OnTouchListener() {
|
|
scrollView.setOnTouchListener(new View.OnTouchListener() {
|
|
@@ -293,6 +331,26 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ scrollView.setOnScrollChangeListener(new View.OnScrollChangeListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ tabLayout.post(new Runnable() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void run() {
|
|
|
|
|
+ toolBarPositionY = tabLayout.getHeight();
|
|
|
|
|
+ ViewGroup.LayoutParams params = mViewPager.getLayoutParams();
|
|
|
|
|
+ params.height = G.HEIGHT - toolBarPositionY - tabLayout.getHeight()+1;
|
|
|
|
|
+ mViewPager.setLayoutParams(params);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
refresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
|
refresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
|
|
@Override
|
|
@Override
|
|
|
public void onRefresh() {
|
|
public void onRefresh() {
|
|
@@ -370,11 +428,12 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
boolean isShowQB = false;
|
|
boolean isShowQB = false;
|
|
|
boolean isShowMd = false;
|
|
boolean isShowMd = false;
|
|
|
for (int i = 0; i < homeListEntitys.size(); i++) {
|
|
for (int i = 0; i < homeListEntitys.size(); i++) {
|
|
|
- if (i < 4) {
|
|
|
|
|
|
|
+ /*if (i < 4) {
|
|
|
homeListEntitysGridview.add(homeListEntitys.get(i));
|
|
homeListEntitysGridview.add(homeListEntitys.get(i));
|
|
|
} else {
|
|
} else {
|
|
|
homeListEntitysListview.add(homeListEntitys.get(i));
|
|
homeListEntitysListview.add(homeListEntitys.get(i));
|
|
|
- }
|
|
|
|
|
|
|
+ }*/
|
|
|
|
|
+ homeListEntitysGridview.add(homeListEntitys.get(i));
|
|
|
if (homeListEntitys.get(i).getJump().equals("6")) {//6Q币充值
|
|
if (homeListEntitys.get(i).getJump().equals("6")) {//6Q币充值
|
|
|
isShowQB = !isShowQB;
|
|
isShowQB = !isShowQB;
|
|
|
}
|
|
}
|
|
@@ -392,6 +451,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
refreshData();
|
|
refreshData();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ int toolBarPositionY;
|
|
|
/**
|
|
/**
|
|
|
* 刷新数据
|
|
* 刷新数据
|
|
|
*/
|
|
*/
|
|
@@ -428,6 +488,25 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
pagePresenter.slideshow(null);//轮播
|
|
pagePresenter.slideshow(null);//轮播
|
|
|
pagePresenter.homeList();//首页list
|
|
pagePresenter.homeList();//首页list
|
|
|
|
|
|
|
|
|
|
+ CommonUtil.getInstance().getUserNoDoingTaskMoney(new Action1<BaseMessage>() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void call(BaseMessage o) {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ adpViewPagerDetail.cleanListFragment();
|
|
|
|
|
+ adpViewPagerDetail.add(FgtTryMakeMoney.newInstance(0), "每日必做");
|
|
|
|
|
+ adpViewPagerDetail.add(FgtTryMakeMoney.newInstance(0), "即将开始");
|
|
|
|
|
+ adpViewPagerDetail.notifyDataSetChanged();
|
|
|
|
|
+ tabLayout.post(new Runnable() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void run() {
|
|
|
|
|
+ toolBarPositionY = tabLayout.getHeight();
|
|
|
|
|
+ ViewGroup.LayoutParams params = mViewPager.getLayoutParams();
|
|
|
|
|
+ params.height = G.HEIGHT - toolBarPositionY - tabLayout.getHeight()+1;
|
|
|
|
|
+ mViewPager.setLayoutParams(params);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -467,7 +546,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
0,
|
|
0,
|
|
|
"-1",
|
|
"-1",
|
|
|
3));
|
|
3));
|
|
|
- tryMakeMoneyPresenter.releaseTask(parameEty);
|
|
|
|
|
|
|
+// tryMakeMoneyPresenter.releaseTask(parameEty);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -728,7 +807,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
if(DataUtil.getInstance().isTaskListChange(getClass()))//数据变化才刷新
|
|
if(DataUtil.getInstance().isTaskListChange(getClass()))//数据变化才刷新
|
|
|
refreshTaskList();
|
|
refreshTaskList();
|
|
|
if(onResumeCount == 0)//第一次才调用
|
|
if(onResumeCount == 0)//第一次才调用
|
|
|
- Jump2View.getInstance().tryShowNewbieTask(activity, userEntity, newbie_task);
|
|
|
|
|
|
|
+// Jump2View.getInstance().tryShowNewbieTask(activity, userEntity, newbie_task);
|
|
|
onResumeCount++;
|
|
onResumeCount++;
|
|
|
viewRobDuty.setOnClickListener(new View.OnClickListener() {
|
|
viewRobDuty.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
@Override
|
|
@@ -965,7 +1044,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
* 公共
|
|
* 公共
|
|
|
*/
|
|
*/
|
|
|
private void inviteNotice(final List<BulletinEnty> bulletinEntyList) {
|
|
private void inviteNotice(final List<BulletinEnty> bulletinEntyList) {
|
|
|
- homepageItemNoticeLayout.setVisibility(View.VISIBLE);
|
|
|
|
|
|
|
+ homepageItemNoticeLayout.setVisibility(View.GONE);
|
|
|
// List<String> infoList = new ArrayList<>();
|
|
// List<String> infoList = new ArrayList<>();
|
|
|
// for(BulletinEnty bulletinEnty: bulletinEntyList){
|
|
// for(BulletinEnty bulletinEnty: bulletinEntyList){
|
|
|
// infoList.add(bulletinEnty.getContent()+"");
|
|
// infoList.add(bulletinEnty.getContent()+"");
|