Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Commit

Permalink
Merge pull request #124 from MaximeZmt/maximezmt/ui
Browse files Browse the repository at this point in the history
Maximezmt/UI
  • Loading branch information
MaximeZmt authored Mar 31, 2022
2 parents b00578a + 0817172 commit 4bc6aed
Show file tree
Hide file tree
Showing 30 changed files with 540 additions and 220 deletions.
57 changes: 32 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# SDP_2022-Vibester
<div align="center"> <img src="app/src/main/res/drawable/logo.png" align=center></img> </div>

[![Maintainability](https://img.shields.io/codeclimate/maintainability/MaximeZmt/SDP_2022-Vibester?style=flat-square&logo=codeclimate&logoColor=white&color=52b2bf)](https://codeclimate.com/github/MaximeZmt/SDP_2022-Vibester/maintainability)
[![Test Coverage](https://img.shields.io/codeclimate/coverage/MaximeZmt/SDP_2022-Vibester?style=flat-square&logo=codeclimate&logoColor=white&color=52b2bf)](https://codeclimate.com/github/MaximeZmt/SDP_2022-Vibester/test_coverage)
[![Contributors](https://img.shields.io/github/contributors/MaximeZmt/SDP_2022-Vibester?style=flat-square&logo=github&logoColor=white&color=52b2bf)](https://github.com/MaximeZmt/SDP_2022-Vibester/graphs/contributors)
[![CI](https://img.shields.io/cirrus/github/MaximeZmt/SDP_2022-Vibester?style=flat-square&logo=github&logoColor=white&color=52b2bf)](https://cirrus-ci.com/github/MaximeZmt/SDP_2022-Vibester)
# Vibester - SDP 2022

### Repository

[![Maintainability](https://img.shields.io/codeclimate/maintainability/MaximeZmt/SDP_2022-Vibester?style=flat-square&logo=codeclimate&logoColor=white&color=227C9D)](https://codeclimate.com/github/MaximeZmt/SDP_2022-Vibester/maintainability)
[![Test Coverage](https://img.shields.io/codeclimate/coverage/MaximeZmt/SDP_2022-Vibester?style=flat-square&logo=codeclimate&logoColor=white&color=227C9D)](https://codeclimate.com/github/MaximeZmt/SDP_2022-Vibester/test_coverage)
[![Contributors](https://img.shields.io/github/contributors/MaximeZmt/SDP_2022-Vibester?style=flat-square&logo=github&logoColor=white&color=227C9D)](https://github.com/MaximeZmt/SDP_2022-Vibester/graphs/contributors)
[![CI](https://img.shields.io/cirrus/github/MaximeZmt/SDP_2022-Vibester?style=flat-square&logo=github&logoColor=white&color=227C9D)](https://cirrus-ci.com/github/MaximeZmt/SDP_2022-Vibester)

### Status

![Website](https://img.shields.io/website?down_color=FE6D73&down_message=offline&label=Lyrics%20API&style=flat-square&up_color=17c3b2&up_message=online&url=https%3A%2F%2Fapi.lyrics.ovh%2Fv1%2Fimagine%2Bdragons%2Fradioactive) ![Website](https://img.shields.io/website?down_color=FE6D73&down_message=offline&label=Itunes%20API&style=flat-square&up_color=17c3b2&up_message=online&url=https%3A%2F%2Fitunes.apple.com%2Fus%2Flookup%3Fid%3D1023678453) ![Website](https://img.shields.io/website?down_color=FE6D73&down_message=offline&label=LastFM%20API&style=flat-square&up_color=17c3b2&up_message=online&url=https%3A%2F%2Fws.audioscrobbler.com%2F)


This is the GitHub repository of our Android App Vibester!
Expand All @@ -14,24 +22,33 @@ There will be different modes in the game: (i) guess the song by name, and (ii)

The game will also offer a customization where the user can create a game from its own list of songs.

[To Complete: Abstract]



## Table Of Contents

1. [TODO](#todo)
2. [Guide & Useful Link](#guideAndLink)
2. [Team](#team)
1. [Team](#team)
2. [Scrumboard & Weekly Meetings Logs](#devLogs)
3. [Guide & Useful Link](#guideAndLink)



## TODO <a name="todo"></a>
## Team <a name="team"></a>

- [x] Create a Github repository
- [x] Setup all Github feature (params, ...)
- [x] Add continuous integration
- [ ]
| Name | GitHub username |
| :--------------- | --------------------------------------------------: |
| Derin Arda Alpay | [Tsathogguaa](https://github.com/Tsathogguaa) |
| Kamila Babayeva | [kamilababayeva](https://github.com/kamilababayeva) |
| Laurynas Lopata | [laurislopata](https://github.com/laurislopata) |
| Jiabao Wen | [jiabaow](https://github.com/jiabaow) |
| Maxime Zammit | [MaximeZmt](https://github.com/MaximeZmt) |
| Margaux Zwierski | [zwierski](https://github.com/zwierski) |



## Scrumboard & Weekly Meetings Logs <a name="devLogs"></a>

- [Our Scrumboard](https://github.com/MaximeZmt/SDP_2022-Vibester/projects/1)
- [Our Weekly Meeting](https://github.com/MaximeZmt/SDP_2022-Vibester/wiki)



Expand All @@ -44,13 +61,3 @@ The game will also offer a customization where the user can create a game from i



## Team <a name="tean"></a>

| Name | GitHub username |
|:--------|---------:|
| Derin Arda Alpay | [Tsathogguaa](https://github.com/Tsathogguaa) |
| Kamila Babayeva | [kamilababayeva](https://github.com/kamilababayeva) |
| Laurynas Lopata | [laurislopata](https://github.com/laurislopata) |
| Jiabao Wen | [jiabaow](https://github.com/jiabaow) |
| Maxime Zammit | [MaximeZmt](https://github.com/MaximeZmt) |
| Margaux Zwierski | [zwierski](https://github.com/zwierski) |
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package ch.sdp.vibester.activity

import android.widget.AdapterView
import androidx.test.core.app.ApplicationProvider

import androidx.test.espresso.Espresso.onData
import androidx.test.espresso.intent.Intents
import androidx.test.ext.junit.rules.ActivityScenarioRule
import androidx.test.espresso.intent.Intents.intended
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.action.ViewActions.scrollTo
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.espresso.intent.matcher.IntentMatchers.*
Expand Down Expand Up @@ -47,41 +47,47 @@ class GameSetupActivityTest {

@Test
fun checkCustomSelectOne() {
onView(withId(R.id.local_buzzer_game_button)).perform(scrollTo(), click())
onView(withId(R.id.nb_player_spinner)).perform(click())
onData(Matchers.anything()).atPosition(0).perform(click())
onView(withId(R.id.nb_player_spinner)).check(matches(withSpinnerText("One")))
}

@Test
fun checkCustomSelectTwo() {
onView(withId(R.id.local_buzzer_game_button)).perform(scrollTo(), click())
onView(withId(R.id.nb_player_spinner)).perform(click())
onData(Matchers.anything()).atPosition(1).perform(click())
onView(withId(R.id.nb_player_spinner)).check(matches(withSpinnerText("Two")))
}

@Test
fun checkCustomSelectThree() {
onView(withId(R.id.local_buzzer_game_button)).perform(scrollTo(), click())
onView(withId(R.id.nb_player_spinner)).perform(click())
onData(Matchers.anything()).atPosition(2).perform(click())
onView(withId(R.id.nb_player_spinner)).check(matches(withSpinnerText("Three")))
}

@Test
fun checkCustomSelectFour() {
onView(withId(R.id.local_buzzer_game_button)).perform(scrollTo(), click())
onView(withId(R.id.nb_player_spinner)).perform(click())
onData(Matchers.anything()).atPosition(3).perform(click())
onView(withId(R.id.nb_player_spinner)).check(matches(withSpinnerText("Four")))
}

@Test
fun checkIntentOnProceedDefault() { //FILLER TEST
onView(withId(R.id.local_buzzer_game_button)).perform(scrollTo(), click())
onView(withId(R.id.nb_players_selected)).perform(click())
intended(hasComponent(GamescreenActivity::class.java.name))
intended(hasExtra("Number of players", 1))
}

@Test
fun checkIntentOnProceedOne() { //FILLER TEST
onView(withId(R.id.local_buzzer_game_button)).perform(scrollTo(), click())
onView(withId(R.id.nb_player_spinner)).perform(click())
onData(Matchers.anything()).atPosition(0).perform(click())
onView(withId(R.id.nb_players_selected)).perform(click())
Expand All @@ -91,6 +97,7 @@ class GameSetupActivityTest {

@Test
fun checkIntentOnProceedTwo() { //FILLER TEST
onView(withId(R.id.local_buzzer_game_button)).perform(scrollTo(), click())
onView(withId(R.id.nb_player_spinner)).perform(click())
onData(Matchers.anything()).atPosition(1).perform(click())
onView(withId(R.id.nb_players_selected)).perform(click())
Expand All @@ -100,6 +107,7 @@ class GameSetupActivityTest {

@Test
fun checkIntentOnProceedThree() { //FILLER TEST
onView(withId(R.id.local_buzzer_game_button)).perform(scrollTo(), click())
onView(withId(R.id.nb_player_spinner)).perform(click())
onData(Matchers.anything()).atPosition(2).perform(click())
onView(withId(R.id.nb_players_selected)).perform(click())
Expand All @@ -109,6 +117,7 @@ class GameSetupActivityTest {

@Test
fun checkIntentOnProceedFour() { //FILLER TEST
onView(withId(R.id.local_buzzer_game_button)).perform(scrollTo(), click())
onView(withId(R.id.nb_player_spinner)).perform(click())
onData(Matchers.anything()).atPosition(3).perform(click())
onView(withId(R.id.nb_players_selected)).perform(click())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@ class TypingGameActivityTest{
Intents.release()
}

@Test
fun borderGenTest(){
val ctx = ApplicationProvider.getApplicationContext() as Context
val border = TypingGameActivity.borderGen(ctx)
assertEquals(getColor(ctx, R.color.maximum_yellow_red), border.color?.defaultColor)
}

@Test
fun spaceGenTest(){
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package ch.sdp.vibester.helper

import android.content.Context
import androidx.core.content.ContextCompat
import androidx.test.core.app.ApplicationProvider
import ch.sdp.vibester.R
import org.junit.Assert.assertEquals
import org.junit.Test

class DisplayContentsTest {
@Test
fun borderGenTest(){
val ctx = ApplicationProvider.getApplicationContext() as Context
val border = DisplayContents.borderGen(ctx, R.color.maximum_yellow_red)
assertEquals(ContextCompat.getColor(ctx, R.color.maximum_yellow_red), border.color?.defaultColor)
}

}
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:icon="@drawable/logo"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:roundIcon="@drawable/logo"
android:supportsRtl="true"
android:theme="@style/Theme.MyApplication"
android:usesCleartextTraffic="true">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package ch.sdp.vibester.activity

import android.content.Intent
import android.os.Bundle
import android.view.Window
import android.widget.Button
import android.widget.EditText
import android.widget.TextView
Expand All @@ -26,6 +27,8 @@ class AuthenticationActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
requestWindowFeature(Window.FEATURE_NO_TITLE)
supportActionBar?.hide()
setContentView(R.layout.activity_google_log_in)

val gso = GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package ch.sdp.vibester.activity
import android.content.Intent
import android.os.Bundle
import android.view.View
import android.view.Window
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import ch.sdp.vibester.R
Expand All @@ -21,6 +22,9 @@ class GameEndingActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
requestWindowFeature(Window.FEATURE_NO_TITLE)
supportActionBar?.hide()

setContentView(R.layout.activity_game_ending_screen)

if(intent.hasExtra("playerName")) {
Expand Down
21 changes: 21 additions & 0 deletions app/src/main/java/ch/sdp/vibester/activity/GameSetupActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,28 @@ package ch.sdp.vibester.activity
import android.content.Intent
import android.os.Bundle
import android.view.View
import android.view.View.GONE
import android.view.View.VISIBLE
import android.view.Window
import android.widget.*
import androidx.appcompat.app.AppCompatActivity
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.view.children
import ch.sdp.vibester.R
import ch.sdp.vibester.helper.DisplayContents

class GameSetupActivity : AppCompatActivity(), AdapterView.OnItemSelectedListener {
var text = "One"
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
requestWindowFeature(Window.FEATURE_NO_TITLE)
supportActionBar?.hide()
setContentView(R.layout.activity_game_setup_screen)

chooseGameSetupListener()

val spinner: Spinner = findViewById(R.id.nb_player_spinner)
//spinner.background = DisplayContents.borderGen(this, R.color.floral_white)
ArrayAdapter.createFromResource(
this,
R.array.nb_players,
Expand Down Expand Up @@ -85,4 +95,15 @@ class GameSetupActivity : AppCompatActivity(), AdapterView.OnItemSelectedListene
intent.putExtra("Player Names", pNameArray)
startActivity(intent)
}

private fun chooseGameSetupListener(){
val butBuzz = findViewById<Button>(R.id.local_buzzer_game_button)
butBuzz.setOnClickListener({
val chooseLinLay = findViewById<LinearLayout>(R.id.chooseGame)
val buzzereConsLay = findViewById<ConstraintLayout>(R.id.buzzerSetup)
chooseLinLay.visibility = GONE
buzzereConsLay.visibility = VISIBLE
})
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.content.Intent
import android.os.Bundle
import android.view.Gravity
import android.view.View
import android.view.Window
import android.widget.Button
import android.widget.LinearLayout
import android.widget.TableRow
Expand All @@ -16,6 +17,8 @@ class GamescreenActivity: AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
requestWindowFeature(Window.FEATURE_NO_TITLE)
supportActionBar?.hide()
setContentView(R.layout.activity_gamescreen)

val getIntent = intent.extras
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.content.Intent
import android.os.Bundle
import android.view.Gravity
import android.view.View
import android.view.Window
import android.widget.LinearLayout
import android.widget.LinearLayout.LayoutParams
import android.widget.TextView
Expand All @@ -19,6 +20,10 @@ class IncorrectSongsActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

requestWindowFeature(Window.FEATURE_NO_TITLE)
supportActionBar?.hide()

setContentView(R.layout.activity_incorrect_songs_screen)

val layout: LinearLayout = findViewById(R.id.incorrect_songs_linear)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ import retrofit2.Callback
import retrofit2.Response
import java.util.*

private const val REQUEST_AUDIO = 100
private const val LASTFM_METHOD = "artist.gettoptracks"



/**
* Game checks if the player say the lyrics of the given song correct
*/
class LyricsBelongGameActivity : AppCompatActivity() {
private val LASTFM_METHOD = "artist.gettoptracks"
private val REQUEST_AUDIO = 100
private lateinit var speechInput : String
private val baseUrlLyrics = "https://api.lyrics.ovh/"
private val baseUrlLastFM = "https://ws.audioscrobbler.com/2.0/"
Expand Down
Loading

0 comments on commit 4bc6aed

Please sign in to comment.