|
|
@@ -43,6 +43,7 @@ import android.widget.TextView;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.bumptech.glide.Glide;
|
|
|
+import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
|
|
|
import com.bumptech.glide.request.RequestOptions;
|
|
|
import com.kfzs.duanduan.utils.NumberFormatUtils;
|
|
|
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
|
|
@@ -68,6 +69,8 @@ import com.sheep.gamegroup.model.entity.SlideshowEty;
|
|
|
import com.sheep.gamegroup.model.entity.TaskAcceptedEty;
|
|
|
import com.sheep.gamegroup.model.entity.UserEntity;
|
|
|
import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
|
+import com.sheep.gamegroup.module.plugin.model.Plugin;
|
|
|
+import com.sheep.gamegroup.module.skin.util.SkinUtil;
|
|
|
import com.sheep.gamegroup.presenter.SmallSheepContract;
|
|
|
import com.sheep.gamegroup.presenter.SmallSheepPresenter;
|
|
|
import com.sheep.gamegroup.presenter.TryMakeMoneyContract;
|
|
|
@@ -87,6 +90,7 @@ import com.sheep.gamegroup.util.TestUtil;
|
|
|
import com.sheep.gamegroup.util.UMConfigUtils;
|
|
|
import com.sheep.gamegroup.util.ViewHolder;
|
|
|
import com.sheep.gamegroup.util.ViewUtil;
|
|
|
+import com.sheep.gamegroup.util.string.SpannableSb;
|
|
|
import com.sheep.gamegroup.view.activity.ActMsg;
|
|
|
import com.sheep.gamegroup.view.activity.NotificationsUtils;
|
|
|
import com.sheep.gamegroup.view.adapter.AdbCommonRecycler;
|
|
|
@@ -96,7 +100,6 @@ 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.dialog.DialogNotificationOfArrival;
|
|
|
-import com.sheep.jiuyan.samllsheep.Config;
|
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
import com.sheep.jiuyan.samllsheep.base.BaseFragment;
|
|
|
@@ -619,8 +622,11 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
|
|
|
|
|
|
//banner的高度
|
|
|
- private int bannerHeight = G.WIDTH * 17 / 40;
|
|
|
+ private int bannerHeight;
|
|
|
|
|
|
+ private void initBannerHeight(){
|
|
|
+ bannerHeight = (G.WIDTH - G.getRealPix(24)) * 17 / 40;
|
|
|
+ }
|
|
|
public void initView() {
|
|
|
try {
|
|
|
EventBus.getDefault().register(this);
|
|
|
@@ -635,7 +641,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
.inject(this);
|
|
|
recyclerInitView();
|
|
|
ViewGroup.LayoutParams bannerLayoutParams = banner.getLayoutParams();
|
|
|
- bannerHeight = G.WIDTH * 17 / 40;
|
|
|
+ initBannerHeight();
|
|
|
bannerLayoutParams.height = bannerHeight;//图片比例发生变化 :306*720
|
|
|
// bannerLayoutParams.height = G.WIDTH * 25 / 72;
|
|
|
banner.setLayoutParams(bannerLayoutParams);
|
|
|
@@ -957,7 +963,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
CashAwarsEntity cashAwarsEntity = o.getData(CashAwarsEntity.class);
|
|
|
if (cashAwarsEntity != null) {
|
|
|
|
|
|
- String award = String.format(activity.getResources().getString(R.string.homepage_award), NumberFormatUtils.retainMost2(cashAwarsEntity.getAward()));
|
|
|
+ CharSequence award = new SpannableSb().append("你还有").append(NumberFormatUtils.retainMost2(cashAwarsEntity.getAward()) + "元", "#FF2D4B").append("的奖励未领取", "#333333").getSsb();
|
|
|
String cash = String.format(activity.getResources().getString(R.string.homepage_cash), NumberFormatUtils.retainMost2(cashAwarsEntity.getCash()));
|
|
|
String welfare = String.format(activity.getResources().getString(R.string.homepage_welfare), NumberFormatUtils.retainMost2(cashAwarsEntity.getWelfare()));
|
|
|
homepage_item_get_award_name_tv.setText(award);
|
|
|
@@ -1408,7 +1414,8 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
public void displayImage(Context context, Object o, ImageView imageView) {
|
|
|
try {
|
|
|
if (o instanceof SlideshowEty && activity != null && !activity.isDestroyed())
|
|
|
- Glide.with(context).load(((SlideshowEty) o).getUrl()).apply(new RequestOptions().dontAnimate()).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);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
@@ -1640,13 +1647,23 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
* 新手任务
|
|
|
*/
|
|
|
private void addNewTask() {
|
|
|
+ boolean isNewYear = SkinUtil.getSkinByTime() == Plugin.skin_new_year;
|
|
|
+ if(isNewYear) {//新年皮肤,加载网络图片
|
|
|
+ int max = 11;
|
|
|
+ int i = 0;
|
|
|
+ for (HomeListEntity homeListEntity : homeListEntitys) {
|
|
|
+ int position = i == 8 ? 12 : i;//position为8的图片上传成功了却下载不了,实在是。。。
|
|
|
+ homeListEntity.setIcon(ViewUtil.getNetImgByNameAndSuffix("ic_new_year_" + position + ".png"));
|
|
|
+ i = (i + 1) % (max + 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
if (CommonUtil.getInstance().addNewTask(activity, userEntity) && homeListEntitysGridview != null) {
|
|
|
HomeListEntity homeListEntityNewTask = new HomeListEntity();
|
|
|
homeListEntityNewTask.setTitle(getString(R.string.fresh_task));
|
|
|
homeListEntityNewTask.setDesc(getString(R.string.fresh_task));
|
|
|
homeListEntityNewTask.setJump("-1");
|
|
|
- homeListEntityNewTask.setIcon("http://cdngame.kuaifazs.com/homepage_xinshourw.png");
|
|
|
+ homeListEntityNewTask.setIcon(ViewUtil.getNetImgByName((isNewYear ? "ic_new_year_" : "") + "homepage_xinshourw"));
|
|
|
homeListEntitys.add(0, homeListEntityNewTask);
|
|
|
}
|
|
|
if (homeListEntitys.size() > 8) {
|
|
|
@@ -1654,13 +1671,14 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
homeListEntity.setTitle("更多");
|
|
|
homeListEntity.setDesc("查看更多");
|
|
|
homeListEntity.setJump("-2");
|
|
|
- homeListEntity.setIcon("http://cdngame.kuaifazs.com/homepage_chakangd.png");
|
|
|
+ homeListEntity.setIcon(ViewUtil.getNetImgByName((isNewYear ? "ic_new_year_" : "") + "homepage_chakangd"));
|
|
|
homeListEntitys.add(7, homeListEntity);
|
|
|
}
|
|
|
setValueList(false);
|
|
|
}
|
|
|
|
|
|
private void setValueList(boolean flag) {
|
|
|
+ boolean isNewYear = SkinUtil.getSkinByTime() == Plugin.skin_new_year;
|
|
|
homeListEntitysGridview.clear();
|
|
|
for (int i = 0; i < homeListEntitys.size(); i++) {
|
|
|
if (flag) {
|
|
|
@@ -1678,11 +1696,11 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
if (flag) {
|
|
|
homeListEntity.setTitle("收起");
|
|
|
homeListEntity.setDesc("收起模块");
|
|
|
- homeListEntity.setIcon("http://cdngame.kuaifazs.com/homepage_chakangd_click.png");
|
|
|
+ homeListEntity.setIcon(ViewUtil.getNetImgByName(isNewYear ? "ic_new_year_homepage_chakangd" : "homepage_chakangd_click"));
|
|
|
} else {
|
|
|
homeListEntity.setTitle("更多");
|
|
|
homeListEntity.setDesc("查看更多");
|
|
|
- homeListEntity.setIcon("http://cdngame.kuaifazs.com/homepage_chakangd.png");
|
|
|
+ homeListEntity.setIcon(ViewUtil.getNetImgByName((isNewYear ? "ic_new_year_" : "") + "homepage_chakangd"));
|
|
|
}
|
|
|
homeListEntitysGridview.set(7, homeListEntity);
|
|
|
}
|