|
|
@@ -21,10 +21,12 @@ import android.support.v7.widget.LinearLayoutManager;
|
|
|
import android.support.v7.widget.RecyclerView;
|
|
|
import android.text.TextUtils;
|
|
|
import android.view.Gravity;
|
|
|
+import android.util.Log;
|
|
|
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.PopupWindow;
|
|
|
@@ -45,7 +47,9 @@ import com.sheep.gamegroup.di.modules.TryMakeMoneyModule;
|
|
|
import com.sheep.gamegroup.model.api.RedPackageMoney;
|
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
import com.sheep.gamegroup.model.entity.BulletinEnty;
|
|
|
+import com.sheep.gamegroup.model.entity.CashAwarsEntity;
|
|
|
import com.sheep.gamegroup.model.entity.Ext;
|
|
|
+import com.sheep.gamegroup.model.entity.GridViewEntity;
|
|
|
import com.sheep.gamegroup.model.entity.HomeListEntity;
|
|
|
import com.sheep.gamegroup.model.entity.MoreDataEntity;
|
|
|
import com.sheep.gamegroup.model.entity.RecyleObj;
|
|
|
@@ -66,6 +70,7 @@ import com.sheep.gamegroup.util.DataUtil;
|
|
|
import com.sheep.gamegroup.util.GlideImageLoader;
|
|
|
import com.sheep.gamegroup.util.Jump2View;
|
|
|
import com.sheep.gamegroup.util.ListUtil;
|
|
|
+import com.sheep.gamegroup.util.LogUtil;
|
|
|
import com.sheep.gamegroup.util.MyGridview;
|
|
|
import com.sheep.gamegroup.util.MyListview;
|
|
|
import com.sheep.gamegroup.util.NestedScrollView;
|
|
|
@@ -79,8 +84,6 @@ 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.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.SheepApp;
|
|
|
@@ -170,6 +173,12 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
ViewPagerAutoHeigh mViewPager;
|
|
|
@BindView(R.id.tabLayout)
|
|
|
TabLayout tabLayout;
|
|
|
+ @BindView(R.id.homepage_item_get_award_name_tv)
|
|
|
+ TextView homepage_item_get_award_name_tv;
|
|
|
+ @BindView(R.id.homepage_item_money_tv)
|
|
|
+ TextView homepage_item_money_tv;
|
|
|
+ @BindView(R.id.homepage_item_juan_tv)
|
|
|
+ TextView homepage_item_juan_tv;
|
|
|
|
|
|
|
|
|
@Inject
|
|
|
@@ -222,6 +231,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ @RequiresApi(api = Build.VERSION_CODES.M)
|
|
|
/**
|
|
|
* @return 是否显示红包
|
|
|
*/
|
|
|
@@ -362,6 +372,16 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
ViewGroup.LayoutParams params = mViewPager.getLayoutParams();
|
|
|
params.height = G.HEIGHT - toolBarPositionY - tabLayout.getHeight() + 1;
|
|
|
mViewPager.setLayoutParams(params);
|
|
|
+ int count = mViewPager.getChildCount();
|
|
|
+ if(count > 0){
|
|
|
+ toolBarPositionY = tabLayout.getHeight();
|
|
|
+// ViewGroup.LayoutParams params = mViewPager.getLayoutParams();
|
|
|
+ ViewGroup.LayoutParams params = mViewPager.getLayoutParams();
|
|
|
+ params.height = G.getRealPix(count * 50);
|
|
|
+ mViewPager.setLayoutParams(params);
|
|
|
+ LogUtil.logE("--------"+count+";height:"+mViewPager.getHeight()+","+mViewPager.getMeasuredHeight());
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
} catch (Exception e) {
|
|
|
@@ -458,9 +478,9 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
}
|
|
|
if (homeListEntitys.get(i).getJump().equals("14")) {//幂动科技
|
|
|
isShowMd = !isShowMd;
|
|
|
- CommonUtil.getInstance().initMiDong(activity, DataUtil.getInstance().getUserId());
|
|
|
}
|
|
|
}
|
|
|
+ addNewTask();
|
|
|
SheepApp.getInstance().setShowQB(isShowQB);
|
|
|
SheepApp.getInstance().setShowMidong(isShowMd);
|
|
|
adpHomeListGrideview.notifyDataSetChanged();
|
|
|
@@ -512,6 +532,9 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
@Override
|
|
|
public void call(BaseMessage o) {
|
|
|
|
|
|
+ if(o != null){
|
|
|
+ CashAwarsEntity cashAwarsEntity = o.getData(CashAwarsEntity.class);
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
adpViewPagerDetail.cleanListFragment();
|
|
|
@@ -550,8 +573,26 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
adpHomeListGrideview = new AdpHomeListGrideview(homeListEntitysGridview, activity);
|
|
|
home_list_gridview_listview.setAdapter(adpHomeListListview);
|
|
|
home_list_gridview_gv.setAdapter(adpHomeListGrideview);
|
|
|
- }
|
|
|
|
|
|
+ home_list_gridview_gv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
|
|
+ if(null == homeListEntitysGridview.get(position)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ HomeListEntity homeListEntity= homeListEntitysGridview.get(position);
|
|
|
+ UMConfigUtils.IdEvent.HOME_LIST.commit(homeListEntity.getId());
|
|
|
+ if(homeListEntity.getJump().equals("-2")){
|
|
|
+ setValueList(!homeListEntity.isSelect());
|
|
|
+ homeListEntity.setSelect(!homeListEntity.isSelect());
|
|
|
+ }else {
|
|
|
+ CommonUtil.getInstance()
|
|
|
+ .goWhere(activity, homeListEntity, "首页");
|
|
|
+ }
|
|
|
+ adpHomeListGrideview.notifyDataSetChanged();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
private void refreshTaskList() {
|
|
|
DataUtil.getInstance().isTaskListChange(getClass());
|
|
|
tryMakeMoneyPresenter.returnTask(is_succession, show_game_task);
|
|
|
@@ -771,19 +812,20 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
boolean isShowQB = false;
|
|
|
boolean isShowMd = false;
|
|
|
for (int i = 0; i < homeListEntitys.size(); i++) {
|
|
|
- if (i < 4) {
|
|
|
- homeListEntitysGridview.add(homeListEntitys.get(i));
|
|
|
- } else {
|
|
|
- homeListEntitysListview.add(homeListEntitys.get(i));
|
|
|
- }
|
|
|
+// if (i < 4) {
|
|
|
+// homeListEntitysGridview.add(homeListEntitys.get(i));
|
|
|
+// } else {
|
|
|
+// homeListEntitysListview.add(homeListEntitys.get(i));
|
|
|
+// }
|
|
|
+ homeListEntitysGridview.add(homeListEntitys.get(i));
|
|
|
if (homeListEntitys.get(i).getJump().equals("6")) {//6Q币充值
|
|
|
isShowQB = !isShowQB;
|
|
|
}
|
|
|
if (homeListEntitys.get(i).getJump().equals("14")) {//幂动科技
|
|
|
isShowMd = !isShowMd;
|
|
|
- CommonUtil.getInstance().initMiDong(activity, DataUtil.getInstance().getUserId());
|
|
|
}
|
|
|
}
|
|
|
+ addNewTask();
|
|
|
SheepApp.getInstance().setShowQB(isShowQB);
|
|
|
SheepApp.getInstance().setShowMidong(isShowMd);
|
|
|
adpHomeListGrideview.notifyDataSetChanged();
|
|
|
@@ -810,9 +852,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
home_list_gridview_layout.setVisibility(View.GONE);
|
|
|
|
|
|
}
|
|
|
-
|
|
|
private int onResumeCount = 0;
|
|
|
-
|
|
|
@Override
|
|
|
public void onResume() {
|
|
|
super.onResume();
|
|
|
@@ -836,6 +876,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
if (onResumeCount == 0)//第一次才调用
|
|
|
// Jump2View.getInstance().tryShowNewbieTask(activity, userEntity, newbie_task);
|
|
|
onResumeCount++;
|
|
|
+
|
|
|
viewRobDuty.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
@@ -1192,4 +1233,54 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新手任务
|
|
|
+ */
|
|
|
+ private void addNewTask(){
|
|
|
+// if(onResumeCount == 0 && CommonUtil.getInstance().addNewTask(activity,userEntity) && homeListEntitysGridview != null)//第一次才调用
|
|
|
+ {
|
|
|
+ HomeListEntity homeListEntity = new HomeListEntity();
|
|
|
+ homeListEntity.setTitle("新手任务");
|
|
|
+ homeListEntity.setDesc("新手任务");
|
|
|
+ homeListEntity.setJump("-1");
|
|
|
+ homeListEntity.setIcon(R.mipmap.homepage_xinshourw+"");
|
|
|
+ homeListEntitys.add(0, homeListEntity);
|
|
|
+
|
|
|
+ }
|
|
|
+ if(homeListEntitys.size() > 8){
|
|
|
+ HomeListEntity homeListEntity = new HomeListEntity();
|
|
|
+ homeListEntity.setTitle("查看更多");
|
|
|
+ homeListEntity.setDesc("查看更多");
|
|
|
+ homeListEntity.setJump("-2");
|
|
|
+ homeListEntity.setIcon(R.mipmap.homepage_chakangd+"");
|
|
|
+ homeListEntitys.add(7, homeListEntity);
|
|
|
+ }
|
|
|
+ onResumeCount++;
|
|
|
+ setValueList(false);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void setValueList(boolean flag) {
|
|
|
+ homeListEntitysGridview.clear();
|
|
|
+ for(int i=0;i<homeListEntitys.size();i++){
|
|
|
+ if(flag){
|
|
|
+ homeListEntitysGridview.add(homeListEntitys.get(i));
|
|
|
+ }else {
|
|
|
+ if(i<8){
|
|
|
+ homeListEntitysGridview.add(homeListEntitys.get(i));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ if(homeListEntitysGridview.size() > 8){
|
|
|
+ HomeListEntity homeListEntity = new HomeListEntity();
|
|
|
+ homeListEntity.setTitle("查看更多");
|
|
|
+ homeListEntity.setDesc("查看更多");
|
|
|
+ homeListEntity.setJump("-2");
|
|
|
+ homeListEntity.setSelect(flag);
|
|
|
+ homeListEntity.setIcon(R.mipmap.homepage_chakangd+"");
|
|
|
+ homeListEntitysGridview.set(7, homeListEntity);
|
|
|
+ }
|
|
|
+ adpHomeListGrideview.notifyDataSetChanged();
|
|
|
+ }
|
|
|
}
|