material-animated-switch, 带有 icon 动画和颜色转换的材质 switch

分享于 

3分钟阅读

GitHub

  繁體 雙語
A material Switch with icon animations and color transitions
  • 源代码名称:material-animated-switch
  • 源代码网址:http://www.github.com/glomadrian/material-animated-switch
  • material-animated-switch源代码文档
  • material-animated-switch源代码下载
  • Git URL:
    git://www.github.com/glomadrian/material-animated-switch.git
    Git Clone代码到本地:
    git clone http://www.github.com/glomadrian/material-animated-switch
    Subversion代码到本地:
    $ svn co --depth empty http://www.github.com/glomadrian/material-animated-switch
    Checked out revision 1.
    $ cd repo
    $ svn up trunk
    

    材质动画 switch

    DownloadAndroid Arsenal

    带有 icon 动画和颜色转换的材质 switch

    Demo Screenshot

    Demo Screenshot

    示例视频:

    Youtube材质动画 switch 视频

    示例应用程序:

    Get it on Google Play

    基于

    收件箱 pinDerek Torsani

    :如何使用

    默认情况下,将收件箱锁定为 switch

    <com.github.glomadrian.materialanimatedswitch.MaterialAnimatedSwitch
     android:id="@+id/pin"android:layout_width="wrap_content"android:layout_height="wrap_content"/>

    使用自定义颜色和图标属性

    <com.github.glomadrian.materialanimatedswitch.MaterialAnimatedSwitch
     android:id="@+id/pin"android:layout_width="wrap_content"android:layout_height="wrap_content" 
     app:base_release_color="@color/md_deep_orange_900"app:base_press_color="@color/md_deep_orange_50"app:ball_release_color="@color/md_deep_orange_500"app:ball_press_color="@color/md_white_1000"app:icon_release="@drawable/ic_play_arrow_white_36dp"app:icon_press="@drawable/ic_stop_deep_orange_500_36dp"/>

    记住将这里用于自定义属性用法

    xmlns:app="http://schemas.android.com/apk/res-auto"

    用于Gradle的

    添加库

    repositories {
     maven {
     url "http://dl.bintray.com/glomadrian/maven" }
    }

    添加依赖项

    compile 'com.github.glomadrian:MaterialAnimatedSwitch:1.1@aar'

    变更日志

    V 1.1

    • 固定的Bug 在开始时切断球
    • 添加了 isChecked() 方法
    • 修复 toggle() 方法

    Adrián García Lomas - glomadrian@gmail.com

    许可证

    
    Copyright 2015 Adrián García Lomas
    
    
    
    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.
    
    
    
    

    COL  MAT  动画  Material  MATE  ICO