All Projects → wayfair-incubator → Panel Layout

wayfair-incubator / Panel Layout

Licence: bsd-2-clause
Panel Layout is a UI library for Android that allows you to display a floating and resizable panel that can also snap to the edges.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Panel Layout

Literate Calc Mode.el
🧮 Literate programming for M-x calc
Stars: ✭ 201 (-1.47%)
Mutual labels:  hacktoberfest
Puppet Python
Puppet module for installing and managing Python, pip, virtualenvs and Gunicorn virtual hosts.
Stars: ✭ 202 (-0.98%)
Mutual labels:  hacktoberfest
Azure Sdk For Net
This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
Stars: ✭ 3,079 (+1409.31%)
Mutual labels:  hacktoberfest
Mezzio
PSR-15 Middleware Microframework
Stars: ✭ 202 (-0.98%)
Mutual labels:  hacktoberfest
Openml Python
Python module to interface with OpenML
Stars: ✭ 202 (-0.98%)
Mutual labels:  hacktoberfest
Desafio333
Repositório do #Desafio333 um desafio meio besta e bimestral para aprendermos juntos 💌
Stars: ✭ 203 (-0.49%)
Mutual labels:  hacktoberfest
Easybuild Easyconfigs
A collection of easyconfig files that describe which software to build using which build options with EasyBuild.
Stars: ✭ 200 (-1.96%)
Mutual labels:  hacktoberfest
Panther
A browser testing and web crawling library for PHP and Symfony
Stars: ✭ 2,480 (+1115.69%)
Mutual labels:  hacktoberfest
Shellshare
Live terminal broadcasts
Stars: ✭ 202 (-0.98%)
Mutual labels:  hacktoberfest
Pest
Pest is an elegant PHP Testing Framework with a focus on simplicity
Stars: ✭ 3,712 (+1719.61%)
Mutual labels:  hacktoberfest
Autarky
Liberating disk space from 📁 node_modules
Stars: ✭ 203 (-0.49%)
Mutual labels:  hacktoberfest
Openfoodfacts Ios
Native (Swift) version of Open Food Facts for iOS. Coders & Decoders welcome 🤳🥫 😊
Stars: ✭ 202 (-0.98%)
Mutual labels:  hacktoberfest
Twire
Twire is an alternative and open source Twitch client for Android
Stars: ✭ 204 (+0%)
Mutual labels:  hacktoberfest
Cypress Terminal Report
Better terminal and file output for cypress test logs.
Stars: ✭ 200 (-1.96%)
Mutual labels:  hacktoberfest
Cep Promise
Busca por CEP integrado diretamente aos serviços dos Correios, ViaCEP e outros (Node.js e Browser)
Stars: ✭ 2,483 (+1117.16%)
Mutual labels:  hacktoberfest
Apt
Development repository for the apt cookbook
Stars: ✭ 201 (-1.47%)
Mutual labels:  hacktoberfest
Keiko Corp
HTML challenge for Hacktoberfest 2020
Stars: ✭ 203 (-0.49%)
Mutual labels:  hacktoberfest
Generator Awesome List
😎 Yeoman generator for GitHub awesome lists
Stars: ✭ 203 (-0.49%)
Mutual labels:  hacktoberfest
Rust
All Algorithms implemented in Rust
Stars: ✭ 4,562 (+2136.27%)
Mutual labels:  hacktoberfest
Streamdecksharp
A simple .NET wrapper for Stream Deck
Stars: ✭ 203 (-0.49%)
Mutual labels:  hacktoberfest

Panel Layout

CI

Panel Layout is a UI library for Android that allows you to display a floating and resizable panel that can also snap to the edges.

Panel Layout makes use of ConstraintLayout to lay out panel with rest of the content.

This library is inspired by a good iOS UI framework: PanelKit

Importing Panel Layout

Bintray

dependencies {
    implementation("com.wayfair.panellayout:panellayout:<latest-version>")
}

Note: Panel Layout is currently in alpha and the public API it offers is subject to heavy changes.

Panel Layout API

Define if the Panel Layout is visible

var panelVisible: Boolean

The command that put Panel Layout in one of the predefine Panel Positions. Possible panel positions are: LEFT_EDGE, RIGHT_EDGE, TOP_EDGE, BOTTOM_EDGE, NO_EDGE.

fun snapPanelTo(panelPosition: PanelPosition)

The command that put the Panel Layout in absolute position with coordinates x and y.

fun popPanelTo(x: Int, y: Int)

Define a listener to define actions on different kinds of events.

var panelLayoutCallbacks: PanelLayout.Callbacks?

interface Callbacks {
    fun beforeSnap(position: PanelPosition)
    fun afterSnap(position: PanelPosition)
    fun beforePop(popToX: Int, popToY: Int)
    fun afterPop(popToX: Int, popToY: Int)
    fun afterClose()
}

Panel Layout attributes

panel_content - Resource id of view where is placed the Panel Layout

panel_view - Resource id of view inside the Panel Layout

panel_move_handle - Resource id of view used for moving the Panel Layout inside of content view

panel_resize_enabled - Flag that defines if the Panel Layout is resizable

panel_snap_to_edges - Define edges where the Panel Layout could be snapped. Possible values: all, none, left, top, right and bottom

panel_start_height - Start height

panel_start_width - Start width

How to Use Panel Layout

Add Panel Layout in your layout:

<com.wayfair.panellayout.PanelLayout
        android:id="@+id/panelLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:panel_content="@id/content"
        app:panel_move_handle="@id/moveHandle"
        app:panel_resize_enabled="true"
        app:panel_resize_handle="@id/resizeHandle"
        app:panel_snap_to_edges="all"
        app:panel_start_height="300dp"
        app:panel_start_width="300dp"
        app:panel_view="@id/panel">

        <FrameLayout
            android:id="@+id/content"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="#f3e5f5">
        </FrameLayout>

        <com.google.android.material.card.MaterialCardView
            android:id="@+id/panel"
            android:layout_width="300dp"
            android:layout_height="300dp"
            app:cardBackgroundColor="@color/white">

            <FrameLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent">

                <View
                    android:id="@+id/moveHandle"
                    android:layout_width="match_parent"
                    android:layout_height="48dp"
                    android:background="#e1bee7" />

                <ImageView
                    android:id="@+id/resizeHandle"
                    android:layout_width="48dp"
                    android:layout_height="48dp"
                    android:layout_gravity="bottom|end"
                    android:padding="4dp"
                    android:src="@drawable/ic_resize"
                    app:tint="@color/divider" />
            </FrameLayout>
        </com.google.android.material.card.MaterialCardView>
    </com.wayfair.panellayout.PanelLayout>

Controls and listeners in the code:

panelLayout.panelVisible = !panelLayout.panelVisible
panelLayout.popPanelTo(100, 100)
panelLayout.snapPanelTo(PanelPosition.RIGHT_EDGE)
panelLayout.panelLayoutCallbacks = object : PanelLayout.Callbacks {
    override fun beforeSnap(position: PanelPosition) {
        TODO("Not yet implemented")
    }

    override fun afterSnap(position: PanelPosition) {
        TODO("Not yet implemented")
    }

    override fun beforePop(popToX: Int, popToY: Int) {
        TODO("Not yet implemented")
    }

    override fun afterPop(popToX: Int, popToY: Int) {
        TODO("Not yet implemented")
    }

    override fun afterClose() {
        TODO("Not yet implemented")
    }
}

LICENSE

Panel Layout is licensed under 2-clause BSD License

See LICENSE.md for details.

CONTRIBUTION

Panel Layout is open to contribution. See CONTRIBUTING.md for details

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].