com.grarak.kerneladiutor.R Java Examples

The following examples show how to use com.grarak.kerneladiutor.R. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ProfileWidget.java    From KA27 with Apache License 2.0 7 votes vote down vote up
@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
    super.onUpdate(context, appWidgetManager, appWidgetIds);

    for (int appWidgetId: appWidgetIds) {
        Intent svcIntent = new Intent(context, WidgetService.class);
        svcIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
        svcIntent.setData(Uri.parse(svcIntent.toUri(Intent.URI_INTENT_SCHEME)));

        RemoteViews widget = new RemoteViews(context.getPackageName(), R.layout.profile_widget_layout);
        widget.setRemoteAdapter(R.id.profile_list, svcIntent);

        widget.setPendingIntentTemplate(R.id.profile_list, getPendingIntent(context, LIST_ITEM_CLICK));

        appWidgetManager.updateAppWidget(appWidgetId, widget);
    }
}
 
Example #2
Source File: BackupFragment.java    From kernel_adiutor with Apache License 2.0 6 votes vote down vote up
private void options(final boolean flashing, final RootFile file) {
    final LinkedHashMap<String, Backup.PARTITION> menu = new LinkedHashMap<>();
    if (Backup.getBootPartition() != null)
        menu.put(getString(R.string.boot), Backup.PARTITION.BOOT);
    if (Backup.getRecoveryPartition() != null)
        menu.put(getString(R.string.recovery), Backup.PARTITION.RECOVERY);
    if (Backup.getFotaPartition() != null)
        menu.put(getString(R.string.fota), Backup.PARTITION.FOTA);

    String[] items = new String[menu.keySet().toArray().length];
    for (int i = 0; i < items.length; i++)
        items[i] = (String) menu.keySet().toArray()[i];
    new AlertDialog.Builder(getActivity()).setItems(items,
            new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    if (flashing)
                        restoreDialog(file, (Backup.PARTITION) menu.values().toArray()[which], false);
                    else backupDialog((Backup.PARTITION) menu.values().toArray()[which]);
                }
            }).show();
}
 
Example #3
Source File: IOFragment.java    From KA27 with Apache License 2.0 6 votes vote down vote up
private void externalStorageInit() {
    DDivider mExternalStorageDivider = new DDivider();
    mExternalStorageDivider.setText(getString(R.string.external_storage));

    addView(mExternalStorageDivider);

    mExternalSchedulerCard = new PopupCardView.DPopupCard(IO.getSchedulers(IO.StorageType.EXTERNAL));
    mExternalSchedulerCard.setDescription(getString(R.string.scheduler));
    mExternalSchedulerCard.setItem(IO.getScheduler(IO.StorageType.EXTERNAL));
    mExternalSchedulerCard.setOnDPopupCardListener(this);

    addView(mExternalSchedulerCard);

    mExternalTunableCard = new CardViewItem.DCardView();
    mExternalTunableCard.setDescription(getString(R.string.scheduler_tunable));
    mExternalTunableCard.setOnDCardListener(this);

    addView(mExternalTunableCard);

    mExternalReadAheadCard = new PopupCardView.DPopupCard(readheads);
    mExternalReadAheadCard.setDescription(getString(R.string.read_ahead));
    mExternalReadAheadCard.setItem(IO.getReadahead(IO.StorageType.EXTERNAL) + getString(R.string.kb));
    mExternalReadAheadCard.setOnDPopupCardListener(this);

    addView(mExternalReadAheadCard);
}
 
