В Frgament вид исчезает при нажатии на значок - PullRequest
0 голосов
/ 06 мая 2020

Класс всплывающей подсказки и ссылка

Я использовал Tooltip.builder () во фрагменте, но когда я нажимаю на ImageView, он показывает, а после отображения всего он исчезает всего за секунду? Пожалуйста, предложите мне.

Пожалуйста, найдите здесь логи: 2020-05-06 16: 36: 19.390 25288-25288 / com.ikea.tradfri.lighting I / Tooltip: child layout: left: 435 top: -759 справа: 794 внизу: -682 2020-05-06 16: 36: 19.391 25288-25288 / com.ikea.tradfri.lighting I / Tooltip: px: 767, py: -771 2020-05-06 16: 36: 19.392 25288-25288 / com.ikea.tradfri.lighting D / Подсказка: точка привязки: 767, -771 2020-05-06 16: 36: 19.392 25288-25288 / com.ikea.tradfri.lighting D / Подсказка: размер: 359 , 77 2020-05-06 16: 36: 51.415 25288-25288 / com.ikea.tradfri.lighting I / Tooltip: l: 0, t: 849, r: 824, b: 849 2020-05-06 16:36 : 51.447 25288-25288 / com.ikea.tradfri.lighting I / Подсказка: onPreDraw: 940, 595 2020-05-06 16: 36: 51.447 25288-25288 / com.ikea.tradfri.lighting D / Подсказка: расположение привязки: 940, 595 2020-05-06 16: 36: 51.448 25288-25288 / com.ikea.tradfri.lighting D / Подсказка: расположение держателя: 188, 1402 2020-05-06 16: 36: 51.448 25288-25288 / com. ikea.tradfri.lighting D / Подсказка: child w: 359 h: 77 2020-05-06 16: 36: 51.448 25288-25288 / com.ikea.tradfri.l ighting D / Tooltip: left: 752, top: -807 2020-05-06 16: 36: 51.448 25288-25288 / com.ikea.tradfri.lighting D / Tooltip: tip top До: -807 2020-05-06 16 : 36: 51.448 25288-25288 / com.ikea.tradfri.lighting D / Tooltip: tip top: -759 2020-05-06 16: 36: 51.448 25288-25288 / com.ikea.tradfri.lighting D / Tooltip: tip Перейти к: 767-771 2020-05-06 16: 36: 51.448 25288-25288 / com.ikea.tradfri.lighting D / Tooltip: tip Строка до: 761-759 2020-05-06 16: 36: 51.448 25288- 25288 / com.ikea.tradfri.lighting D / Tooltip: tip Line to: 773-759 2020-05-06 16: 36: 51.448 25288-25288 / com.ikea.tradfri.lighting D / Tooltip: tip Line to: 767 -771 2020-05-06 16: 36: 51.449 25288-25288 / com.ikea.tradfri.lighting I / Tooltip: дочерний макет: слева: 435 сверху: -759 справа: 794 снизу: -682 2020-05-06 16 : 36: 51.449 25288-25288 / com.ikea.tradfri.lighting I / Подсказка: px: 767, py: -771 2020-05-06 16: 36: 51.451 25288-25288 / com.ikea.tradfri.lighting D / Подсказка: точка привязки: 767, -771 2020-05-06 16: 36: 51.452 25288-25288 / com.ikea.tradfri.lighting D / Подсказка: размер: 3 59, 77 2020-05-06 16: 36: 54.729 25288-25288 / com.ikea.tradfri.lighting I / Tooltip: canvas w: 824, h: 0

private void showCustomTooltip (@nonnull Просмотр привязки ) {

@SuppressLint("InflateParams") View content = getLayoutInflater().inflate(R.layout.item_tooltip_view_1, null);
Resources res = getResources();

int tooltipPadding = res.getDimensionPixelOffset(R.dimen.tooltip_padding);
int tooltipColor = ContextCompat.getColor(mBaseActivity, R.color.warning_text_color);
int tipSizeSmall = res.getDimensionPixelSize(R.dimen.tip_dimen_small);
int tipRadius = res.getDimensionPixelOffset(R.dimen.tip_radius);

customTooltip = new Tooltip.Builder(getActivity())
        .anchor(anchor, Tooltip.BOTTOM)
        .animate(new TooltipAnimation(TooltipAnimation.SCALE_AND_FADE, 400))
        .autoAdjust(true)
        .withPadding(tooltipPadding)
        .withMargin(6)
        .content(content)
        .cancelable(true)
        .checkForPreDraw(true)
        .withTip(new Tooltip.Tip(tipSizeSmall, tipSizeSmall, tooltipColor))
        .into(mRootLayout)
        .debug(true)
        .show();

}

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...