Square layout for android.
It only inherits from ConstraintLayout
.
I did not see the need to create many for each ViewGroup since it would make the library big and providing many classes you wouldn't use 😃
Gradle
dependencies {
implementation 'com.revosleap.squarelayout:squarelayout:1.0.0'
}
Maven
<dependency>
<groupId>com.revosleap.squarelayout</groupId>
<artifactId>squarelayout</artifactId>
<version>1.0.0</version>
<type>pom</type>
</dependency>
XML
<com.revosleap.SquareLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/square"
xmlns:app="http://schemas.android.com/apk/res-auto">
<ImageView .../>
<TextView .../>
</com.revosleap.SquareLayout>
Kotlin
val squareLayout = findViewById(R.id.square)
// you can then do anything you'd do with a constraintLayout
SquareLayout squareLayout = (SquareLayout) findViewById(R.id.square)
// you can then do anything you'd do with a constraintLayout
All the methods provided by the library are:
All the methods provided by ConstraintLayout. 😉
- Fork
- Create feature branch:
git checkout -b my-feature-branch
- Commit changes:
git commit -am 'new awesome feature'
- Push to the branch:
git push origin my-feature-branch
- Submit a pull request
Made with ❤️ by Kevin Kiprotich
MIT License
Copyright (c) 2018 Kevin Kiprotich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.