Вид текста и кнопка внутри относительного макета не отображаются в Android Oreo и Pie, но отлично видны в других версиях Android.
if (mPromocodeCheckBox != null) {
mPromocodeCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (inputMethodManager == null)
inputMethodManager = (InputMethodManager) ALTCommonUtils.currentActivity.getSystemService(Context.INPUT_METHOD_SERVICE);
if (mPromocodeLayout != null) {
if (isChecked) {
mPromocodeLayout.setVisibility(View.VISIBLE);
if (inputMethodManager != null && mPromocodeEditText != null) {
mPromocodeEditText.requestFocus();
inputMethodManager.showSoftInput(mPromocodeEditText, InputMethodManager.SHOW_IMPLICIT);
}
if (mPromocodeApplyButton != null)
mPromocodeApplyButton.setVisibility(View.VISIBLE);
if (mPromocodeEditText != null)
mPromocodeEditText.setEnabled(true);
} else {
mPromocodeLayout.setVisibility(View.GONE);
HandleViewsUtils.TextView_SetText(mPromocodeMsg, "");
if (inputMethodManager != null && mPromocodeEditText != null) {
HandleViewsUtils.EditText_SetText(mPromocodeEditText, "");
inputMethodManager.hideSoftInputFromWindow(mPromocodeEditText.getApplicationWindowToken(), 0);
}
}
}
}
});
}
Для справки я прикрепил скриншот кода XML:
![enter image description here](https://i.stack.imgur.com/Xnr09.png)
![enter image description here](https://i.stack.imgur.com/of6JB.png)
![enter image description here](https://i.stack.imgur.com/QwRGJ.png)
1-й снимок экрана показывает нормальный экран как ниже, так и выше.
![enter image description here](https://i.stack.imgur.com/ZbKjl.png)
2-й снимок экрана отлично показывает, когда я нажимаю флажок промокода ниже:
![enter image description here](https://i.stack.imgur.com/aOb1M.png)
3-й снимок экрана показывает несовершенство, когда я нажимаю переключатель промокод в oreo и pie
![enter image description here](https://i.stack.imgur.com/JbZyb.png)