Code Monkey home page Code Monkey logo

material-expansion-panel's Introduction

Hi there ๐Ÿ‘‹

Im an Android Engineer based in Yerevan, Armenia. I'm also a contributor and creator of some great open-source projects. In 2015 I've created the A2B Transport app, which is a public transport companion app and reached 50000+ downloads.

Find more in https://robertlevonyan.com

Robert's GitHub stats

material-expansion-panel's People

Contributors

robertlevonyan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

material-expansion-panel's Issues

Library code includes app icons

The library build includes app icons, which makes compilation fail for the project which is included into, because of a manifest merger error, as shown below:

C:\Users\Guillermo\...\app\src\main\AndroidManifest.xml:42:9-41 Error:
	Attribute application@icon value=(@mipmap/...) from AndroidManifest.xml:42:9-41
	is also present at [com.robertlevonyan.view:MaterialExpansionPanel:2.0.8] AndroidManifest.xml:13:9-43 value=(@mipmap/ic_launcher).
	Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest.xml:39:5-244:19 to override.
C:\Users\Guillermo\...\app\src\main\AndroidManifest.xml:45:9-46 Error:
	Attribute application@roundIcon value=(@mipmap/...) from AndroidManifest.xml:45:9-46
	is also present at [com.robertlevonyan.view:MaterialExpansionPanel:2.0.8] AndroidManifest.xml:15:9-54 value=(@mipmap/ic_launcher_round).
	Suggestion: add 'tools:replace="android:roundIcon"' to <application> element at AndroidManifest.xml:39:5-244:19 to override.

Icons shouldn't be included if the project is an Android libary.

Workaround: If you're using this library, and you're affected with this issue, you have to add the following line to your AndroidManifest.xml in your <application /> node: tools:replace="android:icon,android:roundIcon"

Problem with dynamic resizing

First, thank you for the solution. I am enjoying using it, but it looks like there is a bug related to dynamic resizing.
When the content view has child components that resizes automatically, like multiline TextInputEditText or RecyclerView, the panel expanded is not automatically resized, hiding its child components. I can't call the expand method programatically because it's a private method.
Can you help me?
Thank you!

Nested recyclerview

Hi, I've been having trouble trying to add a recyclerview inside the expandable content layout.

If I have normal views it works fine, however when I add a recyclerview, it doesn't recalculate the size of the expandable view and it ends up cutting off other views inside.

Here is my code for the expandable layout, the part that doesn't work is the recyclerTeam1 and recyclerTeam2:

<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginBottom="10dp"
    app:cardCornerRadius="8dp"
    app:cardElevation="5dp"
    android:orientation="vertical">

    <com.robertlevonyan.views.expandable.Expandable
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:exp_animateExpand="true"
        app:exp_backgroundColor="#21242d">

        <LinearLayout
            android:id="@+id/header"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_gravity="center"
            android:layout_marginStart="10dp"
            android:weightSum="3">

            <TextView
                android:id="@+id/date"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1.1"
                android:gravity="center"
                android:textAlignment="center"
                android:textColor="#FFF"
                android:textSize="14sp" />

            <TextView
                android:id="@+id/type"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="0.7"
                android:gravity="center"
                android:textAlignment="center"
                android:textColor="#FFF"
                android:textSize="14sp" />

            <TextView
                android:id="@+id/map"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1.2"
                android:gravity="center"
                android:textAlignment="center"
                android:textColor="#FFF"
                android:textSize="14sp" />
        </LinearLayout>

        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/content"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#32353e"
            android:orientation="vertical">
            
            <TextView
                android:id="@+id/title"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:textAlignment="center"
                android:layout_marginTop="5dp"
                android:layout_marginBottom="5dp"
                android:textColor="#FFF"
                android:textSize="14sp"
                android:text="Teams"
                app:layout_constraintTop_toTopOf="parent"
                app:layout_constraintBottom_toTopOf="@id/teams"
                />

            <LinearLayout
                android:id="@+id/teams"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="5dp"
                android:layout_weight="2"
                android:orientation="horizontal"
                app:layout_constraintTop_toBottomOf="@+id/title"
                app:layout_constraintBottom_toTopOf="@id/recyclers">

                <TextView
                    android:id="@+id/team1"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:gravity="center"
                    android:layout_weight="1"
                    android:textAlignment="center"
                    android:textColor="#FFF"
                    android:textSize="14sp" />

                <TextView
                    android:id="@+id/team2"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:gravity="center"
                    android:textAlignment="center"
                    android:textColor="#FFF"
                    android:textSize="14sp" />
            </LinearLayout>

            <LinearLayout
                android:id="@+id/recyclers"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="2"
                android:orientation="horizontal"
                app:layout_constraintTop_toBottomOf="@id/teams"
                app:layout_constraintBottom_toBottomOf="parent">

                <androidx.recyclerview.widget.RecyclerView
                    android:id="@+id/recyclerTeam1"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:layout_gravity="center"
                    app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
                    android:padding="5dp" />

                <androidx.recyclerview.widget.RecyclerView
                    android:id="@+id/recyclerTeam2"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:layout_gravity="center"
                    app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
                    android:padding="5dp" />
            </LinearLayout>
        </androidx.constraintlayout.widget.ConstraintLayout>

    </com.robertlevonyan.views.expandable.Expandable>

