| | |
| | | import androidx.viewbinding.ViewBinding; |
| | | |
| | | import com.duqing.missions.MyApplication; |
| | | import com.duqing.missions.R; |
| | | import com.duqing.missions.data.ApkUpGradeResult; |
| | | import com.duqing.missions.util.MyLog; |
| | | import com.duqing.missions.util.ResPonse; |
| | |
| | | protected void onCreate(@Nullable Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | | // get genericity "B" |
| | | setStatusBarBgColor(R.color.white); |
| | | setStatusBarTextColor(true); |
| | | Class<B> entityClass = (Class<B>) ((ParameterizedType) this.getClass().getGenericSuperclass()).getActualTypeArguments()[0]; |
| | | try { |
| | | Method method = entityClass.getMethod("inflate", LayoutInflater.class);//get method from name "inflate"; |
| | |
| | | public void setStatusBarTextColor(boolean isBlack){ |
| | | View decor = getWindow().getDecorView(); |
| | | if (isBlack) { |
| | | decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); |
| | | decor.setSystemUiVisibility( View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); |
| | | } else { |
| | | decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); |
| | | decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE); |
| | | } |
| | | } |
| | | |