Skip to content
No description, website, or topics provided.
Java
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gradle
.idea
app
gradle/wrapper
sidebyside
Development-sidebyside.iml
README.md
Screenshot_2019-02-28-12-50-23.png
Screenshot_20190416-162113.png
build.gradle
gradle.properties
gradlew
gradlew.bat
local.properties
settings.gradle
sidebyside-master.iml

README.md

Project Status: Active – The project has reached a stable, usable state and is being actively developed. GitHub stars

Side By Side View

Play Store Demo Here

This is a simple merged view to easily display two inputs with labels side by side. When screen size is too small the view will move to a vertical alignment.

Landscape

Example

Usage

dependencies {
    api 'com.github.jampez77:sidebyside:1.0.50'
}

Then in your activity's XML:

<LinearLayout 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="match_parent"
    android:orientation="vertical">

    <com.jampez.sidebyside.SideBySideView
        android:id="@+id/names"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:leftText="@string/first_name"
        app:rightText="@string/last_name"
        app:textAppearance="?android:attr/textAppearanceMedium"
        android:padding="5dp"
        android:layout_marginBottom="10dp"
        app:textViewTextStyle="bold"
        app:leftInput="EditText"
        app:rightSpinnerEntries="@array/planets_array"
        app:rightInput="Spinner"
        app:leftEditInputType="textPersonName"
        app:rightEditInputType="textPersonName"/>
            
</LinearLayout>

Overview

The view is split into two views. They are laid out horizontally unless using a small screen, in which case they are laid out vertically. Each view has a label and an input. The inputs can be a TextView, Spinner, Checkbox, EditText, Time or DateTime. Each input used has a corresponding listener this would be either OnItemSelectedListener, OnCheckedChangeListener or TextWatcher respectively. The listener used will return the String value of the input.

Options

  • leftText/rightText - text value for label and EditText hint
  • textAppearance - set left and right text appearance
  • textViewTextStyle - set Typeface for left/right labels
  • editTextTextStyle - set TypeFace for left/right EditTexts
  • leftInput/rightInput - set input method
  • leftEditInputType/rightEditInputType - set InputType for left/right EditTexts
  • leftSpinnerEntries/rightSpinnerEntries - set left/right spinner items
  • leftEditTextText/rightEditTextText - set left/right EditText Text
  • leftEditTextHint/rightEditTextHint - set left/right EditText hint
  • hideRightView - turn view into single input with label by hiding right side
  • leftRequired/rightRequired - force input to be required for validation
  • passwordValidationExpression - Regular expression for password validation
  • passwordErrorMessage - Error message to display when password validation fails
  • leftInputEnabled/rightInputEnabled - disable/enable input
  • leftPadding/rightPadding - override padding size
  • leftBackground/rightBackground - use custom background for inputs
  • leftHideTitle/rightHideTitle - hide title in favour of displaying just the input
  • leftTextViewInputType/rightTextViewInputType - force lower TextView to uppercase, lowercase, cap_words or cap_sentences
  • titleTextColor/inputTextColor - customise text colors
You can’t perform that action at this time.