Search in sources :

Example 11 with OnCheckedChangeListener

use of android.widget.RadioGroup.OnCheckedChangeListener in project MagicCamera by wuhaoyu1990.

the class ImageEditBeautyView method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    mSkinSmoothView = (RelativeLayout) getView().findViewById(R.id.fragment_beauty_skin);
    mSkinColorView = (RelativeLayout) getView().findViewById(R.id.fragment_beauty_color);
    mRadioGroup = (RadioGroup) getView().findViewById(R.id.fragment_beauty_radiogroup);
    mRadioGroup.setOnCheckedChangeListener(new OnCheckedChangeListener() {

        @Override
        public void onCheckedChanged(RadioGroup group, int checkedId) {
            // TODO Auto-generated method stub
            switch(checkedId) {
                case R.id.fragment_beauty_btn_skinsmooth:
                    mSkinSmoothView.setVisibility(View.VISIBLE);
                    mSkinColorView.setVisibility(View.GONE);
                    break;
                case R.id.fragment_beauty_btn_skincolor:
                    mSkinColorView.setVisibility(View.VISIBLE);
                    mSkinSmoothView.setVisibility(View.GONE);
                    break;
                default:
                    break;
            }
        }
    });
    mMagicSDK = MagicSDK.getInstance();
    mMagicSDK.setMagicSDKListener(mMagicSDKListener);
    mSmoothBubbleSeekBar = (BubbleSeekBar) view.findViewById(R.id.fragment_beauty_skin_seekbar);
    mSmoothBubbleSeekBar.setOnBubbleSeekBarChangeListener(mOnSmoothBubbleSeekBarChangeListener);
    mWhiteBubbleSeekBar = (BubbleSeekBar) view.findViewById(R.id.fragment_beauty_white_seekbar);
    mWhiteBubbleSeekBar.setOnBubbleSeekBarChangeListener(mOnColorBubbleSeekBarChangeListener);
    init();
    super.onViewCreated(view, savedInstanceState);
}
Also used : OnCheckedChangeListener(android.widget.RadioGroup.OnCheckedChangeListener) RadioGroup(android.widget.RadioGroup)

Example 12 with OnCheckedChangeListener

use of android.widget.RadioGroup.OnCheckedChangeListener in project MagicCamera by wuhaoyu1990.

the class ImageEditAdjustView method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    mRadioGroup = (RadioGroup) getView().findViewById(R.id.fragment_adjust_radiogroup);
    mRadioGroup.setOnCheckedChangeListener(new OnCheckedChangeListener() {

        @Override
        public void onCheckedChanged(RadioGroup group, int checkedId) {
            // TODO Auto-generated method stub
            if (checkedId != -1)
                mLinearLayout.setVisibility(View.VISIBLE);
            switch(checkedId) {
                case R.id.fragment_radio_contrast:
                    type = MagicFilterType.CONTRAST;
                    mSeekBar.reset();
                    mSeekBar.setSeekLength(-100, 100, -50, 1);
                    mSeekBar.setValue(contrast);
                    mLabel.setBackgroundResource(R.drawable.selector_image_edit_adjust_contrast);
                    break;
                case R.id.fragment_radio_exposure:
                    type = MagicFilterType.EXPOSURE;
                    mSeekBar.reset();
                    mSeekBar.setSeekLength(-100, 100, 0, 1);
                    mSeekBar.setValue(exposure);
                    mLabel.setBackgroundResource(R.drawable.selector_image_edit_adjust_exposure);
                    break;
                case R.id.fragment_radio_saturation:
                    type = MagicFilterType.SATURATION;
                    mSeekBar.reset();
                    mSeekBar.setSeekLength(-100, 100, 0, 1);
                    mSeekBar.setValue(saturation);
                    mLabel.setBackgroundResource(R.drawable.selector_image_edit_adjust_saturation);
                    break;
                case R.id.fragment_radio_sharpness:
                    type = MagicFilterType.SHARPEN;
                    mSeekBar.reset();
                    mSeekBar.setSeekLength(-100, 100, 0, 1);
                    mSeekBar.setValue(sharpness);
                    mLabel.setBackgroundResource(R.drawable.selector_image_edit_adjust_saturation);
                    break;
                case R.id.fragment_radio_bright:
                    type = MagicFilterType.BRIGHTNESS;
                    mSeekBar.reset();
                    mSeekBar.setSeekLength(-100, 100, 0, 1);
                    mSeekBar.setValue(brightness);
                    break;
                case R.id.fragment_radio_hue:
                    type = MagicFilterType.HUE;
                    mSeekBar.reset();
                    mSeekBar.setSeekLength(0, 360, 0, 1);
                    mSeekBar.setValue(hue);
                    break;
                default:
                    break;
            }
        }
    });
    mSeekBar = (TwoLineSeekBar) view.findViewById(R.id.item_seek_bar);
    mSeekBar.setOnSeekChangeListener(mOnSeekChangeListener);
    mVal = (TextView) view.findViewById(R.id.item_val);
    mLabel = (ImageView) view.findViewById(R.id.item_label);
    mLinearLayout = (LinearLayout) view.findViewById(R.id.seek_bar_item_menu);
    MagicEngine.getInstance().setFilter(MagicFilterType.IMAGE_ADJUST);
}
Also used : OnCheckedChangeListener(android.widget.RadioGroup.OnCheckedChangeListener) RadioGroup(android.widget.RadioGroup)

