|
@@ -2,6 +2,8 @@ package com.sheep.gamegroup.view.activity;
|
|
|
|
|
|
|
|
import android.app.Activity;
|
|
import android.app.Activity;
|
|
|
import android.os.Bundle;
|
|
import android.os.Bundle;
|
|
|
|
|
+import android.support.design.widget.TabLayout;
|
|
|
|
|
+import android.support.v4.view.ViewPager;
|
|
|
import android.support.v4.widget.SwipeRefreshLayout;
|
|
import android.support.v4.widget.SwipeRefreshLayout;
|
|
|
import android.support.v7.widget.LinearLayoutManager;
|
|
import android.support.v7.widget.LinearLayoutManager;
|
|
|
import android.support.v7.widget.RecyclerView;
|
|
import android.support.v7.widget.RecyclerView;
|
|
@@ -16,9 +18,13 @@ import com.alibaba.fastjson.JSONArray;
|
|
|
import com.arialyy.aria.core.download.DownloadTask;
|
|
import com.arialyy.aria.core.download.DownloadTask;
|
|
|
import com.bumptech.glide.Glide;
|
|
import com.bumptech.glide.Glide;
|
|
|
import com.kfzs.duanduan.event.BigEvent;
|
|
import com.kfzs.duanduan.event.BigEvent;
|
|
|
|
|
+import com.kfzs.duanduan.fragment.FgtFindChild;
|
|
|
|
|
+import com.kfzs.duanduan.fragment.FgtGameAgencyRecharge;
|
|
|
|
|
+import com.kfzs.duanduan.mine.GiftpackListAdapter;
|
|
|
import com.sheep.gamegroup.absBase.BaseActivity;
|
|
import com.sheep.gamegroup.absBase.BaseActivity;
|
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
import com.sheep.gamegroup.model.entity.DialogConfig;
|
|
import com.sheep.gamegroup.model.entity.DialogConfig;
|
|
|
|
|
+import com.sheep.gamegroup.model.entity.FindTag;
|
|
|
import com.sheep.gamegroup.model.entity.GameAgencyRechargePlatformEntity;
|
|
import com.sheep.gamegroup.model.entity.GameAgencyRechargePlatformEntity;
|
|
|
import com.sheep.gamegroup.model.entity.GridViewEntity;
|
|
import com.sheep.gamegroup.model.entity.GridViewEntity;
|
|
|
import com.sheep.gamegroup.model.entity.OrienteeringDetail;
|
|
import com.sheep.gamegroup.model.entity.OrienteeringDetail;
|
|
@@ -44,6 +50,7 @@ import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
|
|
|
import org.greenrobot.eventbus.EventBus;
|
|
import org.greenrobot.eventbus.EventBus;
|
|
|
import org.greenrobot.eventbus.Subscribe;
|
|
import org.greenrobot.eventbus.Subscribe;
|
|
|
|
|
|
|
|
|
|
+import java.lang.reflect.Field;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Locale;
|
|
import java.util.Locale;
|
|
@@ -54,6 +61,7 @@ import rx.android.schedulers.AndroidSchedulers;
|
|
|
import rx.functions.Action1;
|
|
import rx.functions.Action1;
|
|
|
import rx.schedulers.Schedulers;
|
|
import rx.schedulers.Schedulers;
|
|
|
|
|
|
|
|
|
|
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.FIND_TAG;
|
|
|
import static com.sheep.gamegroup.util.UMConfigUtils.Event.GAME_INSTEAD_OF_RECHARGE_HELP;
|
|
import static com.sheep.gamegroup.util.UMConfigUtils.Event.GAME_INSTEAD_OF_RECHARGE_HELP;
|
|
|
import static com.sheep.gamegroup.util.UMConfigUtils.Event.GAME_INSTEAD_OF_RECHARGE_TAB;
|
|
import static com.sheep.gamegroup.util.UMConfigUtils.Event.GAME_INSTEAD_OF_RECHARGE_TAB;
|
|
|
|
|
|
|
@@ -71,6 +79,12 @@ public class ActGameAgencyRecharge extends BaseActivity {
|
|
|
SheepmSwipeRefreshLayout refresh;
|
|
SheepmSwipeRefreshLayout refresh;
|
|
|
@BindView(R.id.empty_view)
|
|
@BindView(R.id.empty_view)
|
|
|
View empty_view;
|
|
View empty_view;
|
|
|
|
|
+ @BindView(R.id.indicator)
|
|
|
|
|
+ TabLayout indicator;
|
|
|
|
|
+ @BindView(R.id.pager)
|
|
|
|
|
+ ViewPager pager;
|
|
|
|
|
+ private GiftpackListAdapter mAdapter;
|
|
|
|
|
+
|
|
|
private Activity activity;
|
|
private Activity activity;
|
|
|
private AdpGameAgencyRecharge adpGameAgencyRecharge;
|
|
private AdpGameAgencyRecharge adpGameAgencyRecharge;
|
|
|
private ArrayList<Object> gridviewList = new ArrayList<>();
|
|
private ArrayList<Object> gridviewList = new ArrayList<>();
|
|
@@ -88,8 +102,6 @@ public class ActGameAgencyRecharge extends BaseActivity {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void initView() {
|
|
public void initView() {
|
|
|
-
|
|
|
|
|
- EventBus.getDefault().register(this);
|
|
|
|
|
activity = this;
|
|
activity = this;
|
|
|
TitleBarUtils.getInstance()
|
|
TitleBarUtils.getInstance()
|
|
|
.setTitleFinish(activity)
|
|
.setTitleFinish(activity)
|
|
@@ -110,21 +122,8 @@ public class ActGameAgencyRecharge extends BaseActivity {
|
|
|
Jump2View.getInstance().goGameSearch(activity, null);
|
|
Jump2View.getInstance().goGameSearch(activity, null);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- adpGameAgencyRecharge = new AdpGameAgencyRecharge(activity, gridviewList);
|
|
|
|
|
- gridviewGame.setAdapter(adpGameAgencyRecharge);
|
|
|
|
|
- changeGridview();
|
|
|
|
|
- empty_view.setVisibility(View.GONE);
|
|
|
|
|
- /**
|
|
|
|
|
- * recycle view
|
|
|
|
|
- */
|
|
|
|
|
- recyclerview.setLayoutManager(new LinearLayoutManager(activity));
|
|
|
|
|
- tryMakeMoneyAdp = new TryMakeMoneyAdp(activity);
|
|
|
|
|
-
|
|
|
|
|
- for (int i = 0; i < 2; i++) {
|
|
|
|
|
- tryMakeMoneyAdp.add(RecyleObj.make(RecyleType.NONE, null));
|
|
|
|
|
- }
|
|
|
|
|
- recyclerview.setAdapter(tryMakeMoneyAdp);
|
|
|
|
|
setValue();//gridview data
|
|
setValue();//gridview data
|
|
|
|
|
+ gridviewV();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -136,166 +135,107 @@ public class ActGameAgencyRecharge extends BaseActivity {
|
|
|
@Override
|
|
@Override
|
|
|
public void initListener() {
|
|
public void initListener() {
|
|
|
|
|
|
|
|
- refresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onRefresh() {
|
|
|
|
|
- initData();
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- recyclerview.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
|
|
|
|
|
- super.onScrollStateChanged(recyclerView, newState);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void initData() {}
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ protected void onCreate(Bundle savedInstanceState) {
|
|
|
|
|
+ super.onCreate(savedInstanceState);
|
|
|
|
|
+ // TODO: add setContentView(...) invocation
|
|
|
|
|
+ ButterKnife.bind(this);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ *
|
|
|
|
|
+ */
|
|
|
|
|
+ private void gridviewV(){
|
|
|
|
|
+
|
|
|
|
|
+ mAdapter = new GiftpackListAdapter(getSupportFragmentManager(), activity);
|
|
|
|
|
+ for(int i=0;i<gridviewList.size();i++){
|
|
|
|
|
+ mAdapter.add(FgtGameAgencyRecharge.newInstance(((GridViewEntity)gridviewList.get(i)).getTask_type()), ((GridViewEntity)gridviewList.get(i)).getName());
|
|
|
|
|
+ }
|
|
|
|
|
+ pager.setAdapter(mAdapter);
|
|
|
|
|
+ indicator.setupWithViewPager(pager);
|
|
|
|
|
+ pager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
|
|
@Override
|
|
@Override
|
|
|
- public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
|
|
|
|
|
|
|
+ public void onPageScrolled(int i, float v, int i1) {
|
|
|
|
|
|
|
|
- int topRowVerticalPosition =
|
|
|
|
|
- (recyclerView == null || recyclerView.getChildCount() == 0) ? 0 : recyclerView.getChildAt(0).getTop();
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- refresh.setEnabled(topRowVerticalPosition >= 0);
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onPageSelected(int i) {
|
|
|
|
|
+ position = i;
|
|
|
|
|
+// FIND_TAG.onEvent("find_tag_name", ListUtil.hasIndex(list, i - 1) ? list.get(i - 1).getName() : "全部");
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
- gridviewGame.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
|
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
- public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
|
|
|
|
- GridViewEntity newItem = (GridViewEntity) ListUtil.getIndex(gridviewList, position);
|
|
|
|
|
- if(newItem == null){
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- GAME_INSTEAD_OF_RECHARGE_TAB.onEvent("task_type", newItem.getTask_type(), "name", newItem.getName());
|
|
|
|
|
- if(gridViewEntity == newItem){//无需切换
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- gridViewEntity = (GridViewEntity) gridviewList.get(position);
|
|
|
|
|
- task_type = gridViewEntity.getTask_type();
|
|
|
|
|
- for(int i=0;i<gridviewList.size();i++){
|
|
|
|
|
- if(position == i){
|
|
|
|
|
- ((GridViewEntity) gridviewList.get(i)).setSelectState(true);
|
|
|
|
|
- }else {
|
|
|
|
|
- ((GridViewEntity) gridviewList.get(i)).setSelectState(false);
|
|
|
|
|
|
|
+ public void onPageScrollStateChanged(int i) {
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- adpGameAgencyRecharge.notifyDataSetChanged();
|
|
|
|
|
- try{
|
|
|
|
|
- //刷新界面
|
|
|
|
|
- initData();
|
|
|
|
|
- }catch (Exception e){
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
+ pager.setCurrentItem(position);
|
|
|
|
|
+ reflex(indicator);
|
|
|
}
|
|
}
|
|
|
|
|
+ private int position = 0;//默认选中第一个
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
- public void initData() {
|
|
|
|
|
- refresh.setRefreshing(true);
|
|
|
|
|
- tryMakeMoneyAdp.clear();
|
|
|
|
|
- for (int i = 0; i < 2; i++) {
|
|
|
|
|
- tryMakeMoneyAdp.add(RecyleObj.make(RecyleType.NONE, null));
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 通过反射调整tabLayout中下划线的宽度
|
|
|
|
|
+ * @param tabLayout
|
|
|
|
|
+ */
|
|
|
|
|
+ public void reflex(final TabLayout tabLayout){
|
|
|
|
|
+ //了解源码得知 线的宽度是根据 tabView的宽度来设置的
|
|
|
|
|
+ tabLayout.post(new Runnable() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void run() {
|
|
|
|
|
+ try {
|
|
|
|
|
+ //拿到tabLayout的mTabStrip属性
|
|
|
|
|
+ LinearLayout mTabStrip = (LinearLayout) tabLayout.getChildAt(0);
|
|
|
|
|
|
|
|
- //平台游戏
|
|
|
|
|
- platformList.clear();
|
|
|
|
|
- if(TextUtils.isEmpty(task_type)){
|
|
|
|
|
- task_type = "1002"+",1003"+",1004";
|
|
|
|
|
- }
|
|
|
|
|
- switch (task_type){
|
|
|
|
|
- case "1002":
|
|
|
|
|
-
|
|
|
|
|
- platformList.add(new GameAgencyRechargePlatformEntity(
|
|
|
|
|
- R.mipmap.game_platform_sheep_icon,
|
|
|
|
|
- "平台游戏代充",
|
|
|
|
|
- "充值有福利",
|
|
|
|
|
- 1002));
|
|
|
|
|
- break;
|
|
|
|
|
- case "1003":
|
|
|
|
|
- platformList.add(new GameAgencyRechargePlatformEntity(
|
|
|
|
|
- R.mipmap.game_platform_sheep_icon,
|
|
|
|
|
- "腾讯游戏代充",
|
|
|
|
|
- "充值有福利",
|
|
|
|
|
- 1003));
|
|
|
|
|
-
|
|
|
|
|
- break;
|
|
|
|
|
- case "1004":
|
|
|
|
|
-
|
|
|
|
|
- platformList.add(new GameAgencyRechargePlatformEntity(
|
|
|
|
|
- R.mipmap.game_xiaomi_icon,
|
|
|
|
|
- "小米游戏代充",
|
|
|
|
|
- "充值有福利",
|
|
|
|
|
- 1004));
|
|
|
|
|
- break;
|
|
|
|
|
- case "1002"+",1003"+",1004":
|
|
|
|
|
- default:
|
|
|
|
|
- platformList.add(new GameAgencyRechargePlatformEntity(
|
|
|
|
|
- R.mipmap.game_platform_sheep_icon,
|
|
|
|
|
- "平台游戏代充",
|
|
|
|
|
- "充值有福利",
|
|
|
|
|
- 1002));
|
|
|
|
|
- platformList.add(new GameAgencyRechargePlatformEntity(
|
|
|
|
|
- R.mipmap.game_xiaomi_icon,
|
|
|
|
|
- "小米游戏代充",
|
|
|
|
|
- "充值有福利",
|
|
|
|
|
- 1004));
|
|
|
|
|
- platformList.add(new GameAgencyRechargePlatformEntity(
|
|
|
|
|
- R.mipmap.game_platform_sheep_icon,
|
|
|
|
|
- "腾讯游戏代充",
|
|
|
|
|
- "充值有福利",
|
|
|
|
|
- 1003));
|
|
|
|
|
- break;
|
|
|
|
|
|
|
+// int dp10 = dip2px(tabLayout.getContext(), 10);
|
|
|
|
|
+ int add = getResources().getDimensionPixelSize(R.dimen.content_padding_10);
|
|
|
|
|
+ int count = mTabStrip.getChildCount();
|
|
|
|
|
+ int fillCount = Math.min(5, count);//一屏的个数
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ for (int i = 0; i < count; i++) {
|
|
|
|
|
+ View tabView = mTabStrip.getChildAt(i);
|
|
|
|
|
|
|
|
- tryMakeMoneyAdp.add(RecyleObj.make(RecyleType.GAME_AGENCY_PAYMENT_PLATFORM, platformList),0);
|
|
|
|
|
- notifyDataSetChanged();
|
|
|
|
|
- if(gridViewEntity == null)
|
|
|
|
|
- return;
|
|
|
|
|
- CommonUtil.getInstance()
|
|
|
|
|
- .gameTask(activity, task_type, "", new Action1<BaseMessage>() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void call(BaseMessage baseMessage) {
|
|
|
|
|
- try {
|
|
|
|
|
- List<TaskReleaseEty> releaseEtyList = JSONArray.parseArray(JSONArray.toJSONString(baseMessage.getData()), TaskReleaseEty.class);
|
|
|
|
|
- if(releaseEtyList != null){
|
|
|
|
|
- releaseEtyLists.clear();
|
|
|
|
|
- releaseEtyLists.addAll(releaseEtyList);
|
|
|
|
|
- tryMakeMoneyAdp.add(RecyleObj.make(RecyleType.GAME_AGENCY_PAYMENT, releaseEtyLists),1);
|
|
|
|
|
- notifyDataSetChanged();
|
|
|
|
|
- }
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ //拿到tabView的mTextView属性 tab的字数不固定一定用反射取mTextView
|
|
|
|
|
+ Field mTextViewField = tabView.getClass().getDeclaredField("mTextView");
|
|
|
|
|
+ mTextViewField.setAccessible(true);
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
- protected void onCreate(Bundle savedInstanceState) {
|
|
|
|
|
- super.onCreate(savedInstanceState);
|
|
|
|
|
- // TODO: add setContentView(...) invocation
|
|
|
|
|
- ButterKnife.bind(this);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ TextView mTextView = (TextView) mTextViewField.get(tabView);
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * gridview 改成单行横向布局
|
|
|
|
|
- */
|
|
|
|
|
- private void changeGridview(){
|
|
|
|
|
|
|
+ tabView.setPadding(0, 0, 0, 0);
|
|
|
|
|
|
|
|
- int itemWidth = (G.WIDTH >G.HEIGHT?G.HEIGHT:G.WIDTH) / 4 -30;
|
|
|
|
|
- int itemPaddingh = AppUtil.dp2px(activity, 1);
|
|
|
|
|
|
|
+ //因为我想要的效果是 字多宽线就多宽,所以测量mTextView的宽度
|
|
|
|
|
+ int width = 0;
|
|
|
|
|
+ width = mTextView.getWidth();
|
|
|
|
|
+ if (width == 0) {
|
|
|
|
|
+ mTextView.measure(0, 0);
|
|
|
|
|
+ width = mTextView.getMeasuredWidth();
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- int size = 4;
|
|
|
|
|
|
|
+ //设置tab左右间距为10dp 注意这里不能使用Padding 因为源码中线的宽度是根据 tabView的宽度来设置的
|
|
|
|
|
+ LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) tabView.getLayoutParams();
|
|
|
|
|
+ params.width = width ;
|
|
|
|
|
+ int margin = (G.WIDTH - fillCount*width - 2*add) / (fillCount*2);
|
|
|
|
|
+ params.leftMargin = margin + (i == 0 ? add : 0);
|
|
|
|
|
+ params.rightMargin = margin + (i + 1 == count ? add : 0);
|
|
|
|
|
+ tabView.setLayoutParams(params);
|
|
|
|
|
|
|
|
- int gridview = size * (itemWidth + itemPaddingh);
|
|
|
|
|
|
|
+ tabView.invalidate();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ } catch (NoSuchFieldException e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ } catch (IllegalAccessException e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
- LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(gridview, LinearLayout.LayoutParams.WRAP_CONTENT);
|
|
|
|
|
- gridviewGame.setLayoutParams(params);
|
|
|
|
|
- gridviewGame.setColumnWidth(itemWidth);
|
|
|
|
|
- gridviewGame.setHorizontalSpacing(itemPaddingh);
|
|
|
|
|
- gridviewGame.setStretchMode(MyGridview.NO_STRETCH);
|
|
|
|
|
- gridviewGame.setNumColumns(size);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -312,55 +252,8 @@ public class ActGameAgencyRecharge extends BaseActivity {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private void checkAndInitView() {
|
|
|
|
|
- if(refresh == null)
|
|
|
|
|
- refresh = findViewById(R.id.refresh);
|
|
|
|
|
- if(empty_view == null)
|
|
|
|
|
- empty_view = findViewById(R.id.empty_view);
|
|
|
|
|
- }
|
|
|
|
|
- private void notifyDataSetChanged(){
|
|
|
|
|
- checkAndInitView();
|
|
|
|
|
- tryMakeMoneyAdp.refreshAdapter();
|
|
|
|
|
- if(tryMakeMoneyAdp.isEmpty() && platformList.isEmpty() && releaseEtyLists.isEmpty()){
|
|
|
|
|
-
|
|
|
|
|
- empty_view.setVisibility(View.VISIBLE);
|
|
|
|
|
- }else {
|
|
|
|
|
- empty_view.setVisibility(View.GONE);
|
|
|
|
|
- }
|
|
|
|
|
- refresh.setRefreshing(false);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
@Override
|
|
@Override
|
|
|
protected void onDestroy() {
|
|
protected void onDestroy() {
|
|
|
super.onDestroy();
|
|
super.onDestroy();
|
|
|
-
|
|
|
|
|
- EventBus.getDefault().unregister(this);
|
|
|
|
|
- }
|
|
|
|
|
- @Subscribe
|
|
|
|
|
- public void onEventMainThread(BigEvent event){
|
|
|
|
|
- switch (event.getEventTypes()){
|
|
|
|
|
- case GENERATION_ACCOUNT_REFRESH:
|
|
|
|
|
- initData();
|
|
|
|
|
- break;
|
|
|
|
|
- case GENERATION_ACCOUNT_REFRESH_ADAPTER:
|
|
|
|
|
- if(event.getData() instanceof DownloadTask){
|
|
|
|
|
- DownloadTask task = (DownloadTask) event.getData();
|
|
|
|
|
- try {
|
|
|
|
|
- int p = task.getPercent(); //任务进度百分比
|
|
|
|
|
- String speed = task.getConvertSpeed(); //转换单位后的下载速度,单位转换需要在配置文件中打开
|
|
|
|
|
- System.out.println("Aria "+task.getKey()+",p " + p + ", speed = " + speed);
|
|
|
|
|
- String url = task.getKey();
|
|
|
|
|
- TextView tvProgress = recyclerview.findViewWithTag(TryMakeMoneyAdp.PUBLIC_TAG_PREFIX_TEXTVIEW_LIST + url);
|
|
|
|
|
- if (tvProgress == null) {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- tvProgress.setText(String.format(Locale.CHINA, "%d%%",Math.abs(p)));
|
|
|
|
|
-
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|