Example #4
Source File: ColorPalette.java    From KA27 with Apache License 2.0 6 votes vote down vote up
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    super.onMeasure(widthMeasureSpec, heightMeasureSpec);

    int desiredWidth = getResources().getDisplayMetrics().widthPixels;
    int desiredHeight = getResources().getDimensionPixelSize(R.dimen.colorpalette_height);

    int widthMode = MeasureSpec.getMode(widthMeasureSpec);
    int widthSize = MeasureSpec.getSize(widthMeasureSpec);
    int heightMode = MeasureSpec.getMode(heightMeasureSpec);
    int heightSize = MeasureSpec.getSize(heightMeasureSpec);

    int width;
    int height;

    if (widthMode == MeasureSpec.EXACTLY) width = widthSize;
    else if (widthMode == MeasureSpec.AT_MOST) width = Math.min(desiredWidth, widthSize);
    else width = desiredWidth;

    if (heightMode == MeasureSpec.EXACTLY) height = heightSize;
    else if (heightMode == MeasureSpec.AT_MOST) height = Math.min(desiredHeight, heightSize);
    else height = desiredHeight;


    setMeasuredDimension(width, height);
}
 
Example #5
Source File: KernelInformationFragment.java    From KA27 with Apache License 2.0 6 votes vote down vote up
@Override
public void init(Bundle savedInstanceState) {
    super.init(savedInstanceState);

    CardViewItem.DCardView kernelVersionCard = new CardViewItem.DCardView();
    kernelVersionCard.setTitle(getString(R.string.kernel_version));
    kernelVersionCard.setDescription(Info.getKernelVersion());

    CardViewItem.DCardView cpuCard = new CardViewItem.DCardView();
    cpuCard.setTitle(getString(R.string.cpu_information));
    cpuCard.setDescription(Info.getCpuInfo());

    CardViewItem.DCardView memCard = new CardViewItem.DCardView();
    memCard.setTitle(getString(R.string.memory_information));
    memCard.setDescription(Info.getMemInfo());

    addView(kernelVersionCard);
    addView(cpuCard);
    addView(memCard);
}
 
Example #6
Source File: InitdFragment.java    From KA27 with Apache License 2.0 6 votes vote down vote up
@Override
public void preInit(Bundle savedInstanceState) {
    super.preInit(savedInstanceState);
    fabView.setVisibility(View.GONE);
    fabView = addButton;

    backgroundView.setVisibility(View.GONE);
    backgroundView = null;

    applyOnBootText.setText(getString(R.string.emulate_initd));
    applyOnBootView.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            Utils.saveBoolean("emulateinit.d", isChecked, getActivity());
        }
    });
    applyOnBootView.setChecked(Utils.getBoolean("emulateinit.d", false, getActivity()));
}
 
Example #7
Source File: PopupCardView.java    From kernel_adiutor with Apache License 2.0 6 votes vote down vote up
public PopupCardView(Context context, final List<String> list) {
    super(context, R.layout.popup_cardview);
    this.list = list;

    if (list != null) {
        popup = new PopupMenu(getContext(), valueView);
        for (int i = 0; i < list.size(); i++)
            popup.getMenu().add(Menu.NONE, i, Menu.NONE, list.get(i));
        popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
            @Override
            public boolean onMenuItemClick(MenuItem item) {
                if (valueView != null) {
                    valueText = list.get(item.getItemId()) + " ";
                    valueView.setText(list.get(item.getItemId()) + " ");
                }
                if (onPopupCardListener != null)
                    onPopupCardListener.onItemSelected(PopupCardView.this, item.getItemId());
                return false;
            }
        });
    }

    if (onPopupCardListener != null) setListener();
}
 
Example #8
Source File: GPUFragment.java    From kernel_adiutor with Apache License 2.0 6 votes vote down vote up
private void governorInit() {
    if (GPU.hasGpu2dGovernor()) {
        m2dGovernorCard = new PopupCardView.DPopupCard(GPU.getGpu2dGovernors());
        m2dGovernorCard.setTitle(getString(R.string.gpu_2d_governor));
        m2dGovernorCard.setDescription(getString(R.string.gpu_2d_governor_summary));
        m2dGovernorCard.setItem(GPU.getGpu2dGovernor());
        m2dGovernorCard.setOnDPopupCardListener(this);

        addView(m2dGovernorCard);
    }

    if (GPU.hasGpuGovernor()) {
        mGovernorCard = new PopupCardView.DPopupCard(GPU.getGpuGovernors());
        mGovernorCard.setTitle(getString(R.string.gpu_governor));
        mGovernorCard.setDescription(getString(R.string.gpu_governor_summary));
        mGovernorCard.setItem(GPU.getGpuGovernor());
        mGovernorCard.setOnDPopupCardListener(this);

        addView(mGovernorCard);
    }
}
 
