|
|
@@ -1,23 +1,30 @@
|
|
|
package com.sheep.gamegroup.view.fragment;
|
|
|
|
|
|
+import android.annotation.SuppressLint;
|
|
|
import android.app.Activity;
|
|
|
import android.os.Bundle;
|
|
|
import android.support.design.widget.TabLayout;
|
|
|
import android.support.v4.view.ViewPager;
|
|
|
import android.view.View;
|
|
|
+import android.view.ViewGroup;
|
|
|
import android.widget.ImageView;
|
|
|
+import android.widget.LinearLayout;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
import com.kfzs.duanduan.BaseCompatFragment;
|
|
|
import com.kfzs.duanduan.mine.GiftpackListAdapter;
|
|
|
+import com.kfzs.duanduan.mine.ShenheAdapter;
|
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
import com.sheep.gamegroup.model.entity.TaskAuditEntity;
|
|
|
import com.sheep.gamegroup.util.CommonUtil;
|
|
|
+import com.sheep.gamegroup.util.LogUtil;
|
|
|
import com.sheep.gamegroup.util.ViewUtil;
|
|
|
import com.sheep.gamegroup.view.activity.ActMyMoney;
|
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
|
|
|
|
|
|
+import java.lang.reflect.Field;
|
|
|
+
|
|
|
import butterknife.BindView;
|
|
|
import butterknife.ButterKnife;
|
|
|
import butterknife.Unbinder;
|
|
|
@@ -50,7 +57,8 @@ public class FgtMainAudit extends BaseCompatFragment {
|
|
|
private Activity activity;
|
|
|
|
|
|
public static final String[] tabNames = {"审核中", "任务成功", "任务失败"};
|
|
|
- private GiftpackListAdapter mAdapter;
|
|
|
+ private ShenheAdapter mAdapter;
|
|
|
+
|
|
|
@Override
|
|
|
protected void initView(Bundle savedInstanceState) {
|
|
|
setContentView(R.layout.act_audit_layout);
|
|
|
@@ -59,10 +67,10 @@ public class FgtMainAudit extends BaseCompatFragment {
|
|
|
unbinder = ButterKnife.bind(this, mContentView);
|
|
|
// StatusBarUtils.setTranslucent(this);
|
|
|
TitleBarUtils.getInstance()
|
|
|
- .setTitle(mContentView,"审核中心")
|
|
|
- .setTitleListen(mContentView,0,null);
|
|
|
+ .setTitle(mContentView, "审核中心")
|
|
|
+ .setTitleListen(mContentView, 0, null);
|
|
|
|
|
|
- mAdapter = new GiftpackListAdapter(getChildFragmentManager(), activity.getApplicationContext());
|
|
|
+ mAdapter = new ShenheAdapter(getChildFragmentManager(), activity.getApplicationContext());
|
|
|
mAdapter.add(FgtAudit.newInstance(1), tabNames[0]);
|
|
|
mAdapter.add(FgtAudit.newInstance(2), tabNames[1]);
|
|
|
mAdapter.add(FgtAudit.newInstance(3), tabNames[2]);
|
|
|
@@ -92,18 +100,18 @@ public class FgtMainAudit extends BaseCompatFragment {
|
|
|
public void call(BaseMessage o) {
|
|
|
try {
|
|
|
TaskAuditEntity taskAuditEntity = o.getData(TaskAuditEntity.class);
|
|
|
- if(taskAuditEntity != null){
|
|
|
+ if (taskAuditEntity != null) {
|
|
|
String audit_total_audit = String.format(activity.getResources().getString(R.string.audit_total_audit), taskAuditEntity.getAudit_count());
|
|
|
String audit_total_complete = String.format(activity.getResources().getString(R.string.audit_total_complete), taskAuditEntity.getFinish_count());
|
|
|
String audit_total_money = String.format(activity.getResources().getString(R.string.audit_total_money), taskAuditEntity.getFinish_cash());
|
|
|
String audit_total_welfare = String.format(activity.getResources().getString(R.string.audit_total_welfare), taskAuditEntity.getWelfare_award());
|
|
|
|
|
|
- if(numberTv == null)
|
|
|
+ if (numberTv == null)
|
|
|
return;
|
|
|
- numberTv.setText(audit_total_audit+"");
|
|
|
- auditTotalCompleteTv.setText(audit_total_complete+"");
|
|
|
- auditTotalMoneyTv.setText(audit_total_money+"");
|
|
|
- auditTotalWelfareTv.setText(audit_total_welfare+"");
|
|
|
+ numberTv.setText(audit_total_audit + "");
|
|
|
+ auditTotalCompleteTv.setText(audit_total_complete + "");
|
|
|
+ auditTotalMoneyTv.setText(audit_total_money + "");
|
|
|
+ auditTotalWelfareTv.setText(audit_total_welfare + "");
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
@@ -112,7 +120,7 @@ public class FgtMainAudit extends BaseCompatFragment {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- private void new_tab(){
|
|
|
+ private void new_tab() {
|
|
|
// indicator.newTab();
|
|
|
pager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(indicator));
|
|
|
indicator.addOnTabSelectedListener(new TabLayout.ViewPagerOnTabSelectedListener(pager));
|
|
|
@@ -125,6 +133,7 @@ public class FgtMainAudit extends BaseCompatFragment {
|
|
|
@Override
|
|
|
public void onPageSelected(int i) {
|
|
|
// MY_MONEY_TAB.onEvent("tab_name", tabNames[2]);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -135,8 +144,17 @@ public class FgtMainAudit extends BaseCompatFragment {
|
|
|
|
|
|
indicator.setupWithViewPager(pager);
|
|
|
CommonUtil.getInstance().reflex(indicator, activity);
|
|
|
+ for (int i = 0; i < indicator.getTabCount(); i++) {
|
|
|
+ indicator.getTabAt(i).setCustomView(mAdapter.getTabView(i));
|
|
|
+ }
|
|
|
+
|
|
|
+ TabLayout.Tab tab=indicator.getTabAt(2);
|
|
|
+
|
|
|
+ tab.getCustomView().findViewById(R.id.iv_img).setVisibility(View.VISIBLE);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@Override
|
|
|
public void onResume() {
|
|
|
super.onResume();
|