鸿蒙仿抖音评论区弹出

import com.mytoutou.cehua.ResourceTable;
import com.mytoutou.cehua.listener.touchCommentCloseListener;
import com.mytoutou.cehua.provider.MainPageSliderProvider;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.agp.animation.*;
import ohos.agp.components.*;
import ohos.agp.window.service.Display;
import ohos.agp.window.service.DisplayAttributes;
import ohos.agp.window.service.DisplayManager;

import java.util.ArrayList;
import java.util.List;

public class MainAbilitySlice extends AbilitySlice {

    private DirectionalLayout pageA;
    private DirectionalLayout pageB;

    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        super.setUIContent(ResourceTable.Layout_ability_main);
        initPage();


    }

    private void initPage() {
        //构建pageSlider
        PageSlider pageSlider = getPageSlider();
        //底部弹出--评论区
        DirectionalLayout commentLayout = (DirectionalLayout) pageA.findComponentById(ResourceTable.Id_bottom_comment);
        commentLayout(commentLayout, pageA, pageSlider);
        //手势下拉关闭评论区
        touchCommentLayout(commentLayout, pageSlider);

        /**
         * 测试应用复制一个做测试 commentLayout 与commentLayout1一致
         * 点击评论展开评论区,点击评论区x符号关闭评论区
         */
        DirectionalLayout commentLayout1 = (DirectionalLayout) pageB.findComponentById(ResourceTable.Id_bottom_comment1);
        commentLayoutB(commentLayout1, pageB, pageSlider);
        touchCommentLayout(commentLayout1, pageSlider);

//        pageA.setTouchEventListener(new MainPageListener(pageA));
    }

    private PageSlider getPageSlider() {
        pageA = (DirectionalLayout) LayoutScatter.getInstance(getContext()).parse(ResourceTable.Layout_page_a, null, false);
        pageB = (DirectionalLayout) LayoutScatter.getInstance(getContext()).parse(ResourceTable.Layout_page_b, null, false);
        List<DirectionalLayout> list = new ArrayList<>();
        list.add(pageA);
        list.add(pageB);
        PageSlider pageSlider = (PageSlider) findComponentById(ResourceTable.Id_main_page_slider);
        pageSlider.setProvider(new MainPageSliderProvider(list));

        pageA.setWidth(getScreenWidth());
        pageB.setWidth(getScreenWidth());
        pageA.setHeight(getScreenHeight());
        pageB.setHeight(getScreenHeight());
        return pageSlider;
    }


    private void touchCommentLayout(DirectionalLayout commentLayout, PageSlider pageSlider) {
        commentLayout.setTouchEventListener(new touchCommentCloseListener(commentLayout, commentLayout.getHeight(), pageSlider));
    }

    private void commentLayout(DirectionalLayout commentLayout, DirectionalLayout container, PageSlider pageSlider) {
        //计算展开评论区的高度
        int height = 1300;
        commentLayout.setHeight(height);
        int contentPositionY = getScreenHeight() - height;
        commentLayout.setContentPositionY(getScreenHeight());
        Button btnComment = (Button) container.findComponentById(ResourceTable.Id_btn_comment);
        //设定动画持续时间
        int duration = 100;
        btnComment.setClickedListener(component -> {
            if (commentLayout.getContentPositionY() == contentPositionY) {
                //隐藏
                commentLayout.createAnimatorProperty().moveFromY(contentPositionY).moveToY(contentPositionY + height).setDuration(duration).start();
            } else {
                //展开
                pageSlider.setSlidingPossible(false);
                commentLayout.createAnimatorProperty().moveFromY(contentPositionY + height).moveToY(contentPositionY).setDuration(duration).start();
            }
        });
        DirectionalLayout like = (DirectionalLayout) container.findComponentById(ResourceTable.Id_bottom_layout_like);

        DirectionalLayout comment = (DirectionalLayout) container.findComponentById(ResourceTable.Id_comment_layout);
        comment.setWidth(like.getWidth());
        //屏幕宽度减去容器宽度等于距离左边距离
        int marginLeft = getScreenWidth() - comment.getWidth();
        //主容器的高度除以2减去按钮宽度的一半----防止触底
        int marginTop = container.getHeight() / 2 - like.getHeight() / 2;
        comment.setMarginLeft(marginLeft + 30);
        comment.setMarginTop(marginTop - 100);
        DirectionalLayout resolve = (DirectionalLayout) container.findComponentById(ResourceTable.Id_bottom_comment_resolve);
        resolve.setMarginTop(100);

        Button resolveBtn = (Button) container.findComponentById(ResourceTable.Id_btn_comment_resolve);
        AnimatorProperty animatorProperty = resolveBtn.createAnimatorProperty();
        //转圈圈就是角度变化360度,-1是无限循环
        animatorProperty.rotate(360).setCurveType(AnimatorValue.INFINITE).setDuration(2000).setLoopedCount(-1);
        resolve.setBindStateChangedListener(new Component.BindStateChangedListener() {
            @Override
            public void onComponentBoundToWindow(Component component) {
                animatorProperty.start();
            }

            @Override
            public void onComponentUnboundFromWindow(Component component) {
                animatorProperty.stop();
            }
        });
        //显示视频的标题以及内容
        DirectionalLayout bottomContentTitle = (DirectionalLayout) container.findComponentById(ResourceTable.Id_bottom_content_title);
        int bottomContentTitleMarginTop = getScreenHeight() - bottomContentTitle.getHeight() - 200;
        bottomContentTitle.setMarginRight(comment.getWidth() + 10);
        bottomContentTitle.setMarginLeft(10);
        bottomContentTitle.setMarginTop(bottomContentTitleMarginTop);
        //设置跑马灯属性
        Text text = (Text) container.findComponentById(ResourceTable.Id_horse_race_lamp);
        text.setMarginLeft(30);
        // 跑马灯效果
        text.setTruncationMode(Text.TruncationMode.AUTO_SCROLLING);
        // 始终处于自动滚动状态
        text.setAutoScrollingCount(Text.AUTO_SCROLLING_FOREVER);
        // 启动跑马灯效果
        text.startAutoScrolling();
    }

    private void commentLayoutB(DirectionalLayout commentLayout, DirectionalLayout container, PageSlider pageSlider) {
        //计算展开品论的高度
        int height = 1300;
        commentLayout.setHeight(height);
        int contentPositionY = getScreenHeight() - height;
        commentLayout.setContentPositionY(getScreenHeight());
        Button btnComment = (Button) container.findComponentById(ResourceTable.Id_btn_comment1);
        //设定动画持续时间
        int duration = 100;
        btnComment.setClickedListener(component -> {
            if (commentLayout.getContentPositionY() == contentPositionY) {
                //隐藏
                commentLayout.createAnimatorProperty().moveFromY(contentPositionY).moveToY(contentPositionY + height).setDuration(duration).start();
            } else {
                pageSlider.setSlidingPossible(false);
                //展开
                commentLayout.createAnimatorProperty().moveFromY(contentPositionY + height).moveToY(contentPositionY).setDuration(duration).start();
            }
        });
        DirectionalLayout like = (DirectionalLayout) container.findComponentById(ResourceTable.Id_bottom_layout_like1);

        DirectionalLayout comment = (DirectionalLayout) container.findComponentById(ResourceTable.Id_comment_layout1);
        comment.setWidth(like.getWidth());
        //屏幕宽度减去容器宽度等于距离左边距离
        int marginLeft = getScreenWidth() - comment.getWidth();
        //主容器的高度除以2减去按钮宽度的一半----防止触底
        int marginTop = container.getHeight() / 2 - like.getHeight() / 2;
        comment.setMarginLeft(marginLeft + 30);
        comment.setMarginTop(marginTop - 100);
        DirectionalLayout resolve = (DirectionalLayout) container.findComponentById(ResourceTable.Id_bottom_comment_resolve1);
        resolve.setMarginTop(100);
        Button resolveBtn = (Button) container.findComponentById(ResourceTable.Id_btn_comment_resolve1);
        AnimatorProperty animatorProperty = resolveBtn.createAnimatorProperty();
        animatorProperty.rotate(360).setCurveType(AnimatorValue.INFINITE).setDuration(2000).setLoopedCount(-1);
        resolve.setBindStateChangedListener(new Component.BindStateChangedListener() {
            @Override
            public void onComponentBoundToWindow(Component component) {
                animatorProperty.start();
            }

            @Override
            public void onComponentUnboundFromWindow(Component component) {
                animatorProperty.stop();
            }
        });
        //显示视频的标题以及内容
        DirectionalLayout bottomContentTitle = (DirectionalLayout) container.findComponentById(ResourceTable.Id_bottom_content_title1);
        int bottomContentTitleMarginTop = getScreenHeight() - bottomContentTitle.getHeight() - 200;
        bottomContentTitle.setMarginRight(comment.getWidth() + 10);
        bottomContentTitle.setMarginLeft(10);
        bottomContentTitle.setMarginTop(bottomContentTitleMarginTop);
        //设置跑马灯属性
        Text text = (Text) container.findComponentById(ResourceTable.Id_horse_race_lamp1);
        text.setMarginLeft(30);
        // 跑马灯效果
        text.setTruncationMode(Text.TruncationMode.AUTO_SCROLLING);
        // 始终处于自动滚动状态
        text.setAutoScrollingCount(Text.AUTO_SCROLLING_FOREVER);
        // 启动跑马灯效果
        text.startAutoScrolling();
    }

    @Override
    public void onActive() {
        super.onActive();
    }

    @Override
    public void onForeground(Intent intent) {
        super.onForeground(intent);
    }

    /**
     * 获得手机屏幕宽度
     */
    public int getScreenWidth() {
        DisplayManager displayManager = DisplayManager.getInstance();
        Display display = displayManager.getDefaultDisplay(this).get();
        DisplayAttributes displayAttributes = display.getAttributes();
        return displayAttributes.width;
    }

    /**
     * 获得手机屏幕宽度
     */
    public int getScreenHeight() {
        DisplayManager displayManager = DisplayManager.getInstance();
        Display display = displayManager.getDefaultDisplay(this).get();
        DisplayAttributes displayAttributes = display.getAttributes();
        return displayAttributes.height;
    }
}
MainPageSliderProvider
import ohos.agp.components.*;

