Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

imbeerus/font-span-view

Repository files navigation

font-span-view

API License Android CI

Multi span TextView with custom fonts

Download

Download the latest release or grab via Gradle:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}
dependencies {
        implementation 'com.github.lndmflngs:font-span-view:1.0.2'
}

Usage

The simplest way is to use FontSpanView like a normal TextView

        <com.lockwood.multispan.font.FontTwoSpanView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:firstFont="roboto_medium.ttf"
            app:secondFont="roboto.ttf"
            app:firstText="Username"
            app:firstSeparator=":"
            app:orientation="vertical"
            app:secondText="Mr. Fluffypants" />

Styling

You can override setSpanOnResult and set custom spans on SpannableString

For more information see app directory

See also

Issue Tracking

Found a bug? Have an idea for an improvement? Feel free to add an issue

License

Copyright (C) 2020 Ivan Zinovyev (https://github.com/lndmflngs)
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.