@@ -0,0 +1,3445 @@
+package com.expidevapps.android.measurements.activity;%0A%0Aimport static com.expidev.gcmapp.Constants.EXTRA_GUID;%0Aimport static com.expidev.gcmapp.Constants.EXTRA_MCC;%0Aimport static com.expidev.gcmapp.Constants.EXTRA_MINISTRY_ID;%0Aimport static com.expidev.gcmapp.Constants.EXTRA_PERIOD;%0Aimport static com.expidev.gcmapp.Constants.EXTRA_PERMLINK;%0A%0Aimport android.content.Context;%0Aimport android.content.Intent;%0Aimport android.os.Bundle;%0Aimport android.support.annotation.NonNull;%0Aimport android.support.annotation.Nullable;%0Aimport android.support.v4.app.Fragment;%0Aimport android.support.v4.app.FragmentManager;%0Aimport android.support.v7.app.ActionBarActivity;%0A%0Aimport com.expidev.gcmapp.R;%0Aimport com.expidev.gcmapp.model.Ministry;%0Aimport com.expidev.gcmapp.support.v4.fragment.measurement.MeasurementDetailsFragment;%0A%0Aimport org.joda.time.YearMonth;%0A%0Apublic class MeasurementDetailsActivity extends ActionBarActivity %7B%0A    private static final String TAG_DETAILS = %22measurementDetails%22;%0A%0A    @NonNull%0A    private /* final */ String mGuid;%0A    @NonNull%0A    private /* final */ String mMinistryId;%0A    @NonNull%0A    private /* final */ Ministry.Mcc mMcc;%0A    @NonNull%0A    private /* final */ String mPermLink;%0A    @NonNull%0A    private /* final */ YearMonth mPeriod;%0A%0A    public static void start(@NonNull final Context context, @NonNull final String guid,%0A                             @NonNull final String ministryId, @NonNull final Ministry.Mcc mcc,%0A                             @NonNull final String permLink, @NonNull final YearMonth period) %7B%0A        final Intent intent = new Intent(context, MeasurementDetailsActivity.class);%0A        populateIntent(intent, guid, ministryId, mcc, permLink, period);%0A        context.startActivity(intent);%0A    %7D%0A%0A    public static void populateIntent(@NonNull final Intent intent, @NonNull final String guid,%0A                                      @NonNull final String ministryId, @NonNull final Ministry.Mcc mcc,%0A                                      @NonNull final String permLink, @NonNull final YearMonth period) %7B%0A        intent.putExtra(EXTRA_GUID, guid);%0A        intent.putExtra(EXTRA_MINISTRY_ID, ministryId);%0A        intent.putExtra(EXTRA_MCC, mcc.toString());%0A        intent.putExtra(EXTRA_PERMLINK, permLink);%0A        intent.putExtra(EXTRA_PERIOD, period.toString());%0A    %7D%0A%0A    /* BEGIN lifecycle */%0A%0A    @Override%0A    protected void onCreate(@Nullable final Bundle savedState) %7B%0A        super.onCreate(savedState);%0A        setContentView(R.layout.activity_measurement_details);%0A%0A        final Intent intent = this.getIntent();%0A        mGuid = intent.getStringExtra(EXTRA_GUID);%0A        mMinistryId = intent.getStringExtra(EXTRA_MINISTRY_ID);%0A        mMcc = Ministry.Mcc.fromRaw(intent.getStringExtra(EXTRA_MCC));%0A        mPermLink = intent.getStringExtra(EXTRA_PERMLINK);%0A        mPeriod = YearMonth.parse(intent.getStringExtra(EXTRA_PERIOD));%0A%0A        createDetailsFragmentsIfNeeded();%0A    %7D%0A%0A    /* END lifecycle */%0A%0A    private void createDetailsFragmentsIfNeeded() %7B%0A        final FragmentManager fm = getSupportFragmentManager();%0A%0A        // only create fragment if it doesn't exist%0A        Fragment fragment = fm.findFragmentByTag(TAG_DETAILS);%0A        if (fragment == null) %7B%0A            fragment = MeasurementDetailsFragment.newInstance(mGuid, mMinistryId, mMcc, mPermLink, mPeriod);%0A            fm.beginTransaction().replace(R.id.details, fragment, TAG_DETAILS).commit();%0A        %7D%0A    %7D%0A%7D%0A

create initial MeasurementDetails Activity