nmilcoff / TriangleLabelView

C# port of https://github.com/shts/TriangleLabelView. Provides a super easy way to display a triangle label

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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!

NuGet Build Status

Contents

  1. Features
  2. Installation
  3. Supported OS & SDK versions
  4. Usage
  5. Customising
  6. License
  7. Credits
  • 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#!

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.

Android API lvl 1 ++

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" />

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
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.

The original library used LabelView library by Corer as a base for development.

About

C# port of https://github.com/shts/TriangleLabelView. Provides a super easy way to display a triangle label

License:Apache License 2.0


Languages

Language:C# 100.0%