Search in sources :

Example 36 with SwitchView

use of com.moro.mtweaks.views.recyclerview.SwitchView in project MTweaks-KernelAdiutorMOD by morogoku.

the class ScreenFragment method gloveModeInit.

private void gloveModeInit(List<RecyclerViewItem> items) {
    SwitchView glove = new SwitchView();
    glove.setTitle(getString(R.string.glove_mode));
    glove.setSummary(getString(R.string.glove_mode_summary));
    glove.setChecked(Misc.isGloveModeEnabled());
    glove.addOnSwitchListener(new SwitchView.OnSwitchListener() {

        @Override
        public void onChanged(SwitchView switchView, boolean isChecked) {
            Misc.enableGloveMode(isChecked, getActivity());
        }
    });
    items.add(glove);
}
Also used : SwitchView(com.moro.mtweaks.views.recyclerview.SwitchView)

Example 37 with SwitchView

use of com.moro.mtweaks.views.recyclerview.SwitchView in project MTweaks-KernelAdiutorMOD by morogoku.

the class ScreenFragment method lcdBackLightInit.

private void lcdBackLightInit(List<RecyclerViewItem> items) {
    CardView lcdBackLightCard = new CardView(getActivity());
    lcdBackLightCard.setTitle(getString(R.string.lcd_backlight));
    if (Misc.hasBrightnessMode()) {
        SwitchView brightnessMode = new SwitchView();
        brightnessMode.setSummary(getString(R.string.brightness_mode));
        brightnessMode.setChecked(Misc.isBrightnessModeEnabled());
        brightnessMode.addOnSwitchListener(new SwitchView.OnSwitchListener() {

            @Override
            public void onChanged(SwitchView switchView, boolean isChecked) {
                Misc.enableBrightnessMode(isChecked, getActivity());
            }
        });
        lcdBackLightCard.addItem(brightnessMode);
    }
    if (Misc.hasLcdMinBrightness()) {
        SeekBarView lcdMinBrightness = new SeekBarView();
        lcdMinBrightness.setTitle(getString(R.string.min_brightness));
        lcdMinBrightness.setSummary(getString(R.string.min_brightness_summary));
        lcdMinBrightness.setMax(114);
        lcdMinBrightness.setMin(2);
        lcdMinBrightness.setProgress(Misc.getLcdMinBrightness() - 2);
        lcdMinBrightness.setOnSeekBarListener(new SeekBarView.OnSeekBarListener() {

            @Override
            public void onStop(SeekBarView seekBarView, int position, String value) {
                Misc.setLcdMinBrightness(position + 2, getActivity());
            }

            @Override
            public void onMove(SeekBarView seekBarView, int position, String value) {
            }
        });
        lcdBackLightCard.addItem(lcdMinBrightness);
    }
    if (Misc.hasLcdMaxBrightness()) {
        SeekBarView lcdMaxBrightness = new SeekBarView();
        lcdMaxBrightness.setTitle(getString(R.string.max_brightness));
        lcdMaxBrightness.setSummary(getString(R.string.max_brightness_summary));
        lcdMaxBrightness.setMax(114);
        lcdMaxBrightness.setMin(2);
        lcdMaxBrightness.setProgress(Misc.getLcdMaxBrightness() - 2);
        lcdMaxBrightness.setOnSeekBarListener(new SeekBarView.OnSeekBarListener() {

            @Override
            public void onStop(SeekBarView seekBarView, int position, String value) {
                Misc.setLcdMaxBrightness(position + 2, getActivity());
            }

            @Override
            public void onMove(SeekBarView seekBarView, int position, String value) {
            }
        });
        lcdBackLightCard.addItem(lcdMaxBrightness);
    }
    if (lcdBackLightCard.size() > 0) {
        items.add(lcdBackLightCard);
    }
}
Also used : SwitchView(com.moro.mtweaks.views.recyclerview.SwitchView) CardView(com.moro.mtweaks.views.recyclerview.CardView) SeekBarView(com.moro.mtweaks.views.recyclerview.SeekBarView)

Example 38 with SwitchView

use of com.moro.mtweaks.views.recyclerview.SwitchView in project MTweaks-KernelAdiutorMOD by morogoku.

the class ScreenFragment method backlightDimmerInit.