import java.util.List;

public class MainPageSliderProvider extends PageSliderProvider {
    private List<DirectionalLayout> list;

    public MainPageSliderProvider(List<DirectionalLayout> list) {
        this.list = list;
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Object createPageInContainer(ComponentContainer componentContainer, int i) {
        componentContainer.addComponent(list.get(i));
        return list.get(i);
    }

    @Override
    public void destroyPageFromContainer(ComponentContainer componentContainer, int i, Object o) {
        componentContainer.removeComponent((Component) o);
    }

    @Override
    public boolean isPageMatchToObject(Component component, Object o) {
        return true;
    }
}

下滑关闭评论区listener


import ohos.agp.components.Component;
import ohos.agp.components.DirectionalLayout;
import ohos.agp.components.PageSlider;
import ohos.agp.components.VelocityDetector;
import ohos.agp.window.service.Display;
import ohos.agp.window.service.DisplayAttributes;
import ohos.agp.window.service.DisplayManager;
import ohos.multimodalinput.event.MmiPoint;
import ohos.multimodalinput.event.TouchEvent;

import java.nio.channels.FileLock;

public class touchCommentCloseListener implements Component.TouchEventListener {
    private static final int INVALID_POINTER = -1;
    private static final float STEP_LENGTH = 1;
    private DirectionalLayout commentLayout;
    //当前Y坐标
    private float currentY;
    //最后一次坐标
    private float lastY;
    //当前点击的点id
    private int pointId;
    //滑动的距离
    private float distance;
    //当前点击时事件索引
    private int index;
    //评论区弹出高度
    private int commentHeight;
    //动画时常
    private final int duration = 300;
    // VelocityDetector,用来获取触发Touch事件的手指滑动速度
    protected VelocityDetector mVelocityDetector;
    private int mMaximumVelocity;
    private int maxSpeed;
    private PageSlider pageSlider;

