Search in sources :

Example 16 with TitleView

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

the class SoundFragment method headphoneFlarInit.

private void headphoneFlarInit(List<RecyclerViewItem> items) {
    TitleView title = new TitleView();
    title.setText(getString(R.string.sound_control));
    SeekBarView headphoneFlar = new SeekBarView();
    headphoneFlar.setTitle(getString(R.string.headphone_gain));
    headphoneFlar.setItems(Sound.getHeadphoneFlarLimits());
    headphoneFlar.setProgress(Sound.getHeadphoneFlarLimits().indexOf(Sound.getHeadphoneFlar()));
    headphoneFlar.setOnSeekBarListener(new SeekBarView.OnSeekBarListener() {

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

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

Example 17 with TitleView

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

the class BackupFragment method load.

private void load(List<RecyclerViewItem> items) {
    if (Backup.getBootPartition() != null) {
        List<RecyclerViewItem> boot = new ArrayList<>();
        itemInit(boot, Backup.PARTITION.BOOT);
        if (boot.size() > 0) {
            TitleView titleView = new TitleView();
            titleView.setText(getString(R.string.boot_partition));
            items.add(titleView);
            items.addAll(boot);
        }
    }
    if (Backup.getRecoveryPartition() != null) {
        List<RecyclerViewItem> recovery = new ArrayList<>();
        itemInit(recovery, Backup.PARTITION.RECOVERY);
        if (recovery.size() > 0) {
            TitleView titleView = new TitleView();
            titleView.setText(getString(R.string.recovery_partition));
            items.add(titleView);
            items.addAll(recovery);
        }
    }
    if (Backup.getFotaPartition() != null) {
        List<RecyclerViewItem> fota = new ArrayList<>();
        itemInit(fota, Backup.PARTITION.FOTA);
        if (fota.size() > 0) {
            TitleView titleView = new TitleView();
            titleView.setText(getString(R.string.fota_partition));
            items.add(titleView);
            items.addAll(fota);
        }
    }
}
Also used : ArrayList(java.util.ArrayList) TitleView(com.moro.mtweaks.views.recyclerview.TitleView) RecyclerViewItem(com.moro.mtweaks.views.recyclerview.RecyclerViewItem)

Example 18 with TitleView

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

the class CPUHotplugFragment method aioHotplugInit.

private void aioHotplugInit(List<RecyclerViewItem> items) {
    List<RecyclerViewItem> aioHotplug = new ArrayList<>();
    TitleView title = new TitleView();
    title.setText(getString(R.string.aio_hotplug));
    if (AiOHotplug.hasToggle()) {
        SwitchView toggle = new SwitchView();
        toggle.setTitle(getString(R.string.aio_hotplug));
        toggle.setSummary(getString(R.string.aio_hotplug_summary));
        toggle.setChecked(AiOHotplug.isEnabled());
        toggle.addOnSwitchListener(new SwitchView.OnSwitchListener() {

            @Override
            public void onChanged(SwitchView switchView, boolean isChecked) {
                AiOHotplug.enable(isChecked, getActivity());
            }
        });
        aioHotplug.add(toggle);
        mEnableViews.add(toggle);
    }
    if (AiOHotplug.hasCores()) {
        SeekBarView maxCpus = new SeekBarView();
        maxCpus.setTitle(getString(R.string.max_cpu_online));
        maxCpus.setSummary(getString(R.string.max_cpu_online_summary));
        maxCpus.setMax(CPUFreq.getCpuCount());
        maxCpus.setMin(1);
        maxCpus.setProgress(AiOHotplug.getCores() - 1);
        maxCpus.setOnSeekBarListener(new SeekBarView.OnSeekBarListener() {

            @Override
            public void onMove(SeekBarView seekBarView, int position, String value) {
            }

            @Override
            public void onStop(SeekBarView seekBarView, int position, String value) {
                AiOHotplug.setCores(position + 1, getActivity());
            }
        });
        aioHotplug.add(maxCpus);
    }
    if (CPUFreq.isBigLITTLE() && AiOHotplug.hasBigCores()) {
        List<String> list = new ArrayList<>();
        list.add("Disable");
        for (int i = 1; i <= CPUFreq.getBigCpuRange().size(); i++) {
            list.add(String.valueOf(i));
        }
        SeekBarView bigMaxCpus = new SeekBarView();
        bigMaxCpus.setTitle(getString(R.string.max_cpu_online_big));
        bigMaxCpus.setSummary(getString(R.string.max_cpu_online_big_summary));
        bigMaxCpus.setItems(list);
        bigMaxCpus.setProgress(AiOHotplug.getBigCores());
        bigMaxCpus.setOnSeekBarListener(new SeekBarView.OnSeekBarListener() {

            @Override
            public void onMove(SeekBarView seekBarView, int position, String value) {
            }

            @Override
            public void onStop(SeekBarView seekBarView, int position, String value) {
                AiOHotplug.setBigCores(position, getActivity());
            }
        });
        aioHotplug.add(bigMaxCpus);
    }
    if (CPUFreq.isBigLITTLE() && AiOHotplug.hasLITTLECores()) {
        List<String> list = new ArrayList<>();
        list.add("Disable");
        for (int i = 1; i <= CPUFreq.getLITTLECpuRange().size(); i++) {
            list.add(String.valueOf(i));
        }
        SeekBarView LITTLEMaxCpus = new SeekBarView();
        LITTLEMaxCpus.setTitle(getString(R.string.max_cpu_online_little));
        LITTLEMaxCpus.setSummary(getString(R.string.max_cpu_online_little_summary));
        LITTLEMaxCpus.setItems(list);
        LITTLEMaxCpus.setProgress(AiOHotplug.getLITTLECores());
        LITTLEMaxCpus.setOnSeekBarListener(new SeekBarView.OnSeekBarListener() {

            @Override
            public void onMove(SeekBarView seekBarView, int position, String value) {
            }

            @Override
            public void onStop(SeekBarView seekBarView, int position, String value) {
                AiOHotplug.setLITTLECores(position, getActivity());
            }
        });
        aioHotplug.add(LITTLEMaxCpus);
    }
    if (aioHotplug.size() > 0) {
        items.add(title);
        items.addAll(aioHotplug);
    }
}
Also used : SwitchView(com.moro.mtweaks.views.recyclerview.SwitchView) ArrayList(java.util.ArrayList) RecyclerViewItem(com.moro.mtweaks.views.recyclerview.RecyclerViewItem) SeekBarView(com.moro.mtweaks.views.recyclerview.SeekBarView) TitleView(com.moro.mtweaks.views.recyclerview.TitleView)

Example 19 with TitleView

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

the class CPUHotplugFragment method zenDecisionInit.

private void zenDecisionInit(List<RecyclerViewItem> items) {
    List<RecyclerViewItem> zenDecision = new ArrayList<>();
    TitleView title = new TitleView();
    title.setText(getString(R.string.zen_decision));
    if (ZenDecision.hasZenDecisionEnable()) {
        SwitchView enable = new SwitchView();
        enable.setTitle(getString(R.string.zen_decision));
        enable.setSummary(getString(R.string.zen_decision_summary));
        enable.setChecked(ZenDecision.isZenDecisionEnabled());
        enable.addOnSwitchListener(new SwitchView.OnSwitchListener() {

            @Override
            public void onChanged(SwitchView switchView, boolean isChecked) {
                ZenDecision.enableZenDecision(isChecked, getActivity());
            }
        });
        zenDecision.add(enable);
        mEnableViews.add(enable);
    }
    if (ZenDecision.hasZenDecisionWakeWaitTime()) {
        SeekBarView wakeWaitTime = new SeekBarView();
        wakeWaitTime.setTitle(getString(R.string.wake_wait_time));
        wakeWaitTime.setSummary(getString(R.string.wake_wait_time_summary));
        wakeWaitTime.setUnit(getString(R.string.ms));
        wakeWaitTime.setMax(6000);
        wakeWaitTime.setOffset(1000);
        wakeWaitTime.setProgress(ZenDecision.getZenDecisionWakeWaitTime() / 1000);
        wakeWaitTime.setOnSeekBarListener(new SeekBarView.OnSeekBarListener() {

            @Override
            public void onMove(SeekBarView seekBarView, int position, String value) {
            }

            @Override
            public void onStop(SeekBarView seekBarView, int position, String value) {
                ZenDecision.setZenDecisionWakeWaitTime(position * 1000, getActivity());
            }
        });
        zenDecision.add(wakeWaitTime);
    }
    if (ZenDecision.hasZenDecisionBatThresholdIgnore()) {
        SeekBarView batThresholdIgnore = new SeekBarView();
        batThresholdIgnore.setTitle(getString(R.string.bat_threshold_ignore));
        batThresholdIgnore.setSummary(getString(R.string.bat_threshold_ignore_summary));
        batThresholdIgnore.setUnit("%");
        batThresholdIgnore.setMin(1);
        batThresholdIgnore.setProgress(ZenDecision.getZenDecisionBatThresholdIgnore());
        batThresholdIgnore.setOnSeekBarListener(new SeekBarView.OnSeekBarListener() {

            @Override
            public void onMove(SeekBarView seekBarView, int position, String value) {
            }

            @Override
            public void onStop(SeekBarView seekBarView, int position, String value) {
                ZenDecision.setZenDecisionBatThresholdIgnore(position, getActivity());
            }
        });
        zenDecision.add(batThresholdIgnore);
    }
    if (zenDecision.size() > 0) {
        items.add(title);
        items.addAll(zenDecision);
    }
}
Also used : SwitchView(com.moro.mtweaks.views.recyclerview.SwitchView) ArrayList(java.util.ArrayList) TitleView(com.moro.mtweaks.views.recyclerview.TitleView) RecyclerViewItem(com.moro.mtweaks.views.recyclerview.RecyclerViewItem) SeekBarView(com.moro.mtweaks.views.recyclerview.SeekBarView)

Example 20 with TitleView

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

the class CPUHotplugFragment method bluPlugInit.

private void bluPlugInit(List<RecyclerViewItem> items) {
    final List<RecyclerViewItem> bluplug = new ArrayList<>();
    TitleView title = new TitleView();
    title.setText(getString(R.string.blu_plug));
    if (BluPlug.hasBluPlugEnable()) {
        SwitchView enable = new SwitchView();
        enable.setTitle(getString(R.string.blu_plug));
        enable.setSummary(getString(R.string.blu_plug_summary));
        enable.setChecked(BluPlug.isBluPlugEnabled());
        enable.addOnSwitchListener(new SwitchView.OnSwitchListener() {

            @Override
            public void onChanged(SwitchView switchView, boolean isChecked) {
                BluPlug.enableBluPlug(isChecked, getActivity());
            }
        });
        bluplug.add(enable);
        mEnableViews.add(enable);
    }
    if (BluPlug.hasBluPlugPowersaverMode()) {
        SwitchView powersaverMode = new SwitchView();
        powersaverMode.setTitle(getString(R.string.powersaver_mode));
        powersaverMode.setSummary(getString(R.string.powersaver_mode_summary));
        powersaverMode.setChecked(BluPlug.isBluPlugPowersaverModeEnabled());
        powersaverMode.addOnSwitchListener(new SwitchView.OnSwitchListener() {

            @Override
            public void onChanged(SwitchView switchView, boolean isChecked) {
                BluPlug.enableBluPlugPowersaverMode(isChecked, getActivity());
            }
        });
        bluplug.add(powersaverMode);
    }
    if (BluPlug.hasBluPlugMinOnline()) {
        SeekBarView minOnline = new SeekBarView();
        minOnline.setTitle(getString(R.string.min_cpu_online));
        minOnline.setSummary(getString(R.string.min_cpu_online_summary));
        minOnline.setMax(CPUFreq.getCpuCount());
        minOnline.setMin(1);
        minOnline.setProgress(BluPlug.getBluPlugMinOnline() - 1);
        minOnline.setOnSeekBarListener(new SeekBarView.OnSeekBarListener() {

            @Override
            public void onMove(SeekBarView seekBarView, int position, String value) {
            }

            @Override
            public void onStop(SeekBarView seekBarView, int position, String value) {
                BluPlug.setBluPlugMinOnline(position + 1, getActivity());
            }
        });
        bluplug.add(minOnline);
    }
    if (BluPlug.hasBluPlugMaxOnline()) {
        SeekBarView maxOnline = new SeekBarView();
        maxOnline.setTitle(getString(R.string.max_cpu_online));
        maxOnline.setSummary(getString(R.string.max_cpu_online_summary));
        maxOnline.setMax(CPUFreq.getCpuCount());
        maxOnline.setMin(1);
        maxOnline.setProgress(BluPlug.getBluPlugMaxOnline() - 1);
        maxOnline.setOnSeekBarListener(new SeekBarView.OnSeekBarListener() {

            @Override
            public void onMove(SeekBarView seekBarView, int position, String value) {
            }

            @Override
            public void onStop(SeekBarView seekBarView, int position, String value) {
                BluPlug.setBluPlugMaxOnline(position + 1, getActivity());
            }
        });
        bluplug.add(maxOnline);
    }
    if (BluPlug.hasBluPlugMaxCoresScreenOff()) {
        SeekBarView maxCoresScreenOff = new SeekBarView();
        maxCoresScreenOff.setTitle(getString(R.string.max_cpu_online_screen_off));
        maxCoresScreenOff.setSummary(getString(R.string.max_cpu_online_screen_off_summary));
        maxCoresScreenOff.setMax(CPUFreq.getCpuCount());
        maxCoresScreenOff.setMin(1);
        maxCoresScreenOff.setProgress(BluPlug.getBluPlugMaxCoresScreenOff() - 1);
        maxCoresScreenOff.setOnSeekBarListener(new SeekBarView.OnSeekBarListener() {

            @Override
            public void onMove(SeekBarView seekBarView, int position, String value) {
            }

            @Override
            public void onStop(SeekBarView seekBarView, int position, String value) {
                BluPlug.setBluPlugMaxCoresScreenOff(position + 1, getActivity());
            }
        });
        bluplug.add(maxCoresScreenOff);
    }
    if (BluPlug.hasBluPlugMaxFreqScreenOff() && CPUFreq.getFreqs() != null) {
        List<String> list = new ArrayList<>();
        list.add(getString(R.string.disabled));
        list.addAll(CPUFreq.getAdjustedFreq(getActivity()));
        SeekBarView maxFreqScreenOff = new SeekBarView();
        maxFreqScreenOff.setTitle(getString(R.string.cpu_max_screen_off_freq));
        maxFreqScreenOff.setSummary(getString(R.string.cpu_max_screen_off_freq_summary));
        maxFreqScreenOff.setItems(list);
        maxFreqScreenOff.setProgress(BluPlug.getBluPlugMaxFreqScreenOff());
        maxFreqScreenOff.setOnSeekBarListener(new SeekBarView.OnSeekBarListener() {

            @Override
            public void onMove(SeekBarView seekBarView, int position, String value) {
            }

            @Override
            public void onStop(SeekBarView seekBarView, int position, String value) {
                BluPlug.setBluPlugMaxFreqScreenOff(position, getActivity());
            }
        });
        bluplug.add(maxFreqScreenOff);
    }
    if (BluPlug.hasBluPlugUpThreshold()) {
        SeekBarView upThreshold = new SeekBarView();
        upThreshold.setTitle(getString(R.string.up_threshold));
        upThreshold.setSummary(getString(R.string.up_threshold_summary));
        upThreshold.setUnit("%");
        upThreshold.setMax(100);
        upThreshold.setProgress(BluPlug.getBluPlugUpThreshold());
        upThreshold.setOnSeekBarListener(new SeekBarView.OnSeekBarListener() {

            @Override
            public void onMove(SeekBarView seekBarView, int position, String value) {
            }

            @Override
            public void onStop(SeekBarView seekBarView, int position, String value) {
                BluPlug.setBluPlugUpThreshold(position, getActivity());
            }
        });
        bluplug.add(upThreshold);
    }
    if (BluPlug.hasBluPlugUpTimerCnt()) {
        List<String> list = new ArrayList<>();
        for (float i = 0; i < 21; i++) {
            list.add(String.valueOf(i * 0.5f));
        }
        SeekBarView upTimerCnt = new SeekBarView();
        upTimerCnt.setTitle(getString(R.string.up_timer_cnt));
        upTimerCnt.setSummary(getString(R.string.up_timer_cnt_summary));
        upTimerCnt.setItems(list);
        upTimerCnt.setProgress(BluPlug.getBluPlugUpTimerCnt());
        upTimerCnt.setOnSeekBarListener(new SeekBarView.OnSeekBarListener() {

            @Override
            public void onMove(SeekBarView seekBarView, int position, String value) {
            }

            @Override
            public void onStop(SeekBarView seekBarView, int position, String value) {
                BluPlug.setBluPlugUpTimerCnt(position, getActivity());
            }
        });
        bluplug.add(upTimerCnt);
    }
    if (BluPlug.hasBluPlugDownTimerCnt()) {
        List<String> list = new ArrayList<>();
        for (float i = 0; i < 21; i++) {
            list.add(String.valueOf(i * 0.5f));
        }
        SeekBarView downTimerCnt = new SeekBarView();
        downTimerCnt.setTitle(getString(R.string.down_timer_cnt));
        downTimerCnt.setSummary(getString(R.string.down_timer_cnt_summary));
        downTimerCnt.setItems(list);
        downTimerCnt.setProgress(BluPlug.getBluPlugDownTimerCnt());
        downTimerCnt.setOnSeekBarListener(new SeekBarView.OnSeekBarListener() {

            @Override
            public void onMove(SeekBarView seekBarView, int position, String value) {
            }

            @Override
            public void onStop(SeekBarView seekBarView, int position, String value) {
                BluPlug.setBluPlugDownTimerCnt(position, getActivity());
            }
        });
        bluplug.add(downTimerCnt);
    }
    if (bluplug.size() > 0) {
        items.add(title);
        items.addAll(bluplug);
    }
}
Also used : SwitchView(com.moro.mtweaks.views.recyclerview.SwitchView) ArrayList(java.util.ArrayList) RecyclerViewItem(com.moro.mtweaks.views.recyclerview.RecyclerViewItem) SeekBarView(com.moro.mtweaks.views.recyclerview.SeekBarView) TitleView(com.moro.mtweaks.views.recyclerview.TitleView)

Aggregations

TitleView (com.moro.mtweaks.views.recyclerview.TitleView)25 ArrayList (java.util.ArrayList)19 RecyclerViewItem (com.moro.mtweaks.views.recyclerview.RecyclerViewItem)18 SeekBarView (com.moro.mtweaks.views.recyclerview.SeekBarView)18 SwitchView (com.moro.mtweaks.views.recyclerview.SwitchView)16 DescriptionView (com.moro.mtweaks.views.recyclerview.DescriptionView)7 SelectView (com.moro.mtweaks.views.recyclerview.SelectView)7 CardView (com.moro.mtweaks.views.recyclerview.CardView)6 DialogInterface (android.content.DialogInterface)1 Controls (com.moro.mtweaks.database.tools.customcontrols.Controls)1 Profiles (com.moro.mtweaks.database.tools.profiles.Profiles)1 Device (com.moro.mtweaks.utils.Device)1 Wakelocks (com.moro.mtweaks.utils.kernel.misc.Wakelocks)1 GenericSelectView2 (com.moro.mtweaks.views.recyclerview.GenericSelectView2)1 ImageView (com.moro.mtweaks.views.recyclerview.ImageView)1 HashMap (java.util.HashMap)1