-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
443 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
app/src/main/java/my/neomer/sixtyseconds/core/InfinitePipeline.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...y/neomer/sixtyseconds/ActivityHelper.java → .../sixtyseconds/helpers/ActivityHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...neomer/sixtyseconds/AppMetricaHelper.java → ...ixtyseconds/helpers/AppMetricaHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package my.neomer.sixtyseconds; | ||
package my.neomer.sixtyseconds.helpers; | ||
|
||
public final class AppMetricaHelper { | ||
|
||
|
69 changes: 69 additions & 0 deletions
69
app/src/main/java/my/neomer/sixtyseconds/helpers/ApplicationResources.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
package my.neomer.sixtyseconds.helpers; | ||
|
||
import android.content.Context; | ||
import android.media.AudioAttributes; | ||
import android.media.SoundPool; | ||
import android.support.annotation.NonNull; | ||
import android.support.annotation.Nullable; | ||
|
||
import my.neomer.sixtyseconds.R; | ||
import my.neomer.sixtyseconds.transport.FakeQuestionProvider; | ||
import my.neomer.sixtyseconds.transport.IQuestionProvider; | ||
|
||
public class ApplicationResources { | ||
//region Singleton | ||
|
||
private static final ApplicationResources ourInstance = new ApplicationResources(); | ||
private static final int MAX_STREAMS = 5; | ||
|
||
public static ApplicationResources getInstance() { | ||
return ourInstance; | ||
} | ||
|
||
private ApplicationResources() { | ||
} | ||
|
||
//endregion | ||
|
||
private IQuestionProvider questionProvider = new FakeQuestionProvider(); | ||
|
||
private SoundPool soundPool; | ||
private int timeIsUpSoundId; | ||
private int clickSoundId; | ||
private int countDownSoundId; | ||
|
||
public void loadSounds(@NonNull Context context, @Nullable SoundPool.OnLoadCompleteListener completeListener) { | ||
soundPool = new SoundPool.Builder() | ||
.setMaxStreams(MAX_STREAMS) | ||
.setAudioAttributes( | ||
new AudioAttributes.Builder() | ||
.setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION) | ||
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION) | ||
.build()) | ||
.build(); | ||
|
||
if (completeListener != null) { | ||
soundPool.setOnLoadCompleteListener(completeListener); | ||
} | ||
|
||
timeIsUpSoundId = soundPool.load(context, R.raw.time_is_up, 1); | ||
countDownSoundId = soundPool.load(context, R.raw.countdown, 1); | ||
clickSoundId = soundPool.load(context, R.raw.click, 1); | ||
} | ||
|
||
public void playClickSound() { | ||
soundPool.play(clickSoundId, 1, 1, 0, 0, 1); | ||
} | ||
|
||
public void playCountDownSound() { | ||
soundPool.play(countDownSoundId, 1, 1, 0,0,1); | ||
} | ||
|
||
public void playTimeIsUpSound() { | ||
soundPool.play(timeIsUpSoundId, 1, 1, 0,0,1); | ||
} | ||
|
||
public IQuestionProvider getQuestionProvider() { | ||
return questionProvider; | ||
} | ||
} |
Oops, something went wrong.