|
|
@@ -18,6 +18,7 @@ import com.sheep.gamegroup.util.ViewUtil;
|
|
|
import com.sheep.gamegroup.view.adapter.TitleFragmentListAdapter;
|
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
|
import com.sheep.jiuyan.samllsheep.base.BaseFragment;
|
|
|
+import com.sheep.jiuyan.samllsheep.utils.G;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
|
|
|
|
|
|
import org.greenrobot.eventbus.EventBus;
|
|
|
@@ -67,13 +68,6 @@ public class FgtMainAudit extends BaseFragment {
|
|
|
.setTitle(mView, "审核中心")
|
|
|
.setTitleListen(mView, 0, null);
|
|
|
|
|
|
- mAdapter = new TitleFragmentListAdapter(getChildFragmentManager());
|
|
|
- mAdapter.add(FgtAudit.newInstance(1), tabNames[0]);
|
|
|
- mAdapter.add(FgtAudit.newInstance(2), tabNames[1]);
|
|
|
- mAdapter.add(FgtAudit.newInstance(3), tabNames[2]);
|
|
|
- pager.setAdapter(mAdapter);
|
|
|
- new_tab();
|
|
|
-
|
|
|
my_money_dingxiang_amount_iv.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
@@ -83,12 +77,6 @@ public class FgtMainAudit extends BaseFragment {
|
|
|
});
|
|
|
|
|
|
}
|
|
|
- @Override
|
|
|
- public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
|
|
- // TODO: inflate a fragment view
|
|
|
- View rootView = super.onCreateView(inflater, container, savedInstanceState);
|
|
|
- return rootView;
|
|
|
- }
|
|
|
|
|
|
public void initData() {
|
|
|
|
|
|
@@ -161,16 +149,39 @@ public class FgtMainAudit extends BaseFragment {
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@Override
|
|
|
- public void onResume() {
|
|
|
- super.onResume();
|
|
|
+ protected void initViewOnVisibleToUser() {
|
|
|
+ mAdapter = new TitleFragmentListAdapter(getChildFragmentManager());
|
|
|
+ mAdapter.add(FgtAudit.newInstance(1), tabNames[0]);
|
|
|
+ mAdapter.add(FgtAudit.newInstance(2), tabNames[1]);
|
|
|
+ mAdapter.add(FgtAudit.newInstance(3), tabNames[2]);
|
|
|
+ pager.setAdapter(mAdapter);
|
|
|
+ new_tab();
|
|
|
+ }
|
|
|
|
|
|
+ @Override
|
|
|
+ public void initDataOnVisibleToUser() {
|
|
|
try {
|
|
|
initData();
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
+ G.showToast(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private boolean isFirstOnResume = true;//第一次onResume
|
|
|
+ @Override
|
|
|
+ public void onResume() {
|
|
|
+ super.onResume();
|
|
|
+ if(!isFirstOnResume) {
|
|
|
+ try {
|
|
|
+ initData();
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ G.showToast(e.getMessage());
|
|
|
+ }
|
|
|
}
|
|
|
+ isFirstOnResume = false;
|
|
|
}
|
|
|
|
|
|
public void setCurrentItem(int item, boolean smoothScroll) {
|