    public touchCommentCloseListener(DirectionalLayout commentLayout, int commentHeight, PageSlider pageSlider) {
        this.commentLayout = commentLayout;
        this.commentHeight = commentHeight;
        this.pageSlider = pageSlider;
        init();
    }

    public void init() {
        // 设置页面是否可以滑动---最大滑动速度
        this.mMaximumVelocity = 22000;
        //默认速度
        this.maxSpeed = 1800;
    }

    @Override
    public boolean onTouchEvent(Component component, TouchEvent ev) {
        int action = ev.getAction();
        if (mVelocityDetector == null) {
            mVelocityDetector = VelocityDetector.obtainInstance();
        }
        mVelocityDetector.addEvent(ev);
        switch (action) {
            case TouchEvent.PRIMARY_POINT_DOWN:
                index = ev.getIndex();
                pointId = ev.getPointerId(ev.getIndex());
                lastY = currentY = ev.getPointerScreenPosition(pointId).getY();
                System.out.println("lastY:" + lastY);
                break;
            case TouchEvent.POINT_MOVE:
                pointId = ev.getPointerId(index);
                if (pointId == -1) {
                    break;
                }
                //当我们屏幕中某个区域使用Touch事件的时候我们使用getPointerScreenPosition方法
                currentY = ev.getPointerScreenPosition(pointId).getY();
                distance = currentY - lastY;
                float contentPositionY = distance + commentLayout.getContentPositionY();
                //距离上方的高度必须大于以下计算的高度----意思大于评论区弹出有空区域的高度
                int fixedMargin = getScreenHeight() - commentHeight;
                //可变距离顶部的距离
                int variableMargin = getScreenHeight() - commentHeight + (int) distance;
                if (variableMargin >= fixedMargin) {
                    commentLayout.setMarginTop(variableMargin);
                }
                break;
            case TouchEvent.PRIMARY_POINT_UP:
                final VelocityDetector velocityTracker = mVelocityDetector;
                velocityTracker.calculateCurrentVelocity(1000, mMaximumVelocity, mMaximumVelocity);
                float verticalVelocity = velocityTracker.getVerticalVelocity();
                //如果大于这个速度直接关闭
                if (Math.abs(verticalVelocity) > maxSpeed) {
                    close();
                    break;
                }
                if (distance * STEP_LENGTH < 0) {
                    if (Math.abs(distance) < commentHeight / 4) {
                        //自动还原
                        commentLayout.setContentPositionY(getScreenHeight() - commentHeight);
                    } else {
                        commentLayout.setContentPositionY(getScreenHeight());
                        close();
                    }
                } else {
                    //自动隐藏
                    if (distance * STEP_LENGTH < commentHeight / 4) {
                        commentLayout.setContentPositionY(getScreenHeight() - commentHeight);
                    } else {
                        close();
                    }
                }
                break;
        }

        return true;
    }