Example #9
Source File: IOFragment.java    From kernel_adiutor with Apache License 2.0 6 votes vote down vote up
private void externalStorageInit() {
    DDivider mExternalStorageDivider = new DDivider();
    mExternalStorageDivider.setText(getString(R.string.external_storage));

    addView(mExternalStorageDivider);

    mExternalSchedulerCard = new PopupCardView.DPopupCard(IO.getSchedulers(IO.StorageType.EXTERNAL));
    mExternalSchedulerCard.setDescription(getString(R.string.scheduler));
    mExternalSchedulerCard.setItem(IO.getScheduler(IO.StorageType.EXTERNAL));
    mExternalSchedulerCard.setOnDPopupCardListener(this);

    addView(mExternalSchedulerCard);

    mExternalTunableCard = new CardViewItem.DCardView();
    mExternalTunableCard.setDescription(getString(R.string.scheduler_tunable));
    mExternalTunableCard.setOnDCardListener(this);

    addView(mExternalTunableCard);

    mExternalReadAheadCard = new PopupCardView.DPopupCard(readheads);
    mExternalReadAheadCard.setDescription(getString(R.string.read_ahead));
    mExternalReadAheadCard.setItem(IO.getReadahead(IO.StorageType.EXTERNAL) + getString(R.string.kb));
    mExternalReadAheadCard.setOnDPopupCardListener(this);

    addView(mExternalReadAheadCard);
}
 
Example #10
Source File: MiscFragment.java    From kernel_adiutor with Apache License 2.0 6 votes vote down vote up
private void vibrationInit() {
    List<String> list = new ArrayList<>();
    for (int i = 0; i < 101; i++)
        list.add(i + "%");

    int max = Misc.getVibrationMax();
    int min = Misc.getVibrationMin();
    float offset = (max - min) / (float) 101;

    mVibrationCard = new SeekBarCardView.DSeekBarCard(list);
    mVibrationCard.setTitle(getString(R.string.vibration_strength));
    mVibrationCard.setProgress(Math.round((Misc.getCurVibration() - min) / offset));
    mVibrationCard.setOnDSeekBarCardListener(this);

    addView(mVibrationCard);
}
 
Example #11
Source File: GPUFragment.java    From KA27 with Apache License 2.0 6 votes vote down vote up
private void maxFreqInit() {
    if (GPU.hasGpu2dMaxFreq() && hasGpu2DfreqsString) {

        mMax2dFreqCard = new PopupCardView.DPopupCard(Gpu2DfreqsString);
        mMax2dFreqCard.setTitle(getString(R.string.gpu_2d_max_freq));
        mMax2dFreqCard.setDescription(getString(R.string.gpu_2d_max_freq_summary));
        mMax2dFreqCard.setItem(GPU.getGpu2dMaxFreq() / 1000000 + getString(R.string.mhz));
        mMax2dFreqCard.setOnDPopupCardListener(this);

        addView(mMax2dFreqCard);
    }

    if (GPU.hasGpuMaxFreq() && hasGpufreqsString) {
        mMaxFreqCard = new PopupCardView.DPopupCard(GpufreqsString);
        mMaxFreqCard.setTitle(getString(R.string.gpu_max_freq));
        mMaxFreqCard.setDescription(getString(R.string.gpu_max_freq_summary));
        mMaxFreqCard.setItem(GpufreqsString.get(GPU.getGpuMaxPowerLevel()));
        mMaxFreqCard.setOnDPopupCardListener(this);

        addView(mMaxFreqCard);
    }
}
 