private void backlightDimmerInit(List<RecyclerViewItem> items) {
    CardView backLightDimmerCard = new CardView(getActivity());
    backLightDimmerCard.setTitle(getString(R.string.backlight_dimmer));
    if (Misc.hasBackLightDimmerEnable()) {
        SwitchView backLightDimmer = new SwitchView();
        backLightDimmer.setSummary(getString(R.string.backlight_dimmer));
        backLightDimmer.setChecked(Misc.isBackLightDimmerEnabled());
        backLightDimmer.addOnSwitchListener(new SwitchView.OnSwitchListener() {

            @Override
            public void onChanged(SwitchView switchView, boolean isChecked) {
                Misc.enableBackLightDimmer(isChecked, getActivity());
            }
        });
        backLightDimmerCard.addItem(backLightDimmer);
    }
    if (Misc.hasMinBrightness()) {
        SeekBarView minBrightness = new SeekBarView();
        minBrightness.setTitle(getString(R.string.min_brightness));
        minBrightness.setSummary(getString(R.string.min_brightness_summary));
        minBrightness.setMax(Misc.getMaxMinBrightness());
        minBrightness.setProgress(Misc.getCurMinBrightness());
        minBrightness.setOnSeekBarListener(new SeekBarView.OnSeekBarListener() {

            @Override
            public void onStop(SeekBarView seekBarView, int position, String value) {
                Misc.setMinBrightness(position, getActivity());
            }

            @Override
            public void onMove(SeekBarView seekBarView, int position, String value) {
            }
        });
        backLightDimmerCard.addItem(minBrightness);
    }
    if (Misc.hasBackLightDimmerThreshold()) {
        SeekBarView threshold = new SeekBarView();
        threshold.setTitle(getString(R.string.threshold));
        threshold.setMax(50);
        threshold.setProgress(Misc.getBackLightDimmerThreshold());
        threshold.setOnSeekBarListener(new SeekBarView.OnSeekBarListener() {

            @Override
            public void onStop(SeekBarView seekBarView, int position, String value) {
                Misc.setBackLightDimmerThreshold(position, getActivity());
            }

            @Override
            public void onMove(SeekBarView seekBarView, int position, String value) {
            }
        });
        backLightDimmerCard.addItem(threshold);
    }
    if (Misc.hasBackLightDimmerOffset()) {
        SeekBarView dimmerOffset = new SeekBarView();
        dimmerOffset.setTitle(getString(R.string.offset));
        dimmerOffset.setMax(50);
        dimmerOffset.setProgress(Misc.getBackLightDimmerOffset());
        dimmerOffset.setOnSeekBarListener(new SeekBarView.OnSeekBarListener() {

            @Override
            public void onStop(SeekBarView seekBarView, int position, String value) {
                Misc.setBackLightDimmerOffset(position, getActivity());
            }

            @Override
            public void onMove(SeekBarView seekBarView, int position, String value) {
            }
        });
        backLightDimmerCard.addItem(dimmerOffset);
    }
    if (backLightDimmerCard.size() > 0) {
        items.add(backLightDimmerCard);
    }
}
Also used : SwitchView(com.moro.mtweaks.views.recyclerview.SwitchView) CardView(com.moro.mtweaks.views.recyclerview.CardView) SeekBarView(com.moro.mtweaks.views.recyclerview.SeekBarView)

Example 39 with SwitchView

use of com.moro.mtweaks.views.recyclerview.SwitchView in project MTweaks-KernelAdiutorMOD by morogoku.

the class SoundFragment method soundControlEnableInit.

private void soundControlEnableInit(List<RecyclerViewItem> items) {
    SwitchView soundControl = new SwitchView();
    soundControl.setSummary(getString(R.string.sound_control));
    soundControl.setChecked(Sound.isSoundControlEnabled());
    soundControl.addOnSwitchListener(new SwitchView.OnSwitchListener() {

        @Override
        public void onChanged(SwitchView switchView, boolean isChecked) {
            Sound.enableSoundControl(isChecked, getActivity());
        }
    });
    items.add(soundControl);
}
Also used : SwitchView(com.moro.mtweaks.views.recyclerview.SwitchView)

Example 40 with SwitchView

use of com.moro.mtweaks.views.recyclerview.SwitchView in project MTweaks-KernelAdiutorMOD by morogoku.

the class SoundFragment method lockMicGainInit.

private void lockMicGainInit(List<RecyclerViewItem> items) {
    SwitchView lockMicGain = new SwitchView();
    lockMicGain.setTitle(getString(R.string.lock_mic_gain));
    lockMicGain.setSummary(getString(R.string.lock_mic_gain_summary));
    lockMicGain.setChecked(Sound.isLockMicGainEnabled());
    lockMicGain.addOnSwitchListener(new SwitchView.OnSwitchListener() {

        @Override
        public void onChanged(SwitchView switchView, boolean isChecked) {
            Sound.enableLockMicGain(isChecked, getActivity());
        }
    });
    items.add(lockMicGain);
}
Also used : SwitchView(com.moro.mtweaks.views.recyclerview.SwitchView)

Aggregations

SwitchView (com.moro.mtweaks.views.recyclerview.SwitchView)64 SeekBarView (com.moro.mtweaks.views.recyclerview.SeekBarView)31 CardView (com.moro.mtweaks.views.recyclerview.CardView)23 ArrayList (java.util.ArrayList)19 TitleView (com.moro.mtweaks.views.recyclerview.TitleView)16 RecyclerViewItem (com.moro.mtweaks.views.recyclerview.RecyclerViewItem)15 SelectView (com.moro.mtweaks.views.recyclerview.SelectView)14 DescriptionView (com.moro.mtweaks.views.recyclerview.DescriptionView)4 GenericSelectView2 (com.moro.mtweaks.views.recyclerview.GenericSelectView2)3 GenericSelectView (com.moro.mtweaks.views.recyclerview.GenericSelectView)2 Intent (android.content.Intent)1 Controls (com.moro.mtweaks.database.tools.customcontrols.Controls)1 BoefflaWakelock (com.moro.mtweaks.utils.kernel.boefflawakelock.BoefflaWakelock)1 Wakelocks (com.moro.mtweaks.utils.kernel.misc.Wakelocks)1 CustomControlException (com.moro.mtweaks.utils.tools.customcontrols.CustomControlException)1 XYGraphView (com.moro.mtweaks.views.recyclerview.XYGraphView)1 ErrorView (com.moro.mtweaks.views.recyclerview.customcontrols.ErrorView)1 ConcurrentModificationException (java.util.ConcurrentModificationException)1