Example 13 with OnCheckedChangeListener

use of android.widget.RadioGroup.OnCheckedChangeListener in project MagicCamera by wuhaoyu1990.

the class ImageEditBeautyView method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    mSkinSmoothView = (RelativeLayout) getView().findViewById(R.id.fragment_beauty_skin);
    mSkinColorView = (RelativeLayout) getView().findViewById(R.id.fragment_beauty_color);
    mRadioGroup = (RadioGroup) getView().findViewById(R.id.fragment_beauty_radiogroup);
    mRadioGroup.setOnCheckedChangeListener(new OnCheckedChangeListener() {

        @Override
        public void onCheckedChanged(RadioGroup group, int checkedId) {
            // TODO Auto-generated method stub
            switch(checkedId) {
                case R.id.fragment_beauty_btn_skinsmooth:
                    mSkinSmoothView.setVisibility(View.VISIBLE);
                    mSkinColorView.setVisibility(View.GONE);
                    break;
                case R.id.fragment_beauty_btn_skincolor:
                    mSkinColorView.setVisibility(View.VISIBLE);
                    mSkinSmoothView.setVisibility(View.GONE);
                    break;
                default:
                    break;
            }
        }
    });
    mSmoothBubbleSeekBar = (TwoLineSeekBar) view.findViewById(R.id.fragment_beauty_skin_seekbar);
    mWhiteBubbleSeekBar = (TwoLineSeekBar) view.findViewById(R.id.fragment_beauty_white_seekbar);
    init();
    super.onViewCreated(view, savedInstanceState);
}
Also used : OnCheckedChangeListener(android.widget.RadioGroup.OnCheckedChangeListener) RadioGroup(android.widget.RadioGroup)

Aggregations

RadioGroup (android.widget.RadioGroup)13 OnCheckedChangeListener (android.widget.RadioGroup.OnCheckedChangeListener)13 View (android.view.View)5 TextView (android.widget.TextView)5 RadioButton (android.widget.RadioButton)4 Paint (android.graphics.Paint)2 LayoutParams (android.view.ViewGroup.LayoutParams)2 CheckBox (android.widget.CheckBox)2 LinearLayout (android.widget.LinearLayout)2 Account (android.accounts.Account)1 AccountManager (android.accounts.AccountManager)1 SuppressLint (android.annotation.SuppressLint)1 PendingIntent (android.app.PendingIntent)1 Intent (android.content.Intent)1 Resources (android.content.res.Resources)1 Bundle (android.os.Bundle)1 Button (android.widget.Button)1 CompoundButton (android.widget.CompoundButton)1 ImageView (android.widget.ImageView)1 ListView (android.widget.ListView)1