Example #12
Source File: BuildpropFragment.java    From kernel_adiutor with Apache License 2.0 6 votes vote down vote up
@Override
public void run() {
    if (searchItem != null) MenuItemCompat.collapseActionView(searchItem);

    removeAllViews();
    buildpropItem = Buildprop.getProps();
    for (int i = 0; i < buildpropItem.size(); i++) {
        PopupCardView.DPopupCard mPropCard = new PopupCardView.DPopupCard(null);
        mPropCard.setDescription((String) buildpropItem.keySet().toArray()[i]);
        mPropCard.setItem((String) buildpropItem.values().toArray()[i]);
        mPropCard.setOnClickListener(BuildpropFragment.this);

        addView(mPropCard);
    }

    try {
        getActivity().runOnUiThread(new Runnable() {
            @Override
            public void run() {
                title.setText(getString(R.string.items_found, buildpropItem.size()));
                refreshLayout.setRefreshing(false);
            }
        });
    } catch (NullPointerException ignored) {
    }
}
 
Example #13
Source File: SettingsFragment.java    From KA27 with Apache License 2.0 6 votes vote down vote up
private void navigationDrawerInit() {
    DDivider mNavigationDrawerDividerCard = new DDivider();
    mNavigationDrawerDividerCard.setText(getString(R.string.navigation_drawer));

    addView(mNavigationDrawerDividerCard);

    if (!Utils.isTV(getActivity())) {
        SwitchCardView.DSwitchCard mNavigationDrawerCard = new SwitchCardView.DSwitchCard();
        mNavigationDrawerCard.setTitle(getString(R.string.navigation_drawer));
        mNavigationDrawerCard.setDescription(getString(R.string.navigation_drawer_summary));
        mNavigationDrawerCard.setChecked(Utils.getBoolean("Navbar_Position_Alternate", false, getActivity()));
        mNavigationDrawerCard.setOnDSwitchCardListener(new SwitchCardView.DSwitchCard.OnDSwitchCardListener() {
            @Override
            public void onChecked(SwitchCardView.DSwitchCard dSwitchCard, boolean checked) {
                Utils.saveBoolean("Navbar_Position_Alternate", checked, getActivity());
                MainActivity.reconfigureNavigationDrawer(getContext());
            }
        });

        addView(mNavigationDrawerCard);
    }
}
 
Example #14
Source File: CPUFragment.java    From KA27 with Apache License 2.0 5 votes vote down vote up
private void coreInit() {
    LinearLayout layout = new LinearLayout(getActivity());
    layout.setOrientation(LinearLayout.VERTICAL);

    mCoreCheckBox = new AppCompatCheckBox[CPU.getBigCoreRange().size()];
    mCoreProgressBar = new ProgressBar[mCoreCheckBox.length];
    mCoreUsageText = new AppCompatTextView[mCoreCheckBox.length];
    mCoreFreqText = new AppCompatTextView[mCoreCheckBox.length];
    for (int i = 0; i < mCoreCheckBox.length; i++) {
        View view = inflater.inflate(R.layout.coreview, container, false);

        mCoreCheckBox[i] = (AppCompatCheckBox) view.findViewById(R.id.core_checkbox);
        mCoreCheckBox[i].setText(getString(R.string.core, i));
        mCoreCheckBox[i].setOnClickListener(this);

        mCoreProgressBar[i] = (ProgressBar) view.findViewById(R.id.progressbar);
        mCoreProgressBar[i].setMax(CPU.getFreqs().size());

        mCoreUsageText[i] = (AppCompatTextView) view.findViewById(R.id.usage);

        mCoreFreqText[i] = (AppCompatTextView) view.findViewById(R.id.freq);

        layout.addView(view);
    }

    CardViewItem.DCardView coreCard = new CardViewItem.DCardView();
    coreCard.setTitle(getString(R.string.current_freq));
    coreCard.setView(layout);

    addView(coreCard);
}
 
