Search in sources :

Example 16 with SelectView

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

the class WakeFrament method dt2sInit.

private void dt2sInit(List<RecyclerViewItem> items) {
    CardView dt2sCard = new CardView(getActivity());
    dt2sCard.setTitle(getString(R.string.dt2s));
    SelectView dt2s = new SelectView();
    dt2s.setTitle(getString(R.string.dt2s));
    dt2s.setSummary(getString(R.string.dt2s_summary));
    dt2s.setItems(Dt2s.getMenu(getActivity()));
    dt2s.setItem(Dt2s.get());
    dt2s.setOnItemSelected(new SelectView.OnItemSelected() {

        @Override
        public void onItemSelected(SelectView selectView, int position, String item) {
            Dt2s.set(position, getActivity());
        }
    });
    dt2sCard.addItem(dt2s);
    items.add(dt2sCard);
}
Also used : CardView(com.moro.mtweaks.views.recyclerview.CardView) SelectView(com.moro.mtweaks.views.recyclerview.SelectView)

Example 17 with SelectView

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

the class WakeFrament method s2wInit.

private void s2wInit(List<RecyclerViewItem> items) {
    CardView s2wCard = new CardView(getActivity());
    s2wCard.setTitle(getString(R.string.s2w));
    if (S2w.supported()) {
        SelectView s2w = new SelectView();
        s2w.setTitle(getString(R.string.s2w));
        s2w.setSummary(getString(R.string.s2w_summary));
        s2w.setItems(S2w.getMenu(getActivity()));
        s2w.setItem(S2w.get());
        s2w.setOnItemSelected(new SelectView.OnItemSelected() {

            @Override
            public void onItemSelected(SelectView selectView, int position, String item) {
                S2w.set(position, getActivity());
            }
        });
        s2wCard.addItem(s2w);
    }
    if (S2w.hasLenient()) {
        SwitchView lenient = new SwitchView();
        lenient.setTitle(getString(R.string.lenient));
        lenient.setSummary(getString(R.string.lenient_summary));
        lenient.setChecked(S2w.isLenientEnabled());
        lenient.addOnSwitchListener(new SwitchView.OnSwitchListener() {

            @Override
            public void onChanged(SwitchView switchView, boolean isChecked) {
                S2w.enableLenient(isChecked, getActivity());
            }
        });
        s2wCard.addItem(lenient);
    }
    if (s2wCard.size() > 0) {
        items.add(s2wCard);
    }
}
Also used : SwitchView(com.moro.mtweaks.views.recyclerview.SwitchView) CardView(com.moro.mtweaks.views.recyclerview.CardView) SelectView(com.moro.mtweaks.views.recyclerview.SelectView)

Example 18 with SelectView

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

the class CPUFragment method cpuQuietInit.

private void cpuQuietInit(List<RecyclerViewItem> items) {
    List<RecyclerViewItem> views = new ArrayList<>();
    CardView cpuQuietCard = new CardView(getActivity());
    cpuQuietCard.setTitle(getString(R.string.cpu_quiet));
    if (Misc.hasCpuQuietEnable()) {
        SwitchView cpuQuietEnable = new SwitchView();
        cpuQuietEnable.setSummary(getString(R.string.cpu_quiet));
        cpuQuietEnable.setChecked(Misc.isCpuQuietEnabled());
        cpuQuietEnable.addOnSwitchListener(new SwitchView.OnSwitchListener() {

            @Override
            public void onChanged(SwitchView switchView, boolean isChecked) {
                Misc.enableCpuQuiet(isChecked, getActivity());
            }
        });
        views.add(cpuQuietEnable);
    }
    if (Misc.hasCpuQuietGovernors()) {
        SelectView cpuQuietGovernors = new SelectView();
        cpuQuietGovernors.setSummary(getString(R.string.cpu_quiet_governor));
        cpuQuietGovernors.setItems(Misc.getCpuQuietAvailableGovernors());
        cpuQuietGovernors.setItem(Misc.getCpuQuietCurGovernor());
        cpuQuietGovernors.setOnItemSelected(new SelectView.OnItemSelected() {

            @Override
            public void onItemSelected(SelectView selectView, int position, String item) {
                Misc.setCpuQuietGovernor(item, getActivity());
            }
        });
        views.add(cpuQuietGovernors);
    }
    if (views.size() > 0) {
        DescriptionView descriptionView = new DescriptionView();
        descriptionView.setSummary(getString(R.string.cpu_quiet_summary));
        cpuQuietCard.addItem(descriptionView);
        for (RecyclerViewItem item : views) {
            cpuQuietCard.addItem(item);
        }
        items.add(cpuQuietCard);
    }
}
Also used : SwitchView(com.moro.mtweaks.views.recyclerview.SwitchView) ArrayList(java.util.ArrayList) CardView(com.moro.mtweaks.views.recyclerview.CardView) RecyclerViewItem(com.moro.mtweaks.views.recyclerview.RecyclerViewItem) DescriptionView(com.moro.mtweaks.views.recyclerview.DescriptionView) SelectView(com.moro.mtweaks.views.recyclerview.SelectView)