    //关闭有个动画
    private void close() {
        pageSlider.setSlidingPossible(true);
        commentLayout.createAnimatorProperty()
                .moveFromY(3 * getScreenHeight() / 4)
                .moveToY(getScreenHeight())
                .setDuration(duration).start();
    }

    /**
     * 获得手机屏幕宽度
     */
    public int getScreenHeight() {
        DisplayManager displayManager = DisplayManager.getInstance();
        Display display = displayManager.getDefaultDisplay(commentLayout.getContext()).get();
        DisplayAttributes displayAttributes = display.getAttributes();
        return displayAttributes.height;
    }
}

主布局ability_main.xml

<?xml version="1.0" encoding="utf-8"?>

<PageSlider
    xmlns:ohos="http://schemas.huawei.com/res/ohos"
    ohos:id="$+id:main_page_slider"
    ohos:height="match_parent"
    ohos:width="match_parent"
    ohos:orientation="vertical"
    ohos:layout_alignment="horizontal_center">
</PageSlider>

两个测试页面布局

page_a.xml

<?xml version="1.0" encoding="utf-8"?>
<DirectionalLayout
    xmlns:ohos="http://schemas.huawei.com/res/ohos"
    ohos:id="$+id:pageA"
    ohos:height="match_parent"
    ohos:width="1000"
    ohos:background_element="$graphic:background_ability_main"
    ohos:orientation="vertical">

