Search in sources :

Example 1 with FrequencyTableView

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

the class OverallFragment method generateStateRow.

/**
 * Creates a View that correpsonds to a CPU freq state row as specified
 * by the state parameter
 */
private void generateStateRow(CpuStateMonitor monitor, CpuStateMonitor.CpuState state, CardView frequencyCard) {
    // what percentage we've got
    float per = (float) state.getDuration() * 100 / monitor.getTotalStateTime();
    String sFreq;
    if (state.getFreq() == 0) {
        sFreq = getString(R.string.deep_sleep);
    } else {
        sFreq = state.getFreq() / 1000 + getString(R.string.mhz);
    }
    // duration
    long tSec = state.getDuration() / 100;
    String sDur = sToString(tSec);
    FrequencyTableView frequencyState = new FrequencyTableView();
    frequencyState.setFrequency(sFreq);
    frequencyState.setPercentage((int) per);
    frequencyState.setDuration(sDur);
    frequencyCard.addItem(frequencyState);
}
Also used : FrequencyTableView(com.moro.mtweaks.views.recyclerview.overallstatistics.FrequencyTableView)

Aggregations

FrequencyTableView (com.moro.mtweaks.views.recyclerview.overallstatistics.FrequencyTableView)1