Search in sources :

Example 21 with SimpleHogBug

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);
    }
}
Also used : SimpleHogBug(edu.berkeley.cs.amplab.carat.android.storage.SimpleHogBug)

Example 22 with SimpleHogBug

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;
}
Also used : ListView(android.widget.ListView) OnItemClickListener(android.widget.AdapterView.OnItemClickListener) LocalizedWebView(edu.berkeley.cs.amplab.carat.android.ui.LocalizedWebView) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView) SimpleHogBug(edu.berkeley.cs.amplab.carat.android.storage.SimpleHogBug)

Example 23 with SimpleHogBug

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));
}
Also used : ListView(android.widget.ListView) HogBugSuggestionsAdapter(edu.berkeley.cs.amplab.carat.android.lists.HogBugSuggestionsAdapter) SimpleHogBug(edu.berkeley.cs.amplab.carat.android.storage.SimpleHogBug) CaratApplication(edu.berkeley.cs.amplab.carat.android.CaratApplication)

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