|
|
@@ -52,6 +52,7 @@ import com.sheep.gamegroup.util.UMConfigUtils;
|
|
|
import com.sheep.gamegroup.util.ViewUtil;
|
|
|
import com.sheep.gamegroup.util.upfile.UpFileListener;
|
|
|
import com.sheep.gamegroup.util.upfile.UpFileUtils;
|
|
|
+import com.sheep.gamegroup.view.customview.TouchFrameLayout;
|
|
|
import com.sheep.gamegroup.view.dialog.DialogGameOrTaskOrGift;
|
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
@@ -90,6 +91,18 @@ public class ActMain extends BaseActYmPermissionCheck {
|
|
|
|
|
|
public static WeakReference<View> tabBtn1, tabBtn2;
|
|
|
|
|
|
+ public static final String FIRST_SHOW_MAIN = "first_show_main";//是否是第一次显示主页
|
|
|
+
|
|
|
+ @BindView(R.id.frame_container)
|
|
|
+ TouchFrameLayout frame_container;
|
|
|
+ @BindView(R.id.tab_container)
|
|
|
+ LinearLayout tab_container;
|
|
|
+ @BindView(R.id.main_layout)
|
|
|
+ RelativeLayout main_layout;
|
|
|
+ @BindView(R.id.main_header)
|
|
|
+ View main_header;
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
|
StatusBarUtils.setTranslucent(this);
|
|
|
@@ -151,17 +164,6 @@ public class ActMain extends BaseActYmPermissionCheck {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- public static final String FIRST_SHOW_MAIN = "first_show_main";//是否是第一次显示主页
|
|
|
-
|
|
|
- @BindView(R.id.frame_container)
|
|
|
- FrameLayout frame_container;
|
|
|
- @BindView(R.id.tab_container)
|
|
|
- LinearLayout tab_container;
|
|
|
- @BindView(R.id.main_layout)
|
|
|
- RelativeLayout main_layout;
|
|
|
- @BindView(R.id.main_header)
|
|
|
- View main_header;
|
|
|
-
|
|
|
@Override
|
|
|
protected int getLayoutId() {
|
|
|
return R.layout.act_bottom_bar;
|
|
|
@@ -171,15 +173,12 @@ public class ActMain extends BaseActYmPermissionCheck {
|
|
|
public void initView() {
|
|
|
EventBus.getDefault().register(this);
|
|
|
initFragments();
|
|
|
-// initFind();
|
|
|
-// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && G.checkDeviceHasNavigationBar(this)) {
|
|
|
-// main_layout.setPadding(0, 0, 0, G.getHasVirtualKey(this) - G.getNoHasVirtualKey(this));
|
|
|
-// }
|
|
|
if (!TestUtil.isDev())
|
|
|
CommonUtil.getInstance().initMiDong(this, DataUtil.getInstance().getUserId());
|
|
|
|
|
|
tabBtn1 = new WeakReference<>(findViewById(R.id.tab_1));
|
|
|
tabBtn2 = new WeakReference<>(findViewById(R.id.tab_3));
|
|
|
+ frame_container.setHookView(main_header);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -263,7 +262,7 @@ public class ActMain extends BaseActYmPermissionCheck {
|
|
|
}
|
|
|
|
|
|
public void switchFragment(int position) {
|
|
|
- ViewUtil.setVisibility(main_header, position != 1);
|
|
|
+ frame_container.moveHook(position == 1 ? -1 : 1);
|
|
|
View lastTab = ListUtil.getItem(tabs, lastPosition);
|
|
|
View curTab = ListUtil.getItem(tabs, position);
|
|
|
if (lastTab != null) {
|
|
|
@@ -551,9 +550,9 @@ public class ActMain extends BaseActYmPermissionCheck {
|
|
|
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
|
|
|
super.onActivityResult(requestCode, resultCode, intent);
|
|
|
if (resultCode == RESULT_OK) {
|
|
|
- if(requestCode == Constant.INTENT_CAPTURE_QRCODE){
|
|
|
+ if (requestCode == Constant.INTENT_CAPTURE_QRCODE) {
|
|
|
QRCodeCaptureHelper.handle(this, intent.getStringExtra(CodeUtils.RESULT_STRING));
|
|
|
- } else if(requestCode == Constant.INTENT_DETECT_FACE) {
|
|
|
+ } else if (requestCode == Constant.INTENT_DETECT_FACE) {
|
|
|
UpFileUtils.upImage(new File(intent.getStringExtra("bestPath")), new UpFileListener() {
|
|
|
@Override
|
|
|
public void Success(String msg, int index) {
|
|
|
@@ -577,11 +576,11 @@ public class ActMain extends BaseActYmPermissionCheck {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public Fragment getMainFragment1(){
|
|
|
+ public Fragment getMainFragment1() {
|
|
|
return getSupportFragmentManager().findFragmentByTag("fragment_0");
|
|
|
}
|
|
|
|
|
|
- public Fragment getMainFragment3(){
|
|
|
+ public Fragment getMainFragment3() {
|
|
|
return getSupportFragmentManager().findFragmentByTag("fragment_2");
|
|
|
}
|
|
|
|