    <StackLayout
        ohos:height="match_parent"
        ohos:width="match_parent">

        <DirectionalLayout
            ohos:height="match_parent"
            ohos:width="match_parent"
            ohos:background_element="$graphic:page_a"
            ohos:layout_alignment="bottom">

            <StackLayout
                ohos:height="match_parent"
                ohos:width="match_parent">

                <DirectionalLayout
                    ohos:height="match_parent"
                    ohos:width="match_parent">

                    <Text
                        ohos:id="$+id:text_helloworld21"
                        ohos:height="match_content"
                        ohos:width="match_content"
                        ohos:layout_alignment="center"
                        ohos:text="仿照抖音评论页面"
                        ohos:text_color="#FF659D9D"
                        ohos:text_size="50px"
                        />

                    <Text
                        ohos:id="$+id:text_helloworld5"
                        ohos:height="match_content"
                        ohos:width="match_content"
                        ohos:layout_alignment="center"
                        ohos:text="在视频播放页面点击评论图标弹出评论信息"
                        ohos:text_color="#FF659D9D"
                        ohos:text_size="50px"
                        />
                </DirectionalLayout>
                <!-- 底部标题信息-->
                <DirectionalLayout
                    ohos:id="$+id:bottom_content_title"
                    ohos:height="360"
                    ohos:width="match_parent"
                    ohos:orientation="vertical">

                    <Text
                        ohos:height="100"
                        ohos:width="match_content"
                        ohos:layout_alignment="left"
                        ohos:text="@张三被狗咬"
                        ohos:text_color="#FFE8EFEF"
                        ohos:text_size="50px"
                        ohos:text_weight="700"
                        />

                    <Text
                        ohos:height="160"
                        ohos:width="match_content"
                        ohos:layout_alignment="left"
                        ohos:max_text_lines="2"
                        ohos:multiple_lines="true"
                        ohos:text="虽然学霸的成绩让我目瞪口呆,但是我的交卷速度绝对让学霸目瞪口呆!"
                        ohos:text_color="#FFEEF5F5"
                        ohos:text_font="serif"
                        ohos:text_size="50px"
                        ohos:text_weight="700"
                        />
                    <!-- 跑马灯标题-->
                    <Text
                        ohos:id="$+id:horse_race_lamp"
                        ohos:height="100"
                        ohos:width="175vp"
                        ohos:text="歌曲名称:mao不易-测试版,木马城市--测试版版本,测试的歌曲"
                        ohos:text_color="#FFE8EFEF"
                        ohos:text_font="serif"
                        ohos:text_size="50px"
                        ohos:text_weight="700"
                        />
                </DirectionalLayout>

                <DirectionalLayout
                    ohos:id="$+id:comment_layout"
                    ohos:height="match_parent"
                    ohos:width="match_parent">

                    <DirectionalLayout
                        ohos:id="$+id:bottom_layout_head"
                        ohos:height="200"
                        ohos:width="200">

                        <Button
                            ohos:id="$+id:btn_comment_head"
                            ohos:height="150"
                            ohos:width="150"
                            ohos:background_element="$graphic:btn_graphic"
                            ohos:text="头像"
                            ohos:text_color="#FF0C0C0C"
                            ohos:text_size="40"
                            ohos:text_weight="700"/>
                    </DirectionalLayout>

                    <DirectionalLayout
                        ohos:id="$+id:bottom_layout_like"
                        ohos:height="200"
                        ohos:width="200">

                        <Button
                            ohos:id="$+id:btn_comment_like"
                            ohos:height="150"
                            ohos:width="150"
                            ohos:background_element="$graphic:btn_graphic"
                            ohos:text="喜欢"
                            ohos:text_color="#FF0C0C0C"
                            ohos:text_size="40"
                            ohos:text_weight="700"/>
                    </DirectionalLayout>

                    <DirectionalLayout
                        ohos:id="$+id:bottom_layout_comment"
                        ohos:height="200"
                        ohos:width="200">

                        <Button
                            ohos:id="$+id:btn_comment"
                            ohos:height="150"
                            ohos:width="150"
                            ohos:background_element="$graphic:btn_graphic"
                            ohos:text="评论"
                            ohos:text_color="#FF0C0C0C"
                            ohos:text_size="40"
                            ohos:text_weight="700"/>
                    </DirectionalLayout>

