MCPcopy Index your code
hub / github.com/desnyki/InfinityMenu

github.com/desnyki/InfinityMenu @1.0.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.0.3 ↗ · + Follow
46 symbols 102 edges 4 files 3 documented · 7%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

InfinityMenu

GitHub license

InfinityMenu is an Android Library implementing an accordion style menu. You can place any view with any size in the menu. To close the menu you can drag to close or tap outside the menu. You can have only one menu open at a time.

Add it to your build.gradle with:

allprojects {
    repositories {
        maven { url "https://jitpack.io" }
    }
}

and:

dependencies {
    compile 'com.github.desnyki:InfinityMenu:1.0.0'
}

Demo

How to use:

You can look at the sample app to see how to use this library in detail.

In your layout create a FrameLayout which will hold the RootScrollView that contains the menu title bars. As well as the ChildScrollView that holds the menu item. It is important to set fillViewport for RootScrollView, and to set ChildScrollView as invisible.

 <FrameLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <infinitymenu.RootScrollView
        android:id="@+id/menu_scroll_view"
        android:layout_height="match_parent"
        android:layout_width="match_parent"
        android:fillViewport="true"
        >
    </infinitymenu.RootScrollView>
    <infinitymenu.ChildScrollView
        android:id="@+id/child_scroll_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:visibility="invisible"
        >
    </infinitymenu.ChildScrollView>
    </FrameLayout>

You can style and place menu title bars as children of the RootScrollView. If you want to animate the arrow like in the gif, you will need to have an element with tag "arrow" which will then spin 90 degrees based on state.

<RelativeLayout android:id="@+id/bar1" android:background="@drawable/bar"
    android:layout_width="match_parent" android:layout_height="64dp" android:orientation="horizontal">           
    <ImageView
        android:scaleType="fitCenter"
        android:layout_width="16dp"
        android:layout_height="16dp"
        android:layout_centerVertical="true"
        android:src="https://github.com/desnyki/InfinityMenu/raw/1.0.3/@drawable/arrow_right"
        android:layout_alignParentEnd="true"
        android:tag="arrow"
        android:layout_marginRight="8dp"
        />
</RelativeLayout>

In your main Activity you will have to get a reference to both the ChildScrollView and RootScrollView as well as the bar views.

childScrollView.setBackgroundScrollView(rootScrollView);
childScrollView.setCloseDistance(50);

RelativeLayout bar1 = (RelativeLayout) findViewById(R.id.bar1);
        bar1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                childScrollView.addView((LinearLayout) getLayoutInflater().inflate(R.layout.my_menu_item, null), 0, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
                childScrollView.openWithAnim(bar1,true,false);
            }
        });

.openWithAnim(param 1: title bar object, param 2: is child full screen, param 3: do you want to show the title bar if full screen) is the call that opens your accordion.

Core symbols most depended-on inside this repo

addView
called by 7
library/src/main/java/com/desnyki/library/infinitymenu/LayoutBase.java
openWithAnim
called by 4
library/src/main/java/com/desnyki/library/infinitymenu/LayoutBase.java
closeWithAnim
called by 4
library/src/main/java/com/desnyki/library/infinitymenu/LayoutBase.java
isOpen
called by 4
library/src/main/java/com/desnyki/library/infinitymenu/LayoutBase.java
isReadyForPull
called by 3
library/src/main/java/com/desnyki/library/infinitymenu/LayoutBase.java
isReadyForDragStart
called by 3
library/src/main/java/com/desnyki/library/infinitymenu/LayoutBase.java
isReadyForDragEnd
called by 3
library/src/main/java/com/desnyki/library/infinitymenu/LayoutBase.java
dp2px
called by 2
library/src/main/java/com/desnyki/library/infinitymenu/LayoutBase.java

Shape

Method 40
Class 5
Enum 1

Languages

Java100%

Modules by API surface

library/src/main/java/com/desnyki/library/infinitymenu/LayoutBase.java35 symbols
library/src/main/java/com/desnyki/library/infinitymenu/ChildScrollView.java5 symbols
library/src/main/java/com/desnyki/library/infinitymenu/RootScrollView.java3 symbols
app/src/main/java/com/desnyki/infinitymenuexample/MainActivity.java3 symbols

For agents

$ claude mcp add InfinityMenu \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact