|
@@ -18,10 +18,12 @@ import android.support.v7.app.AlertDialog;
|
|
|
import android.support.v7.widget.LinearLayoutManager;
|
|
import android.support.v7.widget.LinearLayoutManager;
|
|
|
import android.support.v7.widget.RecyclerView;
|
|
import android.support.v7.widget.RecyclerView;
|
|
|
import android.text.TextUtils;
|
|
import android.text.TextUtils;
|
|
|
|
|
+import android.util.Log;
|
|
|
import android.view.LayoutInflater;
|
|
import android.view.LayoutInflater;
|
|
|
import android.view.MotionEvent;
|
|
import android.view.MotionEvent;
|
|
|
import android.view.View;
|
|
import android.view.View;
|
|
|
import android.view.ViewGroup;
|
|
import android.view.ViewGroup;
|
|
|
|
|
+import android.widget.AdapterView;
|
|
|
import android.widget.ImageView;
|
|
import android.widget.ImageView;
|
|
|
import android.widget.LinearLayout;
|
|
import android.widget.LinearLayout;
|
|
|
import android.widget.TextView;
|
|
import android.widget.TextView;
|
|
@@ -40,7 +42,9 @@ import com.sheep.gamegroup.di.modules.SmallSheepModule;
|
|
|
import com.sheep.gamegroup.di.modules.TryMakeMoneyModule;
|
|
import com.sheep.gamegroup.di.modules.TryMakeMoneyModule;
|
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
import com.sheep.gamegroup.model.entity.BulletinEnty;
|
|
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.Ext;
|
|
|
|
|
+import com.sheep.gamegroup.model.entity.GridViewEntity;
|
|
|
import com.sheep.gamegroup.model.entity.HomeListEntity;
|
|
import com.sheep.gamegroup.model.entity.HomeListEntity;
|
|
|
import com.sheep.gamegroup.model.entity.MoreDataEntity;
|
|
import com.sheep.gamegroup.model.entity.MoreDataEntity;
|
|
|
import com.sheep.gamegroup.model.entity.RecyleObj;
|
|
import com.sheep.gamegroup.model.entity.RecyleObj;
|
|
@@ -61,6 +65,7 @@ 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.NestedScrollView;
|
|
@@ -74,8 +79,6 @@ import com.sheep.gamegroup.view.adapter.AdpHomeListListview;
|
|
|
import com.sheep.gamegroup.view.adapter.AdpTryMakemoney;
|
|
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.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;
|
|
@@ -164,6 +167,12 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
ViewPagerAutoHeigh mViewPager;
|
|
ViewPagerAutoHeigh mViewPager;
|
|
|
@BindView(R.id.tabLayout)
|
|
@BindView(R.id.tabLayout)
|
|
|
TabLayout 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
|
|
@Inject
|
|
@@ -340,10 +349,16 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
tabLayout.post(new Runnable() {
|
|
tabLayout.post(new Runnable() {
|
|
|
@Override
|
|
@Override
|
|
|
public void run() {
|
|
public void run() {
|
|
|
- toolBarPositionY = tabLayout.getHeight();
|
|
|
|
|
- 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) {
|
|
} catch (Exception e) {
|
|
@@ -494,6 +509,9 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
@Override
|
|
@Override
|
|
|
public void call(BaseMessage o) {
|
|
public void call(BaseMessage o) {
|
|
|
|
|
|
|
|
|
|
+ if(o != null){
|
|
|
|
|
+ CashAwarsEntity cashAwarsEntity = o.getData(CashAwarsEntity.class);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
adpViewPagerDetail.cleanListFragment();
|
|
adpViewPagerDetail.cleanListFragment();
|
|
@@ -532,8 +550,26 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
adpHomeListGrideview = new AdpHomeListGrideview(homeListEntitysGridview, activity);
|
|
adpHomeListGrideview = new AdpHomeListGrideview(homeListEntitysGridview, activity);
|
|
|
home_list_gridview_listview.setAdapter(adpHomeListListview);
|
|
home_list_gridview_listview.setAdapter(adpHomeListListview);
|
|
|
home_list_gridview_gv.setAdapter(adpHomeListGrideview);
|
|
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() {
|
|
private void refreshTaskList() {
|
|
|
DataUtil.getInstance().isTaskListChange(getClass());
|
|
DataUtil.getInstance().isTaskListChange(getClass());
|
|
|
tryMakeMoneyPresenter.returnTask(is_succession, show_game_task);
|
|
tryMakeMoneyPresenter.returnTask(is_succession, show_game_task);
|
|
@@ -1137,9 +1173,42 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
homeListEntity.setDesc("新手任务");
|
|
homeListEntity.setDesc("新手任务");
|
|
|
homeListEntity.setJump("-1");
|
|
homeListEntity.setJump("-1");
|
|
|
homeListEntity.setIcon(R.mipmap.homepage_xinshourw+"");
|
|
homeListEntity.setIcon(R.mipmap.homepage_xinshourw+"");
|
|
|
- homeListEntitysGridview.set(0, homeListEntity);
|
|
|
|
|
|
|
+ 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++;
|
|
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();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|