Note: This repository contains a port to C# of the original library, which is written in Java.
TriangleLabelView
A small widget that makes it super easy way to display a triangle label!
Contents
Features
- Right triangle with four edges support (top-left, top-right, bottom-left, bottom-right)
- Visual changes in runtime
- Two labels support
- Highly customizable
- Written in c#!
Installation
Nuget
Install-Package Xamarin.Android.TriangleLabelView
Manually
If you prefer not to use either of the aforementioned dependency managers, you can integrate TriangleLabelView into your project manually.
Supported OS & SDK versions
Android API lvl 1 ++
Usage
To see how the TriangleLabelView are added to your xml layouts, check the sample project.
<jp.shts.android.library.TriangleLabelView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
app:backgroundColor="@color/yellow_900"
app:corner="leftTop"
app:labelBottomPadding="5dp"
app:labelCenterPadding="0dp"
app:labelTopPadding="10dp"
app:primaryText="New"
app:primaryTextColor="@color/yellow_500"
app:primaryTextSize="16sp"
app:secondaryText="01"
app:secondaryTextColor="@color/yellow_100"
app:secondaryTextSize="11sp" />
Customising
In order to customise the TriangleLabelView appearance, you can play with the following attributes:
Property | Type | xaml name | Description |
---|---|---|---|
TopPadding |
float | labelTopPadding |
Padding between top and first label |
CenterPadding |
float | labelCenterPadding |
Padding between first and second label |
BottomPadding |
float | labelBottomPadding |
Padding between second label and bottom |
PrimaryText |
float | primaryText |
Text for the bottom label |
SecondaryText |
float | secondaryText |
Text for the top label |
PrimaryTextColor |
Android.Graphics.Color | primaryTextColor |
Text color for the bottom label |
SecondaryTextColor |
Android.Graphics.Color | secondaryTextColor |
Text color for the top label |
PrimaryTextSize |
float | primaryTextSize |
Text size for the bottom label |
SecondaryTextSize |
float | secondaryTextSize |
Text size for for the top label |
TriangleBackgroundColor |
float | backgroundColor |
Background color for the triangle view |
Corner |
Corner (enum) | corner |
Values: leftTop , rightTop , leftBottom , rightBottom . Sets the corner for the triangle view |
License
Copyright (C) 2018 Nicolas Milcoff
Copyright (C) 2016 Shota Saito
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.
Credits
The original library used LabelView library by Corer as a base for development.