biu,biu,一个有趣的EditText

Overview

BiuEditText

biu,biu,一个有趣的EditText

这俩天看到屌炸天的activate-power-mode,这可能有点和之前的动画触发有些区别,新脑洞,依赖键盘输入。但BiuEditText不是在模仿activate-power-mode,而是一个更屌炸世界的键盘,哪里有卖真想买一个。

帅

如果喜欢这个效果,欢迎提pr,搞点有趣的。

直接看效果

and

Usage

Step 1

Install with gradle
    dependencies {
        compile 'com.xujinyang.BiuEditText:library:1.4.1'
    }

Step 2

<me.james.biuedittext.BiuEditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:hint="biu,biu,发射1号"
    android:textColor="@android:color/white"
    app:biu_duration="800"
    app:biu_text_color="@android:color/white"
    app:biu_text_scale="1.5"
    app:biu_type="flydown"
    app:biu_text_start_size="12sp" />

####attrs:

参数 类型 含义
biu_duration int 动画时长
biu_text_color color 飞来飞去的文本颜色
biu_text_start_size dimension 文本原来大小
biu_text_scale float 文本放大倍数
biu_type String 动画类型:flyDown,flyup

Step 3

public class MainActivity extends AppCompatActivity {
    private BiuEditText editText;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        editText = (BiuEditText) findViewById(R.id.biucontainer);
    }
}

License

BiuEditText is opensource, contribution and feedback are welcomed

Apache Version 2.0

Copyright 2015 Supercharge

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.

About me

CSDN

weibo