Example #15
Source File: CPUFragment.java    From KA27 with Apache License 2.0 5 votes vote down vote up
private void powerSavingWqInit() {
    mPowerSavingWqCard = new SwitchCardView.DSwitchCard();
    mPowerSavingWqCard.setTitle(getString(R.string.power_saving_wq));
    mPowerSavingWqCard.setDescription(getString(R.string.power_saving_wq_summary));
    mPowerSavingWqCard.setChecked(CPU.isPowerSavingWqActive());
    mPowerSavingWqCard.setOnDSwitchCardListener(this);

    addView(mPowerSavingWqCard);
}
 
Example #16
Source File: BackupFragment.java    From KA27 with Apache License 2.0 5 votes vote down vote up
private void deleteDialog(final RootFile file) {
    Utils.confirmDialog(null, getString(R.string.delete_question, file.getName()), new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
            file.delete();
            getHandler().post(new Runnable() {
                @Override
                public void run() {
                    create();
                }
            });
        }
    }, getActivity());
}
 
Example #17
Source File: MiscFragment.java    From kernel_adiutor with Apache License 2.0 5 votes vote down vote up
private void bclHotplugInit() {
    mBclHotplugCard = new SwitchCardView.DSwitchCard();
    mBclHotplugCard.setTitle(getString(R.string.bcl_hotplug));
    mBclHotplugCard.setDescription(getString(R.string.bcl_hotplug_summary));
    mBclHotplugCard.setChecked(Misc.isBclHotplugActive());
    mBclHotplugCard.setOnDSwitchCardListener(this);

    addView(mBclHotplugCard);
}
 
Example #18
Source File: CPUFragment.java    From KA27 with Apache License 2.0 5 votes vote down vote up
private void coreLITTLEInit() {
    LinearLayout layout = new LinearLayout(getActivity());
    layout.setOrientation(LinearLayout.VERTICAL);

    mCoreCheckBoxLITTLE = new AppCompatCheckBox[CPU.getLITTLECoreRange().size()];
    mCoreProgressBarLITTLE = new ProgressBar[mCoreCheckBoxLITTLE.length];
    mCoreUsageTextLITTLE = new AppCompatTextView[mCoreCheckBoxLITTLE.length];
    mCoreFreqTextLITTLE = new AppCompatTextView[mCoreCheckBoxLITTLE.length];
    for (int i = 0; i < mCoreCheckBoxLITTLE.length; i++) {
        View view = inflater.inflate(R.layout.coreview, container, false);

        mCoreCheckBoxLITTLE[i] = (AppCompatCheckBox) view.findViewById(R.id.core_checkbox);
        mCoreCheckBoxLITTLE[i].setText(getString(R.string.core, i));
        mCoreCheckBoxLITTLE[i].setOnClickListener(this);

        mCoreProgressBarLITTLE[i] = (ProgressBar) view.findViewById(R.id.progressbar);
        mCoreProgressBarLITTLE[i].setMax(CPU.getFreqs(CPU.getLITTLEcore()).size());

        mCoreUsageTextLITTLE[i] = (AppCompatTextView) view.findViewById(R.id.usage);

        mCoreFreqTextLITTLE[i] = (AppCompatTextView) view.findViewById(R.id.freq);

        layout.addView(view);
    }

    CardViewItem.DCardView coreCard = new CardViewItem.DCardView();
    coreCard.setTitle(getString(R.string.current_freq));
    coreCard.setView(layout);

    addView(coreCard);
}
 