                    <DirectionalLayout
                        ohos:id="$+id:bottom_layout_share"
                        ohos:height="200"
                        ohos:width="200">

                        <Button
                            ohos:id="$+id:btn_comment_share"
                            ohos:height="150"
                            ohos:width="150"
                            ohos:background_element="$graphic:btn_graphic"
                            ohos:text="分享"
                            ohos:text_color="#FF0C0C0C"
                            ohos:text_size="40"
                            ohos:text_weight="700"/>
                    </DirectionalLayout>
                    <DirectionalLayout
                        ohos:id="$+id:bottom_comment_resolve"
                        ohos:height="200"
                        ohos:width="200">

                        <Button
                            ohos:id="$+id:btn_comment_resolve"
                            ohos:height="150"
                            ohos:width="150"
                            ohos:background_element="$graphic:btn_graphic"
                            ohos:text="旋转"
                            ohos:text_color="#FF0C0C0C"
                            ohos:text_size="40"
                            ohos:text_weight="700"/>
                    </DirectionalLayout>
                </DirectionalLayout>
            </StackLayout>
        </DirectionalLayout>


        <DirectionalLayout
            ohos:id="$+id:bottom_comment"
            ohos:height="match_parent"
            ohos:width="match_parent"
            ohos:background_element="$graphic:commnet_bg">

            <Text
                ohos:id="$+id:text_helloworld4"
                ohos:height="match_content"
                ohos:width="match_content"
                ohos:layout_alignment="horizontal_center"
                ohos:text="仿抖音评论页面"
                ohos:text_color="#FF171818"
                ohos:text_size="50px"
                />
        </DirectionalLayout>
    </StackLayout>

</DirectionalLayout>

page_b.xml

<?xml version="1.0" encoding="utf-8"?>
<DirectionalLayout
    xmlns:ohos="http://schemas.huawei.com/res/ohos"
    ohos:id="$+id:pageB"
    ohos:height="match_parent"
    ohos:width="match_parent"
    ohos:background_element="$graphic:background_ability_main1">

    <StackLayout
        ohos:height="match_parent"
        ohos:width="match_parent">

        <DirectionalLayout
            ohos:height="match_parent"
            ohos:width="match_parent"
            ohos:background_element="$graphic:page_b"
            ohos:layout_alignment="bottom">

            <StackLayout
                ohos:height="match_parent"
                ohos:width="match_parent">

                <DirectionalLayout
                    ohos:height="match_parent"
                    ohos:width="match_parent">

                    <Text
                        ohos:id="$+id:text_helloworld21"
                        ohos:height="match_content"
                        ohos:width="match_content"
                        ohos:layout_alignment="center"
                        ohos:text="仿照抖音评论页面"
                        ohos:text_color="#FF659D9D"
                        ohos:text_size="50px"
                        />

                    <Text
                        ohos:id="$+id:text_helloworld51"
                        ohos:height="match_content"
                        ohos:width="match_content"
                        ohos:layout_alignment="center"
                        ohos:text="在视频播放页面点击评论图标弹出评论信息"
                        ohos:text_color="#FF659D9D"
                        ohos:text_size="50px"
                        />
                </DirectionalLayout>
                <!-- 底部标题信息-->
                <DirectionalLayout
                    ohos:id="$+id:bottom_content_title1"
                    ohos:height="360"
                    ohos:width="match_parent"
                    ohos:orientation="vertical">

                    <Text
                        ohos:height="100"
                        ohos:width="match_content"
                        ohos:layout_alignment="left"
                        ohos:text="@张三被狗咬"
                        ohos:text_color="#FFE8EFEF"
                        ohos:text_size="50px"
                        ohos:text_weight="700"
                        />

