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);
}
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);
}
}
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);
}
}
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);
}
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);
}
Aggregations