Example #19
Source File: CPUFragment.java    From KA27 with Apache License 2.0 5 votes vote down vote up
private void freqLITTLEInit() {
    List < String > freqs = new ArrayList < > ();
    for (int freq: CPU.getFreqs(CPU.getLITTLEcore()))
        freqs.add(freq / 1000 + getString(R.string.mhz));

    mMaxFreqLITTLECard = new PopupCardView.DPopupCard(freqs);
    mMaxFreqLITTLECard.setDescription(getString(R.string.cpu_max_freq));
    mMaxFreqLITTLECard.setItem(CPU.getMaxFreq(CPU.getLITTLEcore(), true) / 1000 + getString(R.string.mhz));
    mMaxFreqLITTLECard.setOnDPopupCardListener(this);

    mMinFreqLITTLECard = new PopupCardView.DPopupCard(freqs);
    mMinFreqLITTLECard.setDescription(getString(R.string.cpu_min_freq));
    mMinFreqLITTLECard.setItem(CPU.getMinFreq(CPU.getLITTLEcore(), true) / 1000 + getString(R.string.mhz));
    mMinFreqLITTLECard.setOnDPopupCardListener(this);

    addView(mMaxFreqLITTLECard);
    addView(mMinFreqLITTLECard);

    if (CPU.hasMaxScreenOffFreq()) {
        mMaxScreenOffFreqLITTLECard = new PopupCardView.DPopupCard(freqs);
        mMaxScreenOffFreqLITTLECard.setDescription(getString(R.string.cpu_max_screen_off_freq));
        mMaxScreenOffFreqLITTLECard.setItem(CPU.getMaxScreenOffFreq(CPU.getLITTLEcore(), true) / 1000 +
            getString(R.string.mhz));
        mMaxScreenOffFreqLITTLECard.setOnDPopupCardListener(this);

        addView(mMaxScreenOffFreqLITTLECard);
    }
}
 
Example #20
Source File: SoundFragment.java    From kernel_adiutor with Apache License 2.0 5 votes vote down vote up
private void handsetMicrophoneGainInit() {
    mHandsetMicrophoneGainCard = new SeekBarCardView.DSeekBarCard(Sound.getHandsetMicrophoneGainLimits());
    mHandsetMicrophoneGainCard.setTitle(getString(R.string.handset_microphone_gain));
    mHandsetMicrophoneGainCard.setProgress(Sound.getHandsetMicrophoneGainLimits().indexOf(
            Sound.getCurHandsetMicrophoneGain()));
    mHandsetMicrophoneGainCard.setOnDSeekBarCardListener(this);

    addView(mHandsetMicrophoneGainCard);
}
 
Example #21
Source File: CPUVoltageFragment.java    From KA27 with Apache License 2.0 5 votes vote down vote up
@Override
public void preInit(Bundle savedInstanceState) {
    super.preInit(savedInstanceState);
    SharedPreferences storedvoltagetable = getContext().getSharedPreferences("voltage_table", 0);
    // Save the current Voltage table if it doesn't exist. This will prevent issues in the table if they open it before a reboot.
    // On reboot, the default table will overwrite this as it will have any adjustments done since boot as the reference. This is imperfect, but no better way to do it.
    String toasttext = "";
    List < String > frequencies = CPUVoltage.getFreqs();
    if (frequencies.isEmpty()) return;
    if (storedvoltagetable.getString(frequencies.get(0), "-1").equals("-1")) {
        toasttext = getString(R.string.non_default_reference) + " -- ";
        CPUVoltage.storeVoltageTable(getContext());
    }
    Utils.toast(toasttext + getString(R.string.voltages_toast_notification), getActivity(), Toast.LENGTH_LONG);
}
 
Example #22
Source File: PopupCardView.java    From KA27 with Apache License 2.0 5 votes vote down vote up
@Override
public void setUpInnerLayout(View view) {
    headerCardView = new HeaderCardView(getContext());

    descriptionView = (TextView) view.findViewById(R.id.description_view);
    valueView = (TextView) view.findViewById(R.id.value_view);

    setUpTitle();
    setUpDescription();
    if (valueText != null) valueView.setText(valueText);
}
 
