Search in sources :

Example 1 with ProgressBarView

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

the class VMFragment method memBarsInit.

private void memBarsInit(List<RecyclerViewItem> items) {
    CardView card = new CardView(getActivity());
    card.setTitle(getString(R.string.memory));
    long swap_total = Device.MemInfo.getItemMb("SwapTotal");
    long swap_progress = swap_total - Device.MemInfo.getItemMb("SwapFree");
    swap = new ProgressBarView();
    swap.setTitle("SWAP");
    swap.setItems(swap_total, swap_progress);
    swap.setUnit(getResources().getString(R.string.mb));
    swap.setProgressColor(getResources().getColor(R.color.blue_accent));
    card.addItem(swap);
    long mem_total = Device.MemInfo.getItemMb("MemTotal");
    long mem_progress = mem_total - (Device.MemInfo.getItemMb("Cached") + Device.MemInfo.getItemMb("MemFree"));
    mem = new ProgressBarView();
    mem.setTitle("RAM");
    mem.setItems(mem_total, mem_progress);
    mem.setUnit(getResources().getString(R.string.mb));
    mem.setProgressColor(getResources().getColor(R.color.orange_accent));
    card.addItem(mem);
    items.add(card);
}
Also used : CardView(com.moro.mtweaks.views.recyclerview.CardView) ProgressBarView(com.moro.mtweaks.views.recyclerview.ProgressBarView)

Aggregations

CardView (com.moro.mtweaks.views.recyclerview.CardView)1 ProgressBarView (com.moro.mtweaks.views.recyclerview.ProgressBarView)1