|
|
@@ -1,12 +1,10 @@
|
|
|
package com.kfzs.duanduan.fragment;
|
|
|
|
|
|
import android.annotation.SuppressLint;
|
|
|
-import android.app.ActionBar;
|
|
|
import android.app.Activity;
|
|
|
import android.content.Context;
|
|
|
import android.content.DialogInterface;
|
|
|
import android.graphics.Color;
|
|
|
-import android.graphics.drawable.BitmapDrawable;
|
|
|
import android.os.Build;
|
|
|
import android.os.Bundle;
|
|
|
import android.os.Handler;
|
|
|
@@ -20,8 +18,6 @@ import android.support.v7.app.AlertDialog;
|
|
|
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;
|
|
|
@@ -29,7 +25,6 @@ import android.view.ViewGroup;
|
|
|
import android.widget.AdapterView;
|
|
|
import android.widget.ImageView;
|
|
|
import android.widget.LinearLayout;
|
|
|
-import android.widget.PopupWindow;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
@@ -40,16 +35,14 @@ import com.kfzs.duanduan.event.BigEvent;
|
|
|
import com.kfzs.duanduan.react.ConfigUtil;
|
|
|
import com.kfzs.duanduan.react.SharedPreferences;
|
|
|
import com.kfzs.duanduan.utils.NumberFormatUtils;
|
|
|
-import com.kfzs.duanduan.view.ViewPagerAutoHeigh;
|
|
|
+import com.kfzs.duanduan.utils.dlg.FormatAny;
|
|
|
import com.sheep.gamegroup.di.components.DaggerSmallSheepComponent;
|
|
|
import com.sheep.gamegroup.di.modules.SmallSheepModule;
|
|
|
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;
|
|
|
@@ -113,7 +106,6 @@ import butterknife.Unbinder;
|
|
|
import rx.functions.Action1;
|
|
|
|
|
|
import static com.sheep.gamegroup.util.UMConfigUtils.Event.NEWBIE_TASK;
|
|
|
-import static com.sheep.gamegroup.util.ViewUtil.backgroundAlpha;
|
|
|
|
|
|
public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContract.View, TryMakeMoneyContract.View {
|
|
|
|
|
|
@@ -170,7 +162,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
@BindView(R.id.iv_rob_duty)
|
|
|
ImageView ivDuty;
|
|
|
@BindView(R.id.viewpager_act_game_details)
|
|
|
- ViewPagerAutoHeigh mViewPager;
|
|
|
+ ViewPager mViewPager;
|
|
|
@BindView(R.id.tabLayout)
|
|
|
TabLayout tabLayout;
|
|
|
@BindView(R.id.homepage_item_get_award_name_tv)
|
|
|
@@ -179,6 +171,8 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
TextView homepage_item_money_tv;
|
|
|
@BindView(R.id.homepage_item_juan_tv)
|
|
|
TextView homepage_item_juan_tv;
|
|
|
+ @BindView(R.id.recyclerview_line)
|
|
|
+ View recyclerview_line;
|
|
|
|
|
|
|
|
|
@Inject
|
|
|
@@ -217,10 +211,11 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
break;
|
|
|
case 1:
|
|
|
tryMakeMoneyAdp.clear();
|
|
|
- if (!ListUtil.isEmpty(allTaskAcceptedTaskList)) {
|
|
|
+ if(!ListUtil.isEmpty(allTaskAcceptedTaskList)){
|
|
|
+ recyclerview_line.setVisibility(View.VISIBLE);
|
|
|
tryMakeMoneyAdp.add(RecyleObj.make(RecyleType.RUN_TASK, allTaskAcceptedTaskList));
|
|
|
}
|
|
|
- if (!ListUtil.isEmpty(releaseEtyLists)) {
|
|
|
+ if(!ListUtil.isEmpty(releaseEtyLists)) {
|
|
|
tryMakeMoneyAdp.add(RecyleObj.make(RecyleType.RELEASE_TASK, releaseEtyLists));
|
|
|
}
|
|
|
tryMakeMoneyAdp.notifyDataSetChanged();
|
|
|
@@ -232,18 +227,6 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
};
|
|
|
|
|
|
@RequiresApi(api = Build.VERSION_CODES.M)
|
|
|
- /**
|
|
|
- * @return 是否显示红包
|
|
|
- */
|
|
|
- private void isShowRedPackage() {
|
|
|
- if (userEntity == null) {
|
|
|
- userEntity = DataUtil.getInstance().getUserEntity();
|
|
|
- }
|
|
|
- if (((userEntity.getNewbie_task_status() & (1 << 4)) == 0) && (userEntity.getParent_code().equals("")) && (userEntity.getIs_new() == 1)) {
|
|
|
- showRedPackage(getActivity(), LayoutInflater.from(getContext()).inflate(R.layout.homepage_act_layout, null));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
protected void initView(Bundle savedInstanceState) {
|
|
|
setContentView(R.layout.homepage_act_layout);
|
|
|
@@ -260,7 +243,6 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
}
|
|
|
//每次进入主页都刷新一下url配置信息
|
|
|
CommonUtil.getInstance().initUrlConfigByNet(null, null);
|
|
|
- isShowRedPackage();
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -282,29 +264,13 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
* tablayout
|
|
|
*/
|
|
|
adpViewPagerDetail = new AdpTryMakemoney(getChildFragmentManager(), activity);
|
|
|
- adpViewPagerDetail.add(FgtTryMakeMoney.newInstance(0), "每日必做");
|
|
|
- adpViewPagerDetail.add(FgtTryMakeMoney.newInstance(0), "即将开始");
|
|
|
+ adpViewPagerDetail.add(FgtTryMakeMoney.newInstance(0, "is_hot"), "每日必做");
|
|
|
+ adpViewPagerDetail.add(FgtTryMakeMoney.newInstance(1,"about_to_begin"), "即将开始");
|
|
|
|
|
|
- mViewPager.setOffscreenPageLimit(2);
|
|
|
+// 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);
|
|
|
}
|
|
|
@@ -364,29 +330,25 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
@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);
|
|
|
- int count = mViewPager.getChildCount();
|
|
|
- if(count > 0){
|
|
|
- toolBarPositionY = tabLayout.getHeight();
|
|
|
+// try {
|
|
|
+// tabLayout.post(new Runnable() {
|
|
|
+// @Override
|
|
|
+// public void run() {
|
|
|
+// int count = mViewPager.getChildCount();
|
|
|
+// if(count > 0){
|
|
|
+// toolBarPositionY = tabLayout.getHeight();
|
|
|
+//// ViewGroup.LayoutParams params = mViewPager.getLayoutParams();
|
|
|
// 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) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
+// params.height = G.getRealPix(count * 50);
|
|
|
+// mViewPager.setLayoutParams(params);
|
|
|
+// LogUtil.logE("--------"+count+";height:"+mViewPager.getHeight()+","+mViewPager.getMeasuredHeight());
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
+// });
|
|
|
+// } catch (Exception e) {
|
|
|
+// e.printStackTrace();
|
|
|
+// }
|
|
|
}
|
|
|
});
|
|
|
|
|
|
@@ -419,7 +381,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
|
|
|
//用户信息
|
|
|
userEntity = DataUtil.getInstance().getUserEntity();
|
|
|
- if (userEntity != null) {
|
|
|
+ if(userEntity != null){
|
|
|
loadUserInfo();
|
|
|
}
|
|
|
//任务
|
|
|
@@ -432,13 +394,13 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
|
|
|
//实时动态
|
|
|
List<MoreDataEntity> cacheMoreDataEtyList = DataUtil.getInstance().getCacheList(ApiKey.award_detail, MoreDataEntity.class);
|
|
|
- if (!ListUtil.isEmpty(cacheMoreDataEtyList)) {
|
|
|
+ if(!ListUtil.isEmpty(cacheMoreDataEtyList)){
|
|
|
invite(cacheMoreDataEtyList);
|
|
|
}
|
|
|
|
|
|
//公告
|
|
|
List<BulletinEnty> cacheBulletinEtyList = DataUtil.getInstance().getCacheList(ApiKey.bulletin, BulletinEnty.class);
|
|
|
- if (ListUtil.isEmpty(cacheBulletinEtyList)) {
|
|
|
+ if(ListUtil.isEmpty(cacheBulletinEtyList)){
|
|
|
homepageItemNoticeLayout.setVisibility(View.GONE);
|
|
|
} else {
|
|
|
bulletinEntyLists.clear();
|
|
|
@@ -447,7 +409,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
}
|
|
|
//轮播
|
|
|
List<SlideshowEty> cacheSlideshowEtyList = DataUtil.getInstance().getCacheList(ApiKey.slideshow, SlideshowEty.class);
|
|
|
- if (ListUtil.isEmpty(cacheSlideshowEtyList)) {
|
|
|
+ if(ListUtil.isEmpty(cacheSlideshowEtyList)){
|
|
|
banner.setVisibility(View.GONE);
|
|
|
} else {
|
|
|
for (SlideshowEty slideshowEty : cacheSlideshowEtyList) {
|
|
|
@@ -459,7 +421,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
}
|
|
|
//首页list
|
|
|
List<HomeListEntity> cacheHomeListEtyList = DataUtil.getInstance().getCacheList(ApiKey.home_list, HomeListEntity.class);
|
|
|
- if (ListUtil.isEmpty(cacheHomeListEtyList)) {
|
|
|
+ if(ListUtil.isEmpty(cacheHomeListEtyList)){
|
|
|
home_list_gridview_layout.setVisibility(View.GONE);
|
|
|
} else {
|
|
|
home_list_gridview_layout.setVisibility(View.VISIBLE);
|
|
|
@@ -491,7 +453,6 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
}
|
|
|
|
|
|
int toolBarPositionY;
|
|
|
-
|
|
|
/**
|
|
|
* 刷新数据
|
|
|
*/
|
|
|
@@ -534,6 +495,15 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
|
|
|
if(o != null){
|
|
|
CashAwarsEntity cashAwarsEntity = o.getData(CashAwarsEntity.class);
|
|
|
+ if(cashAwarsEntity != null){
|
|
|
+
|
|
|
+ String award = String.format(activity.getResources().getString(R.string.homepage_award), FormatAny.getInstance().formatString(cashAwarsEntity.getAward()+""));
|
|
|
+ String cash = String.format(activity.getResources().getString(R.string.homepage_cash), FormatAny.getInstance().formatString(cashAwarsEntity.getCash()+""));
|
|
|
+ String welfare = String.format(activity.getResources().getString(R.string.homepage_welfare), FormatAny.getInstance().formatString(cashAwarsEntity.getWelfare()+""));
|
|
|
+ homepage_item_get_award_name_tv.setText(award+"");
|
|
|
+ homepage_item_money_tv.setText(cash+"");
|
|
|
+ homepage_item_juan_tv.setText(welfare+"");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
@@ -546,7 +516,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
public void run() {
|
|
|
toolBarPositionY = tabLayout.getHeight();
|
|
|
ViewGroup.LayoutParams params = mViewPager.getLayoutParams();
|
|
|
- params.height = G.HEIGHT - toolBarPositionY - tabLayout.getHeight() + 1;
|
|
|
+ params.height = G.HEIGHT - toolBarPositionY - tabLayout.getHeight()+1;
|
|
|
mViewPager.setLayoutParams(params);
|
|
|
}
|
|
|
});
|
|
|
@@ -584,12 +554,10 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
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();
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
@@ -605,7 +573,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
1,
|
|
|
0,
|
|
|
0,
|
|
|
- "-1",
|
|
|
+ "-1",
|
|
|
3));
|
|
|
// tryMakeMoneyPresenter.releaseTask(parameEty);
|
|
|
}
|
|
|
@@ -645,7 +613,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
}
|
|
|
BaseMessage baseMessage = (BaseMessage) o;
|
|
|
userEntity = baseMessage.getData(UserEntity.class);
|
|
|
- if (userEntity == null) {
|
|
|
+ if(userEntity == null){
|
|
|
return;
|
|
|
}
|
|
|
DataUtil.getInstance().setUserEntity(userEntity);
|
|
|
@@ -679,14 +647,12 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
public void giveUpTaskFailView(Object o) {
|
|
|
|
|
|
}
|
|
|
-
|
|
|
private int is_succession = 3;//所有
|
|
|
private int show_game_task = 1;//包含游戏任务
|
|
|
-
|
|
|
@Override
|
|
|
public void returnTaskTaskUpdataView(Object object) {
|
|
|
boolean isNewData = DataUtil.getInstance().isNewData(ApiKey.new_run_task(is_succession, show_game_task));
|
|
|
- if (isNewData) {
|
|
|
+ if(isNewData) {
|
|
|
BaseMessage baseMessage = (BaseMessage) object;
|
|
|
allTaskAcceptedTaskList = baseMessage.getDataList(TaskAcceptedEty.class);
|
|
|
AutoTaskListUtil.getInstance().loadList(allTaskAcceptedTaskList);
|
|
|
@@ -720,7 +686,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
@Override
|
|
|
public void releaseTaskTaskUpdataView(Object object) {
|
|
|
boolean isNewData = DataUtil.getInstance().isNewData(ApiKey.release_task);
|
|
|
- if (isNewData && object instanceof BaseMessage) {
|
|
|
+ if(isNewData && object instanceof BaseMessage) {
|
|
|
List<TaskReleaseEty> releaseEtyList = ((BaseMessage) object).getDataList(TaskReleaseEty.class);
|
|
|
if (releaseEtyList != null) {
|
|
|
releaseEtyLists = releaseEtyList;
|
|
|
@@ -758,7 +724,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
@Override
|
|
|
public void successSlideshow(BaseMessage baseMessage) {
|
|
|
boolean isNewData = DataUtil.getInstance().isNewData(ApiKey.slideshow);
|
|
|
- if (isNewData) {
|
|
|
+ if(isNewData){
|
|
|
List<SlideshowEty> slideshowEtyList = baseMessage.getDataList(SlideshowEty.class);
|
|
|
if (ListUtil.isEmpty(slideshowEtyList)) {
|
|
|
banner.setVisibility(View.GONE);
|
|
|
@@ -783,7 +749,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
@Override
|
|
|
public void successbulletin(BaseMessage baseMessage) {
|
|
|
boolean isNewData = DataUtil.getInstance().isNewData(ApiKey.bulletin);
|
|
|
- if (isNewData) {
|
|
|
+ if(isNewData){
|
|
|
List<BulletinEnty> bulletinEntyList = JSONArray.parseArray(JSONArray.toJSONString(baseMessage.getData()), BulletinEnty.class);
|
|
|
if (ListUtil.isEmpty(bulletinEntyList)) {
|
|
|
homepageItemNoticeLayout.setVisibility(View.GONE);
|
|
|
@@ -799,7 +765,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
public void successhomeList(BaseMessage baseMessage) {
|
|
|
checkAndInitView();
|
|
|
boolean isNewData = DataUtil.getInstance().isNewData(ApiKey.home_list);
|
|
|
- if (isNewData) {
|
|
|
+ if(isNewData){
|
|
|
List<HomeListEntity> homeListEntityList = baseMessage.getDataList(HomeListEntity.class);
|
|
|
if (ListUtil.isEmpty(homeListEntityList)) {
|
|
|
home_list_gridview_layout.setVisibility(View.GONE);
|
|
|
@@ -857,11 +823,11 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
public void onResume() {
|
|
|
super.onResume();
|
|
|
UserEntity result = DataUtil.getInstance().getUserEntity();
|
|
|
- if (result == null) {
|
|
|
+ if(result == null) {
|
|
|
CommonUtil.getInstance().updateUserInfo(new Action1<UserEntity>() {
|
|
|
@Override
|
|
|
public void call(UserEntity item) {
|
|
|
- if (item != null) {
|
|
|
+ if(item != null) {
|
|
|
userEntity = item;
|
|
|
loadUserInfo();
|
|
|
}
|
|
|
@@ -871,11 +837,8 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
userEntity = result;
|
|
|
loadUserInfo();
|
|
|
}
|
|
|
- if (DataUtil.getInstance().isTaskListChange(getClass()))//数据变化才刷新
|
|
|
+ if(DataUtil.getInstance().isTaskListChange(getClass()))//数据变化才刷新
|
|
|
refreshTaskList();
|
|
|
- if (onResumeCount == 0)//第一次才调用
|
|
|
-// Jump2View.getInstance().tryShowNewbieTask(activity, userEntity, newbie_task);
|
|
|
- onResumeCount++;
|
|
|
|
|
|
viewRobDuty.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
@@ -1143,7 +1106,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
* 点击一条公告
|
|
|
*/
|
|
|
private void onClickNotice(BulletinEnty item) {
|
|
|
- switch (item.getJumpType()) {// 跳转类型:11,任务 98,内部h5 99,外部h5
|
|
|
+ switch (item.getJumpType()){// 跳转类型:11,任务 98,内部h5 99,外部h5
|
|
|
case 11:
|
|
|
Jump2View.getInstance().goTaskDetailView(activity, NumberFormatUtils.parseInteger(item.getJumpValue()));
|
|
|
break;
|
|
|
@@ -1186,52 +1149,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
});
|
|
|
builder.show();
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- /**
|
|
|
- * 邀请成功后在个人资料显示领红包弹窗
|
|
|
- *
|
|
|
- * @param mActivity 当前Activity
|
|
|
- */
|
|
|
- public void showRedPackage(final Activity mActivity, View viewAnchor) {
|
|
|
- View view = LayoutInflater.from(mActivity).inflate(R.layout.dialog_redpackage_after_invitation, null, false);
|
|
|
- TextView tvGetRedPackage = view.findViewById(R.id.tv_get_redpackage);
|
|
|
- TextView tvMoney = view.findViewById(R.id.tv_money);
|
|
|
- ImageView ivClose = view.findViewById(R.id.iv_close);
|
|
|
- TextView tvNew = view.findViewById(R.id.tv_flag1);
|
|
|
- final PopupWindow popupWindow = new PopupWindow(mActivity);
|
|
|
- popupWindow.setContentView(view);
|
|
|
- popupWindow.setAnimationStyle(R.style.Rising);
|
|
|
- popupWindow.setWidth(ActionBar.LayoutParams.MATCH_PARENT);
|
|
|
- popupWindow.setHeight(ActionBar.LayoutParams.MATCH_PARENT);
|
|
|
- popupWindow.setTouchable(true);
|
|
|
- popupWindow.setFocusable(true);
|
|
|
- popupWindow.setOutsideTouchable(false);
|
|
|
- popupWindow.setBackgroundDrawable(new BitmapDrawable());
|
|
|
- backgroundAlpha(0.7f, mActivity);
|
|
|
- popupWindow.showAtLocation(viewAnchor, Gravity.CENTER, 0, 0);
|
|
|
- popupWindow.setOnDismissListener(new ViewUtil.PopDismissListener(mActivity));
|
|
|
- tvMoney.setText("");
|
|
|
- tvNew.setText("新人红包");
|
|
|
- tvGetRedPackage.setOnClickListener(new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
- CommonUtil.getInstance().updateUserInfo(null);
|
|
|
- popupWindow.dismiss();
|
|
|
- }
|
|
|
- });
|
|
|
- ivClose.setOnClickListener(new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View view) {
|
|
|
- popupWindow.dismiss();
|
|
|
- }
|
|
|
- });
|
|
|
- ivClose.setOnClickListener(new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View view) {
|
|
|
- popupWindow.dismiss();
|
|
|
- }
|
|
|
- });
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -1278,7 +1196,11 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
homeListEntity.setDesc("查看更多");
|
|
|
homeListEntity.setJump("-2");
|
|
|
homeListEntity.setSelect(flag);
|
|
|
- homeListEntity.setIcon(R.mipmap.homepage_chakangd+"");
|
|
|
+ if (flag) {
|
|
|
+ homeListEntity.setIcon(R.mipmap.homepage_chakangd_click+"");
|
|
|
+ } else {
|
|
|
+ homeListEntity.setIcon(R.mipmap.homepage_chakangd+"");
|
|
|
+ }
|
|
|
homeListEntitysGridview.set(7, homeListEntity);
|
|
|
}
|
|
|
adpHomeListGrideview.notifyDataSetChanged();
|