FlipLayout


Source link: https://github.com/cmfsotelo/FlipLayout

FlipLayout

Use the FlipLayout as a ViewGroup to easily swap between child views.

Include in your project

In your root/build.gradle

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

In your app/build.gradle

dependencies {
  compile 'com.github.cmfsotelo:fliplayout:latest.version.here' 
}

Usage

Simply use the FrameLayout public methods to change which view is visible.
/** * Shows the child next to the one being shown, animating it. If the current child is the last one, the first child shown. */ public void showNextChild();
  /** * Shows the child previous to the one being shown, animating it. If the current child is the first one, the last child shown. */ public void showPreviousChild() ;  /** * Sets the target child as the visible one. Can be animated or not. When animated, it animates from the current visible child immediately to the target one. * * @param targetChild - the target child * @param animate
  - flag to make the transition animating it or not */ public void showChild(int targetChild, boolean animate) 

Examples (click image to expand code)

Use to simply flip one view with another

<com.csot.fliplayout.lib.FlipLayout android:id="@+id/fliplayout2" android:layout_width="wrap_content" android:layout_height="wrap_content" app:transition="FLIP_X">
<TextView

android:layout_width="match_parent"

android:layout_height="match_parent"

android:layout_margin="10dp"

android:background="@drawable/circle"

android:backgroundTint="#4286f4"

android:gravity="center"

android:padding="20dp"

android:text="G"

android:textColor="#fff"

android:textSize="40dp"/>
<ImageView

android:layout_width="match_parent"

android:layout_height="match_parent"

android:layout_margin="10dp"

android:background="@drawable/circle"

android:backgroundTint="#555"

android:gravity="center"

android:padding="20dp"

android:src="@drawable/ic_done_black_48dp"

android:textStyle="bold"

android:tint="#fff"/> </com.csot.fliplayout.lib.FlipLayout>

OR

Use to swap over several views

<com.csot.fliplayout.lib.FlipLayout android:id="@+id/fliplayout4" android:layout_width="wrap_content" android:layout_height="wrap_content" app:transition="TRANSLATE_Y">
<TextView

android:layout_width="wrap_content"

android:layout_height="match_parent"

android:layout_gravity="center"

android:layout_margin="10dp"

android:background="#4286f4"

android:gravity="center"

android:padding="20dp"

android:text="FirstView"

android:textColor="#fff"

android:textSize="20dp"/>
<TextView

android:layout_width="wrap_content"

android:layout_height="match_parent"

android:layout_gravity="center"

android:layout_margin="10dp"

android:background="#6016f4"

android:gravity="center"

android:padding="20dp"

android:text="SecondView"

android:textColor="#fff"

android:textSize="20dp"/>
<TextView

android:layout_width="wrap_content"

android:layout_height="match_parent"

android:layout_gravity="center"

android:layout_margin="10dp"

android:background="#f18614"

android:gravity="center"

android:padding="50dp"

android:text="ThirdView"

android:textColor="#fff"

android:textSize="50dp"/> </com.csot.fliplayout.lib.FlipLayout>

Customization

Attribute Type Description Default
startingChild int First visible child 0
transitionDuration int The ending angle for button disposition 200
transition enum The type of the transition, one of: FADE, FLIP_X, FLIP_Y, TRANSLATE_X, TRANSLATE_Y, FLIP_Z1, FLIP_Z2 FLIP_Y

Resources

RoundedLetterView looks like the one in Android 5.0 Contacts app.

Attributes:

  • titleText - The text in the first row.
  • titleSize - The size of the first row text.
  • titleColor - The color of the first row text.
  • backgroundColorValue - the color between the circle and the stroke.

ObservableScrollView is an Android library to observe scroll events on scrollable views.

It's easy to interact with the Toolbar introduced in Android 5.0 Lollipop and may be helpful to implement look and feel of Material Design apps.

AutoFitTextView is a TextView that automatically fit its font and line count based on its available size and content.

Allows to perform various simple operations on bitmaps via JNI , while also providing some protection against OOM using the native Java environment on Android.

Features:

  • store/restore bitmaps to/from JNI.
  • rotate CW/CCW 90, 180, 270 degrees.
  • crop image
  • scale image using either "Nearest-Neighbor" algorithm or "Bilinear-Interpolation" algorithm.

This library enables you to create a window icon similar to Facebooks chat icon, and also similar to the Link Bubble app.

Magnet takes care of all the touching and dragging of the window icon, leaving you with callbacks so you can save your time doing the important stuff.

A simple subclass of android's TextView that counts up or down.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes