|
@@ -40,6 +40,7 @@ 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.load.resource.bitmap.RoundedCorners;
|
|
|
import com.bumptech.glide.request.RequestOptions;
|
|
import com.bumptech.glide.request.RequestOptions;
|
|
|
import com.kfzs.duanduan.utils.NumberFormatUtils;
|
|
import com.kfzs.duanduan.utils.NumberFormatUtils;
|
|
|
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
|
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
|
@@ -176,16 +177,10 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
TextView test_change_user;
|
|
TextView test_change_user;
|
|
|
@BindView(R.id.list_title)
|
|
@BindView(R.id.list_title)
|
|
|
LinearLayout listTitle;
|
|
LinearLayout listTitle;
|
|
|
- @BindView(R.id.to_search_but_rl)
|
|
|
|
|
- View to_search_but_rl;
|
|
|
|
|
- @BindView(R.id.to_search_but)
|
|
|
|
|
- LinearLayout to_search_but;
|
|
|
|
|
@BindView(R.id.title_car)
|
|
@BindView(R.id.title_car)
|
|
|
LinearLayout titleCardLayout;
|
|
LinearLayout titleCardLayout;
|
|
|
@BindView(R.id.home_award_container)
|
|
@BindView(R.id.home_award_container)
|
|
|
View home_award_container;
|
|
View home_award_container;
|
|
|
- @BindView(R.id.search_text_view)
|
|
|
|
|
- TextView search_text_view;
|
|
|
|
|
/* 记录滑动坐标的数组 */
|
|
/* 记录滑动坐标的数组 */
|
|
|
int[] locate = new int[2];
|
|
int[] locate = new int[2];
|
|
|
|
|
|
|
@@ -215,7 +210,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
private static final RecyleObj NULL = RecyleObj.make(RecyleType.NONE, null);//空数据
|
|
private static final RecyleObj NULL = RecyleObj.make(RecyleType.NONE, null);//空数据
|
|
|
public static final int WHAT_LOAD_RUN_TASK = 1;//加载正在进行的任务列表
|
|
public static final int WHAT_LOAD_RUN_TASK = 1;//加载正在进行的任务列表
|
|
|
public static final int WHAT_TRY_SHOW_HB = 7;//尝试显示红包
|
|
public static final int WHAT_TRY_SHOW_HB = 7;//尝试显示红包
|
|
|
- public static final int WHAT_REFRESH_MSG_COUNT = 8;//尝试显示红包
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
public boolean needRefreshMsgCount = false;
|
|
public boolean needRefreshMsgCount = false;
|
|
|
|
|
|
|
@@ -243,9 +238,6 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
case WHAT_TRY_SHOW_HB:
|
|
case WHAT_TRY_SHOW_HB:
|
|
|
isShowRedPackages(activity);
|
|
isShowRedPackages(activity);
|
|
|
break;
|
|
break;
|
|
|
- case WHAT_REFRESH_MSG_COUNT:
|
|
|
|
|
- getUnReadMessageCounts();
|
|
|
|
|
- break;
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -317,21 +309,6 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
ivClose.setOnClickListener(view12 -> popupWindow.dismiss());
|
|
ivClose.setOnClickListener(view12 -> popupWindow.dismiss());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @OnClick(R.id.to_search_but)
|
|
|
|
|
- public void toSearchActivity() {
|
|
|
|
|
- Jump2View.getInstance().goActSearch(getActivity());
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @OnClick(R.id.home_search_sbd_iv)
|
|
|
|
|
- public void toActWebX5Sbd() {
|
|
|
|
|
- Jump2View.getInstance().goWeb(activity, new WebParams(Config.getUrlByPath(Config.PATH_SBD_HOME), Config.SBD_NAME));
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @OnClick(R.id.home_search_msg_iv)
|
|
|
|
|
- public void toActMsg() {
|
|
|
|
|
- startActivity(new Intent(activity, ActMsg.class));
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 兑换红包
|
|
* 兑换红包
|
|
|
*
|
|
*
|
|
@@ -632,7 +609,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
// bannerLayoutParams.height = G.WIDTH * 25 / 72;
|
|
// bannerLayoutParams.height = G.WIDTH * 25 / 72;
|
|
|
// banner.setLayoutParams(bannerLayoutParams);
|
|
// banner.setLayoutParams(bannerLayoutParams);
|
|
|
LayoutParamsUtil.resetLayoutParams(banner, new Lp().setHeight(bannerHeight));
|
|
LayoutParamsUtil.resetLayoutParams(banner, new Lp().setHeight(bannerHeight));
|
|
|
-
|
|
|
|
|
|
|
+ banner.setPadding(G.getRealPix(8), G.getRealPix(8), G.getRealPix(8), G.getRealPix(8));
|
|
|
/**
|
|
/**
|
|
|
* tablayout
|
|
* tablayout
|
|
|
*/
|
|
*/
|
|
@@ -707,8 +684,6 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- //上面的搜索
|
|
|
|
|
- ViewUtil.setVisibility(home_search_msg_tv, false);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private int curPosition = 0;
|
|
private int curPosition = 0;
|
|
@@ -920,8 +895,6 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
notifyDataSetChanged();
|
|
notifyDataSetChanged();
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- getUnReadMessageCounts();
|
|
|
|
|
- getSearchHotKeyword();
|
|
|
|
|
if (upview1 != null) {
|
|
if (upview1 != null) {
|
|
|
//停止滚动
|
|
//停止滚动
|
|
|
upview1.stopFlipping();
|
|
upview1.stopFlipping();
|
|
@@ -971,32 +944,6 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
isFirst = false;
|
|
isFirst = false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private void getSearchHotKeyword() {
|
|
|
|
|
- SheepApp.getInstance().getNetComponent().getApiService().keywords()
|
|
|
|
|
- .subscribeOn(Schedulers.io())
|
|
|
|
|
- .observeOn(AndroidSchedulers.mainThread())
|
|
|
|
|
- .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onNext(BaseMessage baseMessage) {
|
|
|
|
|
- List<Keyword> hotKeywords = baseMessage.getDatas(Keyword.class);
|
|
|
|
|
- Iterator<Keyword> it = hotKeywords.iterator();
|
|
|
|
|
- while (it.hasNext()) {
|
|
|
|
|
- Keyword keyword = it.next();
|
|
|
|
|
- if (keyword.getPosition() == 2) {
|
|
|
|
|
- search_text_view.setText(keyword.getKeyword());
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onError(BaseMessage baseMessage) {
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
private boolean isFirst = true;
|
|
private boolean isFirst = true;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -1262,13 +1209,6 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
CommonUtil.getInstance().callActionWithUserInfo(item -> userEntity = item);
|
|
CommonUtil.getInstance().callActionWithUserInfo(item -> userEntity = item);
|
|
|
if (onResumeCount > 0)
|
|
if (onResumeCount > 0)
|
|
|
refreshTaskList();
|
|
refreshTaskList();
|
|
|
- if (!hasShowSbd && activity instanceof ActMain && ((ActMain) activity).getLastPosition() == MainTab.FgtSmallSheep.ordinal()) {
|
|
|
|
|
- hasShowSbd = true;
|
|
|
|
|
- //延时显示随便打弹出框提示
|
|
|
|
|
- PopupWindowUtil.delayShowLayout(activity, new PopupWindowUtil.PopupWindowParams(R.layout.pop_show_sbd_tip).setAnchor(to_search_but_rl)
|
|
|
|
|
- .setGravity(Gravity.BOTTOM).setXoff(G.getRealPix(16))
|
|
|
|
|
- .setDelay(100L).setShowTime(5000L).setOutsideTouchable(true).setFocusable(false));
|
|
|
|
|
- }
|
|
|
|
|
onResumeCount++;
|
|
onResumeCount++;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1326,9 +1266,6 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
case FGT_SHEEP_SHOW_NEW_USER_HONG_BAO:
|
|
case FGT_SHEEP_SHOW_NEW_USER_HONG_BAO:
|
|
|
mHandler.sendEmptyMessage(WHAT_TRY_SHOW_HB);
|
|
mHandler.sendEmptyMessage(WHAT_TRY_SHOW_HB);
|
|
|
break;
|
|
break;
|
|
|
- case FGT_SHEEP_HOME_MESSAGE_COUNT:
|
|
|
|
|
- mHandler.sendEmptyMessage(WHAT_REFRESH_MSG_COUNT);
|
|
|
|
|
- break;
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1365,10 +1302,10 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
@Override
|
|
@Override
|
|
|
public void displayImage(Context context, Object o, ImageView imageView) {
|
|
public void displayImage(Context context, Object o, ImageView imageView) {
|
|
|
try {
|
|
try {
|
|
|
- if (o instanceof SlideshowEty && activity != null && !activity.isDestroyed())
|
|
|
|
|
- Glide.with(context).load(((SlideshowEty) o).getUrl()).apply(new RequestOptions().centerCrop()).into(imageView);
|
|
|
|
|
-// Glide.with(context).load(((SlideshowEty) o).getUrl()).apply(new RequestOptions().centerCrop().transform(new RoundedCorners(G.getRealPix(10)))).into(imageView);
|
|
|
|
|
-// Glide.with(context).load(((SlideshowEty) o).getUrl()).apply(new RequestOptions().transform(new RoundedCornersTransformation(G.getRealPix(10), 0))).into(imageView);
|
|
|
|
|
|
|
+ if (o instanceof SlideshowEty && activity != null && !activity.isDestroyed()) {
|
|
|
|
|
+// GlideImageLoader.roundedCornersImage(imageView, ((SlideshowEty) o).getUrl(), G.getRealPix(10));
|
|
|
|
|
+ Glide.with(context).load(((SlideshowEty) o).getUrl()).apply(new RequestOptions().centerCrop().transform(new RoundedCorners(G.getRealPix(8)))).into(imageView);
|
|
|
|
|
+ }
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|
|
@@ -1644,39 +1581,4 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @BindView(R.id.home_search_sbd_tv)
|
|
|
|
|
- TextView home_search_sbd_tv;
|
|
|
|
|
- @BindView(R.id.home_search_msg_tv)
|
|
|
|
|
- TextView home_search_msg_tv;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * 获取是否有未读消息并更新图标
|
|
|
|
|
- */
|
|
|
|
|
- private void getUnReadMessageCounts() {
|
|
|
|
|
- SheepApp.getInstance()
|
|
|
|
|
- .getNetComponent()
|
|
|
|
|
- .getApiService()
|
|
|
|
|
- .getMessageUnReadNum(DataUtil.getInstance().getUserId())
|
|
|
|
|
- .subscribeOn(Schedulers.io())
|
|
|
|
|
- .observeOn(AndroidSchedulers.mainThread())
|
|
|
|
|
- .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onNext(BaseMessage baseMessage) {
|
|
|
|
|
- MessageUnReadEntity entity = baseMessage.getData(MessageUnReadEntity.class);
|
|
|
|
|
- if (entity != null && entity.getNum() > 0) {
|
|
|
|
|
- ViewUtil.setVisibility(home_search_msg_tv, true);
|
|
|
|
|
- ViewUtil.setText(home_search_msg_tv, entity.getNum());
|
|
|
|
|
- DialogNotificationOfArrival.checkNotificationOfArrivalList(activity);
|
|
|
|
|
- } else {
|
|
|
|
|
- ViewUtil.setVisibility(home_search_msg_tv, false);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onError(BaseMessage baseMessage) {
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
}
|
|
}
|