8000 Support android colapsing toolbar · Issue #40 · ppamorim/Dragger · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Support android colapsing toolbar #40
Open
@miladna7

Description

@miladna7

Hello dear.
thank u for Ur amazing library.
i want to add collapsing toolbar into my activity.
i use android support library for this goal.
every thing was ok, so i just add dragger as root and add to the two needed layout.
problem is, when i start activity, layout position is nut right. for example the main child posation is in the half of screen and when i touch the screen and do some scroll, layout go up and every thing is OK.
Should i use Android-ObservableScrollView?
i think it is nothing about Observing the scroll but i think it worth to mention.
`

<com.github.ppamorim.dragger.DraggerView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/tools"
    xmlns:card_view="http://schemas.android.com/apk/res-auto"
    xmlns:dragger_layout="http://schemas.android.com/apk/res-auto"
    android:id="@+id/dragger_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    dragger_layout:drag_position="right"
    dragger_layout:drag_view_id="@+id/drag_view"

    dragger_layout:shadow_view_id="@+id/shadow_view">

<FrameLayout
    android:visibility="gone"
    android:id="@+id/shadow_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/transparent" />
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/drag_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">

    <android.support.design.widget.AppBarLayout
        android:id="@+id/appbar"
        android:layout_width="match_parent"
        android:layout_height="256dp"
        android:fitsSystemWindows="true"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

        <android.support.design.widget.CollapsingToolbarLayout
            android:id="@+id/collapsing_toolbar"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:fitsSystemWindows="true"
            app:contentScrim="?attr/colorPrimary"
            app:expandedTitleMarginEnd="64dp"
            app:expandedTitleMarginStart="48dp"
            app:layout_scrollFlags="scroll|exitUntilCollapsed">

            <ImageView
                android:id="@+id/backdrop"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:fitsSystemWindows="true"
                android:scaleType="centerCrop"
                app:layout_collapseMode="parallax" />
            <View
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginBottom="200dp"
                android:background="@drawable/grd_collapsing_toolbar_top"
                app:layout_collapseMode="parallax"
                app:layout_collapseParallaxMultiplier="0.1"/>
            <View
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginTop="200dp"
                android:background="@drawable/grd_collapsing_toolbar_bottom"
                app:layout_collapseMode="parallax"
                app:layout_collapseParallaxMultiplier="0.1"/>

            <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                app:layout_collapseMode="pin"
                app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />

        </android.support.design.widget.CollapsingToolbarLayout>

    </android.support.design.widget.AppBarLayout>

    <android.support.v4.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"
            android:paddingTop="24dp">

            <android.support.v7.widget.CardView

                android:id="@+id/cv"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:paddingBottom="8dp"
                android:paddingLeft="8dp"
                android:paddingRight="8dp"
                android:layout_margin="16dp">


                <RelativeLayout
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent">

                    <FrameLayout
                        android:id="@+id/fl_titlePart"
                        android:layout_width="fill_parent"
                        android:layout_height="match_parent"
                        android:background="@color/colorAccent">

                        <ImageView

                            android:id="@+id/iv_title"
                            android:layout_width="fill_parent"
                            android:layout_height="wrap_content" />

                        <TextView
                            android:id="@+id/tv_title"
                            android:layout_width="fill_parent"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:paddingBottom="16dp"
                            android:paddingLeft="8dp"
                            android:paddingRight="8dp"
                            android:paddingTop="16dp"
                            android:text="very very big title"
                            android:textAppearance="?android:attr/textAppearanceMedium" />
                    </FrameLayout>

                </RelativeLayout>
            </android.support.v7.widget.CardView>

        </LinearLayout>

    </android.support.v4.widget.NestedScrollView>

    <android.support.design.widget.FloatingActionButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="16dp"
        android:clickable="true"
        android:src="@drawable/heart_on"
        app:layout_anchor="@id/appbar"
        app:layout_anchorGravity="bottom|right|end" />
</android.support.design.widget.CoordinatorLayout>
</com.github.ppamorim.dragger.DraggerView>

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0