Example 19 with SelectView

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

the class CPUFragment method cfsSchedulerInit.

private void cfsSchedulerInit(List<RecyclerViewItem> items) {
    SelectView cfsScheduler = new SelectView();
    cfsScheduler.setTitle(getString(R.string.cfs_scheduler_policy));
    cfsScheduler.setSummary(getString(R.string.cfs_scheduler_policy_summary));
    cfsScheduler.setItems(Misc.getAvailableCFSSchedulers());
    cfsScheduler.setItem(Misc.getCurrentCFSScheduler());
    cfsScheduler.setOnItemSelected(new SelectView.OnItemSelected() {

        @Override
        public void onItemSelected(SelectView selectView, int position, String item) {
            Misc.setCFSScheduler(item, getActivity());
        }
    });
    items.add(cfsScheduler);
}
Also used : SelectView(com.moro.mtweaks.views.recyclerview.SelectView)

Example 20 with SelectView

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

the class CPUFragment method mcPowerSavingInit.

private void mcPowerSavingInit(List<RecyclerViewItem> items) {
    SelectView mcPowerSaving = new SelectView();
    mcPowerSaving.setTitle(getString(R.string.mc_power_saving));
    mcPowerSaving.setSummary(getString(R.string.mc_power_saving_summary));
    mcPowerSaving.setItems(Arrays.asList(getResources().getStringArray(R.array.mc_power_saving_items)));
    mcPowerSaving.setItem(Misc.getCurMcPowerSaving());
    mcPowerSaving.setOnItemSelected(new SelectView.OnItemSelected() {

        @Override
        public void onItemSelected(SelectView selectView, int position, String item) {
            Misc.setMcPowerSaving(position, getActivity());
        }
    });
    items.add(mcPowerSaving);
}
Also used : SelectView(com.moro.mtweaks.views.recyclerview.SelectView)

Aggregations

SelectView (com.moro.mtweaks.views.recyclerview.SelectView)29 CardView (com.moro.mtweaks.views.recyclerview.CardView)20 SwitchView (com.moro.mtweaks.views.recyclerview.SwitchView)14 SeekBarView (com.moro.mtweaks.views.recyclerview.SeekBarView)12 ArrayList (java.util.ArrayList)10 RecyclerViewItem (com.moro.mtweaks.views.recyclerview.RecyclerViewItem)8 TitleView (com.moro.mtweaks.views.recyclerview.TitleView)7 DescriptionView (com.moro.mtweaks.views.recyclerview.DescriptionView)5 GenericSelectView (com.moro.mtweaks.views.recyclerview.GenericSelectView)3 GenericSelectView2 (com.moro.mtweaks.views.recyclerview.GenericSelectView2)2 XYGraphView (com.moro.mtweaks.views.recyclerview.XYGraphView)2