This library help you to achieve popular tint effect from view.
U can check the sample app here.
You can download a .jar from GitHub's releases page.
Or use Gradle jCenter:
dependencies {
repositories {
mavenCentral()
maven {
url 'http://dl.bintray.com/gigamole/maven/'
}
}
compile 'com.github.gigamole.tintlayout:library:+'
}
Or Gradle Maven Central:
compile 'com.github.gigamole.tintlayout:library:1.0.2'
Or Maven:
<dependency>
<groupId>com.github.gigamole.tintlayout</groupId>
<artifactId>library</artifactId>
<version>1.0.2</version>
<type>aar</type>
</dependency>
TintLayout requires a minimum sdk version of 11.
You can set such parameters as:
-
colors:
allows you to create shadow with transparent etc.
-
angle:
allows you to set the angle of tint.
TintLayout must have child. Only one child.
The angle can only be positive and be in range from 0 to 360.
Check out in code init:
final TintLayout tintLayout = (TintLayout) findViewById(R.id.tint_layout);
tintLayout.setAngle(145);
And XML init:
<com.gigamole.tintlayout.lib.TintLayout
android:id="@+id/tint_layout"
android:layout_width="300dp"
android:layout_height="300dp"
android:layout_gravity="center"
android:background="@drawable/circle"
libs:colors="@array/tint_layout_colors">
<com.gigamole.tintlayout.AgencyTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="@string/tint_layout_title"
android:textColor="@color/white"
android:textSize="50sp"
libs:agencyFont="agency_bold" />
</com.gigamole.tintlayout.lib.TintLayout>
If you want to look at circular tint animation just remove comment block in sample from XML and MainActivity.
To report a specific problem or feature request, open a new issue on Github.
Apache 2.0. See LICENSE file for details.
Basil Miller - @gigamole