Comments
  • setText(

    setText("")

    report : Caused by: java.lang.NullPointerException at me.james.biuedittext.BiuEditText.playFlyUp(BiuEditText.java:183) at me.james.biuedittext.BiuEditText.playAnaimator(BiuEditText.java:128) at me.james.biuedittext.BiuEditText.update(BiuEditText.java:110) at me.james.biuedittext.BiuEditText.access$100(BiuEditText.java:26) at me.james.biuedittext.BiuEditText$1.onTextChanged(BiuEditText.java:87) at android.widget.TextView.sendOnTextChanged(TextView.java:7079) at android.widget.TextView.setText(TextView.java:3550) at android.widget.TextView.setText(TextView.java:3405) at android.widget.EditText.setText(EditText.java:80) at android.widget.TextView.setText(TextView.java:3380)

    opened by sayhellotogithub 2
  • Show error

    Show error

    Hi, thanks you for this library but when use this library, show me this error :

    Process: com.tellfa.tasktodo, PID: 18083 android.view.InflateException: Binary XML file line #34: Error inflating class me.james.biuedittext.BiuEditText at android.view.LayoutInflater.createView(LayoutInflater.java:633) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743) at android.view.LayoutInflater.rInflate(LayoutInflater.java:806) at android.view.LayoutInflater.rInflate(LayoutInflater.java:809) at android.view.LayoutInflater.inflate(LayoutInflater.java:504) at android.view.LayoutInflater.inflate(LayoutInflater.java:414) at com.tellfa.tasktodo.DialogAdd.onCreateView(DialogAdd.java:45) at android.support.v4.app.Fragment.performCreateView(Fragment.java:1974) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1252) at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:738) at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1617) at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:517) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5349) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703) Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.newInstance(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:288) at android.view.LayoutInflater.createView(LayoutInflater.java:607) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)  at android.view.LayoutInflater.inflate(LayoutInflater.java:504)  at android.view.LayoutInflater.inflate(LayoutInflater.java:414)  at com.tellfa.tasktodo.DialogAdd.onCreateView(DialogAdd.java:45)  at android.support.v4.app.Fragment.performCreateView(Fragment.java:1974)  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067)  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1252)  at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:738)  at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1617)  at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:517)  at android.os.Handler.handleCallback(Handler.java:739)  at android.os.Handler.dispatchMessage(Handler.java:95)  at android.os.Looper.loop(Looper.java:135)  at android.app.ActivityThread.main(ActivityThread.java:5349)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)  Caused by: java.lang.ClassCastException: android.view.ContextThemeWrapper cannot be cast to android.app.Activity at me.james.biuedittext.BiuEditText.init(BiuEditText.java:71) at me.james.biuedittext.BiuEditText.<init>(BiuEditText.java:47) at java.lang.reflect.Constructor.newInstance(Native Method)  at java.lang.reflect.Constructor.newInstance(Constructor.java:288)  at android.view.LayoutInflater.createView(LayoutInflater.java:607)  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)  at android.view.LayoutInflater.inflate(LayoutInflater.java:504)  at android.view.LayoutInflater.inflate(LayoutInflater.java:414)  at com.tellfa.tasktodo.DialogAdd.onCreateView(DialogAdd.java:45)  at android.support.v4.app.Fragment.performCreateView(Fragment.java:1974)  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067)  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1252)  at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:738)  at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1617)  at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:517)  at android.os.Handler.handleCallback(Handler.java:739)  at android.os.Handler.dispatchMessage(Handler.java:95)  at android.os.Looper.loop(Looper.java:135)  at android.app.ActivityThread.main(ActivityThread.java:5349)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703) 

    XMl code : <me.james.biuedittext.BiuEditText android:id="@+id/dialog_add_task" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="biu,biu,发射1号" android:textColor="@android:color/white" app:biu_duration="800" app:biu_text_color="@android:color/white" app:biu_text_scale="1.5" app:biu_type="flydown" app:biu_text_start_size="12sp" />

    how can i fix it? thanks

    opened by tellfa 1
  • when cursor not on last, popup the last word

    when cursor not on last, popup the last word

    Thanks the good library.

    Example, "abcdefg", when cursor between "d" and "e", add or remove word, it popup "g", not new word

    opened by henrychuangtw 1
  • StringIndexOutOfBoundsException: length=0; index=-1

    StringIndexOutOfBoundsException: length=0; index=-1

    增加属性:android:digits="1234567890." 代码里设置:editText.setInputType(EditorInfo.TYPE_CLASS_PHONE); 控制EditText获取到焦点直接打开的是数字面板,报错了!

    Caused by: java.lang.StringIndexOutOfBoundsException: length=0; index=-1 at java.lang.String.indexAndLength(String.java:500) at java.lang.String.charAt(String.java:494) at me.james.biuedittext.BiuEditText$1.onTextChanged(BiuEditText.java:85) at android.widget.TextView.sendOnTextChanged(TextView.java:7682) at android.widget.TextView.setText(TextView.java:4063) at android.widget.TextView.setText(TextView.java:3918) at android.widget.EditText.setText(EditText.java:85) at android.widget.TextView.setText(TextView.java:3893) at android.widget.TextView.setTransformationMethod(TextView.java:1776) at android.widget.TextView.applySingleLine(TextView.java:7379) at android.widget.TextView.setInputType(TextView.java:4264) at jamesxu.biuedittext.BiuFragment.onCreateView(BiuFragment.java:23) at android.support.v4.app.Fragment.performCreateView(Fragment.java:1965) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1078) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1259) at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:738) at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1624) at android.support.v4.app.FragmentController.execPendingActions(FragmentController.java:330) at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:547) at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1236) at com.qihoo360.mobilesafe.loader.c.callActivityOnStart(SourceFile:150) at android.app.Activity.performStart(Activity.java:6006) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2288)             at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)             at android.app.ActivityThread.access$800(ActivityThread.java:151)             at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)             at android.os.Handler.dispatchMessage(Handler.java:102)             at android.os.Looper.loop(Looper.java:135)             at android.app.ActivityThread.main(ActivityThread.java:5254)             at java.lang.reflect.Method.invoke(Native Method)             at java.lang.reflect.Method.invoke(Method.java:372)             at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)

    opened by GalvinChen 1
  • 动画结束时位置endY不对

    动画结束时位置endY不对

    测试了一下,我的布局是一个LinearLayout,先是一个TextView,然后是文本框,不是在最上面,结果bug来了:字符动画结束时位置在文本框上面,立马觉得是endY的问题,于是用日志输出了endY的值,结果是0 根据你的endY=baseline + ascent;日志输出了baseline为29,而ascent为-29,结果endY.... Uploading issu.jpg…

    opened by aboutZZ 1
  • 这个Edittext非常有趣,不过有bug,下面是bug描述

    这个Edittext非常有趣,不过有bug,下面是bug描述

    java.lang.NullPointerException: Attempt to invoke virtual method 'android.graphics.Rect android.graphics.drawable.Drawable.getBounds()' on a null object reference at me.james.biuedittext.BiuEditText.getCursorCoordinate(BiuEditText.java:244) at me.james.biuedittext.BiuEditText.playFlyUp(BiuEditText.java:180) at me.james.biuedittext.BiuEditText.playAnaimator(BiuEditText.java:135) at me.james.biuedittext.BiuEditText.update(BiuEditText.java:117) at me.james.biuedittext.BiuEditText.access$100(BiuEditText.java:33) at me.james.biuedittext.BiuEditText$1.onTextChanged(BiuEditText.java:94) at android.widget.TextView.sendOnTextChanged(TextView.java:8240) at android.widget.TextView.handleTextChanged(TextView.java:8302) at android.widget.TextView$ChangeWatcher.onTextChanged(TextView.java:10669) at android.text.SpannableStringBuilder.sendTextChanged(SpannableStringBuilder.java:1208) at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:578) at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:509) at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:508) at android.view.inputmethod.BaseInputConnection.replaceText(BaseInputConnection.java:844) at android.view.inputmethod.BaseInputConnection.commitText(BaseInputConnection.java:198) at com.android.internal.widget.EditableInputConnection.commitText(EditableInputConnection.java:183) at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:353) at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:93) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:159) at android.app.ActivityThread.main(ActivityThread.java:6306) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1096) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:883)

    锤子坚果pro 手机测试

    opened by LinTaoAndroid 0
  • 输入文字超过一行时,文字飞入的位置还在第一行

    输入文字超过一行时,文字飞入的位置还在第一行

    1,多行文字时,文本框的基准线已经往下移了,飞入的文字还是在第一行时的位置 2,同时输入多个文字时,比如,我输入了个 “我们都一样”,这样一句话,因为键盘上已经提示出来了,我点击时,文字会同一时间出现在文本框里,这时飞入的是最后一个字,位置 也是对应在“我”这个字所在位置,希望输入多个文字时能同时飞入,且位置对应

    opened by maxiaoyi 0
Owner
xujinyang
想做一名个人开发者
xujinyang