|
|
@@ -1,6 +1,8 @@
|
|
|
package com.kfzs.duanduan.react;
|
|
|
|
|
|
+import android.os.Bundle;
|
|
|
import android.support.v4.app.Fragment;
|
|
|
+import android.support.v4.app.FragmentTransaction;
|
|
|
import android.support.v4.view.ViewPager;
|
|
|
import android.view.View;
|
|
|
import android.widget.LinearLayout;
|
|
|
@@ -11,12 +13,11 @@ import com.kf.utils.ToastBuilder;
|
|
|
import com.kfzs.duanduan.ActMain;
|
|
|
import com.kfzs.duanduan.KFZSApp;
|
|
|
import com.kfzs.duanduan.adp.ViewPagerFragmentAdapter;
|
|
|
-import com.kfzs.duanduan.adp.ViewPagerFragmentStateAdapter;
|
|
|
import com.kfzs.duanduan.fragment.FgtFind;
|
|
|
import com.kfzs.duanduan.fragment.FgtPersonalCenter;
|
|
|
import com.kfzs.duanduan.fragment.FgtSmallSheep;
|
|
|
-import com.sheep.gamegroup.util.LogUtil;
|
|
|
import com.sheep.gamegroup.util.DrawablesHelper;
|
|
|
+import com.sheep.gamegroup.util.LogUtil;
|
|
|
import com.sheep.gamegroup.util.SysAppUtil;
|
|
|
import com.sheep.gamegroup.util.UMConfigUtils;
|
|
|
import com.sheep.gamegroup.view.fragment.FgtMainAudit;
|
|
|
@@ -114,7 +115,7 @@ public class TabsHelper {
|
|
|
FgtSmallSheep fgtSmallSheep = (FgtSmallSheep) fragmentList.get(sheepPosition);
|
|
|
FgtPersonalCenter personnalCenter = (FgtPersonalCenter) fragmentList.get(personnalPosition);
|
|
|
FgtMainAudit auditFgt = (FgtMainAudit) fragmentList.get(auditPosition);
|
|
|
- FgtFind findFgt = (FgtFind) fragmentList.get(fPosition);
|
|
|
+// FgtFind findFgt = (FgtFind) fragmentList.get(fPosition);
|
|
|
if(position == sheepPosition){
|
|
|
fgtSmallSheep.onResume();
|
|
|
} else {
|
|
|
@@ -127,7 +128,7 @@ public class TabsHelper {
|
|
|
auditFgt.onResume();
|
|
|
}
|
|
|
if(position == fPosition){
|
|
|
- findFgt.onResume();
|
|
|
+// findFgt.onResume();
|
|
|
}
|
|
|
checkWhichPage(position);
|
|
|
}
|
|
|
@@ -206,6 +207,7 @@ public class TabsHelper {
|
|
|
if (lastPosition > -1)
|
|
|
tabs.get(lastPosition).setActivated(false);
|
|
|
tabs.get(position).setActivated(true);
|
|
|
+ showFind(position == MainTab.Fgt_Find.ordinal());
|
|
|
//更新position
|
|
|
lastPosition = position;
|
|
|
}
|
|
|
@@ -221,10 +223,32 @@ public class TabsHelper {
|
|
|
checkViewState(lastPosition);
|
|
|
}
|
|
|
|
|
|
+ private void showFind(boolean isFind) {
|
|
|
+ View frame_container = activity.findViewById(R.id.frame_container);
|
|
|
+ if(isFind)
|
|
|
+ frame_container.bringToFront();
|
|
|
+ else
|
|
|
+ other_container.bringToFront();
|
|
|
+ }
|
|
|
+
|
|
|
public void init() {
|
|
|
initViews();
|
|
|
initArrays();
|
|
|
initViewPager();
|
|
|
+
|
|
|
+ FragmentTransaction transaction = activity.getSupportFragmentManager().beginTransaction();
|
|
|
+ Bundle bundle = new Bundle();
|
|
|
+ Fragment fragment = activity.getSupportFragmentManager().findFragmentByTag("tag");
|
|
|
+ if(fragment == null){
|
|
|
+ fragment = new FgtFind();
|
|
|
+ fragment.setArguments(bundle);
|
|
|
+ transaction.add(R.id.frame_container, fragment, "tag");
|
|
|
+ transaction.commitAllowingStateLoss();
|
|
|
+ }else {
|
|
|
+ fragment.setArguments(bundle);
|
|
|
+ transaction.replace(R.id.frame_container, fragment);
|
|
|
+ transaction.commitAllowingStateLoss();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private long lastbackrn = 0;
|