|
@@ -86,8 +86,9 @@ public class ActMain extends BaseActYmPermissionCheck {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
- protected void initSlidr(){
|
|
|
|
|
|
|
+ protected void initSlidr() {
|
|
|
// doNothing
|
|
// doNothing
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -104,10 +105,10 @@ public class ActMain extends BaseActYmPermissionCheck {
|
|
|
@Override
|
|
@Override
|
|
|
public void onWindowFocusChanged(boolean hasFocus) {
|
|
public void onWindowFocusChanged(boolean hasFocus) {
|
|
|
super.onWindowFocusChanged(hasFocus);
|
|
super.onWindowFocusChanged(hasFocus);
|
|
|
- setSystemUiVisibility();
|
|
|
|
|
|
|
+ setSystemUiVisibility(true);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private void setSystemUiVisibility() {
|
|
|
|
|
|
|
+ private void setSystemUiVisibility(boolean isDark) {
|
|
|
int flag =
|
|
int flag =
|
|
|
View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
|
|
View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
|
|
|
// View.SYSTEM_UI_FLAG_VISIBLE;
|
|
// View.SYSTEM_UI_FLAG_VISIBLE;
|
|
@@ -120,12 +121,12 @@ public class ActMain extends BaseActYmPermissionCheck {
|
|
|
// } else {
|
|
// } else {
|
|
|
// getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);//白色
|
|
// getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);//白色
|
|
|
// }
|
|
// }
|
|
|
- flag |=
|
|
|
|
|
- View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
|
|
|
|
|
- View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
|
|
|
|
|
- View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | // hide
|
|
|
|
|
|
|
+ flag |= isDark ? View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR : View.SYSTEM_UI_FLAG_VISIBLE;
|
|
|
|
|
+ flag |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
|
|
|
|
|
+ View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
|
|
|
|
|
+ View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | // hide
|
|
|
// View.SYSTEM_UI_FLAG_FULLSCREEN | // hide status bar
|
|
// View.SYSTEM_UI_FLAG_FULLSCREEN | // hide status bar
|
|
|
- View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
|
|
|
|
|
|
|
+ View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
|
|
|
}
|
|
}
|
|
|
// 获取属性
|
|
// 获取属性
|
|
|
getWindow().getDecorView().setSystemUiVisibility(flag);
|
|
getWindow().getDecorView().setSystemUiVisibility(flag);
|
|
@@ -212,7 +213,7 @@ public class ActMain extends BaseActYmPermissionCheck {
|
|
|
View view = tab_container.getChildAt(index);
|
|
View view = tab_container.getChildAt(index);
|
|
|
if (view instanceof TextView) {
|
|
if (view instanceof TextView) {
|
|
|
((TextView) view).setText(mainTab.getStringId());
|
|
((TextView) view).setText(mainTab.getStringId());
|
|
|
- if(mainTab.getDrawableId() == R.drawable.drawable_selector_askgetmoney) {
|
|
|
|
|
|
|
+ if (mainTab.getDrawableId() == R.drawable.drawable_selector_askgetmoney) {
|
|
|
// 166x137 204x170
|
|
// 166x137 204x170
|
|
|
new DrawablesHelper((TextView) view).direction(DrawablesHelper.TOP).drawable(mainTab.getDrawableId(), 150 / 170.0f).commit();
|
|
new DrawablesHelper((TextView) view).direction(DrawablesHelper.TOP).drawable(mainTab.getDrawableId(), 150 / 170.0f).commit();
|
|
|
// testView = view;
|
|
// testView = view;
|
|
@@ -256,6 +257,11 @@ public class ActMain extends BaseActYmPermissionCheck {
|
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
private void switchFragment(int position) {
|
|
private void switchFragment(int position) {
|
|
|
|
|
+ if(position==2|| position==4){
|
|
|
|
|
+ setSystemUiVisibility(false);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ setSystemUiVisibility(true);
|
|
|
|
|
+ }
|
|
|
View lastTab = ListUtil.getItem(tabs, lastPosition);
|
|
View lastTab = ListUtil.getItem(tabs, lastPosition);
|
|
|
View curTab = ListUtil.getItem(tabs, position);
|
|
View curTab = ListUtil.getItem(tabs, position);
|
|
|
if (lastTab != null) {
|
|
if (lastTab != null) {
|
|
@@ -268,14 +274,14 @@ public class ActMain extends BaseActYmPermissionCheck {
|
|
|
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
|
|
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
|
|
|
Fragment cFragment = getSupportFragmentManager().findFragmentByTag("fragment_" + position);
|
|
Fragment cFragment = getSupportFragmentManager().findFragmentByTag("fragment_" + position);
|
|
|
Fragment lFragment = getSupportFragmentManager().findFragmentByTag("fragment_" + lastPosition);
|
|
Fragment lFragment = getSupportFragmentManager().findFragmentByTag("fragment_" + lastPosition);
|
|
|
- if(lFragment != null)
|
|
|
|
|
|
|
+ if (lFragment != null)
|
|
|
transaction.hide(lFragment);
|
|
transaction.hide(lFragment);
|
|
|
- if(cFragment != null)
|
|
|
|
|
|
|
+ if (cFragment != null)
|
|
|
transaction.show(cFragment);
|
|
transaction.show(cFragment);
|
|
|
transaction.commitAllowingStateLoss();
|
|
transaction.commitAllowingStateLoss();
|
|
|
- if(lFragment != null)
|
|
|
|
|
|
|
+ if (lFragment != null)
|
|
|
lFragment.setUserVisibleHint(false);
|
|
lFragment.setUserVisibleHint(false);
|
|
|
- if(cFragment != null)
|
|
|
|
|
|
|
+ if (cFragment != null)
|
|
|
cFragment.setUserVisibleHint(true);
|
|
cFragment.setUserVisibleHint(true);
|
|
|
}
|
|
}
|
|
|
changeVisible(lastPosition, position);
|
|
changeVisible(lastPosition, position);
|
|
@@ -340,7 +346,7 @@ public class ActMain extends BaseActYmPermissionCheck {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void onBackPressed() {
|
|
public void onBackPressed() {
|
|
|
- if(!checkBackPressed()){
|
|
|
|
|
|
|
+ if (!checkBackPressed()) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
if (System.currentTimeMillis() - lastBackTime < PERIOD) {
|
|
if (System.currentTimeMillis() - lastBackTime < PERIOD) {
|
|
@@ -519,6 +525,7 @@ public class ActMain extends BaseActYmPermissionCheck {
|
|
|
|
|
|
|
|
|
|
|
|
|
public static final String KEY_HAS_APPOINT_TASK = "hasAppointTask";
|
|
public static final String KEY_HAS_APPOINT_TASK = "hasAppointTask";
|
|
|
|
|
+
|
|
|
@Subscribe
|
|
@Subscribe
|
|
|
public void onEventMainThread(ShowRedDot showRedDot) {
|
|
public void onEventMainThread(ShowRedDot showRedDot) {
|
|
|
switch (showRedDot.getWhere()) {
|
|
switch (showRedDot.getWhere()) {
|
|
@@ -533,6 +540,7 @@ public class ActMain extends BaseActYmPermissionCheck {
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
@Subscribe
|
|
@Subscribe
|
|
|
public void whenPersonVoucherClick(FgtPersonalCenter.PersonVoucherClickEvent ev) {
|
|
public void whenPersonVoucherClick(FgtPersonalCenter.PersonVoucherClickEvent ev) {
|
|
|
ViewUtil.setVisibility(person_center_red_dot, DataUtil.getAsBoolean(KEY_HAS_APPOINT_TASK, false));
|
|
ViewUtil.setVisibility(person_center_red_dot, DataUtil.getAsBoolean(KEY_HAS_APPOINT_TASK, false));
|