|
@@ -17,6 +17,7 @@ import com.sheep.gamegroup.util.UMConfigUtils;
|
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
|
+import java.util.Calendar;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
|
@@ -31,6 +32,10 @@ import rx.schedulers.Schedulers;
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
public class TabsHelper {
|
|
public class TabsHelper {
|
|
|
|
|
+
|
|
|
|
|
+ //多次点击预防
|
|
|
|
|
+ public static final int MIN_CLICK_DELAY_TIME = 1000;
|
|
|
|
|
+ private long lastClickTime = 0;
|
|
|
private ActMain activity;
|
|
private ActMain activity;
|
|
|
|
|
|
|
|
LinearLayout other_container;
|
|
LinearLayout other_container;
|
|
@@ -94,16 +99,22 @@ public class TabsHelper {
|
|
|
view.setOnClickListener(new View.OnClickListener() {
|
|
view.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
@Override
|
|
|
public void onClick(View view) {
|
|
public void onClick(View view) {
|
|
|
- checkViewState(position);
|
|
|
|
|
- view_pager_container.setCurrentItem(position, false);
|
|
|
|
|
- int sheepPosition = MainTab.FgtSmallSheep.ordinal();
|
|
|
|
|
- FgtSmallSheep fgtSmallSheep = (FgtSmallSheep) fragmentList.get(sheepPosition);
|
|
|
|
|
- if(position == sheepPosition){
|
|
|
|
|
- fgtSmallSheep.onResume();
|
|
|
|
|
- } else {
|
|
|
|
|
- fgtSmallSheep.onPause();
|
|
|
|
|
|
|
+ long currentTime = Calendar.getInstance().getTimeInMillis();
|
|
|
|
|
+ if (currentTime - lastClickTime > MIN_CLICK_DELAY_TIME) {
|
|
|
|
|
+ lastClickTime = currentTime;
|
|
|
|
|
+
|
|
|
|
|
+ checkViewState(position);
|
|
|
|
|
+ view_pager_container.setCurrentItem(position, false);
|
|
|
|
|
+ int sheepPosition = MainTab.FgtSmallSheep.ordinal();
|
|
|
|
|
+ FgtSmallSheep fgtSmallSheep = (FgtSmallSheep) fragmentList.get(sheepPosition);
|
|
|
|
|
+ if(position == sheepPosition){
|
|
|
|
|
+ fgtSmallSheep.onResume();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ fgtSmallSheep.onPause();
|
|
|
|
|
+ }
|
|
|
|
|
+ checkWhichPage(position);
|
|
|
}
|
|
}
|
|
|
- checkWhichPage(position);
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
index++;
|
|
index++;
|