function ImageToggle(shape, theme) {
        shape = shape || Shape.RECT;
        theme = theme || Theme.DEFAULT;
        let thiz = this;
        thiz._shape = shape;
        thiz._theme = theme;
        thiz._params = new LinearLayout_.LayoutParams(-1, DP * 36);
        thiz._view = new ToggleButton_(CONTEXT);
        thiz._pressedDrawable = new ColorDrawable_(0);
        thiz._unpressedDrawable = new ColorDrawable_(0);
        thiz._func = () => {};
        thiz._params.setMargins(DP * 6, DP * 6, DP * 6, DP * 6);
        thiz._view.setBackgroundDrawable(thiz._unpressedDrawable);
        thiz._view.setGravity(Gravity_.CENTER);
        thiz._view.setLayoutParams(thiz._params);
        thiz._view.setOnCheckedChangeListener(new CompoundButton_.OnCheckedChangeListener({
            onCheckedChanged(buttonView, isChecked) {
                thiz._func(buttonView, isChecked);
                if (isChecked) {
                    buttonView.setBackgroundDrawable(thiz._pressedDrawable);
                } else {
                    buttonView.setBackgroundDrawable(thiz._unpressedDrawable);
                }
            }
        }));
        thiz._view.setTextOff("");
        thiz._view.setTextOn("");
    }
/**
     * Class representing a image toggle.
     * @since 2016-05-27
     * @class
     * @extends me.astro.widget.ImageButton
     * @memberOf me.astro.widget
     * @param {Number} [shape=me.astro.design.Shape.RECT] Shape of image toggle
     * @param {me.astro.design.Theme} [theme=me.astro.design.Theme.DEFAULT] Theme of image toggle
     */
Class representing a image toggle.
Class representing a image toggle .
function ImageToggle(shape, theme) {
        shape = shape || Shape.RECT;
        theme = theme || Theme.DEFAULT;
        let thiz = this;
        thiz._shape = shape;
        thiz._theme = theme;
        thiz._params = new LinearLayout_.LayoutParams(-1, DP * 36);
        thiz._view = new ToggleButton_(CONTEXT);
        thiz._pressedDrawable = new ColorDrawable_(0);
        thiz._unpressedDrawable = new ColorDrawable_(0);
        thiz._func = () => {};
        thiz._params.setMargins(DP * 6, DP * 6, DP * 6, DP * 6);
        thiz._view.setBackgroundDrawable(thiz._unpressedDrawable);
        thiz._view.setGravity(Gravity_.CENTER);
        thiz._view.setLayoutParams(thiz._params);
        thiz._view.setOnCheckedChangeListener(new CompoundButton_.OnCheckedChangeListener({
            onCheckedChanged(buttonView, isChecked) {
                thiz._func(buttonView, isChecked);
                if (isChecked) {
                    buttonView.setBackgroundDrawable(thiz._pressedDrawable);
                } else {
                    buttonView.setBackgroundDrawable(thiz._unpressedDrawable);
                }
            }
        }));
        thiz._view.setTextOff("");
        thiz._view.setTextOn("");
    }
function ImageToggle ( shape , theme ) { shape = shape || Shape . RECT ; theme = theme || Theme . DEFAULT ; let thiz = this ; thiz . _shape = shape ; thiz . _theme = theme ; thiz . _params = new LinearLayout_ . LayoutParams ( - 1 , DP * 36 ) ; thiz . _view = new ToggleButton_ ( CONTEXT ) ; thiz . _pressedDrawable = new ColorDrawable_ ( 0 ) ; thiz . _unpressedDrawable = new ColorDrawable_ ( 0 ) ; thiz . _func = ( ) => { } ; thiz . _params . setMargins ( DP * 6 , DP * 6 , DP * 6 , DP * 6 ) ; thiz . _view . setBackgroundDrawable ( thiz . _unpressedDrawable ) ; thiz . _view . setGravity ( Gravity_ . CENTER ) ; thiz . _view . setLayoutParams ( thiz . _params ) ; thiz . _view . setOnCheckedChangeListener ( new CompoundButton_ . OnCheckedChangeListener ( { onCheckedChanged ( buttonView , isChecked ) { thiz . _func ( buttonView , isChecked ) ; if ( isChecked ) { buttonView . setBackgroundDrawable ( thiz . _pressedDrawable ) ; } else { buttonView . setBackgroundDrawable ( thiz . _unpressedDrawable ) ; } } } ) ) ; thiz . _view . setTextOff ( "" ) ; thiz . _view . setTextOn ( "" ) ; }
Class representing a image toggle.
Class representing a image toggle .