Giter Club home page Giter Club logo

Comments (11)

YummyLau avatar YummyLau commented on May 28, 2024

PanelSwitchLayout如果要足够的高的话,那他岂不是要把我原来的布局给包进去才行,不然这个布局会把我原来的布局给覆盖掉。。。。

不太理解你说的。PanelSwitchLayout 跟你的布局没有关系。
描述遇到问题的场景请说明(至少)

  1. 你的业务场景是什么,你的布局排版是什么
  2. 当前出现了什么问题
  3. 你期望得到的结果是什么

from panelswitchhelper.

lijintan1990 avatar lijintan1990 commented on May 28, 2024

` <com.effective.android.panel.view.PanelSwitchLayout
android:id="@+id/panel_switch_layout"
android:layout_width="match_parent"
android:layout_height="100dp"
android:orientation="vertical">

    <com.effective.android.panel.view.ContentContainer
        android:id="@+id/content_view"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:orientation="vertical"
        app:empty_view="@id/empty_view">

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:background="#ebebeb">

            <View
                android:id="@+id/empty_view"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />
        </FrameLayout>


        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/shape_input_layout"
            android:gravity="bottom"
            android:minHeight="@dimen/dp_50"
            android:orientation="horizontal"
            android:paddingBottom="@dimen/dp_7.5"
            android:paddingLeft="@dimen/dp_10"
            android:paddingRight="@dimen/dp_10">

            <!-- 更多入口 -->
            <ImageView
                android:id="@+id/add_btn"
                android:layout_width="@dimen/dp_35"
                android:layout_height="@dimen/dp_35"
                android:layout_marginRight="@dimen/dp_10"
                android:src="@drawable/icon_add" />
            
            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="@dimen/dp_35"
                android:orientation="horizontal">

                <!-- 表情入口 -->
                <ImageView
                    android:id="@+id/emotion_btn"
                    android:layout_width="@dimen/dp_35"
                    android:layout_height="@dimen/dp_35"
                    android:layout_marginEnd="@dimen/dp_10"
                    android:layout_marginRight="@dimen/dp_10"
                    android:src="@drawable/selector_emotion_btn" />

                <TextView
                    android:id="@+id/send"
                    android:layout_width="@dimen/dp_50"
                    android:layout_height="@dimen/dp_35"
                    android:background="@drawable/selector_send_btn"
                    android:gravity="center"
                    android:text="发送"
                    android:textColor="@color/send_btn_color"
                    android:textSize="@dimen/sp_15" />

                <TextView
                    android:id="@+id/create_text"
                    android:layout_width="@dimen/dp_50"
                    android:layout_height="@dimen/dp_35"
                    android:background="@drawable/selector_send_btn"
                    android:gravity="center"
                    android:text="创建EditText"
                    android:layout_marginLeft="2dp"
                    android:textColor="@color/send_btn_color"
                    android:textSize="@dimen/sp_15" />
            </LinearLayout>

        </LinearLayout>
    </com.effective.android.panel.view.ContentContainer>


    <!-- 面板区域,仅能包含PanelView-->
    <com.effective.android.panel.view.PanelContainer
        android:id="@+id/panel_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <com.effective.android.panel.view.PanelView
            android:id="@+id/panel_addition"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:panel_layout="@layout/panel_add_layout"
            app:panel_trigger="@id/add_btn" />

    </com.effective.android.panel.view.PanelContainer>

</com.effective.android.panel.view.PanelSwitchLayout>`

我把PanelSwitchLayout设置成100dp,不够大,然后panel_add_layout这个东西也不能完整显示出来,我的意思就是PanelSwitchLayout是不是得足够高,不然内容没法显示

from panelswitchhelper.

lijintan1990 avatar lijintan1990 commented on May 28, 2024

PanelSwitchLayout这个如果足够大的话又把我之前的布局给遮住了

from panelswitchhelper.

lijintan1990 avatar lijintan1990 commented on May 28, 2024

我的痛点在于不知道要设置PanelSwitchLayout为多高,我不可能设置他match_parent的,这样把其他布局全部给遮住了,除非我把其他的布局全部放到PanelSwitchLayout里面去,感觉不太好

from panelswitchhelper.

YummyLau avatar YummyLau commented on May 28, 2024

我的痛点在于不知道要设置PanelSwitchLayout为多高,我不可能设置他match_parent的,这样把其他布局全部给遮住了,除非我把其他的布局全部放到PanelSwitchLayout里面去,感觉不太好

你要理解整个框架的原理是什么。
PanelSwitchLayout一般都要包住其他布局的。而你的场景,实际上你的布局可以放到ContentContainer足以。什么需求都可以实现的

from panelswitchhelper.

lijintan1990 avatar lijintan1990 commented on May 28, 2024

我的痛点在于不知道要设置PanelSwitchLayout为多高,我不可能设置他match_parent的,这样把其他布局全部给遮住了,除非我把其他的布局全部放到PanelSwitchLayout里面去,感觉不太好

你要理解整个框架的原理是什么。
PanelSwitchLayout一般都要包住其他布局的。而你的场景,实际上你的布局可以放到ContentContainer足以。什么需求都可以实现的

