All Projects → youkai-app → PlaceholderTextView

youkai-app / PlaceholderTextView

Licence: Apache-2.0 license
A custom TextView which shows placeholder lines given a sample text when it has no text set

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to PlaceholderTextView

Custom-Grid-View
Custom Drag and Drop Grid for Home Assistant
Stars: ✭ 103 (+329.17%)
Mutual labels:  custom-view
SoundLine
An Android custom view which offers an audio timeline controller as the SoundCloud Sound Wave
Stars: ✭ 53 (+120.83%)
Mutual labels:  custom-view
clearable-edittext
Simple custom view for clearable EditText.
Stars: ✭ 58 (+141.67%)
Mutual labels:  custom-view
YuanaItemSettingView
Customizable Item Setting View Android
Stars: ✭ 15 (-37.5%)
Mutual labels:  custom-view
flasto
A FLoating ASsistive TOuch library for android!
Stars: ✭ 15 (-37.5%)
Mutual labels:  custom-view
MarkDEditor
A WYSIWYG MarkDown editor for Android.
Stars: ✭ 76 (+216.67%)
Mutual labels:  custom-view
Android-Code-Demos
📦 Android learning code demos.
Stars: ✭ 41 (+70.83%)
Mutual labels:  custom-view
mCustomView
总结了博主这么多年所写的自定义view,以及自定义view的教程
Stars: ✭ 17 (-29.17%)
Mutual labels:  custom-view
MenuPopupView
一款仿iOS长按菜单弹窗的自定义控件
Stars: ✭ 26 (+8.33%)
Mutual labels:  custom-view
RxLoading
RxJava library for showing a loading (i.e. progress bar) state while waiting for async data with minimal effort and advanced options.
Stars: ✭ 49 (+104.17%)
Mutual labels:  custom-view
Image-Support
Add badge with counter to ImageView Android.
Stars: ✭ 128 (+433.33%)
Mutual labels:  custom-view
SkeletonPlaceholderView
A library for creating dynamic skeleton view
Stars: ✭ 25 (+4.17%)
Mutual labels:  custom-view
un-material-tab
(deprecated) Custom tab layout which can be used as a material TabLayout alternative and contains basic functionality which Google's TabLayout has.
Stars: ✭ 83 (+245.83%)
Mutual labels:  custom-view
SquaresLoadingView
A SquaresLoadingView based on android.View, nicely rotation、easy to use.
Stars: ✭ 26 (+8.33%)
Mutual labels:  custom-view
EasyMoney-Widgets
The widgets (EditText and TextView) for support of money requirements like currency, number formatting, comma formatting etc.
Stars: ✭ 91 (+279.17%)
Mutual labels:  custom-view
password-view
Android password animation
Stars: ✭ 43 (+79.17%)
Mutual labels:  custom-view
SocialOrbitLayout
Kotlin based custom view to show floating objects that can be used for social apps.
Stars: ✭ 28 (+16.67%)
Mutual labels:  custom-view
RecyclerViewCardGallery
RecyclerView实现循环banner,替代ViewPager方案。能够快速滑动并最终定位到居中位置(相比于原库支持了循环滑动)
Stars: ✭ 610 (+2441.67%)
Mutual labels:  custom-view
HeartBeatView
Simple custom view of a beating heart using scaling animation.
Stars: ✭ 44 (+83.33%)
Mutual labels:  custom-view
double-avatar-view
Instagram-like double avatar view with cropping
Stars: ✭ 31 (+29.17%)
Mutual labels:  custom-view

PlaceholderTextView

A custom TextView which shows placeholder lines given a sample text when it has no text set

Get apk

You give it some sample text, it calculates and draws equivalent placeholder lines. You then give it some text (.setText(...)), it automatically gets rid of the placeholder and shows your text.

Download

    compile 'app.youkai.placeholdertextview:library:1.1.1'

Note: You might have to add jcenter() to your repositories.

Usage

    <app.youkai.placeholdertextview.PlaceholderTextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textColor="@color/my_text_color"
            android:lines="2"
            android:maxLines="3"
            app:ptv_placeholderColor="@color/my_placeholder_color"
            app:ptv_sampleText="Lorem ipsum dolor sit amet" />
    placeholderTextView.setSampleText("Lorem ipsum dolor sit amet");
    int originalPlaceholderColor = placeholderTextView.getPlaceholderColor();
    placeholderTextView.setPlaceholderColor(getColor(R.colod.my_placeholder.color));

Yes, PlaceholderTextView does respect android:lines and android:maxLines attributes when displaying the placeholder lines.

Theming

By default, PlaceholderTextView uses the text color with 20% alpha. You can use app:ptv_placeholderColor="@color/... or ptv.setPlaceholdercolor(int) to set your own color.

License

Copyright (C) 2017 The Youkai Team

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.

Apache License Version 2.0 (LICENSE)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].