Skip to content

JoeTomkinson/Xama.JTPorts.MaterialTextField

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
 
 
 
 
 
 

Xama.JTPorts.MaterialTextField

platform API License: MIT

Namespace: Xama.JTPorts.MaterialTextField

Google Material Design - Xamarin.Android Text Field.

This is a ported build, converted from Java to C# for use with the Xamarin MonoFramework. There are only minor additions to the original library, these include the removal of various deprecated dependancies.


!gif


How to Install

NugetIcon

Simply add the following Nuget Package to your Xamarin.Android App, and ensure you have the latest AndroidX dependancies installed, if you don't the code will tell you which ones are missing.

  • Install using Package Manager:

Install-Package Xama.JTPorts.MaterialTextField -Version 1.0.2

  • Install .NET CLI:

dotnet add package Xama.JTPorts.MaterialTextField --version 1.0.2

Basic Usage

Create the control inside of your layout and wrap it around a single EditText control.

<Xama.JTPorts.MaterialTextField.MaterialTextField
        android:id="@+id/mtvInput"
        android:layout_marginTop="15dp"
        android:layout_width="300dp"
        android:layout_height="wrap_content"
        app:mtf_labelColor="@android:color/white"
        app:mtf_image="@drawable/iconemail">

        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="Email Address"
            android:inputType="textEmailAddress"
            android:textColor="@android:color/black"
            android:textSize="15sp" />

    </Xama.JTPorts.MaterialTextField.MaterialTextField>  

Available Attributes

You can supply the following attributes:

    <attr name="mtf_cardCollapsedHeight" format="dimension"/>
    <attr name="mtf_labelColor" format="color"/>
    <attr name="mtf_image" format="reference"/>
    <attr name="mtf_hasFocus" format="boolean"/>
    <attr name="mtf_animationDuration" format="integer"/>
    <attr name="mtf_openKeyboardOnFocus" format="boolean"/>
    <attr name="mtf_backgroundColor" format="color"/>

These mostly have default values should you decide not to supply them

Support 💎

If you want to support the work that I do and you find any of these libraries useful? Consider supporting it by joining stargazers for this repository. 🔭 🌠


or alternatively if you want to you can also buy me a coffee.

Buy Me A Coffee

You know, only if you want to.