use of edu.berkeley.cs.amplab.carat.android.storage.SimpleHogBug in project carat by amplab.
the class SettingsSuggestionAdapter method acceptDisableGps.
private void acceptDisableGps(ArrayList<SimpleHogBug> result) {
if (SamplingLibrary.getGpsEnabled(a.getApplicationContext()) == true) {
SimpleHogBug item = new SimpleHogBug(a.getString(R.string.disablegps), Constants.Type.OS);
result.add(item);
}
}
use of edu.berkeley.cs.amplab.carat.android.storage.SimpleHogBug in project carat by amplab.
the class SettingsSuggestionsFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
rootView = inflater.inflate(R.layout.suggestions, container, false);
final ListView lv = (ListView) rootView.findViewById(android.R.id.list);
lv.setCacheColorHint(0);
lv.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> a, View v, int position, long id) {
Object o = lv.getItemAtPosition(position);
SimpleHogBug fullObject = (SimpleHogBug) o;
final String actionName = fullObject.getAppName();
if (actionName.equals("OsUpgrade"))
mMainActivity.showHTMLFile("upgradeos", getString(R.string.upgradeosinfo), false);
else if (actionName.equals(getString(R.string.dimscreen)))
GoToDisplayScreen();
else if (actionName.equals(getString(R.string.disablewifi)))
GoToWifiScreen();
else if (actionName.equals(getString(R.string.disablegps)))
GoToLocSevScreen();
else if (actionName.equals(getString(R.string.disablelocation)))
GoToLocSevScreen();
else if (actionName.equals(getString(R.string.disablebluetooth)))
GoToBluetoothScreen();
else if (actionName.equals(getString(R.string.disablehapticfeedback)))
GoToSoundScreen();
else if (actionName.equals(getString(R.string.automaticbrightness)))
GoToDisplayScreen();
else if (actionName.equals(getString(R.string.disablenetwork)))
GoToMobileNetworkScreen();
else if (actionName.equals(getString(R.string.disablevibration)))
GoToSoundScreen();
else if (actionName.equals(getString(R.string.shortenscreentimeout)))
GoToDisplayScreen();
else if (actionName.equals(getString(R.string.disableautomaticsync)))
GoToSyncScreen();
else if (actionName.equals(getString(R.string.helpcarat)))
mMainActivity.showHTMLFile("collectdata", getString(R.string.collectdatainfo), false);
else if (actionName.equals(getString(R.string.questionnaire)))
openQuestionnaire();
}
});
initUpgradeOsView(rootView);
/*
getActivity().setTitle(getResources().getString(R.string.tab_settings));
*/
return rootView;
}
use of edu.berkeley.cs.amplab.carat.android.storage.SimpleHogBug in project carat by amplab.
the class SuggestionsFragment method refresh.
public void refresh() {
SimpleHogBug[] hogReport, bugReport;
hogReport = CaratApplication.storage.getHogReport();
bugReport = CaratApplication.storage.getBugReport();
if (hogReport.length == 0 && bugReport.length == 0)
return;
CaratApplication caratAppllication = (CaratApplication) CaratApplication.getMainActivity().getApplication();
final ListView lv = (ListView) root.findViewById(android.R.id.list);
lv.setAdapter(new HogBugSuggestionsAdapter(caratAppllication, hogReport, bugReport));
}
Aggregations