All Projects → polyak01 → Iconswitch

polyak01 / Iconswitch

🍭 Custom Android Switch widget

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Iconswitch

simple-analog-clock
Simple clock view for displaying uh...time?
Stars: ✭ 24 (-97.25%)
Mutual labels:  widget, view
Android Toggle
Custom Switches for Android
Stars: ✭ 266 (-69.57%)
Mutual labels:  switch, view
EasyMoney-Widgets
The widgets (EditText and TextView) for support of money requirements like currency, number formatting, comma formatting etc.
Stars: ✭ 91 (-89.59%)
Mutual labels:  widget, custom-view
Custom-Grid-View
Custom Drag and Drop Grid for Home Assistant
Stars: ✭ 103 (-88.22%)
Mutual labels:  view, custom-view
Sliding Panel
Android sliding panel that is part of the view hierarchy, not above it.
Stars: ✭ 433 (-50.46%)
Mutual labels:  custom-view, widget
SkeletonPlaceholderView
A library for creating dynamic skeleton view
Stars: ✭ 25 (-97.14%)
Mutual labels:  view, custom-view
Uilibrary
平时项目开发中写的自定义Drawable、View和Shape
Stars: ✭ 260 (-70.25%)
Mutual labels:  view, custom-view
Tristatetogglebutton
Customizable tri-state toggle button (with three states, three state toggle) for Android
Stars: ✭ 198 (-77.35%)
Mutual labels:  switch, selector
Supertextview
Hi,Developer,Welcome to use SuperTextView !
Stars: ✭ 3,170 (+262.7%)
Mutual labels:  view, widget
Nbaseuikit
个人平时使用的一些Qt编写的组件(有部分是整合的开源作品,部分是自己原创);
Stars: ✭ 286 (-67.28%)
Mutual labels:  switch, widget
view-admin-as
View the WordPress admin as a different role, switch between users, temporarily change your capabilities, set default screen settings for roles, manage your roles and capabilities.
Stars: ✭ 44 (-94.97%)
Mutual labels:  view, switch
Easysignseekbar
本库主要提供一个漂亮而强大的自定义SeekBar,进度变化由提示牌 (sign)展示,具有强大的属性设置,支持设置section(节点)、mark(标记)、track(轨迹)、thumb(拖动块)、progress(进度)、sign(提示框)等功能
Stars: ✭ 629 (-28.03%)
Mutual labels:  view, custom-view
AndroidUiKit
uikit widget common baseview Adapter faster develop
Stars: ✭ 48 (-94.51%)
Mutual labels:  widget, view
CheckableTextView
A simple and flexible Checked TextView or Checkable TextView
Stars: ✭ 108 (-87.64%)
Mutual labels:  widget, view
ProgressableImageView
Change your users progress capability with ProgressableImageView
Stars: ✭ 86 (-90.16%)
Mutual labels:  view, custom-view
auto-fill-edit-text
This custom EditText can suggest and fill text defined before.
Stars: ✭ 26 (-97.03%)
Mutual labels:  view, custom-view
Zwtopselectvcview
快速导入多个控制器,通过顶部选择菜单切换控制器,实现一个页面多个控制器切换处理.(It's an so easy way to add your all kinds of childControllers into superViewController, then you can slide around or just click on the topButton which is automatically building in the topView to switch your childViewController.)
Stars: ✭ 61 (-93.02%)
Mutual labels:  switch, view
Flutter smart select
SmartSelect allows you to easily convert your usual form select or dropdown into dynamic page, popup dialog, or sliding bottom sheet with various choices input such as radio, checkbox, switch, chips, or even custom input. Supports single and multiple choice.
Stars: ✭ 179 (-79.52%)
Mutual labels:  switch, widget
Tickview
一个精致带感的打钩小动画
Stars: ✭ 284 (-67.51%)
Mutual labels:  custom-view, widget
Freepager
ViewPagers library for Android
Stars: ✭ 461 (-47.25%)
Mutual labels:  view, custom-view

IconSwitch

The library is a custom Switch widget inspired by this dribbble shot.

GifSample

Gradle

Add this into your dependencies block.

compile 'com.polyak:icon-switch:1.0.0'

Sample

Please see the sample app for a library usage example.

Wiki

Usage:

Simply add an IconSwitch to your view hieararchy. Either programatically or using xml:

<com.polyak.iconswitch.IconSwitch
  android:id="@+id/icon_switch"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  app:isw_icon_left="@drawable/ic_format_list_bulleted_white_18dp"
  app:isw_icon_right="@drawable/ic_location_on_white_18dp" />

API

General

Size of the widget is controlled by the attribute:

<com.polyak.iconswitch.IconSwitch
  android:isw_icon_size="@dimen/your_size" />

Default selection can be set using:

<com.polyak.iconswitch.IconSwitch
  android:isw_default_selection="left|right" />

To control the current state or get information about it, use:

iconSwitch.setChecked();
iconSwitch.getChecked();
iconSwitch.toggle();

Color

To customize colors of the widget, you can use the following self-explanatory attributes:

<com.polyak.iconswitch.IconSwitch
  app:isw_background_color="#fff"
  app:isw_thumb_color_left="#fff"
  app:isw_thumb_color_right="#fff"
  app:isw_inactive_tint_icon_left="#fff"
  app:isw_inactive_tint_icon_right="#fff"
  app:isw_active_tint_icon_left="#fff"
  app:isw_active_tint_icon_right="#fff" />

or setter-methods:

iconSwitch.setBackgroundColor(color);
iconSwitch.setThumbColorLeft(color);
iconSwitch.setThumbColorRight(color);
iconSwitch.setActiveTintIconLeft(color);
iconSwitch.setInactiveTintIconLeft(color);
iconSwitch.setActiveTintIconRight(color);
iconSwitch.setInactiveTintIconRight(color);

Callback

To listen for the check changed events use:

iconSwitch.setCheckedChangeListener(listener);

public interface CheckedChangeListener {
  void onCheckChanged(Checked current);
}

enum Checked { LEFT, RIGHT }

License

Copyright 2017 Yaroslav Polyakov

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