|
@@ -9,6 +9,7 @@ import android.content.Context;
|
|
|
import android.content.DialogInterface;
|
|
import android.content.DialogInterface;
|
|
|
import android.graphics.Color;
|
|
import android.graphics.Color;
|
|
|
import android.graphics.drawable.BitmapDrawable;
|
|
import android.graphics.drawable.BitmapDrawable;
|
|
|
|
|
+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;
|
|
@@ -21,6 +22,8 @@ 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.transition.ChangeBounds;
|
|
|
|
|
+import android.transition.TransitionManager;
|
|
|
import android.view.Gravity;
|
|
import android.view.Gravity;
|
|
|
import android.view.LayoutInflater;
|
|
import android.view.LayoutInflater;
|
|
|
import android.view.MotionEvent;
|
|
import android.view.MotionEvent;
|
|
@@ -41,13 +44,11 @@ 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.google.gson.Gson;
|
|
|
-import com.sheep.gamegroup.event.BigEvent;
|
|
|
|
|
-import com.sheep.gamegroup.model.entity.RobTask;
|
|
|
|
|
-import com.sheep.gamegroup.util.ConfigUtil;
|
|
|
|
|
import com.kfzs.duanduan.utils.NumberFormatUtils;
|
|
import com.kfzs.duanduan.utils.NumberFormatUtils;
|
|
|
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;
|
|
|
|
|
+import com.sheep.gamegroup.event.BigEvent;
|
|
|
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.CashAwarsEntity;
|
|
@@ -56,6 +57,7 @@ import com.sheep.gamegroup.model.entity.MoreDataEntity;
|
|
|
import com.sheep.gamegroup.model.entity.RecyleObj;
|
|
import com.sheep.gamegroup.model.entity.RecyleObj;
|
|
|
import com.sheep.gamegroup.model.entity.RecyleType;
|
|
import com.sheep.gamegroup.model.entity.RecyleType;
|
|
|
import com.sheep.gamegroup.model.entity.RequestParamEty;
|
|
import com.sheep.gamegroup.model.entity.RequestParamEty;
|
|
|
|
|
+import com.sheep.gamegroup.model.entity.RobTask;
|
|
|
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.TaskReleaseEty;
|
|
import com.sheep.gamegroup.model.entity.TaskReleaseEty;
|
|
@@ -67,6 +69,7 @@ import com.sheep.gamegroup.presenter.SmallSheepPresenter;
|
|
|
import com.sheep.gamegroup.presenter.TryMakeMoneyContract;
|
|
import com.sheep.gamegroup.presenter.TryMakeMoneyContract;
|
|
|
import com.sheep.gamegroup.presenter.TryMakeMoneyPresenter;
|
|
import com.sheep.gamegroup.presenter.TryMakeMoneyPresenter;
|
|
|
import com.sheep.gamegroup.util.CommonUtil;
|
|
import com.sheep.gamegroup.util.CommonUtil;
|
|
|
|
|
+import com.sheep.gamegroup.util.ConfigUtil;
|
|
|
import com.sheep.gamegroup.util.DataUtil;
|
|
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;
|
|
@@ -193,7 +196,11 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
TextView test_change;
|
|
TextView test_change;
|
|
|
@BindView(R.id.test_change_user)
|
|
@BindView(R.id.test_change_user)
|
|
|
TextView test_change_user;
|
|
TextView test_change_user;
|
|
|
-
|
|
|
|
|
|
|
+ @BindView(R.id.list_title)
|
|
|
|
|
+ LinearLayout listTitle;
|
|
|
|
|
+ LinearLayout titleCardLayout;
|
|
|
|
|
+ /* 记录滑动坐标的数组 */
|
|
|
|
|
+ int[] locate = new int[2];
|
|
|
|
|
|
|
|
@Inject
|
|
@Inject
|
|
|
SmallSheepPresenter pagePresenter;
|
|
SmallSheepPresenter pagePresenter;
|
|
@@ -228,6 +235,8 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
public static final int WHAT_UPDATE_BOTTOM_LINE = 3;//刷新底线(双击我回到顶部)
|
|
public static final int WHAT_UPDATE_BOTTOM_LINE = 3;//刷新底线(双击我回到顶部)
|
|
|
public static final int WHAT_UPDATE_FOOT_VIEW_CALL_BACK = 4;//刷新发布任务列表的加载更多的状态回调
|
|
public static final int WHAT_UPDATE_FOOT_VIEW_CALL_BACK = 4;//刷新发布任务列表的加载更多的状态回调
|
|
|
public static final int WHAT_TRY_SHOW_HB = 7;//尝试显示红包
|
|
public static final int WHAT_TRY_SHOW_HB = 7;//尝试显示红包
|
|
|
|
|
+
|
|
|
|
|
+ private int clickCount = 0;
|
|
|
public Handler mHandler = new Handler(Looper.getMainLooper()) {
|
|
public Handler mHandler = new Handler(Looper.getMainLooper()) {
|
|
|
@Override
|
|
@Override
|
|
|
public void handleMessage(Message msg) {
|
|
public void handleMessage(Message msg) {
|
|
@@ -267,7 +276,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
break;
|
|
break;
|
|
|
case WHAT_UPDATE_FOOT_VIEW_CALL_BACK://发布任务列表的加载更多的回调
|
|
case WHAT_UPDATE_FOOT_VIEW_CALL_BACK://发布任务列表的加载更多的回调
|
|
|
String obj = (String) msg.obj;
|
|
String obj = (String) msg.obj;
|
|
|
- switch (obj){
|
|
|
|
|
|
|
+ switch (obj) {
|
|
|
case "onLoadingMore":
|
|
case "onLoadingMore":
|
|
|
bottom_line_text.setText("羊羊努力加载中...");
|
|
bottom_line_text.setText("羊羊努力加载中...");
|
|
|
break;
|
|
break;
|
|
@@ -283,7 +292,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
if (mViewPager == null || item == null) {
|
|
if (mViewPager == null || item == null) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- bottom_line_text.setText(item.isNoMore() ?"我是有底线的,双击我回到顶部" : "双击我回到顶部");
|
|
|
|
|
|
|
+ bottom_line_text.setText(item.isNoMore() ? "我是有底线的,双击我回到顶部" : "双击我回到顶部");
|
|
|
break;
|
|
break;
|
|
|
case WHAT_TRY_SHOW_HB:
|
|
case WHAT_TRY_SHOW_HB:
|
|
|
isShowRedPackages(activity);
|
|
isShowRedPackages(activity);
|
|
@@ -292,6 +301,10 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
+ private TextView doIt;
|
|
|
|
|
+ private TextView willStart;
|
|
|
|
|
+ private View doItLine;
|
|
|
|
|
+ private LinearLayout lines;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @return 是否显示兑换邀请码红包
|
|
* @return 是否显示兑换邀请码红包
|
|
@@ -359,7 +372,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
if (clipData != null && clipData.getItemCount() > 0) {
|
|
if (clipData != null && clipData.getItemCount() > 0) {
|
|
|
// 从数据集中获取(粘贴)第一条文本数据
|
|
// 从数据集中获取(粘贴)第一条文本数据
|
|
|
CharSequence codetext = clipData.getItemAt(0).getText();
|
|
CharSequence codetext = clipData.getItemAt(0).getText();
|
|
|
- if (!TextUtils.isEmpty(codetext)){
|
|
|
|
|
|
|
+ if (!TextUtils.isEmpty(codetext)) {
|
|
|
edInvitationCode.setText(codetext);
|
|
edInvitationCode.setText(codetext);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -501,11 +514,11 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
if (userEntity == null) {
|
|
if (userEntity == null) {
|
|
|
userEntity = DataUtil.getInstance().getUserEntity();
|
|
userEntity = DataUtil.getInstance().getUserEntity();
|
|
|
}
|
|
}
|
|
|
- if(userEntity == null){
|
|
|
|
|
|
|
+ if (userEntity == null) {
|
|
|
CommonUtil.getInstance().updateUserInfo(new Action1<UserEntity>() {
|
|
CommonUtil.getInstance().updateUserInfo(new Action1<UserEntity>() {
|
|
|
@Override
|
|
@Override
|
|
|
public void call(UserEntity result) {
|
|
public void call(UserEntity result) {
|
|
|
- if(result != null){
|
|
|
|
|
|
|
+ if (result != null) {
|
|
|
userEntity = result;
|
|
userEntity = result;
|
|
|
showRedPackageNext();
|
|
showRedPackageNext();
|
|
|
}
|
|
}
|
|
@@ -526,6 +539,82 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 初始化选项卡
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param context 上下文参数
|
|
|
|
|
+ */
|
|
|
|
|
+ @SuppressLint("InflateParams")
|
|
|
|
|
+ private void initTitleCardLayout(final Context context) {
|
|
|
|
|
+ WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
|
|
|
|
|
+ titleCardLayout = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.view_float_title_card, null);
|
|
|
|
|
+ doIt = titleCardLayout.findViewById(R.id.do_it_text);
|
|
|
|
|
+ willStart = titleCardLayout.findViewById(R.id.will_start_text);
|
|
|
|
|
+ doItLine = titleCardLayout.findViewById(R.id.do_it_every_day_line);
|
|
|
|
|
+ lines = titleCardLayout.findViewById(R.id.but_will_start);
|
|
|
|
|
+ int linex = (wm.getDefaultDisplay().getWidth() / 6) - (getViewWidth(doItLine) / 2);
|
|
|
|
|
+ lines.setX(linex);
|
|
|
|
|
+ ViewGroup.LayoutParams layoutParams = lines.getLayoutParams();
|
|
|
|
|
+ layoutParams.width = wm.getDefaultDisplay().getWidth() - (linex * 2);
|
|
|
|
|
+ doIt.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onClick(View v) {
|
|
|
|
|
+ if (mViewPager != null) {
|
|
|
|
|
+ mViewPager.setCurrentItem(0);
|
|
|
|
|
+ }
|
|
|
|
|
+ toDayClick();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ willStart.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onClick(View v) {
|
|
|
|
|
+ if (mViewPager != null) {
|
|
|
|
|
+ mViewPager.setCurrentItem(1);
|
|
|
|
|
+ }
|
|
|
|
|
+ willStartClick();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ ((ViewGroup) this.getActivity().getWindow().getDecorView()).addView(titleCardLayout);
|
|
|
|
|
+ titleCardLayout.setVisibility(View.GONE);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 每日必做按钮事件回调
|
|
|
|
|
+ */
|
|
|
|
|
+ private void toDayClick() {
|
|
|
|
|
+ doIt.setTextColor(getContext().getResources().getColor(R.color.blue_34a6e7));
|
|
|
|
|
+ willStart.setTextColor(getContext().getResources().getColor(R.color.black_444444));
|
|
|
|
|
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
|
|
|
|
+ TransitionManager.beginDelayedTransition(titleCardLayout, new ChangeBounds());
|
|
|
|
|
+ }
|
|
|
|
|
+ lines.setGravity(Gravity.LEFT);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 即将开始按钮事件回调
|
|
|
|
|
+ */
|
|
|
|
|
+ private void willStartClick() {
|
|
|
|
|
+ doIt.setTextColor(getContext().getResources().getColor(R.color.black_444444));
|
|
|
|
|
+ willStart.setTextColor(getContext().getResources().getColor(R.color.blue_34a6e7));
|
|
|
|
|
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
|
|
|
|
+ TransitionManager.beginDelayedTransition(titleCardLayout, new ChangeBounds());
|
|
|
|
|
+ }
|
|
|
|
|
+ lines.setGravity(Gravity.RIGHT);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取控件宽度
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param view 视图控件
|
|
|
|
|
+ * @return 返回视图控件的宽度
|
|
|
|
|
+ */
|
|
|
|
|
+ private int getViewWidth(View view) {
|
|
|
|
|
+ int Kw = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
|
|
|
|
|
+ int Kh = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
|
|
|
|
|
+ view.measure(Kw, Kh);
|
|
|
|
|
+ return view.getMeasuredWidth();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public int getLayoutId() {
|
|
public int getLayoutId() {
|
|
|
return R.layout.homepage_act_layout;
|
|
return R.layout.homepage_act_layout;
|
|
@@ -537,6 +626,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
showPDialog();
|
|
showPDialog();
|
|
|
initView();
|
|
initView();
|
|
|
initListener();
|
|
initListener();
|
|
|
|
|
+ initTitleCardLayout(this.getContext());
|
|
|
TestUtil.testChange(activity, test_change);
|
|
TestUtil.testChange(activity, test_change);
|
|
|
TestUtil.testChangeUser(activity, test_change_user);
|
|
TestUtil.testChangeUser(activity, test_change_user);
|
|
|
GlideImageLoader.setImage(bg_newbie_task, "http://cdngame.kuaifazs.com/bg_newbie_task.png");
|
|
GlideImageLoader.setImage(bg_newbie_task, "http://cdngame.kuaifazs.com/bg_newbie_task.png");
|
|
@@ -568,7 +658,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
*/
|
|
*/
|
|
|
adpViewPagerDetail = new AdpTryMakemoney(getChildFragmentManager(), activity);
|
|
adpViewPagerDetail = new AdpTryMakemoney(getChildFragmentManager(), activity);
|
|
|
FgtTryMakeMoney firstItem = FgtTryMakeMoney.newInstance(0, "is_hot");
|
|
FgtTryMakeMoney firstItem = FgtTryMakeMoney.newInstance(0, "is_hot");
|
|
|
- adpViewPagerDetail.add(firstItem,"每日必做");
|
|
|
|
|
|
|
+ adpViewPagerDetail.add(firstItem, "每日必做");
|
|
|
adpViewPagerDetail.add(FgtTryMakeMoney.newInstance(1, "about_to_begin"), "即将开始");
|
|
adpViewPagerDetail.add(FgtTryMakeMoney.newInstance(1, "about_to_begin"), "即将开始");
|
|
|
|
|
|
|
|
mViewPager.setOffscreenPageLimit(2);
|
|
mViewPager.setOffscreenPageLimit(2);
|
|
@@ -584,6 +674,11 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void onPageSelected(int position) {
|
|
public void onPageSelected(int position) {
|
|
|
|
|
+ if (position == 0) {
|
|
|
|
|
+ toDayClick();
|
|
|
|
|
+ } else if (position == 1) {
|
|
|
|
|
+ willStartClick();
|
|
|
|
|
+ }
|
|
|
FgtTryMakeMoney lastItem = (FgtTryMakeMoney) adpViewPagerDetail.getItem(position);
|
|
FgtTryMakeMoney lastItem = (FgtTryMakeMoney) adpViewPagerDetail.getItem(position);
|
|
|
curPosition = position;
|
|
curPosition = position;
|
|
|
FgtTryMakeMoney item = (FgtTryMakeMoney) adpViewPagerDetail.getItem(curPosition);
|
|
FgtTryMakeMoney item = (FgtTryMakeMoney) adpViewPagerDetail.getItem(curPosition);
|
|
@@ -604,7 +699,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
full_home_list_rv.setHasFixedSize(true);
|
|
full_home_list_rv.setHasFixedSize(true);
|
|
|
full_home_list_rv.setNestedScrollingEnabled(false);
|
|
full_home_list_rv.setNestedScrollingEnabled(false);
|
|
|
full_home_list_rv.setLayoutManager(new LinearLayoutManager(activity));
|
|
full_home_list_rv.setLayoutManager(new LinearLayoutManager(activity));
|
|
|
- full_home_list_rv.setAdapter(new AdbCommonRecycler<HomeListEntity>(activity, fullHomeList){
|
|
|
|
|
|
|
+ full_home_list_rv.setAdapter(new AdbCommonRecycler<HomeListEntity>(activity, fullHomeList) {
|
|
|
@Override
|
|
@Override
|
|
|
public int getViewIdByType(int type) {
|
|
public int getViewIdByType(int type) {
|
|
|
return R.layout.item_image_full_home_list;
|
|
return R.layout.item_image_full_home_list;
|
|
@@ -637,7 +732,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
animation.setDuration(150);
|
|
animation.setDuration(150);
|
|
|
animation.setRepeatCount(Integer.MAX_VALUE);//根据产品要求,要一直晃动
|
|
animation.setRepeatCount(Integer.MAX_VALUE);//根据产品要求,要一直晃动
|
|
|
animation.setRepeatMode(Animation.REVERSE);
|
|
animation.setRepeatMode(Animation.REVERSE);
|
|
|
- if(imageView != null)
|
|
|
|
|
|
|
+ if (imageView != null)
|
|
|
imageView.startAnimation(animation);
|
|
imageView.startAnimation(animation);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -659,6 +754,17 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
|
|
|
|
|
@SuppressLint("ClickableViewAccessibility")
|
|
@SuppressLint("ClickableViewAccessibility")
|
|
|
public void initListener() {
|
|
public void initListener() {
|
|
|
|
|
+ scrollView.setOnScrollChangeListener(new NestedScrollView.OnScrollChangeListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onScrollChange(NestedScrollView nestedScrollView, int i, int i1, int i2, int i3) {
|
|
|
|
|
+ listTitle.getLocationInWindow(locate);
|
|
|
|
|
+ if (locate[1] < 0 && titleCardLayout.getVisibility() == View.GONE) {
|
|
|
|
|
+ titleCardLayout.setVisibility(View.VISIBLE);
|
|
|
|
|
+ } else if (locate[1] > 20 && titleCardLayout.getVisibility() == View.VISIBLE) {
|
|
|
|
|
+ titleCardLayout.setVisibility(View.GONE);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
scrollView.setOnTouchListener(new View.OnTouchListener() {
|
|
scrollView.setOnTouchListener(new View.OnTouchListener() {
|
|
|
@Override
|
|
@Override
|
|
|
public boolean onTouch(View v, MotionEvent event) {
|
|
public boolean onTouch(View v, MotionEvent event) {
|
|
@@ -891,6 +997,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
}
|
|
}
|
|
|
UMConfigUtils.IdEvent.HOME_LIST.commit(homeListEntity.getId());
|
|
UMConfigUtils.IdEvent.HOME_LIST.commit(homeListEntity.getId());
|
|
|
if ("-2".equals(homeListEntity.getJump())) {
|
|
if ("-2".equals(homeListEntity.getJump())) {
|
|
|
|
|
+ clickCount += 1;
|
|
|
setValueList(!homeListEntity.isSelect());
|
|
setValueList(!homeListEntity.isSelect());
|
|
|
} else {
|
|
} else {
|
|
|
CommonUtil.getInstance()
|
|
CommonUtil.getInstance()
|
|
@@ -919,12 +1026,12 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
|
|
|
|
|
@OnClick({R.id.recharge, R.id.withdrawal, R.id.view_rob_duty,
|
|
@OnClick({R.id.recharge, R.id.withdrawal, R.id.view_rob_duty,
|
|
|
R.id.newbie_task, R.id.icon_img_iv, R.id.user_layout,
|
|
R.id.newbie_task, R.id.icon_img_iv, R.id.user_layout,
|
|
|
- R.id.bottom_line,R.id.homepage_item_money_tv
|
|
|
|
|
|
|
+ R.id.bottom_line, R.id.homepage_item_money_tv
|
|
|
})
|
|
})
|
|
|
public void onViewClicked(View view) {
|
|
public void onViewClicked(View view) {
|
|
|
switch (view.getId()) {
|
|
switch (view.getId()) {
|
|
|
case R.id.homepage_item_money_tv:
|
|
case R.id.homepage_item_money_tv:
|
|
|
- Jump2View.getInstance().goTryplayView(activity,null);
|
|
|
|
|
|
|
+ Jump2View.getInstance().goTryplayView(activity, null);
|
|
|
break;
|
|
break;
|
|
|
case R.id.withdrawal://提现
|
|
case R.id.withdrawal://提现
|
|
|
Jump2View.getInstance().tryGoWithdrawal(activity, userEntity);
|
|
Jump2View.getInstance().tryGoWithdrawal(activity, userEntity);
|
|
@@ -949,10 +1056,10 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
CommonUtil.getInstance().robTask(new Action1<RobTask>() {
|
|
CommonUtil.getInstance().robTask(new Action1<RobTask>() {
|
|
|
@Override
|
|
@Override
|
|
|
public void call(RobTask robTask) {
|
|
public void call(RobTask robTask) {
|
|
|
- if(robTask != null){
|
|
|
|
|
|
|
+ if (robTask != null) {
|
|
|
SheepApp.getInstance().setOrder(robTask.getOrder());
|
|
SheepApp.getInstance().setOrder(robTask.getOrder());
|
|
|
ViewUtil.newInstance().showRobDutyDialog(getActivity(), getView(), robTask);
|
|
ViewUtil.newInstance().showRobDutyDialog(getActivity(), getView(), robTask);
|
|
|
- }else {
|
|
|
|
|
|
|
+ } else {
|
|
|
G.showToast("任务已被抢光!请实时关注任务发布!");
|
|
G.showToast("任务已被抢光!请实时关注任务发布!");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1168,8 +1275,8 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void checkAndInitView() {
|
|
private void checkAndInitView() {
|
|
|
- if (recyclerview == null){
|
|
|
|
|
- if(unbinder != null){
|
|
|
|
|
|
|
+ if (recyclerview == null) {
|
|
|
|
|
+ if (unbinder != null) {
|
|
|
try {
|
|
try {
|
|
|
unbinder.unbind();
|
|
unbinder.unbind();
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -1332,7 +1439,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
.setOnBannerListener(new OnBannerListener() {
|
|
.setOnBannerListener(new OnBannerListener() {
|
|
|
@Override
|
|
@Override
|
|
|
public void OnBannerClick(int i) {
|
|
public void OnBannerClick(int i) {
|
|
|
- CommonUtil.getInstance().clickBanner(activity,i, slideshowEtyLists);
|
|
|
|
|
|
|
+ CommonUtil.getInstance().clickBanner(activity, i, slideshowEtyLists);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -1546,8 +1653,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
*/
|
|
*/
|
|
|
private void addNewTask() {
|
|
private void addNewTask() {
|
|
|
|
|
|
|
|
- if (CommonUtil.getInstance().addNewTask(activity, userEntity) && homeListEntitysGridview != null)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ if (CommonUtil.getInstance().addNewTask(activity, userEntity) && homeListEntitysGridview != null) {
|
|
|
HomeListEntity homeListEntityNewTask = new HomeListEntity();
|
|
HomeListEntity homeListEntityNewTask = new HomeListEntity();
|
|
|
homeListEntityNewTask.setTitle("新手任务");
|
|
homeListEntityNewTask.setTitle("新手任务");
|
|
|
homeListEntityNewTask.setDesc("新手任务");
|
|
homeListEntityNewTask.setDesc("新手任务");
|
|
@@ -1557,7 +1663,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
}
|
|
}
|
|
|
if (homeListEntitys.size() > 8) {
|
|
if (homeListEntitys.size() > 8) {
|
|
|
HomeListEntity homeListEntity = new HomeListEntity();
|
|
HomeListEntity homeListEntity = new HomeListEntity();
|
|
|
- homeListEntity.setTitle("查看更多");
|
|
|
|
|
|
|
+ homeListEntity.setTitle("更多");
|
|
|
homeListEntity.setDesc("查看更多");
|
|
homeListEntity.setDesc("查看更多");
|
|
|
homeListEntity.setJump("-2");
|
|
homeListEntity.setJump("-2");
|
|
|
homeListEntity.setIcon("http://cdngame.kuaifazs.com/homepage_chakangd.png");
|
|
homeListEntity.setIcon("http://cdngame.kuaifazs.com/homepage_chakangd.png");
|
|
@@ -1576,23 +1682,26 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
homeListEntitysGridview.add(homeListEntitys.get(i));
|
|
homeListEntitysGridview.add(homeListEntitys.get(i));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
if (homeListEntitysGridview.size() > 8) {
|
|
if (homeListEntitysGridview.size() > 8) {
|
|
|
HomeListEntity homeListEntity = new HomeListEntity();
|
|
HomeListEntity homeListEntity = new HomeListEntity();
|
|
|
homeListEntity.setJump("-2");
|
|
homeListEntity.setJump("-2");
|
|
|
homeListEntity.setSelect(flag);
|
|
homeListEntity.setSelect(flag);
|
|
|
if (flag) {
|
|
if (flag) {
|
|
|
- homeListEntity.setTitle("收起模块");
|
|
|
|
|
|
|
+ homeListEntity.setTitle("收起");
|
|
|
homeListEntity.setDesc("收起模块");
|
|
homeListEntity.setDesc("收起模块");
|
|
|
homeListEntity.setIcon("http://cdngame.kuaifazs.com/homepage_chakangd_click.png");
|
|
homeListEntity.setIcon("http://cdngame.kuaifazs.com/homepage_chakangd_click.png");
|
|
|
} else {
|
|
} else {
|
|
|
- homeListEntity.setTitle("查看更多");
|
|
|
|
|
|
|
+ homeListEntity.setTitle("更多");
|
|
|
homeListEntity.setDesc("查看更多");
|
|
homeListEntity.setDesc("查看更多");
|
|
|
homeListEntity.setIcon("http://cdngame.kuaifazs.com/homepage_chakangd.png");
|
|
homeListEntity.setIcon("http://cdngame.kuaifazs.com/homepage_chakangd.png");
|
|
|
}
|
|
}
|
|
|
homeListEntitysGridview.set(7, homeListEntity);
|
|
homeListEntitysGridview.set(7, homeListEntity);
|
|
|
}
|
|
}
|
|
|
|
|
+ /* 为了避免第一次点击时网络图片未加载到本地导致UI混乱,第一次点击不执行此动画,转而使用View自带的变换动画 */
|
|
|
|
|
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT && clickCount > 1) {
|
|
|
|
|
+ TransitionManager.beginDelayedTransition(home_list_gridview_gv, new ChangeBounds());
|
|
|
|
|
+ }
|
|
|
adpHomeListGrideview.notifyDataSetChanged();
|
|
adpHomeListGrideview.notifyDataSetChanged();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|