Example #23
Source File: ScreenFragment.java    From kernel_adiutor with Apache License 2.0 5 votes vote down vote up
private String getColor(int position) {
    switch (position) {
        case 0:
            return getString(R.string.red);
        case 1:
            return getString(R.string.green);
        case 2:
            return getString(R.string.blue);
        default:
            return null;
    }
}
 
Example #24
Source File: CPUHotplugFragment.java    From kernel_adiutor with Apache License 2.0 5 votes vote down vote up
private void thunderPlugInit() {
    if (CPUHotplug.hasThunderPlugEnable()) {
        mThunderPlugEnableCard = new SwitchCardView.DSwitchCard();
        mThunderPlugEnableCard.setTitle(getString(R.string.thunderplug));
        mThunderPlugEnableCard.setDescription(getString(R.string.thunderplug_summary));
        mThunderPlugEnableCard.setChecked(CPUHotplug.isThunderPlugActive());
        mThunderPlugEnableCard.setOnDSwitchCardListener(this);

        addView(mThunderPlugEnableCard);
    }
}
 
Example #25
Source File: BackupFragment.java    From KA27 with Apache License 2.0 5 votes vote down vote up
private void create() {
    removeAllViews();

    final long size = viewInit(boot, Backup.PARTITION.BOOT) + viewInit(recovery, Backup.PARTITION.RECOVERY);
    getActivity().runOnUiThread(new Runnable() {
        @Override
        public void run() {
            title.setText(getCount() > 0 ? getString(R.string.items_found, getCount()) + " (" +
                size + getString(R.string.mb) + ")" : getString(R.string.no_backups));
        }
    });
}
 
Example #26
Source File: CPUFragment.java    From kernel_adiutor with Apache License 2.0 5 votes vote down vote up
private void freqLITTLEInit() {
    List<String> freqs = new ArrayList<>();
    for (int freq : CPU.getFreqs(CPU.getLITTLEcore()))
        freqs.add(freq / 1000 + getString(R.string.mhz));

    mMaxFreqLITTLECard = new PopupCardView.DPopupCard(freqs);
    mMaxFreqLITTLECard.setDescription(getString(R.string.cpu_max_freq));
    mMaxFreqLITTLECard.setItem(CPU.getMaxFreq(CPU.getLITTLEcore(), true) / 1000 + getString(R.string.mhz));
    mMaxFreqLITTLECard.setOnDPopupCardListener(this);

    mMinFreqLITTLECard = new PopupCardView.DPopupCard(freqs);
    mMinFreqLITTLECard.setDescription(getString(R.string.cpu_min_freq));
    mMinFreqLITTLECard.setItem(CPU.getMinFreq(CPU.getLITTLEcore(), true) / 1000 + getString(R.string.mhz));
    mMinFreqLITTLECard.setOnDPopupCardListener(this);

    addView(mMaxFreqLITTLECard);
    addView(mMinFreqLITTLECard);

    if (CPU.hasMaxScreenOffFreq()) {
        mMaxScreenOffFreqLITTLECard = new PopupCardView.DPopupCard(freqs);
        mMaxScreenOffFreqLITTLECard.setDescription(getString(R.string.cpu_max_screen_off_freq));
        mMaxScreenOffFreqLITTLECard.setItem(CPU.getMaxScreenOffFreq(CPU.getLITTLEcore(), true) / 1000 +
                getString(R.string.mhz));
        mMaxScreenOffFreqLITTLECard.setOnDPopupCardListener(this);

        addView(mMaxScreenOffFreqLITTLECard);
    }
}
 
Example #27
Source File: AboutusFragment.java    From kernel_adiutor with Apache License 2.0 5 votes vote down vote up
private void appSourceInit() {
    CardViewItem.DCardView mAppSourceCard = new CardViewItem.DCardView();
    mAppSourceCard.setTitle(getString(R.string.open_source));
    mAppSourceCard.setDescription(getString(R.string.open_source_summary));
    mAppSourceCard.setOnDCardListener(new CardViewItem.DCardView.OnDCardListener() {
        @Override
        public void onClick(CardViewItem.DCardView dCardView) {
            Utils.launchUrl(getActivity(), APP_SOURCE);
        }
    });

    addView(mAppSourceCard);
}
 
