alibaba / Virtualview-Android

A light way to build UI in custom XML.
http://tangram.pingguohe.net/
MIT License
1.46k stars 187 forks source link

组件上覆盖实体布局,会拦截点击事件。 #53

Closed longerian closed 6 years ago

longerian commented 6 years ago
<NFrameLayout
    id="1"
    flag="flag_exposure|flag_clickable"
    action="root"
    layoutHeight="wrap_content"
    layoutMarginRight="12"
    layoutWidth="match_parent"
    paddingBottom="12"
    paddingLeft="12"
    paddingTop="12"
    refForeground="selectableItemBackground"
    xmlns="http://www.bilibili.com"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.bilibili.com ../virtualview.xsd">

    <VH2Layout
        layoutHeight="wrap_content"
        layoutWidth="wrap_content"
        orientation="H">
        <FrameLayout
            layoutHeight="wrap_content"
            layoutWidth="wrap_content">
            <NImage
                actualImageUri="${cover}"
                aspectRadioHeight="10"
                aspectRadioWidth="16"
                failureImage="bili_default_image_tv"
                layoutHeight="wrap_content"
                layoutWidth="144"
                placeholderImage="bili_default_image_tv"
                placeholderImageScaleType="centerInside"
                roundedCornerRadius="2"
                scaleViewType="fitWidth"
                src="https://img.alicdn.com/imgextra/i2/2671315119/TB2b2zabvNNTKJjSspeXXaSwpXa_!!2671315119.jpg"
                thumbHeight="100"
                thumbRatio="ratio_16_10"
                thumbWidth="160" />

            <NText
                backgroundDrawable="shape_roundrect_black_trans"
                id="54"
                layoutGravity="right|bottom"
                layoutHeight="wrap_content"
                layoutMarginBottom="6"
                layoutMarginRight="6"
                layoutWidth="wrap_content"
                paddingBottom="2"
                paddingLeft="4"
                paddingRight="4"
                paddingTop="2"
                textColor="white"
                textSize="10" />
        </FrameLayout>

        <NVH2Layout
            layoutHeight="90"
            layoutMarginLeft="10"
            layoutWidth="match_parent"
            orientation="V">

            <VHLayout
                layoutDirection="top"
                layoutHeight="wrap_content"
                layoutWidth="match_parent"
                orientation="V">

                <NText
                    ellipsize="end"
                    layoutHeight="wrap_content"
                    layoutWidth="wrap_content"
                    maxLines="2"
                    text="title"
                    refTextColor="daynight_color_text_body_primary"
                    textSize="14" />

                <VHLayout
                    gravity="left|v_center"
                    layoutHeight="20"
                    layoutMarginTop="8"
                    layoutWidth="wrap_content"
                    orientation="H">

                    <NText
                        drawableLeft="ic_info_views"
                        drawableLeftTint="index_card_text_light"
                        drawablePadding="4"
                        gravity="v_center"
                        id="51"
                        text="ic_info_views"
                        layoutGravity="v_center"
                        layoutHeight="wrap_content"
                        layoutMarginLeft="3"
                        layoutWidth="wrap_content"
                        refTextColor="daynight_color_text_supplementary_dark"
                        textSize="10" />

                    <NText
                        drawableLeft="ic_info_danmakus"
                        drawableLeftTint="index_card_text_light"
                        drawablePadding="4"
                        gravity="v_center"
                        id="52"
                        text="ic_info_danmakus"
                        layoutGravity="v_center"
                        layoutHeight="wrap_content"
                        layoutMarginLeft="3"
                        layoutWidth="wrap_content"
                        refTextColor="daynight_color_text_supplementary_dark"
                        textSize="10" />
                </VHLayout>
            </VHLayout>

            <NText
                flag="flag_clickable"
                action="text"
                ellipsize="end"
                id="101"
                layoutDirection="bottom"
                layoutHeight="wrap_content"
                layoutMarginRight="30"
                layoutWidth="match_parent"
                lines="1"
                text="test"
                refTextColor="daynight_color_text_supplementary_dark"
                textSize="10" />

        </NVH2Layout>
    </VH2Layout>

    <NFrameLayout
        flag="flag_clickable"
        action="right_bottom"
        id="2"
        background="#FF0000"
        layoutGravity="right|bottom"
        layoutHeight="30"
        layoutWidth="30">

        <NImage
            layoutGravity="right|bottom"
            layoutHeight="15"
            layoutMarginLeft="30"
            layoutWidth="15"
            src="https://img.alicdn.com/imgextra/i2/2671315119/TB2b2zabvNNTKJjSspeXXaSwpXa_!!2671315119.jpg" />
    </NFrameLayout>

    <NFrameLayout
        layoutHeight="match_parent"
        layoutWidth="match_parent"
        background="#80000000">
    </NFrameLayout>
</NFrameLayout>