Skip to content

Commit

Permalink
Merge pull request #16 from gscdev/master
Browse files Browse the repository at this point in the history
#15 updated audio file names
  • Loading branch information
Jo Grimstad authored Apr 27, 2017
2 parents dd3e160 + 0e05f55 commit 5c35acf
Show file tree
Hide file tree
Showing 13 changed files with 139 additions and 11 deletions.
7 changes: 5 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.literacyapp.startguide">

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>

<application
android:allowBackup="true"
Expand All @@ -23,6 +23,9 @@
<activity
android:name=".content.swipe.SwipeRightLeftActivity"
android:noHistory="true"/>
<activity
android:name=".content.FinalActivity"
android:noHistory="true"/>
<activity android:name=".TestGestureActivity">
<!--<intent-filter>
<action android:name="android.intent.action.MAIN"/>
Expand All @@ -33,7 +36,7 @@

<receiver android:name=".receiver.BootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</receiver>
</application>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package org.literacyapp.startguide.content;

import android.graphics.drawable.Animatable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageView;

import org.literacyapp.startguide.R;
import org.literacyapp.startguide.util.MediaPlayerHelper;

import static org.literacyapp.startguide.util.MediaPlayerHelper.DEFAULT_PLAYER_DELAY;


public class FinalActivity extends AppCompatActivity {

private ImageView mFinalCheckmarkImageView;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_final);

mFinalCheckmarkImageView = (ImageView) findViewById(R.id.final_checkmark);
}

@Override
protected void onStart() {
super.onStart();

// Animate checkmark
mFinalCheckmarkImageView.postDelayed(new Runnable() {
@Override
public void run() {
mFinalCheckmarkImageView.setVisibility(View.VISIBLE);
Drawable drawable = mFinalCheckmarkImageView.getDrawable();
((Animatable) drawable).start();

playGoodJob();
}
}, DEFAULT_PLAYER_DELAY);
}

private void playGoodJob() {
MediaPlayerHelper.play(this, R.raw.good_job, new MediaPlayerHelper.MediaPlayerListener() {
@Override
public void onCompletion() {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
finish();
}
}, DEFAULT_PLAYER_DELAY);
}
});
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.literacyapp.startguide.content.swipe;

import android.content.Intent;
import android.content.res.TypedArray;
import android.os.Bundle;
import android.support.design.widget.CoordinatorLayout;
Expand All @@ -18,6 +19,7 @@
import org.literacyapp.handgesture.Gestures;
import org.literacyapp.handgesture.HandView;
import org.literacyapp.startguide.R;
import org.literacyapp.startguide.content.FinalActivity;
import org.literacyapp.startguide.util.MediaPlayerHelper;

/**
Expand Down Expand Up @@ -63,8 +65,7 @@ protected void onCreate(Bundle savedInstanceState) {
}

private void playMoveLeft() {
//TODO: 04/02/2017 audio file (en, sw) "Find the images on the right"
MediaPlayerHelper.playWithDelay(this, R.raw.find_right, new MediaPlayerHelper.MediaPlayerListener() {
MediaPlayerHelper.playWithDelay(this, R.raw.find_the_images_to_the_right, new MediaPlayerHelper.MediaPlayerListener() {
@Override
public void onCompletion() {
showSlideLeft();
Expand All @@ -73,8 +74,7 @@ public void onCompletion() {
}

private void playMoveRight() {
//TODO: 04/02/2017 audio file (en, sw) "Find the images on the left"
MediaPlayerHelper.playWithDelay(this, R.raw.find_left, new MediaPlayerHelper.MediaPlayerListener() {
MediaPlayerHelper.playWithDelay(this, R.raw.find_the_images_to_the_left, new MediaPlayerHelper.MediaPlayerListener() {
@Override
public void onCompletion() {
showSlideRight();
Expand Down Expand Up @@ -133,7 +133,8 @@ public void onPageSelected(int page) {
playMoveRight();
} else if ((page == 0) && !isDetectLeftActive()) {
setDetectRight(false);
// TODO: 12/02/2017 go to the 'exit full screen' explanation
Intent intent = new Intent(this, FinalActivity.class);
startActivity(intent);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ protected void onCreate(Bundle savedInstanceState) {
}

private void playMoveBottom() {
//TODO: 04/02/2017 update audio file (en, sw) "Move to the bottom of the list"
MediaPlayerHelper.playWithDelay(this, R.raw.move_bottom, new MediaPlayerHelper.MediaPlayerListener() {
MediaPlayerHelper.playWithDelay(this, R.raw.move_to_the_bottom_of_the_list, new MediaPlayerHelper.MediaPlayerListener() {
@Override
public void onCompletion() {
showMoveBottom();
Expand All @@ -56,8 +55,7 @@ public void onCompletion() {
}

private void playMoveTop() {
//TODO: 04/02/2017 update audio file (en, sw) "Move to the top of the list"
MediaPlayerHelper.play(this, R.raw.move_top, new MediaPlayerHelper.MediaPlayerListener() {
MediaPlayerHelper.play(this, R.raw.move_to_the_top_of_the_list, new MediaPlayerHelper.MediaPlayerListener() {
@Override
public void onCompletion() {
showMoveTop();
Expand Down
22 changes: 22 additions & 0 deletions app/src/main/res/anim/checkmark_animation.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_interpolator"
android:ordering="sequentially"
android:shareInterpolator="false">

<!-- Step 1 -->
<objectAnimator
android:duration="@android:integer/config_shortAnimTime"
android:propertyName="pathData"
android:valueFrom="M6,11 l0,0 l0,0"
android:valueTo="M6,11 l3.5,4 l0,0"
android:valueType="pathType" />

<!-- Step 2 -->
<objectAnimator
android:duration="@android:integer/config_shortAnimTime"
android:propertyName="pathData"
android:valueFrom="M6,11 l3.5,4 l0,0"
android:valueTo="M6,11 l3.5,4 l8,-7"
android:valueType="pathType" />
</set>
7 changes: 7 additions & 0 deletions app/src/main/res/drawable/animated_checkmark.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/checkmark">
<target
android:name="tick"
android:animation="@anim/checkmark_animation"/>
</animated-vector>
21 changes: 21 additions & 0 deletions app/src/main/res/drawable/checkmark.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">

<group android:name="background">
<path
android:name="circle"
android:fillColor="@color/colorAccent"
android:pathData="M12,12m-10,0a10,10 0,1 1,20 0a10,10 0,1 1,-20 0" />
</group>
<group android:name="check">
<path
android:name="tick"
android:pathData="M6,11 l0,0 l0,0"
android:strokeColor="#FFF"
android:strokeWidth="1" />
</group>
</vector>
17 changes: 17 additions & 0 deletions app/src/main/res/layout/activity_final.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
tools:context="org.literacyapp.startguide.content.FinalActivity">

<ImageView
android:id="@+id/final_checkmark"
android:visibility="gone"
android:layout_width="256dp"
android:layout_height="256dp"
android:layout_centerInParent="true"
android:src="@drawable/animated_checkmark"
tools:visibility="visible"/>
</RelativeLayout>
File renamed without changes.
File renamed without changes.
Binary file added app/src/main/res/raw/good_job.mp3
Binary file not shown.
File renamed without changes.
File renamed without changes.

0 comments on commit 5c35acf

Please sign in to comment.