Search in sources :

Example 1 with ViewReportView

use of com.ushahidi.android.app.views.ViewReportView in project Ushahidi_Android by ushahidi.

the class ViewReportFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Inflate the layout containing a title and body text.
    ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.view_report, container, false);
    mView = new ViewReportView(rootView, getActivity());
    mReports = new ListReportModel();
    mView.mMapView.onCreate(savedInstanceState);
    if (mCategoryId > 0) {
        mReports.loadReportByCategory(mCategoryId);
    } else {
        mReports.load();
    }
    // Get GoogleMap from MapView
    mMap = mView.mMapView.getMap();
    try {
        MapsInitializer.initialize(getActivity());
    } catch (GooglePlayServicesNotAvailableException e) {
        e.printStackTrace();
    }
    // Initialize views with report data. This also handles map
    // initialization
    initReport(mPageNumber);
    fetchComments();
    // Set the title view to show the page number.
    mView.setPageIndicator(getString(R.string.title_template_step, mPageNumber + 1, mReports.getReports().size()));
    return rootView;
}
Also used : ViewGroup(android.view.ViewGroup) ListReportModel(com.ushahidi.android.app.models.ListReportModel) ViewReportView(com.ushahidi.android.app.views.ViewReportView) GooglePlayServicesNotAvailableException(com.google.android.gms.common.GooglePlayServicesNotAvailableException)

Aggregations

ViewGroup (android.view.ViewGroup)1 GooglePlayServicesNotAvailableException (com.google.android.gms.common.GooglePlayServicesNotAvailableException)1 ListReportModel (com.ushahidi.android.app.models.ListReportModel)1 ViewReportView (com.ushahidi.android.app.views.ViewReportView)1