Skip to content
This repository has been archived by the owner on Nov 8, 2018. It is now read-only.

Fixes #419 : CircleIntroActivity not loading when Circle of Trust is selected from the navigation bar. #447

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions app/src/main/java/com/peacecorps/pcsa/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import android.widget.ExpandableListView;
import android.widget.Toast;

import com.peacecorps.pcsa.circle_of_trust.CircleIntroActivity;
import com.peacecorps.pcsa.circle_of_trust.CircleOfTrustFragment;
import com.peacecorps.pcsa.get_help_now.ContactOtherStaff;
import com.peacecorps.pcsa.get_help_now.ContactPostStaff;
Expand Down Expand Up @@ -115,9 +116,14 @@ public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition
break;
case 1:
//Swapping CircleOfTrustFragment into the container
CircleOfTrustFragment circleOfTrustFragment = new CircleOfTrustFragment();
MainActivity.swapFragmentIn(MainActivity.this, circleOfTrustFragment, CircleOfTrustFragment.TAG, true);
mDrawer.closeDrawer(GravityCompat.START);
boolean isFirstRun = getSharedPreferences("prefs", 0).getBoolean("firstRun", true);
if(isFirstRun) {
startActivityForResult(new Intent(MainActivity.this, CircleIntroActivity.class),2);
} else {
CircleOfTrustFragment circleOfTrustFragment = new CircleOfTrustFragment();
MainActivity.swapFragmentIn(MainActivity.this, circleOfTrustFragment, CircleOfTrustFragment.TAG, true);
mDrawer.closeDrawer(GravityCompat.START);
}
break;
case 6:
Intent intent = new Intent(MainActivity.this, UserSettingsActivity.class);
Expand Down Expand Up @@ -377,4 +383,17 @@ public boolean onOptionsItemSelected(MenuItem item) {
}
return true;
}

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode)
{
case 2:
//Swapping CircleOfTrustFragment into the container
CircleOfTrustFragment circleOfTrustFragment = new CircleOfTrustFragment();
MainActivity.swapFragmentIn(MainActivity.this,circleOfTrustFragment,CircleOfTrustFragment.TAG,true);
mDrawer.closeDrawer(GravityCompat.START);
}
}
}