Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

不行, ll_stick_list LinearLayout 并没有在头部 #10

Closed
as11051105 opened this issue Apr 2, 2019 · 1 comment
Closed

不行, ll_stick_list LinearLayout 并没有在头部 #10

as11051105 opened this issue Apr 2, 2019 · 1 comment

Comments

@as11051105
Copy link

`

    <View
        android:layout_width="match_parent"
        android:layout_height="@dimen/statusBar_height"
        android:background="@color/white_color" />

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="@dimen/dp_48"
        android:background="@color/white_color"
        android:paddingStart="@dimen/dp_16"
        android:paddingEnd="@dimen/dp_16">

        <TextView
            android:id="@+id/tv_choose_area"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:drawableEnd="@drawable/ico_down_arrow_333"
            android:drawablePadding="@dimen/dp_4"
            android:text="重庆"
            android:textColor="@color/black_333"
            android:textSize="@dimen/sp_16"
            android:visibility="invisible"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <TextView
            android:id="@+id/tv_titlebar_search"
            android:layout_width="0dp"
            android:layout_height="28dp"
            android:layout_marginStart="@dimen/dp_12"
            android:layout_marginEnd="@dimen/dp_12"
            android:background="@drawable/search_ev_bg"
            android:drawableStart="@drawable/ic_search"
            android:drawablePadding="@dimen/dp_10"
            android:gravity="center_vertical"
            android:hint="搜索商品"
            android:maxLines="1"
            android:paddingStart="@dimen/dp_16"
            android:singleLine="true"
            android:textColor="@color/black_333"
            android:textSize="@dimen/sp_16"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@+id/cl_to_msg"
            app:layout_constraintStart_toEndOf="@+id/tv_choose_area"
            app:layout_constraintTop_toTopOf="parent" />

        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/cl_to_msg"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="parent">

            <ImageView
                android:id="@+id/iv_to_msg"
                android:layout_width="32dp"
                android:layout_height="32dp"
                android:padding="@dimen/dp_4"
                android:src="@drawable/ico_home_msg"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

            <ImageView
                android:id="@+id/iv_is_has_unred"
                android:layout_width="4dp"
                android:layout_height="4dp"
                android:layout_marginTop="@dimen/dp_8"
                android:layout_marginEnd="@dimen/dp_6"
                android:background="@color/red_dark"
                app:layout_constraintEnd_toEndOf="@+id/iv_to_msg"
                app:layout_constraintTop_toTopOf="@+id/iv_to_msg" />
        </androidx.constraintlayout.widget.ConstraintLayout>
    </androidx.constraintlayout.widget.ConstraintLayout>


    <com.gds.ypw.support.view.CustomPullRefreshLayout
        android:id="@+id/pull_to_refresh"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/activity_bg_color"
        android:scrollbars="none">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <wellijohn.org.scrollviewwithstickheader.ScrollViewWithStickHeader
                android:id="@+id/stick_scroll_view"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <LinearLayout
                    android:id="@+id/ll"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:descendantFocusability="blocksDescendants"
                    android:focusableInTouchMode="true"
                    android:orientation="vertical">


                    <LinearLayout
                        android:id="@+id/rlayout"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="vertical">

                        <include
                            android:id="@+id/banner_content"
                            layout="@layout/layout_banner"
                            android:layout_width="match_parent"
                            android:layout_height="186dp" />

                        <com.gds.ypw.support.view.FullGridView
                            android:id="@+id/main_type_grid"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:background="@color/white_color"
                            android:cacheColorHint="@android:color/transparent"
                            android:listSelector="@android:color/transparent"
                            android:numColumns="5"
                            android:padding="16dp"
                            android:stretchMode="columnWidth"
                            android:verticalSpacing="16dp" />

                        <LinearLayout
                            android:id="@+id/ll_content"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:descendantFocusability="blocksDescendants"
                            android:orientation="vertical" />
                    </LinearLayout>


                    <LinearLayout
                        android:id="@+id/ll_stick_list"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="vertical">


                        <com.google.android.material.tabs.TabLayout
                            android:id="@+id/order_manager_tabs"
                            android:layout_width="match_parent"
                            android:layout_height="50dp"
                            android:background="#FFFFFF"
                            tools:tabGravity="fill"
                            tools:tabMode="fixed" />

                        <androidx.viewpager.widget.ViewPager
                            android:id="@+id/vp"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content" />
                    </LinearLayout>
                </LinearLayout>
            </wellijohn.org.scrollviewwithstickheader.ScrollViewWithStickHeader>

        </RelativeLayout>
    </com.gds.ypw.support.view.CustomPullRefreshLayout>
</LinearLayout>`
@WelliJohn
Copy link
Owner

请注意下前言部分,现在官方有能支持的组件,可以直接用,在实现上述效果之后,用了下appbarlayout,觉得也能实现上述滑动的效果,不需要更改什么代码,体验上更好,具体可以看AndroidWidgetActivity,在这里面就是CollapsingToolbarLayout和appbarlayout的使用,完成上述的效果,可以简单看下实现的效果图,如果你们觉得满足需求了就不需要继续往下看了,如果想了解下手势点击原理的话,欢迎往下看提点意见

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants