Search in sources :

Example 26 with SeekBarView

use of com.moro.mtweaks.views.recyclerview.SeekBarView 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 27 with SeekBarView

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

the class SoundFragment method microphoneFlarInit.

private void microphoneFlarInit(List<RecyclerViewItem> items) {
    SeekBarView microphoneFlar = new SeekBarView();
    microphoneFlar.setTitle(getString(R.string.microphone_gain));
    microphoneFlar.setItems(Sound.getMicrophoneFlarLimits());
    microphoneFlar.setProgress(Sound.getMicrophoneFlarLimits().indexOf(Sound.getMicrophoneFlar()));
    microphoneFlar.setOnSeekBarListener(new SeekBarView.OnSeekBarListener() {

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

        @Override
        public void onMove(SeekBarView seekBarView, int position, String value) {
        }
    });
    items.add(microphoneFlar);
}
Also used : SeekBarView(com.moro.mtweaks.views.recyclerview.SeekBarView)

Example 28 with SeekBarView

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

the class SoundFragment method camMicrophoneGainInit.

private void camMicrophoneGainInit(List<RecyclerViewItem> items) {
    SeekBarView camMicrophoneGain = new SeekBarView();
    camMicrophoneGain.setTitle(getString(R.string.cam_microphone_gain));
    camMicrophoneGain.setItems(Sound.getCamMicrophoneGainLimits());
    camMicrophoneGain.setProgress(Sound.getCamMicrophoneGainLimits().indexOf(Sound.getCamMicrophoneGain()));
    camMicrophoneGain.setOnSeekBarListener(new SeekBarView.OnSeekBarListener() {

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

        @Override
        public void onMove(SeekBarView seekBarView, int position, String value) {
        }
    });
    items.add(camMicrophoneGain);
}
Also used : SeekBarView(com.moro.mtweaks.views.recyclerview.SeekBarView)

Example 29 with SeekBarView

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

the class SoundFragment method headphonePowerAmpGainInit.

private void headphonePowerAmpGainInit(List<RecyclerViewItem> items) {
    SeekBarView headphonePowerAmpGain = new SeekBarView();
    headphonePowerAmpGain.setTitle(getString(R.string.headphone_poweramp_gain));
    headphonePowerAmpGain.setItems(Sound.getHeadphonePowerAmpGainLimits());
    headphonePowerAmpGain.setProgress(Sound.getHeadphonePowerAmpGainLimits().indexOf(Sound.getHeadphonePowerAmpGain()));
    headphonePowerAmpGain.setOnSeekBarListener(new SeekBarView.OnSeekBarListener() {

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

        @Override
        public void onMove(SeekBarView seekBarView, int position, String value) {
        }
    });
    items.add(headphonePowerAmpGain);
}
Also used : SeekBarView(com.moro.mtweaks.views.recyclerview.SeekBarView)

Example 30 with SeekBarView

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

the class SoundFragment method headphoneTpaGainInit.

private void headphoneTpaGainInit(List<RecyclerViewItem> items) {
    SeekBarView headphoneTpaGain = new SeekBarView();
    headphoneTpaGain.setTitle(getString(R.string.headphone_tpa6165_gain));
    headphoneTpaGain.setItems(Sound.getHeadphoneTpaGainLimits());
    headphoneTpaGain.setProgress(Sound.getHeadphoneTpaGainLimits().indexOf(Sound.getHeadphoneTpaGain()));
    headphoneTpaGain.setOnSeekBarListener(new SeekBarView.OnSeekBarListener() {

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

        @Override
        public void onMove(SeekBarView seekBarView, int position, String value) {
        }
    });
    items.add(headphoneTpaGain);
}
Also used : SeekBarView(com.moro.mtweaks.views.recyclerview.SeekBarView)

Aggregations

SeekBarView (com.moro.mtweaks.views.recyclerview.SeekBarView)53 SwitchView (com.moro.mtweaks.views.recyclerview.SwitchView)31 CardView (com.moro.mtweaks.views.recyclerview.CardView)23 ArrayList (java.util.ArrayList)23 TitleView (com.moro.mtweaks.views.recyclerview.TitleView)18 RecyclerViewItem (com.moro.mtweaks.views.recyclerview.RecyclerViewItem)14 SelectView (com.moro.mtweaks.views.recyclerview.SelectView)12 DescriptionView (com.moro.mtweaks.views.recyclerview.DescriptionView)4 GenericSelectView2 (com.moro.mtweaks.views.recyclerview.GenericSelectView2)2 Vibrator (android.os.Vibrator)1 Controls (com.moro.mtweaks.database.tools.customcontrols.Controls)1 Wakelocks (com.moro.mtweaks.utils.kernel.misc.Wakelocks)1 CustomControlException (com.moro.mtweaks.utils.tools.customcontrols.CustomControlException)1 GenericSelectView (com.moro.mtweaks.views.recyclerview.GenericSelectView)1 ErrorView (com.moro.mtweaks.views.recyclerview.customcontrols.ErrorView)1 List (java.util.List)1