All Projects → Faltenreich → Textinputview

Faltenreich / Textinputview

Licence: apache-2.0
Permanent hint for EditText

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Textinputview

Viewtooltip
A fluent tooltip for Android
Stars: ✭ 1,029 (+3857.69%)
Mutual labels:  edittext, hint
Maskara
A simple way to format text fields without getting affected by input filters
Stars: ✭ 515 (+1880.77%)
Mutual labels:  edittext
Text-Length-Bar
No description or website provided.
Stars: ✭ 31 (+19.23%)
Mutual labels:  edittext
Autocomplete
Simple yet powerful autocomplete behavior for EditTexts, to avoid working with MultiAutoCompleteTextView APIs.
Stars: ✭ 307 (+1080.77%)
Mutual labels:  edittext
currency edittext
Simple currency formatter for Android EditText
Stars: ✭ 64 (+146.15%)
Mutual labels:  edittext
Pinview
A PIN view library for Android. Use to enter PIN/OTP/password etc.
Stars: ✭ 387 (+1388.46%)
Mutual labels:  edittext
RotatableAutofitEditText
Extended EditText which allows to move, rotate and resize text at the same time
Stars: ✭ 51 (+96.15%)
Mutual labels:  edittext
Rxmarkdown
📠Markdown for Android, supports TextView && EditText (Live Preview), supports code high light.
Stars: ✭ 714 (+2646.15%)
Mutual labels:  edittext
Xedittext
XEditText: clear contents easily; show/hide password; separeta contents automatically, such as credit card number; disable Emoji inputs; 带删除功能的EditText;显示或者隐藏密码;可设置自动添加分隔符分割电话号码、银行卡号等;支持禁止Emoji表情符号输入。
Stars: ✭ 474 (+1723.08%)
Mutual labels:  edittext
Hint
💡 A hinting engine for the web
Stars: ✭ 3,280 (+12515.38%)
Mutual labels:  hint
Spedittool
An efficient and scalable library for inputing and displaying gif or @mention on graph-text mixed TextView/EditText
Stars: ✭ 292 (+1023.08%)
Mutual labels:  edittext
Bankcardformat
💳 自动格式化银行卡号的EditText,卡号格式化、归属银行及卡别判断
Stars: ✭ 273 (+950%)
Mutual labels:  edittext
Edittext Mask
The custom masks for EditText. The solution for input phone numbers, SSN, and so on for Android
Stars: ✭ 413 (+1488.46%)
Mutual labels:  edittext
jsPanel3
A jQuery Plugin to create highly configurable floating panels, modals, tooltips, hints/notifiers or contextmenus for use in a backend solution and other web applications.
Stars: ✭ 89 (+242.31%)
Mutual labels:  hint
Tmux Fingers
copy pasting in terminal with vimium/vimperator like hints.
Stars: ✭ 556 (+2038.46%)
Mutual labels:  hint
CustomEditText
Simple Custom EditText for Android like Instagram
Stars: ✭ 23 (-11.54%)
Mutual labels:  edittext
Editdrawabletext
EditDrawableText - An EditText which makes your Drawable Clickable
Stars: ✭ 288 (+1007.69%)
Mutual labels:  edittext
Marlin Config
Marlin firmware instant configurator
Stars: ✭ 327 (+1157.69%)
Mutual labels:  hint
Textfieldboxes
Material Design text field that comes in a box, based on (OLD) Google Material Design guidelines.
Stars: ✭ 760 (+2823.08%)
Mutual labels:  edittext
Gsyricktext
类似微博的emoji表情、@人、话题等的EdiText,优化了编辑框中的光标点击和删除处理。TextView支持emoji表情、话题、链接、电话和@某人特殊显示的文本。
Stars: ✭ 651 (+2403.85%)
Mutual labels:  edittext

TextInputView

Download API Android Arsenal

A different approach to the TextInputLayout

Instead of preserving extra space for repositioning its hint, the TextInputView will place it into the embedded EditText. The Material Design Guidelines are being respected by adapting primary- and accent colors as well as the style of the target hint.

Preview

Features

  • More space for you: Reduce the extra space for a permanent hint to an absolute minimum
  • Customization: Adjust textSize, textColor, padding and overlap action of the hint
  • Gravity: Support for Gravity.START (Gravity.LEFT), Gravity.END (Gravity.RIGHT) - and even Gravity.CENTER
  • Compound drawables: Support for setError() and other compound drawables
  • RTL: Support for right-to-left configurations
  • Minimum footprint: No dependencies (other than org.jetbrains.kotlin:kotlin-stdlib-jre7)

Getting Started

Gradle
dependencies {
    implementation 'com.faltenreich:textinputview:1.0.2'
}
XML
<com.faltenreich.textinputview.TextInputView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:overlapAction="push">
    
    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="Every pixel counts"/>
        
</com.faltenreich.textinputview.TextInputView>
Java
public class MainActivity extends AppCompatActivity {
    
    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        TextInputView textInputView = new TextInputView(editText);
    }
}

Kotlin
class MainActivity : AppCompatActivity() {
    
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        
        val textInputView = TextInputView(editText)
    }
}

Configuration

Property Type Description
android:textColor color Applied when the embedded EditText loses focus (defaults to textColor of the hint)
android:textSize dimension Text size of the hint (defaults to textSize of the hint)
android:tint color Applied when the embedded EditText gets focused (defaults to tint of the hint)
overlapAction enum Applied when the input of the embedded EditText overlaps the hint (options: push, toggle) (defaults to toggle)

FAQ

Why this library?

I adore the Material Design Guidelines. For me they are an incredible source of wisdom for non-designers. No longer do I have to spent dozens of hours for the fine details of my user interfaces. Now I have more time to do the thing I love the most: developing sourcecode that keeps everything together.

The InputTextLayout is one of the many fine Material Design Components. It helps users navigating a form by providing a permanent hint. One particular problem with the InputTextLayout is the additional screen space it preserves for positioning its hint. Not only does this lead to vertically larger user interfaces, but the preserved space stays completely empty until a user input has been given - and is therefor temporarily useless.

How does the TextInputView work?

The TextInputLayout wraps a given EditText and replaces its hint with a TextView that stays within the bounds of the original view. Therefor it does not preserve additional screen space and stays there as long as it fits into the original EditText alongside the user input - otherwise it will be pushed to the side (or optionally be hidden immediately). The latter should rarely occur as the user input of most forms stays relatively short.

What about gravity?

The gravity of the embedded EditText may be set to Gravity.START, Gravity.END, Gravity.CENTER - or to the obsolete Gravity.LEFT and Gravity.RIGHT, if you insist. The hint of the TextInputView will adjust accordingly and either be moved to the left or right to make place for the user input.

What about EditText.setError() or other compound drawables?

The hint of the TextInputView will be positioned right before (drawableEnd) or after (drawableStart) a compound drawable, including its compoundDrawablePadding.

What about RTL?

Right-to-left input is supported throughout using the Android resource system (res/values-ldrtl). The calculations are flipped in order to respect the inverted alignments.

License

Copyright 2018 Philipp Fahlteich

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.

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