Skip to content

An Android layout which splits the available space between child views

License

Notifications You must be signed in to change notification settings

ndori/android-split-pane-layout

 
 

Repository files navigation

Android Split Pane Layout

An Android layout which splits the available space between two child views. An optionally movable bar exists between the children which allows the user to redistribute the space allocated to each view.

Usage

Add a reference to the split-pane-layout library project, or copy the necessary files into your project. Add a SplitPaneLayout as follows:

<com.mobidevelop.spl.widget.SplitPaneLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:spl="http://schemas.android.com/apk/res-auto"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    spl:orientation="vertical"
    spl:splitterSize="12dip"
    spl:splitterPosition="33%"
    spl:splitterBackground="@drawable/splitter_bg_v"
    >
    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Child1" />
    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Child2" />
</com.mobidevelop.spl.widget.SplitPaneLayout>

NOTE: A SplitPaneLayout MUST have exactly two children.

Using with Gradle

SplitPaneLayout is published to Maven Central so can be easily added to your Gradle-based Android projects by adding the following entry to your dependencies:

dependencies {
    compile 'com.mobidevelop.spl:split-pane-layout:1.0.0'
}

Precompiled Demo APK

https://www.box.com/s/6yw9kekmq558wgbwan91

QR

About

An Android layout which splits the available space between child views

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%