Code Monkey home page Code Monkey logo

oiview's Introduction

程序员恋爱系列(1)---OiView

标签(空格分隔): Android Java


##什么是程序员恋爱系列 打算是程序员圈子比较小、妹子也少,认识妹子更少,泡上妹子难上加难所以就有了这份教程,但是这个不一定是用在这个用途,可以有更多用途,等着你发现~~~

您可以使用OiView:

  • 简单灵活,直接调用,个性化定制
  • 酷炫,灵活,符合潮流
  • 学会了可以给Ta一个惊喜,遇到Ta的时候能搭讪

##什么是OiView 哟,这个项目是复写了TextView,Button,增加部分动画,使一些控件看起来更舒服,增加了一些闪动的效果,可以在适当的位置使用,使你的app更加酷炫。 不多说上gif图片

###通常第一步配置咯

###好了配置好,可以去开发了 先定义自己的页面

<com.oi.library.view.OiTextView
        android:id="@+id/OiTextView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        oi:textColor="#000000"
        oi:textSize="12"
        oi:text="Dear" />
 <com.oi.library.view.OiButton
        android:id="@+id/OiButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/OiTextView"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="20dp"
        oi:text="Cancle"
        oi:textColor="#000000"
        oi:textSize="12sp" />

com.oi.library.view.OiTextView&&com.oi.library.view.OiButton这个是命名空间,写过自定义插件童鞋门应该知道的 oi:xxxx这个是相应自定义属性

  • textColor 是重写了android:textColor属性
  • textSize 是重写了android:textSize属性
  • text 是重写了android:text的属性

Button的例子比较看出来

自定义样式已经写完,可以写代码了 TextView:

OiTextView oiTextView = (OiTextView) findViewById(R.id.OiTextView);
oiTextView.setInTime(0.2f);
oiTextView.setOutTime(0.2f);
oiTextView.setTextColor(Color.RED);
oiTextView.setProgress(progress * 1f / 100);

重要参数说明:其他方法可以看OiView

  • setInTime(float mTime) 设置划入动画时长
  • setOutTime(float mTime) 设置划出动画时长
  • setLight(boolean isLight) 划入后是否开始闪光
  • setPaddingTop(int dp) 设置划入动画的高度
  • setTextSize(float mTextSize) 设置字体大小
  • show() 展示
  • hide() 隐藏

OiButton是继承OiTextView,所大同小异

oiview's People

Contributors

cdansion avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

oiview's Issues

where the gif

hello,cdansion. I've seen you project for a long time,but i still can't see the gif?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.