This is a simple library that helps you use all of your classic android widget.Views with an extra attribute, the aspectRatio. You can use aspectRatio byWidth or byHeight. If you have any questions or suggestions, please don't hesitate to send me an e-mail, enjoy!
======================= Fork the repository and include the 'library' module and you are done :) AAR File coming to soon to maven central near you ;)
Or use JitPack: https://jitpack.io/#ptsiogas4/AspectRatioLayout
repositories {
maven { url 'https://jitpack.io' }
}
compile 'com.github.ptsiogas4:AspectRatioLayout:1.0.0'
RatioLinearLayout ratioLinearLayout = ...
ratioLinearLayout.setAspectRatio(2);
Attribute | Description |
aspectRatio | This parameter indicates the proportion of the size Height or Width. Default is Width |
ratioType | This parameter indicates that the ratio is calculated byWidth Or byHeight. Default is byWidth |
- RatioLinearLayout
- RatioFrameLayout
- RatioRelativeLayout
- RatioGridLayout
- RatioImageButton
- RatioImageView
- RatioTextView
- RatioGridView
- RatioListView
- RatioButton
- RatioCheckBox
- RatioCheckedTextView
- RatioEditText
- RatioProgressBar
- RatioRadioButton
- RatioRadioGroup
ptsiogas - [email protected]
Copyright [2017] ptsiogas
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.