Skip to content

Commit

Permalink
Merge pull request #17 from cmsc436/post-demo
Browse files Browse the repository at this point in the history
Post demo
  • Loading branch information
0queue authored May 2, 2017
2 parents 013f3ae + 0de404d commit 8810510
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
9 changes: 2 additions & 7 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme.ColorBlind">
<activity
android:name=".IntroActivity"
android:screenOrientation="landscape">
<activity android:name=".IntroActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>

Expand All @@ -21,13 +19,10 @@
</activity>
<activity
android:name=".ui.CoordinatorActivity"
android:screenOrientation="landscape"
android:theme="@style/AppTheme.Fullscreen">
</activity>

<activity
android:name=".MainActivity"
android:screenOrientation="landscape"/>
<activity android:name=".MainActivity"/>
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ public void onSlide(@NonNull View bottomSheet, float slideOffset) {
mToast = Toast.makeText(this, "", Toast.LENGTH_SHORT);

mRecyclerView = (RecyclerView) findViewById(R.id.practice_test_recyclerview);
mRecyclerView.setItemAnimator(null);
mRecyclerView.post(new Runnable() {
@Override
public void run() {
Expand Down
12 changes: 9 additions & 3 deletions app/src/main/java/edu/umd/cmsc436/mstestsuite/MainPresenter.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,16 @@ public void run() {

private boolean isPractice;
private boolean isBottomSheetExpanded;
private Map<File, Float> mToInstall;

private UserManager mUserManager;

private ActionsAdapter mMainAdapter;
private ActionsAdapter mPracticeModeAdapter;
private Sheets mSheet;
private TestApp[] mAllApps;
private int[] mAllDifficulties;

private int mNumTrials;
private int[] mAllDifficulties;
private Map<File, Float> mToInstall;
private ArrayList<TestApp> mDesiredApps;

MainPresenter(MainContract.View v) {
Expand Down Expand Up @@ -153,6 +154,8 @@ public void onDestroy() {
public void onUserSelected(String patient_id) {
mUserManager.onUserSelected(patient_id);
mMainAdapter.setHeader(mView.getContext().getString(R.string.main_actions_header, mUserManager.getCurUserID()));
mMainAdapter.setEnabled(0, false);
mSheet.fetchPrescription(mUserManager.getCurUserID(), this);
}

@Override
Expand Down Expand Up @@ -201,6 +204,9 @@ public void onPrescriptionFetched(@Nullable List<String> list) {

if (list == null) {
Log.e(getClass().getCanonicalName(), "Null prescription");
mView.showToast("No prescription found for " + mUserManager.getCurUserID());
isBottomSheetExpanded = false;
mView.hideBottomSheet();
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ public static int getDifficulty (Intent i) {
*/
public static Intent getResultIntent (float score) {
Intent i = new Intent();
i.getExtras().putFloat(KEY_SCORE, score);

i.putExtra(KEY_SCORE, score);
return i;
}
}

0 comments on commit 8810510

Please sign in to comment.