Search in sources :

Example 1 with CaratApplication

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

the class BugsOrHogsFragment method refresh.

public void refresh() {
    if (getActivity() == null)
        Log.e("BugsOrHogsFragment", "unable to get activity");
    CaratApplication app = (CaratApplication) getActivity().getApplication();
    final ListView lv = (ListView) getActivity().findViewById(android.R.id.list);
    if (isBugs) {
        if (CaratApplication.storage.getBugReport().length == 0)
            return;
        else
            lv.setAdapter(new HogsBugsAdapter(app, CaratApplication.storage.getBugReport()));
    } else
        lv.setAdapter(new HogsBugsAdapter(app, CaratApplication.storage.getHogReport()));
}
Also used : ListView(android.widget.ListView) HogsBugsAdapter(edu.berkeley.cs.amplab.carat.android.lists.HogsBugsAdapter) CaratApplication(edu.berkeley.cs.amplab.carat.android.CaratApplication)

Example 2 with CaratApplication

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

the class SettingsSuggestionsFragment method refresh.

public void refresh() {
    CaratApplication caratAppllication = (CaratApplication) CaratApplication.getMainActivity().getApplication();
    final ListView lv = (ListView) rootView.findViewById(android.R.id.list);
    lv.setAdapter(new SettingsSuggestionAdapter(caratAppllication, CaratApplication.storage.getSettingsReport()));
}
Also used : SettingsSuggestionAdapter(edu.berkeley.cs.amplab.carat.android.lists.SettingsSuggestionAdapter) ListView(android.widget.ListView) CaratApplication(edu.berkeley.cs.amplab.carat.android.CaratApplication)

Example 3 with CaratApplication

use of edu.berkeley.cs.amplab.carat.android.CaratApplication 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

ListView (android.widget.ListView)3 CaratApplication (edu.berkeley.cs.amplab.carat.android.CaratApplication)3 HogBugSuggestionsAdapter (edu.berkeley.cs.amplab.carat.android.lists.HogBugSuggestionsAdapter)1 HogsBugsAdapter (edu.berkeley.cs.amplab.carat.android.lists.HogsBugsAdapter)1 SettingsSuggestionAdapter (edu.berkeley.cs.amplab.carat.android.lists.SettingsSuggestionAdapter)1 SimpleHogBug (edu.berkeley.cs.amplab.carat.android.storage.SimpleHogBug)1