Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

pierrre/Android-FixedRatio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Android FixedRatio Library

This library allows to resize a view using a ratio.

Features

  • Resize a view using a ratio
  • Resize policies: crop, fit, width or height

Compatibility

This library is compatible from API 8 (Android 2.2), but it should work on previous versions.

Usage

Add the View to the layout:

<org.pierrre.fixedratio.FixedRatioView xmlns:fixedratio="http://schemas.android.com/apk/res-auto"
    android:layout_width="100dp"
    android:layout_height="100dp"
    fixedratio:ratio="2" >

<!-- Your views here, it's a FrameLayout -->

</org.pierrre.fixedratio.FixedRatioView>

You can also define the ratio using both fixedratio:ratio_horizontal and fixedratio:ratio_vertical attributes.

There are several resize policies: crop (default), fit, width and height. Change it with the fixedratio:policy attribute.

Contact

About

NOT MAINTAINED

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages