Search in sources :

Example 16 with CardView

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

the class WakeFrament method t2wInit.

private void t2wInit(List<RecyclerViewItem> items) {
    CardView t2wCard = new CardView(getActivity());
    t2wCard.setTitle(getString(R.string.t2w));
    SelectView t2w = new SelectView();
    t2w.setTitle(getString(R.string.t2w));
    t2w.setSummary(getString(R.string.t2w_summary));
    t2w.setItems(T2w.getMenu(getActivity()));
    t2w.setItem(T2w.get());
    t2w.setOnItemSelected(new SelectView.OnItemSelected() {

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

Example 17 with CardView

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

the class WakeFrament method s2sInit.

private void s2sInit(List<RecyclerViewItem> items) {
    CardView s2sCard = new CardView(getActivity());
    s2sCard.setTitle(getString(R.string.s2s));
    SelectView s2s = new SelectView();
    s2s.setTitle(getString(R.string.s2s));
    s2s.setSummary(getString(R.string.s2s_summary));
    s2s.setItems(S2s.getMenu(getActivity()));
    s2s.setItem(S2s.get());
    s2s.setOnItemSelected(new SelectView.OnItemSelected() {

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

Example 18 with CardView

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

the class WakeFrament method areaInit.

private void areaInit(List<RecyclerViewItem> items) {
    CardView areaCard = new CardView(getActivity());
    areaCard.setTitle(getString(R.string.area));
    if (Dt2s.hasWidth()) {
        final int w = getResources().getDisplayMetrics().widthPixels;
        SeekBarView width = new SeekBarView();
        width.setTitle(getString(R.string.width));
        width.setUnit(getString(R.string.px));
        width.setMax(w);
        width.setMin(Math.round(w / 28.8f));
        width.setProgress(Dt2s.getWidth() - Math.round(w / 28.8f));
        width.setOnSeekBarListener(new SeekBarView.OnSeekBarListener() {

            @Override
            public void onStop(SeekBarView seekBarView, int position, String value) {
                Dt2s.setWidth(position + Math.round(w / 28.8f), getActivity());
            }

            @Override
            public void onMove(SeekBarView seekBarView, int position, String value) {
            }
        });
        areaCard.addItem(width);
    }
    if (Dt2s.hasHeight()) {
        final int h = getResources().getDisplayMetrics().heightPixels;
        SeekBarView height = new SeekBarView();
        height.setTitle(getString(R.string.height));
        height.setUnit(getString(R.string.px));
        height.setMax(h);
        height.setMin(Math.round(h / 51.2f));
        height.setProgress(Dt2s.getHeight() - Math.round(h / 51.2f));
        height.setOnSeekBarListener(new SeekBarView.OnSeekBarListener() {

            @Override
            public void onStop(SeekBarView seekBarView, int position, String value) {
                Dt2s.setHeight(position + Math.round(h / 51.2f), getActivity());
            }

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

Example 19 with CardView

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

the class WakeFrament method dt2wInit.

private void dt2wInit(List<RecyclerViewItem> items) {
    CardView dt2wCard = new CardView(getActivity());
    dt2wCard.setTitle(getString(R.string.dt2w));
    SelectView dt2w = new SelectView();
    dt2w.setTitle(getString(R.string.dt2w));
    dt2w.setSummary(getString(R.string.dt2w_summary));
    dt2w.setItems(Dt2w.getMenu(getActivity()));
    dt2w.setItem(Dt2w.get());
    dt2w.setOnItemSelected(new SelectView.OnItemSelected() {

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

Example 20 with CardView

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

the class AboutFragment method librariesInit.

private void librariesInit(List<RecyclerViewItem> items) {
    CardView about = new CardView(getActivity());
    about.setTitle(getString(R.string.app_version));
    DescriptionView app = new DescriptionView();
    app.setTitle(getString(R.string.app_name));
    app.setSummary("v" + BuildConfig.VERSION_NAME);
    about.addItem(app);
    items.add(about);
    CardView cardView = new CardView(getActivity());
    cardView.setTitle(getString(R.string.libraries_used));
    for (final String lib : sLibraries.keySet()) {
        DescriptionView descriptionView = new DescriptionView();
        descriptionView.setTitle(lib.split(",")[1]);
        descriptionView.setSummary(lib.split(",")[0]);
        descriptionView.setOnItemClickListener(new RecyclerViewItem.OnItemClickListener() {

            @Override
            public void onClick(RecyclerViewItem item) {
                Utils.launchUrl(sLibraries.get(lib), getActivity());
            }
        });
        cardView.addItem(descriptionView);
    }
    items.add(cardView);
}
Also used : DescriptionView(com.moro.mtweaks.views.recyclerview.DescriptionView) CardView(com.moro.mtweaks.views.recyclerview.CardView) RecyclerViewItem(com.moro.mtweaks.views.recyclerview.RecyclerViewItem)

Aggregations

CardView (com.moro.mtweaks.views.recyclerview.CardView)51 SeekBarView (com.moro.mtweaks.views.recyclerview.SeekBarView)23 SwitchView (com.moro.mtweaks.views.recyclerview.SwitchView)23 SelectView (com.moro.mtweaks.views.recyclerview.SelectView)20 DescriptionView (com.moro.mtweaks.views.recyclerview.DescriptionView)13 RecyclerViewItem (com.moro.mtweaks.views.recyclerview.RecyclerViewItem)9 ArrayList (java.util.ArrayList)8 TitleView (com.moro.mtweaks.views.recyclerview.TitleView)6 PopupMenu (android.support.v7.widget.PopupMenu)4 MenuItem (android.view.MenuItem)4 GenericSelectView (com.moro.mtweaks.views.recyclerview.GenericSelectView)4 DialogInterface (android.content.DialogInterface)3 Menu (android.view.Menu)3 Intent (android.content.Intent)2 GenericSelectView2 (com.moro.mtweaks.views.recyclerview.GenericSelectView2)2 XYGraphView (com.moro.mtweaks.views.recyclerview.XYGraphView)2 AppWidgetManager (android.appwidget.AppWidgetManager)1 ComponentName (android.content.ComponentName)1 View (android.view.View)1 TextView (android.widget.TextView)1