</androidx.cardview.widget.CardView>

Here are some screenshots:

No recyclerviews:
228807469_5835224823216312_3020479327798093259_n

With recyclerviews:
229394309_585542399497455_5588224295292134955_n

Only one Expanded Child At Time

How can I have only one expanded at time means in All Adapter at a time only one child can expand ?
How can I achieve this ?

Only One Child Expanded At Time ?

How can I have only one expanded at time means in Recycler Adapter at a time only one child can expand ?
Please Help me out...
Manually don't know how to do so...?

See AppCompatDelegate.setCompatVectorFromResourcesEnabled() Android 4.4

android.content.res.Resources$NotFoundException: File res/drawable/ic_down.xml from drawable resource ID #0x7f080128. If the resource you are trying to use is a vector resource, you may be referencing it in an unsupported way. See AppCompatDelegate.setCompatVectorFromResourcesEnabled() for more info.
at android.content.res.Resources.loadDrawable(Resources.java:2101)
at android.content.res.Resources.getDrawable(Resources.java:700)
at androidx.core.content.ContextCompat.getDrawable(ContextCompat.java:457)
at com.robertlevonyan.views.expandable.Expandable.createExpandIcon(Expandable.kt:150)
at com.robertlevonyan.views.expandable.Expandable.creteHeader(Expandable.kt:116)
at com.robertlevonyan.views.expandable.Expandable.buildView(Expandable.kt:107)
at com.robertlevonyan.views.expandable.Expandable.onFinishInflate(Expandable.kt:94)

Build error with custom app icon name

Manifest merger failed : Attribute application@icon value=(@drawable/myappicon) from AndroidManifest.xml:18:9-57
	is also present at [com.robertlevonyan.view:MaterialExpansionPanel:2.0.10] AndroidManifest.xml:13:9-43 value=(@mipmap/ic_launcher).
	Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest.xml:15:5-74:19 to override.

After adding 'tools:replace="android:icon"' to manifest,build throws another error
P:\myproject\app\build\intermediates\packaged_manifests\debug\AndroidManifest.xml:23: AAPT: error: resource mipmap/ic_launcher_round (aka com.myapp:mipmap/ic_launcher_round) not found.

Hide Expandable Icon

how can one hide Expandable Icon ?
Or Expandable View without Expandable Icon ?

ExpandingListener

where you define your ExapandingListener? I can`t find that code.

Max height issue

Hi
the panel is really great ! sadly i face some issue as the inner ChipGroup doesn't grow as it does without this ExpansionPanel...
when adding a number of Chips inside the ChipGroup , i can't see more than the 1st line of chips ...

i know i didn't use the include, but that seemed to work as below...

anything i miss ?
thanks a lot !

my xml:

<com.robertlevonyan.views.expandable.Expandable
android:id="@+id/expandable"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
app:exp_backgroundColor="@color/colorPrimary"
app:exp_headerBackgroundColor="@android:color/white"
app:layout_constrainedHeight="false">

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="labels" />

            <com.google.android.material.chip.ChipGroup
                android:id="@+id/chipslayout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

            </com.google.android.material.chip.ChipGroup>

        </com.robertlevonyan.views.expandable.Expandable>

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.