All Projects → Commit451 → Untriggered

Commit451 / Untriggered

Licence: Apache-2.0 License
Set CompoundButtons checked state without being so triggered

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Untriggered

em-beer-manager
Manage your beers with WordPress. Integrates simply with Untappd beer checkins. Great for everyone from home brewers to professional breweries!
Stars: ✭ 15 (+15.38%)
Mutual labels:  widget
yii2-time-down-counter
Widget for yii2, to start count down timer with a lot of options, This widget build dependence of timeDownCounter JS library
Stars: ✭ 15 (+15.38%)
Mutual labels:  widget
rc-year-calendar
Official React wrapper for the year-calendar widget
Stars: ✭ 27 (+107.69%)
Mutual labels:  widget
MTCircularSlider
A feature-rich circular slider control written in Swift.
Stars: ✭ 118 (+807.69%)
Mutual labels:  widget
github-profile-card
Simple and easy to use widget with your GitHub profile — No dependencies
Stars: ✭ 98 (+653.85%)
Mutual labels:  widget
pixel-widget
Scriptable Widget inspired by Pixel's "At a Glance" widget.
Stars: ✭ 96 (+638.46%)
Mutual labels:  widget
awesome
Configs for awesomeWM
Stars: ✭ 42 (+223.08%)
Mutual labels:  widget
GITGET
GitHub의 Contributions를 iOS의 Widget으로 보여주는 App
Stars: ✭ 101 (+676.92%)
Mutual labels:  widget
yii-masked-input
Yii Framework Masked input widget Extension
Stars: ✭ 38 (+192.31%)
Mutual labels:  widget
ModularPlayers
Modular desktop media widget
Stars: ✭ 28 (+115.38%)
Mutual labels:  widget
height-slider
A customisable height slider for Flutter.
Stars: ✭ 15 (+15.38%)
Mutual labels:  widget
crypto-price-widget
Easily track the price of your favorite crypto in an attractive desktop widget
Stars: ✭ 72 (+453.85%)
Mutual labels:  widget
uploadcare-rails
Rails wrapper for Uploadcare
Stars: ✭ 48 (+269.23%)
Mutual labels:  widget
SPPerspective
Widgets iOS 14 animation with 3D and dynamic shadow. Customisable transform and duration.
Stars: ✭ 271 (+1984.62%)
Mutual labels:  widget
yii2-multi-select-widget
Bootstrap MultiSelect and MultiSelect Listbox widgets for Yii2
Stars: ✭ 45 (+246.15%)
Mutual labels:  widget
slack widgets
An abstraction of the JSON structure needed to create widgets in Slack message attachments
Stars: ✭ 14 (+7.69%)
Mutual labels:  widget
lifecycle
Lifecycle support for Flutter widgets.
Stars: ✭ 30 (+130.77%)
Mutual labels:  widget
menu button
Flutter plugin to display a popup menu button widget with handsome design and easy to use.
Stars: ✭ 64 (+392.31%)
Mutual labels:  widget
bazaar
思源笔记社区集市。SiYuan community bazaar.
Stars: ✭ 18 (+38.46%)
Mutual labels:  widget
vue-smart-widget
🗃️Smart widget is a flexible and extensible content container component for Vue2.x / Vue3.x in Next branch.
Stars: ✭ 110 (+746.15%)
Mutual labels:  widget

Untriggered

Build Status

Sometimes, you just want to set the state of a CompoundButton such as a CheckBox or Switch, such as when these items are in a RecyclerView. You also want to listen for when these buttons change their "checked" state. But alas, when you bind the ViewHolder with the checked state, you get a OnCheckedChangeListener callback! The agony! UntriggeredCheckBox and the like allow you to set this checked state without triggering the listener. Wow!

Usage

final UntriggeredCheckBox checkBox = (UntriggeredCheckBox) findViewById(R.id.checkbox);

checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
    @Override
    public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
        Snackbar.make(root, "Checkbox set to " + isChecked + " and I am triggered!", Snackbar.LENGTH_SHORT)
                .show();
    }
});
findViewById(R.id.button).setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        //checkbox will be set, onCheckChanged will not be triggered. All is well
        checkBox.setCheckedUntriggered(!checkBox.isChecked());
    }
});

Support

Please note that this library has a dependency on appcompat. Widgets are subclassed from their AppCompat counterparts, such as AppCompatCheckBox and the like to allow for fancy Material styling on all API levels.

Currently supported CompoundButtons are:

  • CheckBox
  • RadioButton
  • Switch
  • SwitchCompat
  • ToggleButton

And some others:

  • SeekBar
  • RatingBar
  • Spinner

Feel free to make a PR if you feel another widget should be added! They are very simple to make.

License

Copyright 2018 Commit 451

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