-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from btmccord/elevation-fix
Elevation Support
- Loading branch information
Showing
3 changed files
with
83 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
scalinglib/src/main/java/iammert/com/view/scalinglib/ScalingLayoutOutlineProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package iammert.com.view.scalinglib; | ||
|
||
import android.graphics.Outline; | ||
import android.view.View; | ||
import android.view.ViewOutlineProvider; | ||
|
||
/** | ||
* Created by mertsimsek on 08/01/2018. | ||
*/ | ||
public class ScalingLayoutOutlineProvider extends ViewOutlineProvider { | ||
|
||
private int width; | ||
private int height; | ||
private float radius; | ||
|
||
ScalingLayoutOutlineProvider(int width, int height, float radius) { | ||
this.width = width; | ||
this.height = height; | ||
this.radius = radius; | ||
} | ||
|
||
@Override | ||
public void getOutline(View view, Outline outline) { | ||
outline.setRoundRect(0, 0, width, height, radius); | ||
} | ||
|
||
public int getWidth() { | ||
return width; | ||
} | ||
|
||
public void setWidth(int width) { | ||
this.width = width; | ||
} | ||
|
||
public int getHeight() { | ||
return height; | ||
} | ||
|
||
public void setHeight(int height) { | ||
this.height = height; | ||
} | ||
|
||
public float getRadius() { | ||
return radius; | ||
} | ||
|
||
public void setRadius(float radius) { | ||
this.radius = radius; | ||
} | ||
} |