                    <Text
                        ohos:height="160"
                        ohos:width="match_content"
                        ohos:layout_alignment="left"
                        ohos:max_text_lines="2"
                        ohos:multiple_lines="true"
                        ohos:text="虽然学霸的成绩让我目瞪口呆,但是我的交卷速度绝对让学霸目瞪口呆!"
                        ohos:text_color="#FFEEF5F5"
                        ohos:text_font="serif"
                        ohos:text_size="50px"
                        ohos:text_weight="700"
                        />
                    <!-- 跑马灯标题-->
                    <Text
                        ohos:id="$+id:horse_race_lamp1"
                        ohos:height="100"
                        ohos:width="175vp"
                        ohos:text="歌曲名称:mao不易-测试版,木马城市--测试版版本,测试的歌曲"
                        ohos:text_color="#FFE8EFEF"
                        ohos:text_font="serif"
                        ohos:text_size="50px"
                        ohos:text_weight="700"
                        />
                </DirectionalLayout>

                <DirectionalLayout
                    ohos:id="$+id:comment_layout1"
                    ohos:height="match_parent"
                    ohos:width="match_parent">

                    <DirectionalLayout
                        ohos:id="$+id:bottom_layout_head1"
                        ohos:height="200"
                        ohos:width="200">

                        <Button
                            ohos:id="$+id:btn_comment_head1"
                            ohos:height="150"
                            ohos:width="150"
                            ohos:background_element="$graphic:btn_graphic"
                            ohos:text="头像"
                            ohos:text_color="#FF0C0C0C"
                            ohos:text_size="40"
                            ohos:text_weight="700"/>
                    </DirectionalLayout>

                    <DirectionalLayout
                        ohos:id="$+id:bottom_layout_like1"
                        ohos:height="200"
                        ohos:width="200">

                        <Button
                            ohos:id="$+id:btn_comment_like1"
                            ohos:height="150"
                            ohos:width="150"
                            ohos:background_element="$graphic:btn_graphic"
                            ohos:text="喜欢"
                            ohos:text_color="#FF0C0C0C"
                            ohos:text_size="40"
                            ohos:text_weight="700"/>
                    </DirectionalLayout>

                    <DirectionalLayout
                        ohos:id="$+id:bottom_layout_comment1"
                        ohos:height="200"
                        ohos:width="200">

                        <Button
                            ohos:id="$+id:btn_comment1"
                            ohos:height="150"
                            ohos:width="150"
                            ohos:background_element="$graphic:btn_graphic"
                            ohos:text="评论"
                            ohos:text_color="#FF0C0C0C"
                            ohos:text_size="40"
                            ohos:text_weight="700"/>
                    </DirectionalLayout>

                    <DirectionalLayout
                        ohos:id="$+id:bottom_layout_share1"
                        ohos:height="200"
                        ohos:width="200">

                        <Button
                            ohos:id="$+id:btn_comment_share1"
                            ohos:height="150"
                            ohos:width="150"
                            ohos:background_element="$graphic:btn_graphic"
                            ohos:text="分享"
                            ohos:text_color="#FF0C0C0C"
                            ohos:text_size="40"
                            ohos:text_weight="700"/>
                    </DirectionalLayout>
                    <DirectionalLayout
                        ohos:id="$+id:bottom_comment_resolve1"
                        ohos:height="200"
                        ohos:width="200">

                        <Button
                            ohos:id="$+id:btn_comment_resolve1"
                            ohos:height="150"
                            ohos:width="150"
                            ohos:background_element="$graphic:btn_graphic"
                            ohos:text="旋转"
                            ohos:text_color="#FF0C0C0C"
                            ohos:text_size="40"
                            ohos:text_weight="700"/>
                    </DirectionalLayout>
                </DirectionalLayout>
            </StackLayout>
        </DirectionalLayout>


        <DirectionalLayout
            ohos:id="$+id:bottom_comment1"
            ohos:height="match_parent"
            ohos:width="match_parent"
            ohos:background_element="$graphic:commnet_bg">

            <Text
                ohos:id="$+id:text_helloworld41"
                ohos:height="match_content"
                ohos:width="match_content"
                ohos:layout_alignment="horizontal_center"
                ohos:text="仿抖音评论页面"
                ohos:text_color="#FF171818"
                ohos:text_size="50px"
                />
        </DirectionalLayout>
    </StackLayout>
</DirectionalLayout>

 

 

 

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

我来秋风扫落叶

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值