Search in sources :

Example 6 with SimpleHogBug

use of edu.berkeley.cs.amplab.carat.android.storage.SimpleHogBug in project carat by amplab.

the class SettingsSuggestionAdapter method acceptDisableLocSev.

private void acceptDisableLocSev(ArrayList<SimpleHogBug> result) {
    List<String> providers = SamplingLibrary.getEnabledLocationProviders(a.getApplicationContext());
    if (providers != null && providers.size() > 1) {
        // Always has 1 provider
        SimpleHogBug item = new SimpleHogBug(a.getString(R.string.disablelocation), Constants.Type.OS);
        result.add(item);
    }
}
Also used : SimpleHogBug(edu.berkeley.cs.amplab.carat.android.storage.SimpleHogBug)

Example 7 with SimpleHogBug

use of edu.berkeley.cs.amplab.carat.android.storage.SimpleHogBug in project carat by amplab.

the class SettingsSuggestionAdapter method acceptSettings.

private void acceptSettings(SimpleHogBug[] inputArrayList, ArrayList<SimpleHogBug> resultArrayList) {
    if (inputArrayList == null)
        return;
    for (SimpleHogBug item : inputArrayList) {
        if (item == null)
            continue;
        // TODO: can we use the same formula for calculating the expected improvement?
        // if not, embed the formula here or fetch the value from the server
        // double benefit = 100.0 / item.getExpectedValueWithout() - 100.0
        // 		/ item.getExpectedValue();
        // TODO other filter conditions?
        // Limit max number of items?
        String appName = item.getAppName();
        if (appName == null)
            appName = a.getString(R.string.unknown);
        // TODO: skip (leave out) special cases
        boolean someCondition = true;
        if (someCondition)
            continue;
        // TODO: fill in the list if it's empty (for non focus-group users)
        // if (addFakeItem && appName.equals(FAKE_ITEM))
        //    resultArrayList.add(item);
        // Filter out if benefit is too small
        // TODO: disabled this check for the time being, until we have a calculated benefit
        // if (SamplingLibrary.isSettingsSuggestion(a.getApplicationContext(), appName) && benefit > 60 ) {
        resultArrayList.add(item);
    // }
    }
}
Also used : SimpleHogBug(edu.berkeley.cs.amplab.carat.android.storage.SimpleHogBug)

Example 8 with SimpleHogBug

use of edu.berkeley.cs.amplab.carat.android.storage.SimpleHogBug in project carat by amplab.

the class SettingsSuggestionAdapter method questionnaire.

private void questionnaire(ArrayList<SimpleHogBug> result) {
    SimpleHogBug item = new SimpleHogBug(a.getString(R.string.questionnaire), Constants.Type.OTHER, a.getString(R.string.questionnaire2));
    result.add(item);
}
Also used : SimpleHogBug(edu.berkeley.cs.amplab.carat.android.storage.SimpleHogBug)

Example 9 with SimpleHogBug

use of edu.berkeley.cs.amplab.carat.android.storage.SimpleHogBug in project carat by amplab.

the class SettingsSuggestionAdapter method helpCaratCollectMoreData.

private void helpCaratCollectMoreData(ArrayList<SimpleHogBug> result) {
    SimpleHogBug item = new SimpleHogBug(a.getString(R.string.helpcarat), Constants.Type.OS);
    result.add(item);
}
Also used : SimpleHogBug(edu.berkeley.cs.amplab.carat.android.storage.SimpleHogBug)

Example 10 with SimpleHogBug

use of edu.berkeley.cs.amplab.carat.android.storage.SimpleHogBug in project carat by amplab.

the class SettingsSuggestionAdapter method acceptDisableHapticFb.

private void acceptDisableHapticFb(ArrayList<SimpleHogBug> result) {
    try {
        if (Settings.System.getInt(a.getApplicationContext().getContentResolver(), Settings.System.HAPTIC_FEEDBACK_ENABLED) == 1) {
            SimpleHogBug item = new SimpleHogBug(a.getString(R.string.disablehapticfeedback), Constants.Type.OS);
            // TODO Get expected benefit
            result.add(item);
        }
    } catch (SettingNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
Also used : SettingNotFoundException(android.provider.Settings.SettingNotFoundException) SimpleHogBug(edu.berkeley.cs.amplab.carat.android.storage.SimpleHogBug)

Aggregations

SimpleHogBug (edu.berkeley.cs.amplab.carat.android.storage.SimpleHogBug)23 ListView (android.widget.ListView)4 Drawable (android.graphics.drawable.Drawable)3 View (android.view.View)3 AdapterView (android.widget.AdapterView)3 OnItemClickListener (android.widget.AdapterView.OnItemClickListener)3 TextView (android.widget.TextView)3 LocalizedWebView (edu.berkeley.cs.amplab.carat.android.ui.LocalizedWebView)3 SettingNotFoundException (android.provider.Settings.SettingNotFoundException)2 Constants (edu.berkeley.cs.amplab.carat.android.Constants)2 BluetoothAdapter (android.bluetooth.BluetoothAdapter)1 SharedPreferences (android.content.SharedPreferences)1 PackageInfo (android.content.pm.PackageInfo)1 AudioManager (android.media.AudioManager)1 Bundle (android.os.Bundle)1 Fragment (android.support.v4.app.Fragment)1 LayoutInflater (android.view.LayoutInflater)1 OnClickListener (android.view.View.OnClickListener)1 ImageView (android.widget.ImageView)1 CaratApplication (edu.berkeley.cs.amplab.carat.android.CaratApplication)1