cachapa / ExpandableLayout

An expandable layout container for Android
Apache License 2.0
2.34k stars 273 forks source link

flick UI #64

Closed ashkryab closed 6 years ago

ashkryab commented 6 years ago

https://youtu.be/ycs9BNGPOLk

<?xml version="1.0" encoding="utf-8"?> <layout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools">

<data>

    <variable
        name="presenter"
        type="com.selecto.verdict.app.login_screen.fragments.signup_interests.SignUpInterestsPresenter" />

</data>

<LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/backgroundColor" android:orientation="vertical">

<net.cachapa.expandablelayout.ExpandableLayout   **<---------------------------------**
    android:id="@+id/navigation_header_container"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:el_expanded="true"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent">

    <android.support.constraint.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp">

        <ImageView
            android:id="@+id/iv_back"
            android:layout_width="@dimen/dimen_40dp"
            android:layout_height="@dimen/dimen_40dp"
            android:layout_marginStart="@dimen/dimen_8dp"
            android:contentDescription="@string/description"
            android:padding="@dimen/dimen_8dp"
            android:src="@drawable/ic_back_button"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <TextView
            android:id="@+id/tv_signup_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:fontFamily="@font/pathway_gothic_one_regular"
            android:letterSpacing="0.1"
            android:text="@string/interests"
            android:textColor="@color/colorWhite"
            android:textSize="22sp"
            app:layout_constraintBottom_toBottomOf="@+id/iv_back"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="@+id/iv_back" />

        <TextView
            android:id="@+id/tv_interest_count"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="6dp"
            android:fontFamily="@font/pathway_gothic_one_regular"
            android:letterSpacing="0.1"
            android:textColor="@color/blue"
            android:textSize="22sp"
            app:layout_constraintBottom_toBottomOf="@+id/iv_back"
            app:layout_constraintStart_toEndOf="@+id/tv_signup_title"
            app:layout_constraintTop_toTopOf="@+id/iv_back" />
    </android.support.constraint.ConstraintLayout>
</net.cachapa.expandablelayout.ExpandableLayout>

<android.support.constraint.ConstraintLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:descendantFocusability="beforeDescendants"
    android:focusableInTouchMode="true">

    <net.cachapa.expandablelayout.ExpandableLayout
        android:id="@+id/done"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="8dp"
        android:layout_marginEnd="8dp"
        android:layout_marginTop="8dp"
        android:onClick="@{()->presenter.onDoneClick()}"
        android:orientation="horizontal"
        app:el_expanded="false"
        app:layout_constraintBottom_toBottomOf="@+id/search_bg"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="@+id/search_bg">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:fontFamily="@font/avenir_roman"
            android:text="@string/text_done"
            android:textColor="@color/colorWhite"
            android:textSize="16sp" />
    </net.cachapa.expandablelayout.ExpandableLayout>

    <View
        android:id="@+id/search_bg"
        android:layout_width="0dp"
        android:layout_height="50dp"
        android:layout_marginStart="16dp"
        android:layout_marginTop="16dp"
        android:background="@color/search_bg_color"
        app:layout_constraintEnd_toStartOf="@+id/done"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <ImageView
        android:id="@+id/search_icon"
        android:layout_width="20dp"
        android:layout_height="20dp"
        android:layout_marginStart="8dp"
        android:src="@drawable/ic_search"
        app:layout_constraintBottom_toBottomOf="@+id/search_bg"
        app:layout_constraintStart_toStartOf="@+id/search_bg"
        app:layout_constraintTop_toTopOf="@+id/search_bg" />

    <ImageView
        android:id="@+id/clear_icon"
        android:layout_width="20dp"
        android:layout_height="20dp"
        android:src="@drawable/ic_clear"
        app:layout_constraintBottom_toBottomOf="@+id/done"
        app:layout_constraintEnd_toEndOf="@+id/search_bg"
        app:layout_constraintRight_toRightOf="@id/search_bg"
        app:layout_constraintTop_toTopOf="@+id/done" />

    <EditText
        android:id="@+id/et_search"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginEnd="@dimen/dimen_8dp"
        android:layout_marginStart="@dimen/dimen_8dp"
        android:background="@color/tranparent"
        android:maxLines="1"
        android:onClick="@{()->presenter.startSearch()}"
        android:textColor="@color/colorWhite"
        app:layout_constraintBottom_toBottomOf="@id/search_bg"
        app:layout_constraintEnd_toStartOf="@id/clear_icon"
        app:layout_constraintStart_toEndOf="@id/search_icon"
        app:layout_constraintTop_toTopOf="@id/search_bg" />

    <TextView
        android:id="@+id/topic"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginEnd="8dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:text="@string/added_topics"
        android:textAllCaps="true"
        android:textColor="@color/hint_color"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/search_bg" />

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_marginBottom="8dp"
        app:layout_constraintBottom_toTopOf="@id/btn_create_acc"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/topic">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <com.wefika.flowlayout.FlowLayout
                android:id="@+id/fl_selected_chips"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:gravity="center">

            </com.wefika.flowlayout.FlowLayout>

            <com.wefika.flowlayout.FlowLayout
                android:id="@+id/fl_list_chips"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginTop="8dp"
                android:layout_weight="1"
                android:gravity="center"></com.wefika.flowlayout.FlowLayout>

        </LinearLayout>

    </ScrollView>

    <TextView
        android:id="@+id/btn_create_acc"
        android:layout_width="0dp"
        android:layout_height="56dp"
        android:layout_marginBottom="8dp"
        android:layout_marginEnd="16dp"
        android:layout_marginStart="16dp"
        android:background="@drawable/shape_diagonal_rounded_background_blue"
        android:fontFamily="@font/avenir_black"
        android:gravity="center"
        android:onClick="@{()->presenter.registration()}"
        android:text="@string/create_account"
        android:textAllCaps="false"
        android:textColor="@color/colorWhite"
        android:textSize="18sp"
        android:textStyle="bold"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent">

        <requestFocus />
    </TextView>

    <net.cachapa.expandablelayout.ExpandableLayout
        android:id="@+id/exp_search"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:background="@color/backgroundColor"
        app:el_parallax="0.5"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/search_bg">

        <android.support.v7.widget.RecyclerView
            android:id="@+id/rv_search"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layoutManager="android.support.v7.widget.LinearLayoutManager" />

    </net.cachapa.expandablelayout.ExpandableLayout>

</android.support.constraint.ConstraintLayout>

cachapa commented 6 years ago

Your layout file isn't valid. You also have many expandable layouts and it's unclear which of those are being expanded/collapsed during the animations.

From watching your video it doesn't seem that expandablelayout is to blame for the "flicking". It's either something in your code on in the complexity of your layout file. Please be also aware that ConstraintLayouts are still sometimes buggy so your problem might be related to that.

In any case I'm closing this report since the information here isn't enough to analyse the problem. Please try to reduce your code to as few lines as possible while still reproducing the problem. For more general Android help please try StackOverflow.