Search in sources :

Example 1 with Tracker

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

the class AppDetailsFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View detailsPage = inflater.inflate(R.layout.graph, container, false);
    DrawView drawView = new DrawView(getActivity());
    if (isApp) {
        drawView.setParams(fullObject, detailsPage);
        setBenefitTextView(detailsPage, fullObject.getBenefitText());
    } else {
        // isOS or isModel
        Reports reports = CaratApplication.storage.getReports();
        if (reports != null) {
            Tracker tracker = Tracker.getInstance();
            if (isOs) {
                setOsWidgets(detailsPage, drawView, reports, tracker);
            } else {
                // isModel
                setModelWidgets(detailsPage, drawView, reports, tracker);
            }
            // common piece of code for both OS and Model
            setBenefitWidget(detailsPage);
        }
        Log.d("NullReports", "Reports are null!!!");
    }
    // common piece of code for App, OS, and Model
    setDescriptionWidgets(detailsPage);
    // layout file
    return detailsPage;
}
Also used : Tracker(edu.berkeley.cs.amplab.carat.android.utils.Tracker) DrawView(edu.berkeley.cs.amplab.carat.android.ui.DrawView) Reports(edu.berkeley.cs.amplab.carat.thrift.Reports) DrawView(edu.berkeley.cs.amplab.carat.android.ui.DrawView) TextView(android.widget.TextView) View(android.view.View)

Example 2 with Tracker

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

the class ProcessListFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.processlist, container, false);
    ListView lv = (ListView) view.findViewById(R.id.processList);
    List<ProcessInfo> searchResults = SamplingLibrary.getRunningAppInfo(getActivity());
    lv.setAdapter(new ProcessInfoAdapter(getActivity(), searchResults));
    Tracker tracker = Tracker.getInstance();
    tracker.trackUser("ProcessList");
    return view;
}
Also used : Tracker(edu.berkeley.cs.amplab.carat.android.utils.Tracker) ProcessInfoAdapter(edu.berkeley.cs.amplab.carat.android.lists.ProcessInfoAdapter) ListView(android.widget.ListView) ProcessInfo(edu.berkeley.cs.amplab.carat.thrift.ProcessInfo) View(android.view.View) ListView(android.widget.ListView)

Example 3 with Tracker

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

the class DrawView method setParams.

public void setParams(SimpleHogBug fullObject, View parent) {
    String ver = "";
    Context activity = CaratApplication.getMainActivity();
    String label = CaratApplication.labelForApp(activity, fullObject.getAppName());
    PackageInfo pak = SamplingLibrary.getPackageInfo(activity, fullObject.getAppName());
    if (pak != null) {
        ver = pak.versionName;
        if (ver == null)
            ver = pak.versionCode + "";
    }
    this.appName = label + " " + ver;
    this.icon = CaratApplication.iconForApp(activity, fullObject.getAppName());
    this.type = fullObject.getType();
    this.benefit = fullObject.getBenefitText();
    this.sampleCount = fullObject.getSamples();
    this.sampleCountWo = fullObject.getSamplesWithout();
    this.error = fullObject.getError();
    this.ev = fullObject.getExpectedValue();
    this.evWithout = fullObject.getExpectedValueWithout();
    this.errorWo = fullObject.getErrorWithout();
    Tracker tracker = Tracker.getInstance();
    // the field "type" should be set BEFORE calling this tracking method
    tracker.trackUser(label, fullObject);
    setFields(parent, true);
}
Also used : Context(android.content.Context) Tracker(edu.berkeley.cs.amplab.carat.android.utils.Tracker) PackageInfo(android.content.pm.PackageInfo)

Aggregations

Tracker (edu.berkeley.cs.amplab.carat.android.utils.Tracker)3 View (android.view.View)2 Context (android.content.Context)1 PackageInfo (android.content.pm.PackageInfo)1 ListView (android.widget.ListView)1 TextView (android.widget.TextView)1 ProcessInfoAdapter (edu.berkeley.cs.amplab.carat.android.lists.ProcessInfoAdapter)1 DrawView (edu.berkeley.cs.amplab.carat.android.ui.DrawView)1 ProcessInfo (edu.berkeley.cs.amplab.carat.thrift.ProcessInfo)1 Reports (edu.berkeley.cs.amplab.carat.thrift.Reports)1