Oblique
With Oblique explore new styles of displaying images
Demo
Usage
include namespace
xmlns:app="http://schemas.android.com/apk/res-auto"
ObliqueView xml representation
<ak.sh.ay.oblique.ObliqueView
android:id="@+id/obliqueView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="20dp"
android:scaleType="centerCrop"
app:angle="LEFT_BOTTOM_TO_RIGHT_TOP"
android:src="@drawable/img"
app:basecolor="#2E3192"
app:startcolor="#D4145A"
app:endcolor="#FBB03B"
app:radius="18"
app:shadow_height="10"
app:ending_slant_angle="0"
app:starting_slant_angle="10"
app:type="linear_gradient" />
Change your Style by changing oblique type
app:type="image"
app:type="solid_color"
app:type="linear_gradient"
app:type="radial_gradient"
or can do all that by java
obliqueView.setType(Type.LINEAR_GRADIENT);
obliqueView.setStartColor(Color.parseColor("#D4145A"));
obliqueView.setEndColor(Color.parseColor("#FBB03B"));
obliqueView.setAngle(GradientAngle.LEFT_BOTTOM_TO_RIGHT_TOP);
obliqueView.setStartAngle(12);
obliqueView.setEndAngle(0);
obliqueView.setCornerRadius(15);
obliqueView.setShadow(10);
set multiple types in java among these
obliqueView.setType(Type.LINEAR_GRADIENT);
IMAGE, LINEAR_GRADIENT, RADIAL_GRADIENT, SOLID_COLOR
add radius and elevation by
obliqueView.setCornerRadius(15);
obliqueView.setShadow(10);
Download
compile 'com.fxn769:oblique:2.0'
or Maven:
<dependency>
<groupId>com.fxn769</groupId>
<artifactId>oblique</artifactId>
<version>2.0</version>
<type>pom</type>
</dependency>
or ivy:
<dependency org='com.fxn769' name='oblique' rev='2.0'>
<artifact name='oblique' ext='pom' ></artifact>
</dependency>
Snapshots of the development version are available in Sonatype's snapshots
repository.
License
Copyright 2017 Akshay Sharma 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.