SquareLayout
Provide a wrapper class for creating Square dimensioned ViewGroups of the various layouts used in Android.
Usage
Add dependencies to your module's build.gradle
:
dependencies {
compile 'com.github.kaushikthedeveloper:squarelayout:0.0.3'
}
Add the different SquareLayoutViews to your layout (Minimalistic Layout shown below) :
<com.kaushikthedeveloper.squarelayout.SquareLinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
The min version for Support Library
requires version "26.+"
Features :
- Square Layout dimensions calculated before View is rendered.
- No extra cost, nor any re-rendering processes involved.
- Basic Layout methods remain untouched and can be accessed.
Square Layouts Supported :
- SquareFrameLayout
- SquareGridLayout
- SquareLinearLayout
- SquareRelativeLayout
- SquareTableLayout
SquarePercentFrameLayout(deprecated)SquarePercentRelativeLayout(deprecated)
Note : the Preview of the XML for SquareLayouts is broken for the moment (due to the method used for rendering perfect Square in all situations), though this in no way affects the Performance nor the rendering of the Layouts.