Example #28
Source File: VMFragment.java    From KA27 with Apache License 2.0 5 votes vote down vote up
private void overcommitratioInit() {
    List < String > list = new ArrayList < > ();
    list.add(getString(R.string.disabled));
    for (int i = 1; i <= 100; i++)
        list.add(i + getString(R.string.percent));

    mOverCommitRatioCard = new SeekBarCardView.DSeekBarCard(list);
    mOverCommitRatioCard.setTitle(getString(R.string.overcommit_ratio));
    mOverCommitRatioCard.setDescription(getString(R.string.overcommit_ratio_summary));
    mOverCommitRatioCard.setProgress(VM.getOverCommitRatio());
    mOverCommitRatioCard.setOnDSeekBarCardListener(this);

    addView(mOverCommitRatioCard);

}
 
Example #29
Source File: CPUHotplugFragment.java    From KA27 with Apache License 2.0 5 votes vote down vote up
private void himaInit() {
    if (CPUHotplug.hasHimaEnable()) {
        mHimaEnableCard = new SwitchCardView.DSwitchCard();
        mHimaEnableCard.setTitle(getString(R.string.hima));
        mHimaEnableCard.setDescription(getString(R.string.hima_summary));
        mHimaEnableCard.setChecked(CPUHotplug.isHimaActive());
        mHimaEnableCard.setOnDSwitchCardListener(this);

        addView(mHimaEnableCard);
    }
}
 
Example #30
Source File: SoundFragment.java    From kernel_adiutor with Apache License 2.0 5 votes vote down vote up
private void headphoneGainInit() {

        mHeadphoneGainIndependentCard = new SwitchCardView.DSwitchCard();
        mHeadphoneGainIndependentCard.setTitle(getString(R.string.headphone_gain_independent));
        mHeadphoneGainIndependentCard.setDescription(getString(R.string.headphone_gain_independent_summary));
        mHeadphoneGainIndependentCard.setChecked(Sound.isIndependentHeadphoneGainEnabled(getActivity()));
        mHeadphoneGainIndependentCard.setOnDSwitchCardListener(this);

        addView(mHeadphoneGainIndependentCard);

        if (Sound.isIndependentHeadphoneGainEnabled(getActivity())) {

            mHeadphoneGainLCard = new SeekBarCardView.DSeekBarCard(Sound.getHeadphoneGainLimits());
            mHeadphoneGainLCard.setTitle(getString(R.string.headphone_gain_l));
            mHeadphoneGainLCard.setProgress(Sound.getHeadphoneGainLimits().indexOf(Sound.getCurHeadphoneGain("L")));
            mHeadphoneGainLCard.setOnDSeekBarCardListener(this);

            addView(mHeadphoneGainLCard);

            mHeadphoneGainRCard = new SeekBarCardView.DSeekBarCard(Sound.getHeadphoneGainLimits());
            mHeadphoneGainRCard.setTitle(getString(R.string.headphone_gain_r));
            mHeadphoneGainRCard.setProgress(Sound.getHeadphoneGainLimits().indexOf(Sound.getCurHeadphoneGain("R")));
            mHeadphoneGainRCard.setOnDSeekBarCardListener(this);

            addView(mHeadphoneGainRCard);

        }

        else {

            mHeadphoneGainCard = new SeekBarCardView.DSeekBarCard(Sound.getHeadphoneGainLimits());
            mHeadphoneGainCard.setTitle(getString(R.string.headphone_gain));
            mHeadphoneGainCard.setProgress(Sound.getHeadphoneGainLimits().indexOf(Sound.getCurHeadphoneGain("B")));
            mHeadphoneGainCard.setOnDSeekBarCardListener(this);

            addView(mHeadphoneGainCard);
        }
    }