我现在所有的都放在ContentContainer,弹出的面板还是那么一点点,还有如果弹出软键盘,软键盘上面显示不出我的布局,这问题可能出在哪里,我始终没搞明白为什么demo里面软键盘上面那个布局正好就在软键盘上面显示

from panelswitchhelper.

YummyLau avatar YummyLau commented on May 28, 2024

我的痛点在于不知道要设置PanelSwitchLayout为多高,我不可能设置他match_parent的,这样把其他布局全部给遮住了,除非我把其他的布局全部放到PanelSwitchLayout里面去,感觉不太好

你要理解整个框架的原理是什么。
PanelSwitchLayout一般都要包住其他布局的。而你的场景,实际上你的布局可以放到ContentContainer足以。什么需求都可以实现的

我现在所有的都放在ContentContainer,弹出的面板还是那么一点点,还有如果弹出软键盘,软键盘上面显示不出我的布局,这问题可能出在哪里,我始终没搞明白为什么demo里面软键盘上面那个布局正好就在软键盘上面显示

ContentContainer 会自动变化高度,demo是软键盘上输入布局是固定的,输入布局上还有一个自使用高度的列表。ContentContainer 怎么变化,输入布局的高度都不会变化,会变化的是列表的高度。
建议看下 LinearLayout weight 属性的作用

from panelswitchhelper.

lijintan1990 avatar lijintan1990 commented on May 28, 2024

我的痛点在于不知道要设置PanelSwitchLayout为多高,我不可能设置他match_parent的,这样把其他布局全部给遮住了,除非我把其他的布局全部放到PanelSwitchLayout里面去,感觉不太好

你要理解整个框架的原理是什么。
PanelSwitchLayout一般都要包住其他布局的。而你的场景,实际上你的布局可以放到ContentContainer足以。什么需求都可以实现的

我现在所有的都放在ContentContainer,弹出的面板还是那么一点点,还有如果弹出软键盘,软键盘上面显示不出我的布局,这问题可能出在哪里,我始终没搞明白为什么demo里面软键盘上面那个布局正好就在软键盘上面显示

ContentContainer 会自动变化高度,demo是软键盘上输入布局是固定的,输入布局上还有一个自使用高度的列表。ContentContainer 怎么变化,输入布局的高度都不会变化,会变化的是列表的高度。
建议看下 LinearLayout weight 属性的作用

我感觉是这个empty_view在作怪,我没有写这个empty_view。大概布局是这样子:
` <com.effective.android.panel.view.PanelSwitchLayout
android:id="@+id/panel_switch_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"

    android:orientation="vertical">

    <com.effective.android.panel.view.ContentContainer
        android:id="@+id/content_view"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:orientation="vertical">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:background="@color/func_zone_color">`
        </RelativeLayout>


        <LinearLayout
            android:id="@+id/text_panel_bar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"

            android:visibility="visible"
            android:background="@color/func_zone_color"
            android:gravity="bottom"
            android:paddingBottom="10dp"
            android:orientation="horizontal">
            <ImageButton
                android:id="@+id/text_edit_close"
                android:layout_width="35dp"
                android:layout_height="35dp"
                android:layout_gravity="center"
                android:layout_centerVertical="true"
                android:layout_marginLeft="5dp"
                android:layout_alignParentLeft="true"
                android:background="@mipmap/sticker_select_cancel"/>

    </com.effective.android.panel.view.ContentContainer>

    <!-- 面板区域,仅能包含PanelView-->
    <com.effective.android.panel.view.PanelContainer
        android:id="@+id/panel_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <com.effective.android.panel.view.PanelView
            android:id="@+id/panel_addition"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:panel_layout="@layout/layout_color_panel"
            app:panel_trigger="@id/key_board" />

    </com.effective.android.panel.view.PanelContainer>
</com.effective.android.panel.view.PanelSwitchLayout>

基本上和你的布局一模一样,我都不知道什么情况

from panelswitchhelper.

lijintan1990 avatar lijintan1990 commented on May 28, 2024

感觉是代码的bug, onGlobalLayout在没有菜单栏的情况下判断是全屏,全屏情况下直接把那个panelContent的高度写到了prefernce里面去了,然后后面从里面取出来就取出这个数字,所以我感觉全屏模式下面那个计算是错误的,这个keyboardHeight的高度应该是不能这么计算, 但是要怎么算呢

from panelswitchhelper.

lijintan1990 avatar lijintan1990 commented on May 28, 2024

我用demo调试,都没有走setKeyBoardHeight,怎么getKeyBoardHeight却有正确值,这个值只有setKeyBoardHeight这个地方才有设置,真是太奇怪了

from panelswitchhelper.

YummyLau avatar YummyLau commented on May 28, 2024

我用demo调试,都没有走setKeyBoardHeight,怎么getKeyBoardHeight却有正确值,这个值只有setKeyBoardHeight这个地方才有设置,真是太奇怪了

Demo视频场景下提供了全屏的例子。另外,全屏分完全全屏和沉浸视图全屏。很多细节逻辑可以通过阅读源码解决。 getKeyBoardHeight 有值是因为任何设备都不能保证初始化的时候知道设备的输入法高度,初始化值是通过线上设备归纳得到的,只有第一次训练之后才能得到当前场景的输入法并智能兼容。

from panelswitchhelper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.