Android-RatioFillLayout

A custom layout that fills given width or height as per the original ratio of each child.

License

License

GroupId

GroupId

com.github.bosphere.android-ratiofilllayout
ArtifactId

ArtifactId

ratiofilllayout
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

aar
Description

Description

Android-RatioFillLayout
A custom layout that fills given width or height as per the original ratio of each child.
Project URL

Project URL

https://github.com/bosphere/Android-RatioFillLayout
Source Code Management

Source Code Management

https://github.com/bosphere/Android-RatioFillLayout

Download ratiofilllayout

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.bosphere.android-ratiofilllayout/ratiofilllayout/ -->
<dependency>
    <groupId>com.github.bosphere.android-ratiofilllayout</groupId>
    <artifactId>ratiofilllayout</artifactId>
    <version>1.0.0</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.github.bosphere.android-ratiofilllayout/ratiofilllayout/
implementation 'com.github.bosphere.android-ratiofilllayout:ratiofilllayout:1.0.0'
// https://jarcasting.com/artifacts/com.github.bosphere.android-ratiofilllayout/ratiofilllayout/
implementation ("com.github.bosphere.android-ratiofilllayout:ratiofilllayout:1.0.0")
'com.github.bosphere.android-ratiofilllayout:ratiofilllayout:aar:1.0.0'
<dependency org="com.github.bosphere.android-ratiofilllayout" name="ratiofilllayout" rev="1.0.0">
  <artifact name="ratiofilllayout" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.github.bosphere.android-ratiofilllayout', module='ratiofilllayout', version='1.0.0')
)
libraryDependencies += "com.github.bosphere.android-ratiofilllayout" % "ratiofilllayout" % "1.0.0"
[com.github.bosphere.android-ratiofilllayout/ratiofilllayout "1.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

Android-RatioFillLayout

A custom layout that fills given width or height as per the original ratio of each child.

If given width or height is exceeded, it largely replicates the behavior of LinearLayout.

What RatioFillLayout offers:

  • Orientation: horizontal, vertical
  • Gravity: top, bottom, left, right, center_horizontal, center_vertical

Usage

dependencies {
    compile 'com.github.bosphere.android-ratiofilllayout:ratiofilllayout:1.0.0'
}
<com.bosphere.ratiofilllayout.RatioFillLayout
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:rfl_orientation="horizontal"
    app:rfl_gravity="center_vertical">
    
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="123456"/>

</com.bosphere.ratiofilllayout.RatioFillLayout>

Compatibility

API 11 (Android 3.0) and up

License

Copyright 2017 Yang Bo

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.

Versions

Version
1.0.0