2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @ -6,4 +6,4 @@ | |||||||
| /build | /build | ||||||
| /captures | /captures | ||||||
| .externalNativeBuild | .externalNativeBuild | ||||||
| /app/release | /app/release/ | ||||||
|  | |||||||
							
								
								
									
										
											BIN
										
									
								
								.idea/caches/build_file_checksums.ser
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.idea/caches/build_file_checksums.ser
									
									
									
										generated
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										125
									
								
								.idea/codeStyles/Project.xml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										125
									
								
								.idea/codeStyles/Project.xml
									
									
									
										generated
									
									
									
								
							| @ -1,6 +1,22 @@ | |||||||
| <component name="ProjectCodeStyleConfiguration"> | <component name="ProjectCodeStyleConfiguration"> | ||||||
|   <code_scheme name="Project" version="173"> |   <code_scheme name="Project" version="173"> | ||||||
|     <JetCodeStyleSettings> |     <JetCodeStyleSettings> | ||||||
|  |       <option name="PACKAGES_TO_USE_STAR_IMPORTS"> | ||||||
|  |         <value> | ||||||
|  |           <package name="java.util" alias="false" withSubpackages="false" /> | ||||||
|  |           <package name="kotlinx.android.synthetic" alias="false" withSubpackages="true" /> | ||||||
|  |           <package name="io.ktor" alias="false" withSubpackages="true" /> | ||||||
|  |         </value> | ||||||
|  |       </option> | ||||||
|  |       <option name="PACKAGES_IMPORT_LAYOUT"> | ||||||
|  |         <value> | ||||||
|  |           <package name="" alias="false" withSubpackages="true" /> | ||||||
|  |           <package name="java" alias="false" withSubpackages="true" /> | ||||||
|  |           <package name="javax" alias="false" withSubpackages="true" /> | ||||||
|  |           <package name="kotlin" alias="false" withSubpackages="true" /> | ||||||
|  |           <package name="" alias="true" withSubpackages="true" /> | ||||||
|  |         </value> | ||||||
|  |       </option> | ||||||
|       <option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" /> |       <option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" /> | ||||||
|     </JetCodeStyleSettings> |     </JetCodeStyleSettings> | ||||||
|     <Objective-C-extensions> |     <Objective-C-extensions> | ||||||
| @ -28,6 +44,115 @@ | |||||||
|         <pair source="c" header="h" fileNamingConvention="NONE" /> |         <pair source="c" header="h" fileNamingConvention="NONE" /> | ||||||
|       </extensions> |       </extensions> | ||||||
|     </Objective-C-extensions> |     </Objective-C-extensions> | ||||||
|  |     <codeStyleSettings language="XML"> | ||||||
|  |       <arrangement> | ||||||
|  |         <rules> | ||||||
|  |           <section> | ||||||
|  |             <rule> | ||||||
|  |               <match> | ||||||
|  |                 <AND> | ||||||
|  |                   <NAME>xmlns:android</NAME> | ||||||
|  |                   <XML_ATTRIBUTE /> | ||||||
|  |                   <XML_NAMESPACE>^$</XML_NAMESPACE> | ||||||
|  |                 </AND> | ||||||
|  |               </match> | ||||||
|  |             </rule> | ||||||
|  |           </section> | ||||||
|  |           <section> | ||||||
|  |             <rule> | ||||||
|  |               <match> | ||||||
|  |                 <AND> | ||||||
|  |                   <NAME>xmlns:.*</NAME> | ||||||
|  |                   <XML_ATTRIBUTE /> | ||||||
|  |                   <XML_NAMESPACE>^$</XML_NAMESPACE> | ||||||
|  |                 </AND> | ||||||
|  |               </match> | ||||||
|  |               <order>BY_NAME</order> | ||||||
|  |             </rule> | ||||||
|  |           </section> | ||||||
|  |           <section> | ||||||
|  |             <rule> | ||||||
|  |               <match> | ||||||
|  |                 <AND> | ||||||
|  |                   <NAME>.*:id</NAME> | ||||||
|  |                   <XML_ATTRIBUTE /> | ||||||
|  |                   <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE> | ||||||
|  |                 </AND> | ||||||
|  |               </match> | ||||||
|  |             </rule> | ||||||
|  |           </section> | ||||||
|  |           <section> | ||||||
|  |             <rule> | ||||||
|  |               <match> | ||||||
|  |                 <AND> | ||||||
|  |                   <NAME>.*:name</NAME> | ||||||
|  |                   <XML_ATTRIBUTE /> | ||||||
|  |                   <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE> | ||||||
|  |                 </AND> | ||||||
|  |               </match> | ||||||
|  |             </rule> | ||||||
|  |           </section> | ||||||
|  |           <section> | ||||||
|  |             <rule> | ||||||
|  |               <match> | ||||||
|  |                 <AND> | ||||||
|  |                   <NAME>name</NAME> | ||||||
|  |                   <XML_ATTRIBUTE /> | ||||||
|  |                   <XML_NAMESPACE>^$</XML_NAMESPACE> | ||||||
|  |                 </AND> | ||||||
|  |               </match> | ||||||
|  |             </rule> | ||||||
|  |           </section> | ||||||
|  |           <section> | ||||||
|  |             <rule> | ||||||
|  |               <match> | ||||||
|  |                 <AND> | ||||||
|  |                   <NAME>style</NAME> | ||||||
|  |                   <XML_ATTRIBUTE /> | ||||||
|  |                   <XML_NAMESPACE>^$</XML_NAMESPACE> | ||||||
|  |                 </AND> | ||||||
|  |               </match> | ||||||
|  |             </rule> | ||||||
|  |           </section> | ||||||
|  |           <section> | ||||||
|  |             <rule> | ||||||
|  |               <match> | ||||||
|  |                 <AND> | ||||||
|  |                   <NAME>.*</NAME> | ||||||
|  |                   <XML_ATTRIBUTE /> | ||||||
|  |                   <XML_NAMESPACE>^$</XML_NAMESPACE> | ||||||
|  |                 </AND> | ||||||
|  |               </match> | ||||||
|  |               <order>BY_NAME</order> | ||||||
|  |             </rule> | ||||||
|  |           </section> | ||||||
|  |           <section> | ||||||
|  |             <rule> | ||||||
|  |               <match> | ||||||
|  |                 <AND> | ||||||
|  |                   <NAME>.*</NAME> | ||||||
|  |                   <XML_ATTRIBUTE /> | ||||||
|  |                   <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE> | ||||||
|  |                 </AND> | ||||||
|  |               </match> | ||||||
|  |               <order>ANDROID_ATTRIBUTE_ORDER</order> | ||||||
|  |             </rule> | ||||||
|  |           </section> | ||||||
|  |           <section> | ||||||
|  |             <rule> | ||||||
|  |               <match> | ||||||
|  |                 <AND> | ||||||
|  |                   <NAME>.*</NAME> | ||||||
|  |                   <XML_ATTRIBUTE /> | ||||||
|  |                   <XML_NAMESPACE>.*</XML_NAMESPACE> | ||||||
|  |                 </AND> | ||||||
|  |               </match> | ||||||
|  |               <order>BY_NAME</order> | ||||||
|  |             </rule> | ||||||
|  |           </section> | ||||||
|  |         </rules> | ||||||
|  |       </arrangement> | ||||||
|  |     </codeStyleSettings> | ||||||
|     <codeStyleSettings language="kotlin"> |     <codeStyleSettings language="kotlin"> | ||||||
|       <option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" /> |       <option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" /> | ||||||
|     </codeStyleSettings> |     </codeStyleSettings> | ||||||
|  | |||||||
							
								
								
									
										2
									
								
								.idea/gradle.xml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								.idea/gradle.xml
									
									
									
										generated
									
									
									
								
							| @ -1,8 +1,10 @@ | |||||||
| <?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||||||
| <project version="4"> | <project version="4"> | ||||||
|  |   <component name="GradleMigrationSettings" migrationVersion="1" /> | ||||||
|   <component name="GradleSettings"> |   <component name="GradleSettings"> | ||||||
|     <option name="linkedExternalProjectsSettings"> |     <option name="linkedExternalProjectsSettings"> | ||||||
|       <GradleProjectSettings> |       <GradleProjectSettings> | ||||||
|  |         <option name="testRunner" value="PLATFORM" /> | ||||||
|         <option name="distributionType" value="DEFAULT_WRAPPED" /> |         <option name="distributionType" value="DEFAULT_WRAPPED" /> | ||||||
|         <option name="externalProjectPath" value="$PROJECT_DIR$" /> |         <option name="externalProjectPath" value="$PROJECT_DIR$" /> | ||||||
|         <option name="modules"> |         <option name="modules"> | ||||||
|  | |||||||
							
								
								
									
										14
									
								
								.idea/misc.xml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										14
									
								
								.idea/misc.xml
									
									
									
										generated
									
									
									
								
							| @ -5,7 +5,7 @@ | |||||||
|     <option name="myDefaultNotNull" value="android.support.annotation.NonNull" /> |     <option name="myDefaultNotNull" value="android.support.annotation.NonNull" /> | ||||||
|     <option name="myNullables"> |     <option name="myNullables"> | ||||||
|       <value> |       <value> | ||||||
|         <list size="7"> |         <list size="12"> | ||||||
|           <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" /> |           <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" /> | ||||||
|           <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" /> |           <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" /> | ||||||
|           <item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" /> |           <item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" /> | ||||||
| @ -13,18 +13,28 @@ | |||||||
|           <item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" /> |           <item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" /> | ||||||
|           <item index="5" class="java.lang.String" itemvalue="androidx.annotation.Nullable" /> |           <item index="5" class="java.lang.String" itemvalue="androidx.annotation.Nullable" /> | ||||||
|           <item index="6" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" /> |           <item index="6" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" /> | ||||||
|  |           <item index="7" class="java.lang.String" itemvalue="android.annotation.Nullable" /> | ||||||
|  |           <item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.Nullable" /> | ||||||
|  |           <item index="9" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableDecl" /> | ||||||
|  |           <item index="10" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableType" /> | ||||||
|  |           <item index="11" class="java.lang.String" itemvalue="com.android.annotations.Nullable" /> | ||||||
|         </list> |         </list> | ||||||
|       </value> |       </value> | ||||||
|     </option> |     </option> | ||||||
|     <option name="myNotNulls"> |     <option name="myNotNulls"> | ||||||
|       <value> |       <value> | ||||||
|         <list size="6"> |         <list size="11"> | ||||||
|           <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" /> |           <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" /> | ||||||
|           <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" /> |           <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" /> | ||||||
|           <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" /> |           <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" /> | ||||||
|           <item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" /> |           <item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" /> | ||||||
|           <item index="4" class="java.lang.String" itemvalue="androidx.annotation.NonNull" /> |           <item index="4" class="java.lang.String" itemvalue="androidx.annotation.NonNull" /> | ||||||
|           <item index="5" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" /> |           <item index="5" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" /> | ||||||
|  |           <item index="6" class="java.lang.String" itemvalue="android.annotation.NonNull" /> | ||||||
|  |           <item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.NonNull" /> | ||||||
|  |           <item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullDecl" /> | ||||||
|  |           <item index="9" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullType" /> | ||||||
|  |           <item index="10" class="java.lang.String" itemvalue="com.android.annotations.NonNull" /> | ||||||
|         </list> |         </list> | ||||||
|       </value> |       </value> | ||||||
|     </option> |     </option> | ||||||
|  | |||||||
| @ -5,13 +5,13 @@ apply plugin: 'kotlin-android' | |||||||
| apply plugin: 'kotlin-android-extensions' | apply plugin: 'kotlin-android-extensions' | ||||||
|  |  | ||||||
| android { | android { | ||||||
|     compileSdkVersion 28 |     compileSdkVersion 30 | ||||||
|     defaultConfig { |     defaultConfig { | ||||||
|         applicationId "adrienmalin.pingpoints" |         applicationId "adrienmalin.pingpoints" | ||||||
|         minSdkVersion 15 |         minSdkVersion 15 | ||||||
|         targetSdkVersion 28 |         targetSdkVersion 30 | ||||||
|         versionCode 9 |         versionCode 10 | ||||||
|         versionName "2.3" |         versionName "2.4" | ||||||
|         vectorDrawables.useSupportLibrary true |         vectorDrawables.useSupportLibrary true | ||||||
|     } |     } | ||||||
|     buildTypes { |     buildTypes { | ||||||
| @ -25,11 +25,11 @@ android { | |||||||
| dependencies { | dependencies { | ||||||
|     implementation fileTree(dir: 'libs', include: ['*.jar']) |     implementation fileTree(dir: 'libs', include: ['*.jar']) | ||||||
|     implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" |     implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" | ||||||
|     implementation 'com.android.support:appcompat-v7:28.0.0' |     implementation 'androidx.appcompat:appcompat:1.2.0' | ||||||
|     implementation 'com.android.support.constraint:constraint-layout:1.1.3' |     implementation 'androidx.constraintlayout:constraintlayout:2.0.1' | ||||||
|     implementation 'com.android.support:design:28.0.0' |     implementation 'com.google.android.material:material:1.2.1' | ||||||
|     implementation 'com.android.support:support-v4:28.0.0' |     implementation 'androidx.legacy:legacy-support-v4:1.0.0' | ||||||
|     implementation 'android.arch.lifecycle:extensions:1.1.1' |     implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' | ||||||
|     annotationProcessor 'android.arch.lifecycle:compiler:1.1.1' |     annotationProcessor 'androidx.lifecycle:lifecycle-compiler:2.2.0' | ||||||
|     implementation 'com.android.support:design:28.0.0' |     implementation 'com.google.android.material:material:1.2.1' | ||||||
| } | } | ||||||
|  | |||||||
| @ -12,6 +12,7 @@ | |||||||
|             android:logo="@mipmap/ic_launcher" |             android:logo="@mipmap/ic_launcher" | ||||||
|             android:roundIcon="@mipmap/ic_launcher_round" |             android:roundIcon="@mipmap/ic_launcher_round" | ||||||
|             android:supportsRtl="true" |             android:supportsRtl="true" | ||||||
|  |             android:fullBackupContent="@xml/backup_descriptor" | ||||||
|             android:theme="@style/PingPointsTheme"> |             android:theme="@style/PingPointsTheme"> | ||||||
|         <activity |         <activity | ||||||
|                 android:name=".StarterNameActivity" |                 android:name=".StarterNameActivity" | ||||||
|  | |||||||
| @ -1,26 +1,38 @@ | |||||||
| package adrienmalin.pingpoints | package adrienmalin.pingpoints | ||||||
|  |  | ||||||
| import android.arch.lifecycle.ViewModelProviders | import android.content.ActivityNotFoundException | ||||||
|  | import android.content.Context | ||||||
| import android.content.Intent | import android.content.Intent | ||||||
|  | import android.media.AudioManager | ||||||
|  | import android.os.Build | ||||||
| import android.os.Bundle | import android.os.Bundle | ||||||
|  | import android.speech.RecognitionListener | ||||||
|  | import android.speech.RecognizerIntent | ||||||
|  | import android.speech.SpeechRecognizer | ||||||
| import android.speech.tts.TextToSpeech | import android.speech.tts.TextToSpeech | ||||||
| import android.speech.tts.UtteranceProgressListener | import android.speech.tts.UtteranceProgressListener | ||||||
| import android.support.design.widget.Snackbar | import android.util.Log | ||||||
| import android.support.v7.app.AppCompatActivity |  | ||||||
| import android.support.v7.app.AppCompatDelegate |  | ||||||
| import android.view.View | import android.view.View | ||||||
| import android.widget.Button | import android.widget.Button | ||||||
| import android.widget.ImageView | import android.widget.ImageView | ||||||
| import java.util.regex.Pattern | import androidx.appcompat.app.AppCompatActivity | ||||||
|  | import androidx.appcompat.app.AppCompatDelegate | ||||||
|  | import androidx.lifecycle.ViewModelProvider | ||||||
|  | import com.google.android.material.snackbar.Snackbar | ||||||
|  | import kotlin.math.max | ||||||
|  | import kotlin.math.min | ||||||
|  |  | ||||||
|  |  | ||||||
| class MatchActivity : AppCompatActivity() { | class MatchActivity : AppCompatActivity() { | ||||||
|     var matchModel: MatchModel? = null |     var match: MatchModel? = null | ||||||
|     var textScore: android.widget.TextView? = null |     var textScore: android.widget.TextView? = null | ||||||
|     var textService: android.widget.TextView? = null |     var textService: android.widget.TextView? = null | ||||||
|     var buttons: Array<Button> = emptyArray() |     var buttons: Array<Button> = emptyArray() | ||||||
|     var imageViews: Array<ImageView> = emptyArray() |     var imageViews: Array<ImageView> = emptyArray() | ||||||
|  |     var icStt: ImageView? = null | ||||||
|     var tts: TextToSpeech? = null |     var tts: TextToSpeech? = null | ||||||
|  |     var stt: SpeechRecognizer? = null | ||||||
|  |  | ||||||
|  |  | ||||||
|     inner class WaitForTtsInit : TextToSpeech.OnInitListener { |     inner class WaitForTtsInit : TextToSpeech.OnInitListener { | ||||||
|         override fun onInit(status: Int) { |         override fun onInit(status: Int) { | ||||||
| @ -28,58 +40,91 @@ class MatchActivity : AppCompatActivity() { | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     inner class SttAfterTts : UtteranceProgressListener() { |     inner class WaitForTtsSpeak : UtteranceProgressListener() { | ||||||
|         override fun onDone(id: String) { |         override fun onDone(id: String) { | ||||||
|             SttDialog().show(supportFragmentManager, "SttDialog") |             runOnUiThread { | ||||||
|  |                 startSTT() | ||||||
|  |             } | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         override fun onStart(id: String) {} |         override fun onStart(id: String) {} | ||||||
|  |  | ||||||
|         @Suppress("OverridingDeprecatedMember") |  | ||||||
|         override fun onError(id: String) {} |         override fun onError(id: String) {} | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     inner class SttListener : RecognitionListener { | ||||||
|  |         var minRms: Float = 0f | ||||||
|  |         var maxRms: Float = 0f | ||||||
|  |  | ||||||
|  |         override fun onReadyForSpeech(arg0: Bundle?) { | ||||||
|  |             icStt?.alpha = .5f | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         override fun onBeginningOfSpeech() {} | ||||||
|  |  | ||||||
|  |         override fun onBufferReceived(buffer: ByteArray?) {} | ||||||
|  |  | ||||||
|  |         override fun onRmsChanged(rmsdB: Float) { | ||||||
|  |             minRms = min(rmsdB, minRms) | ||||||
|  |             maxRms = max(rmsdB, maxRms) | ||||||
|  |             if (minRms != maxRms) | ||||||
|  |                 icStt?.alpha = 0.5f + (rmsdB - minRms) / (2 * (maxRms - minRms)) | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         override fun onPartialResults(data: Bundle) {} | ||||||
|  |  | ||||||
|  |         override fun onResults(data: Bundle) { | ||||||
|  |             stt = null | ||||||
|  |             data.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION)?.let { results -> | ||||||
|  |                 match?.apply { | ||||||
|  |                     for (result in results) { | ||||||
|  |                         Log.i("stt results", result) | ||||||
|  |                         val soundex = soundex(result) | ||||||
|  |                         for (player in players) { | ||||||
|  |                             if (soundex == player.soundex) { | ||||||
|  |                                 icStt?.alpha = 0f | ||||||
|  |                                 unMuteAudio() | ||||||
|  |                                 updateScore(player) | ||||||
|  |                                 updateUI() | ||||||
|  |                                 return | ||||||
|  |                             } | ||||||
|  |                         } | ||||||
|  |                     } | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  |             showPopUp(getString(R.string.not_understood)) | ||||||
|  |             startSTT() | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         override fun onEndOfSpeech() {} | ||||||
|  |  | ||||||
|  |         override fun onError(errorCode: Int) { | ||||||
|  |             muteAudio() | ||||||
|  |             Log.e( | ||||||
|  |                 "stt", when (errorCode) { | ||||||
|  |                     SpeechRecognizer.ERROR_AUDIO -> "Audio recording error" | ||||||
|  |                     SpeechRecognizer.ERROR_CLIENT -> "Client side error" | ||||||
|  |                     SpeechRecognizer.ERROR_INSUFFICIENT_PERMISSIONS -> "Insufficient permissions" | ||||||
|  |                     SpeechRecognizer.ERROR_NETWORK -> "Network error" | ||||||
|  |                     SpeechRecognizer.ERROR_NETWORK_TIMEOUT -> "Network timeout" | ||||||
|  |                     SpeechRecognizer.ERROR_NO_MATCH -> "No match" | ||||||
|  |                     SpeechRecognizer.ERROR_RECOGNIZER_BUSY -> "RecognitionService busy" | ||||||
|  |                     SpeechRecognizer.ERROR_SERVER -> "Error from server" | ||||||
|  |                     SpeechRecognizer.ERROR_SPEECH_TIMEOUT -> "No speech input" | ||||||
|  |                     else -> "Didn't understand, please try again." | ||||||
|  |                 } | ||||||
|  |             ) | ||||||
|  |             if (match?.matchStarted == true) startSTT() | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         override fun onEvent(arg0: Int, arg1: Bundle?) {} | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |  | ||||||
|     override fun onCreate(savedInstanceState: Bundle?) { |     override fun onCreate(savedInstanceState: Bundle?) { | ||||||
|         super.onCreate(savedInstanceState) |         super.onCreate(savedInstanceState) | ||||||
|         AppCompatDelegate.setCompatVectorFromResourcesEnabled(true) |         AppCompatDelegate.setCompatVectorFromResourcesEnabled(true) | ||||||
|         setContentView(R.layout.activity_match) |         setContentView(R.layout.activity_match) | ||||||
|  |  | ||||||
|         initMatchModel() |  | ||||||
|         findViews() |  | ||||||
|         updateUI() |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     fun initMatchModel() { |  | ||||||
|         matchModel = ViewModelProviders.of(this).get(MatchModel::class.java).apply { |  | ||||||
|             if (!matchStarted) { |  | ||||||
|                 intent.apply { |  | ||||||
|                     matchStarted = true |  | ||||||
|                     val player1Name = getStringExtra("player1Name") |  | ||||||
|                     val player2Name = getStringExtra("player2Name") |  | ||||||
|                     players = listOf( |  | ||||||
|                         Player(player1Name, 0), |  | ||||||
|                         Player(player2Name, 0) |  | ||||||
|                     ) |  | ||||||
|                     serviceSide = getIntExtra("starterId", 0) |  | ||||||
|                     relaunchSide = when(serviceSide) { |  | ||||||
|                         0 -> 1 |  | ||||||
|                         else -> 0 |  | ||||||
|                     } |  | ||||||
|                     ttsEnabled = getBooleanExtra("enableTTS", false) |  | ||||||
|                     sttEnabled = getBooleanExtra("enableSTT", false) |  | ||||||
|                     saveState() |  | ||||||
|  |  | ||||||
|                     if (ttsEnabled) { |  | ||||||
|                         tts = TextToSpeech(this@MatchActivity, WaitForTtsInit()) |  | ||||||
|                         if (sttEnabled) tts?.setOnUtteranceProgressListener(SttAfterTts()) |  | ||||||
|                     } |  | ||||||
|                     if (!sttEnabled) showPopUp(getString(R.string.button_hint)) |  | ||||||
|                 } |  | ||||||
|             } |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     fun findViews() { |  | ||||||
|         textScore = findViewById(R.id.textScore) |         textScore = findViewById(R.id.textScore) | ||||||
|         textService = findViewById(R.id.textService) |         textService = findViewById(R.id.textService) | ||||||
|         buttons = arrayOf( |         buttons = arrayOf( | ||||||
| @ -90,10 +135,70 @@ class MatchActivity : AppCompatActivity() { | |||||||
|             findViewById(R.id.imgService0), |             findViewById(R.id.imgService0), | ||||||
|             findViewById(R.id.imgService1) |             findViewById(R.id.imgService1) | ||||||
|         ) |         ) | ||||||
|  |         icStt = findViewById(R.id.icStt) | ||||||
|  |  | ||||||
|  |         match = ViewModelProvider(this).get(MatchModel::class.java).apply { | ||||||
|  |             if (!matchStarted) { | ||||||
|  |                 intent.apply { | ||||||
|  |                     matchStarted = true | ||||||
|  |                     val player1Name = getStringExtra("player1Name") | ||||||
|  |                     val player2Name = getStringExtra("player2Name") | ||||||
|  |                     players = listOf( | ||||||
|  |                         Player(player1Name ?: getString(R.string.player_1_default_name), 0), | ||||||
|  |                         Player(player2Name ?: getString(R.string.player_2_default_name), 0) | ||||||
|  |                     ) | ||||||
|  |                     players.forEach { | ||||||
|  |                         it.soundex = soundex(getString(R.string.soundex, it.name)) | ||||||
|  |                     } | ||||||
|  |                     serviceSide = getIntExtra("starterId", 0) | ||||||
|  |                     relaunchSide = when (serviceSide) { | ||||||
|  |                         0 -> 1 | ||||||
|  |                         else -> 0 | ||||||
|  |                     } | ||||||
|  |                     ttsEnabled = getBooleanExtra("enableTTS", false) | ||||||
|  |                     sttEnabled = getBooleanExtra("enableSTT", false) | ||||||
|  |                     saveState() | ||||||
|  |  | ||||||
|  |                     if (sttEnabled) { | ||||||
|  |                         showPopUp( | ||||||
|  |                             getString( | ||||||
|  |                                 R.string.STT_hint, | ||||||
|  |                                 players[0].name, | ||||||
|  |                                 players[1].name | ||||||
|  |                             ), | ||||||
|  |                             Snackbar.LENGTH_LONG | ||||||
|  |                         ) | ||||||
|  |                     } else { | ||||||
|  |                         showPopUp(getString(R.string.button_hint)) | ||||||
|  |                     } | ||||||
|  |  | ||||||
|  |                     if (ttsEnabled) { | ||||||
|  |                         tts = TextToSpeech(this@MatchActivity, WaitForTtsInit()).apply { | ||||||
|  |                             if (sttEnabled) setOnUtteranceProgressListener(WaitForTtsSpeak()) | ||||||
|  |                         } | ||||||
|  |                     } | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     override fun onDestroy() { | ||||||
|  |         stopSTT() | ||||||
|  |         super.onDestroy() | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     override fun onResume() { | ||||||
|  |         super.onResume() | ||||||
|  |         updateUI() | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     override fun onPause() { | ||||||
|  |         stopSTT() | ||||||
|  |         super.onPause() | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     fun updateUI() { |     fun updateUI() { | ||||||
|         matchModel?.apply { |         match?.apply { | ||||||
|             textScore?.text = getString( |             textScore?.text = getString( | ||||||
|                 R.string.score_score, |                 R.string.score_score, | ||||||
|                 players[serviceSide].score, |                 players[serviceSide].score, | ||||||
| @ -105,23 +210,25 @@ class MatchActivity : AppCompatActivity() { | |||||||
|                 button.text = fromHtml(getString(R.string.button_text, player.name, player.score)) |                 button.text = fromHtml(getString(R.string.button_text, player.name, player.score)) | ||||||
|  |  | ||||||
|             imageViews[0].setImageResource( |             imageViews[0].setImageResource( | ||||||
|                 when(serviceSide) { |                 when (serviceSide) { | ||||||
|                     0 -> R.drawable.ic_service_0 |                     0 -> R.drawable.ic_service_0 | ||||||
|                     else -> 0 |                     else -> 0 | ||||||
|                 } |                 } | ||||||
|             ) |             ) | ||||||
|             imageViews[1].setImageResource( |             imageViews[1].setImageResource( | ||||||
|                 when(serviceSide) { |                 when (serviceSide) { | ||||||
|                     0 -> 0 |                     0 -> 0 | ||||||
|                     else -> R.drawable.ic_service_1 |                     else -> R.drawable.ic_service_1 | ||||||
|                 } |                 } | ||||||
|             ) |             ) | ||||||
|  |  | ||||||
|  |             if (matchStarted) { | ||||||
|                 if (matchFinished) |                 if (matchFinished) | ||||||
|                     proclaimVictory() |                     proclaimVictory() | ||||||
|                 else { |                 else { | ||||||
|                     if (ttsEnabled) { |                     if (ttsEnabled) { | ||||||
|                     var scoreSpeech: String = getString( |                         unMuteAudio() | ||||||
|  |                         var scoreSpeech = getString( | ||||||
|                             R.string.update_score_speech, |                             R.string.update_score_speech, | ||||||
|                             players[serviceSide].score, |                             players[serviceSide].score, | ||||||
|                             players[relaunchSide].score, |                             players[relaunchSide].score, | ||||||
| @ -129,16 +236,18 @@ class MatchActivity : AppCompatActivity() { | |||||||
|                         ) |                         ) | ||||||
|                         if (matchPoint) scoreSpeech += getString(R.string.match_point) |                         if (matchPoint) scoreSpeech += getString(R.string.match_point) | ||||||
|                         say(scoreSpeech) |                         say(scoreSpeech) | ||||||
|  |                     } else if (sttEnabled) { | ||||||
|  |                         startSTT() | ||||||
|                     } |                     } | ||||||
|                 else { |  | ||||||
|                     if (sttEnabled) SttDialog().show(supportFragmentManager, "SttDialog") |  | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     fun proclaimVictory() { |     fun proclaimVictory() { | ||||||
|         matchModel?.apply { |         match?.apply { | ||||||
|  |             matchStarted = false | ||||||
|  |             stopSTT() | ||||||
|             val (loser, winner) = players.sortedBy { it.score } |             val (loser, winner) = players.sortedBy { it.score } | ||||||
|             if (ttsEnabled) { |             if (ttsEnabled) { | ||||||
|                 say( |                 say( | ||||||
| @ -163,9 +272,9 @@ class MatchActivity : AppCompatActivity() { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     fun updateScore(view: View) { |     fun updateScore(view: View) { | ||||||
|         matchModel?.apply { |         match?.apply { | ||||||
|             if (!matchFinished) { |             if (!matchFinished) { | ||||||
|                 when(view) { |                 when (view) { | ||||||
|                     buttons[0] -> updateScore(players[0]) |                     buttons[0] -> updateScore(players[0]) | ||||||
|                     buttons[1] -> updateScore(players[1]) |                     buttons[1] -> updateScore(players[1]) | ||||||
|                 } |                 } | ||||||
| @ -175,10 +284,10 @@ class MatchActivity : AppCompatActivity() { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     override fun onBackPressed() { |     override fun onBackPressed() { | ||||||
|         if (matchModel?.pointId == 0) |         if (match?.pointId == 0) | ||||||
|             super.onBackPressed() |             super.onBackPressed() | ||||||
|         else { |         else { | ||||||
|             matchModel?.undo() |             match?.undo() | ||||||
|             updateUI() |             updateUI() | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| @ -191,7 +300,7 @@ class MatchActivity : AppCompatActivity() { | |||||||
|         ).show() |         ).show() | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     fun showPopUp(textId: Int, duration: Int = Snackbar.LENGTH_SHORT) { |     fun showPopUp(textId: Int, duration: Int = Snackbar.LENGTH_INDEFINITE) { | ||||||
|         Snackbar.make( |         Snackbar.make( | ||||||
|             findViewById(R.id.coordinatorLayout), |             findViewById(R.id.coordinatorLayout), | ||||||
|             textId, |             textId, | ||||||
| @ -199,12 +308,87 @@ class MatchActivity : AppCompatActivity() { | |||||||
|         ).show() |         ).show() | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     fun stopSTT() { | ||||||
|  |         icStt?.alpha = 0f | ||||||
|  |         unMuteAudio() | ||||||
|  |         stt?.stopListening() | ||||||
|  |         stt?.destroy() | ||||||
|  |         stt = null | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     fun startSTT() { | ||||||
|  |         stt?.stopListening() | ||||||
|  |         stt?.destroy() | ||||||
|  |         if (match?.matchStarted == true) { | ||||||
|  |             stt = SpeechRecognizer.createSpeechRecognizer(this@MatchActivity).apply { | ||||||
|  |                 setRecognitionListener(SttListener()) | ||||||
|  |                 try { | ||||||
|  |                     startListening( | ||||||
|  |                         Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH).apply { | ||||||
|  |                             putExtra( | ||||||
|  |                                 RecognizerIntent.EXTRA_LANGUAGE_MODEL, | ||||||
|  |                                 RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH | ||||||
|  |                             ) | ||||||
|  |                             putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 10) | ||||||
|  |                             putExtra(RecognizerIntent.EXTRA_PARTIAL_RESULTS, true) | ||||||
|  |                             if (!hasExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE)) { | ||||||
|  |                                 putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, packageName) | ||||||
|  |                             } | ||||||
|  |                         } | ||||||
|  |                     ) | ||||||
|  |                 } catch (e: ActivityNotFoundException) { | ||||||
|  |                     match?.sttEnabled = false | ||||||
|  |                     showPopUp(R.string.STT_unavailable) | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|     @Suppress("DEPRECATION") |     @Suppress("DEPRECATION") | ||||||
|     fun say(text: String, queueMode: Int = TextToSpeech.QUEUE_FLUSH) { |     fun say(text: String, queueMode: Int = TextToSpeech.QUEUE_FLUSH) { | ||||||
|  |         stopSTT() | ||||||
|         tts?.speak( |         tts?.speak( | ||||||
|             text, |             text, | ||||||
|             queueMode, |             queueMode, | ||||||
|             hashMapOf(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID to "TTS") |             hashMapOf(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID to "TTS") | ||||||
|         ) |         ) | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @Suppress("DEPRECATION") | ||||||
|  |     fun muteAudio() { | ||||||
|  |         (getSystemService(Context.AUDIO_SERVICE) as AudioManager).apply { | ||||||
|  |             if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { | ||||||
|  |                 adjustStreamVolume(AudioManager.STREAM_NOTIFICATION, AudioManager.ADJUST_MUTE, 0) | ||||||
|  |                 adjustStreamVolume(AudioManager.STREAM_ALARM, AudioManager.ADJUST_MUTE, 0) | ||||||
|  |                 adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_MUTE, 0) | ||||||
|  |                 adjustStreamVolume(AudioManager.STREAM_RING, AudioManager.ADJUST_MUTE, 0) | ||||||
|  |                 adjustStreamVolume(AudioManager.STREAM_SYSTEM, AudioManager.ADJUST_MUTE, 0) | ||||||
|  |             } else { | ||||||
|  |                 setStreamMute(AudioManager.STREAM_NOTIFICATION, true) | ||||||
|  |                 setStreamMute(AudioManager.STREAM_ALARM, true) | ||||||
|  |                 setStreamMute(AudioManager.STREAM_MUSIC, true) | ||||||
|  |                 setStreamMute(AudioManager.STREAM_RING, true) | ||||||
|  |                 setStreamMute(AudioManager.STREAM_SYSTEM, true) | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     @Suppress("DEPRECATION") | ||||||
|  |     fun unMuteAudio() { | ||||||
|  |         (getSystemService(Context.AUDIO_SERVICE) as AudioManager).apply { | ||||||
|  |             if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { | ||||||
|  |                 adjustStreamVolume(AudioManager.STREAM_NOTIFICATION, AudioManager.ADJUST_UNMUTE, 0) | ||||||
|  |                 adjustStreamVolume(AudioManager.STREAM_ALARM, AudioManager.ADJUST_UNMUTE, 0) | ||||||
|  |                 adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_UNMUTE, 0) | ||||||
|  |                 adjustStreamVolume(AudioManager.STREAM_RING, AudioManager.ADJUST_UNMUTE, 0) | ||||||
|  |                 adjustStreamVolume(AudioManager.STREAM_SYSTEM, AudioManager.ADJUST_UNMUTE, 0) | ||||||
|  |             } else { | ||||||
|  |                 setStreamMute(AudioManager.STREAM_NOTIFICATION, false) | ||||||
|  |                 setStreamMute(AudioManager.STREAM_ALARM, false) | ||||||
|  |                 setStreamMute(AudioManager.STREAM_MUSIC, false) | ||||||
|  |                 setStreamMute(AudioManager.STREAM_RING, false) | ||||||
|  |                 setStreamMute(AudioManager.STREAM_SYSTEM, false) | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |     } | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,6 +1,6 @@ | |||||||
| package adrienmalin.pingpoints | package adrienmalin.pingpoints | ||||||
|  |  | ||||||
| import android.arch.lifecycle.ViewModel | import androidx.lifecycle.ViewModel | ||||||
|  |  | ||||||
|  |  | ||||||
| class MatchModel : ViewModel() { | class MatchModel : ViewModel() { | ||||||
|  | |||||||
| @ -1,7 +1,7 @@ | |||||||
| package adrienmalin.pingpoints | package adrienmalin.pingpoints | ||||||
|  |  | ||||||
| data class Player ( | data class Player( | ||||||
|     val name: String, |     val name: String, | ||||||
|     var score: Int, |     var score: Int, | ||||||
|     val soundex: String = soundex(name) |     var soundex: String = "" | ||||||
| ) | ) | ||||||
|  | |||||||
| @ -9,14 +9,16 @@ import android.content.pm.PackageManager | |||||||
| import android.os.Bundle | import android.os.Bundle | ||||||
| import android.speech.SpeechRecognizer | import android.speech.SpeechRecognizer | ||||||
| import android.speech.tts.TextToSpeech | import android.speech.tts.TextToSpeech | ||||||
| import android.support.design.widget.Snackbar |  | ||||||
| import android.support.v4.app.ActivityCompat |  | ||||||
| import android.support.v4.content.ContextCompat |  | ||||||
| import android.support.v7.app.AlertDialog |  | ||||||
| import android.support.v7.app.AppCompatActivity |  | ||||||
| import android.view.MotionEvent |  | ||||||
| import android.view.View | import android.view.View | ||||||
| import android.widget.* | import android.widget.ArrayAdapter | ||||||
|  | import android.widget.AutoCompleteTextView | ||||||
|  | import android.widget.RadioGroup | ||||||
|  | import android.widget.TextView | ||||||
|  | import androidx.appcompat.app.AppCompatActivity | ||||||
|  | import androidx.core.app.ActivityCompat | ||||||
|  | import androidx.core.content.ContextCompat | ||||||
|  | import com.google.android.material.snackbar.Snackbar | ||||||
|  | import com.google.android.material.switchmaterial.SwitchMaterial | ||||||
|  |  | ||||||
|  |  | ||||||
| class StarterNameActivity : AppCompatActivity() { | class StarterNameActivity : AppCompatActivity() { | ||||||
| @ -26,8 +28,8 @@ class StarterNameActivity : AppCompatActivity() { | |||||||
|     var player1NameInput: AutoCompleteTextView? = null |     var player1NameInput: AutoCompleteTextView? = null | ||||||
|     var player2NameInput: AutoCompleteTextView? = null |     var player2NameInput: AutoCompleteTextView? = null | ||||||
|     var starterRadioGroup: RadioGroup? = null |     var starterRadioGroup: RadioGroup? = null | ||||||
|     var enableTtsSwitch: Switch? = null |     var enableTtsSwitch: SwitchMaterial? = null | ||||||
|     var enableSttSwitch: Switch? = null |     var enableSttSwitch: SwitchMaterial? = null | ||||||
|     var previousMatch: SharedPreferences? = null |     var previousMatch: SharedPreferences? = null | ||||||
|     var previousPlayers: Set<String> = emptySet() |     var previousPlayers: Set<String> = emptySet() | ||||||
|  |  | ||||||
| @ -53,10 +55,11 @@ class StarterNameActivity : AppCompatActivity() { | |||||||
|     fun restorePreviousSettings() { |     fun restorePreviousSettings() { | ||||||
|         previousMatch = getPreferences(Context.MODE_PRIVATE).apply { |         previousMatch = getPreferences(Context.MODE_PRIVATE).apply { | ||||||
|             getStringSet("previousPlayers", emptySet())?.let { previousPlayers = it.toSet() } |             getStringSet("previousPlayers", emptySet())?.let { previousPlayers = it.toSet() } | ||||||
|             val adapter = ArrayAdapter<String>( |             val adapter = ArrayAdapter( | ||||||
|                 this@StarterNameActivity, |                 this@StarterNameActivity, | ||||||
|                 android.R.layout.simple_list_item_1, |                 android.R.layout.simple_list_item_1, | ||||||
|                 previousPlayers.toList()) |                 previousPlayers.toList() | ||||||
|  |             ) | ||||||
|             player1NameInput?.apply { |             player1NameInput?.apply { | ||||||
|                 setText( |                 setText( | ||||||
|                     getString("previousPlayer2", getString(R.string.player_1_default_name)), |                     getString("previousPlayer2", getString(R.string.player_1_default_name)), | ||||||
| @ -148,17 +151,16 @@ class StarterNameActivity : AppCompatActivity() { | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     fun swapNames(view: View) { |     fun swapNames(@Suppress("UNUSED_PARAMETER") view: View) { | ||||||
|         player1NameInput?.text = player2NameInput?.text.also { |         player1NameInput?.text = player2NameInput?.text.also { | ||||||
|             player2NameInput?.text = player1NameInput?.text |             player2NameInput?.text = player1NameInput?.text | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     fun startMatch(view: View) { |     fun startMatch(@Suppress("UNUSED_PARAMETER") view: View) { | ||||||
|         val player1Name = player1NameInput?.text.toString() |         val player1Name = player1NameInput?.text.toString() | ||||||
|         val player2Name = player2NameInput?.text.toString() |         val player2Name = player2NameInput?.text.toString() | ||||||
|         val radioStarterId = starterRadioGroup?.checkedRadioButtonId |         val starterId = when (starterRadioGroup?.checkedRadioButtonId) { | ||||||
|         val starterId = when(radioStarterId) { |  | ||||||
|             R.id.radioPlayer2Starts -> 1 |             R.id.radioPlayer2Starts -> 1 | ||||||
|             else -> 0 |             else -> 0 | ||||||
|         } |         } | ||||||
| @ -166,14 +168,14 @@ class StarterNameActivity : AppCompatActivity() { | |||||||
|         val enableSTT = enableSttSwitch?.isChecked |         val enableSTT = enableSttSwitch?.isChecked | ||||||
|  |  | ||||||
|         // Save settings |         // Save settings | ||||||
|         previousMatch?.edit()?.apply{ |         previousMatch?.edit()?.apply { | ||||||
|             player1Name.let { putString("previousPlayer1", it) } |             putString("previousPlayer1", player1Name) | ||||||
|             player2Name.let { putString("previousPlayer2", it) } |             putString("previousPlayer2", player2Name) | ||||||
|             putInt("previousStarterId", starterId) |             putInt("previousStarterId", starterId) | ||||||
|             putStringSet("previousPlayers", previousPlayers.plus(player1Name).plus(player2Name)) |             putStringSet("previousPlayers", previousPlayers.plus(player1Name).plus(player2Name)) | ||||||
|             enableTTS?.let { putBoolean("enableTTS", it) } |             enableTTS?.let { putBoolean("enableTTS", it) } | ||||||
|             enableSTT?.let { putBoolean("enableSTT", it) } |             enableSTT?.let { putBoolean("enableSTT", it) } | ||||||
|             commit() |             apply() | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         startActivity( |         startActivity( | ||||||
|  | |||||||
| @ -1,200 +0,0 @@ | |||||||
| package adrienmalin.pingpoints |  | ||||||
|  |  | ||||||
| import android.app.AlertDialog |  | ||||||
| import android.content.ActivityNotFoundException |  | ||||||
| import android.content.Context |  | ||||||
| import android.content.Intent |  | ||||||
| import android.media.AudioManager |  | ||||||
| import android.os.Build |  | ||||||
| import android.os.Bundle |  | ||||||
| import android.speech.RecognitionListener |  | ||||||
| import android.speech.RecognizerIntent |  | ||||||
| import android.speech.SpeechRecognizer |  | ||||||
| import android.support.v4.app.DialogFragment |  | ||||||
| import android.view.LayoutInflater |  | ||||||
| import android.widget.ImageView |  | ||||||
| import android.widget.TextView |  | ||||||
| import java.util.regex.Pattern |  | ||||||
| import kotlin.math.max |  | ||||||
| import kotlin.math.min |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class SttDialog : DialogFragment() { |  | ||||||
|     var matchActivity: MatchActivity? = null |  | ||||||
|     var partialResultsTextView: TextView? = null |  | ||||||
|     var icStt: ImageView? = null |  | ||||||
|     var stt: SpeechRecognizer? = null |  | ||||||
|     var sttIntent: Intent? = null |  | ||||||
|     var pattern: Pattern? = null |  | ||||||
|  |  | ||||||
|     inner class SttListener : RecognitionListener { |  | ||||||
|         val ERROR_NOT_UNDERSTOOD = 1 |  | ||||||
|         var minRms: Float = 0f |  | ||||||
|         var maxRms: Float = 0f |  | ||||||
|  |  | ||||||
|         override fun onReadyForSpeech(arg0: Bundle?) {} |  | ||||||
|  |  | ||||||
|         override fun onBeginningOfSpeech() {} |  | ||||||
|  |  | ||||||
|         override fun onBufferReceived(buffer: ByteArray?) {} |  | ||||||
|  |  | ||||||
|         override fun onRmsChanged(rmsdB: Float) { |  | ||||||
|             minRms = min(rmsdB, minRms) |  | ||||||
|             maxRms = max(rmsdB, maxRms) |  | ||||||
|             if (minRms != maxRms) |  | ||||||
|                 icStt?.alpha = 0.5f + (rmsdB - minRms) / (2 * (maxRms - minRms)) |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|         override fun onPartialResults(data: Bundle) { |  | ||||||
|             data.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION)?.let { results -> |  | ||||||
|                 matchActivity?.apply { |  | ||||||
|                     matchModel?.apply { |  | ||||||
|                         for (result in results) { |  | ||||||
|                             partialResultsTextView?.text = result |  | ||||||
|                             pattern?.apply{ |  | ||||||
|                                 val matcher = matcher(result) |  | ||||||
|                                 if (matcher.find()) { |  | ||||||
|                                     val foundName = matcher.group(1) |  | ||||||
|                                     for (player in players) { |  | ||||||
|                                         if (soundex(foundName) == player.soundex) { |  | ||||||
|                                             dismiss() |  | ||||||
|                                             updateScore(player) |  | ||||||
|                                             updateUI() |  | ||||||
|                                             return |  | ||||||
|                                         } |  | ||||||
|                                     } |  | ||||||
|                                 } |  | ||||||
|                             } |  | ||||||
|                         } |  | ||||||
|                     } |  | ||||||
|                 } |  | ||||||
|             } |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|         override fun onResults(data: Bundle) { |  | ||||||
|             partialResultsTextView?.text = getString(R.string.not_understood) |  | ||||||
|             onError(ERROR_NOT_UNDERSTOOD) |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|         override fun onEndOfSpeech() {} |  | ||||||
|  |  | ||||||
|         override fun onError(errorCode: Int) { |  | ||||||
|             muteAudio() |  | ||||||
|             stt?.destroy() |  | ||||||
|             stt = SpeechRecognizer.createSpeechRecognizer(activity).apply { |  | ||||||
|                 setRecognitionListener(this@SttListener) |  | ||||||
|                 startListening(sttIntent) |  | ||||||
|             } |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|         override fun onEvent(arg0: Int, arg1: Bundle?) {} |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     override fun onCreateDialog(savedInstanceState: Bundle?) = AlertDialog.Builder(activity).apply { |  | ||||||
|         (context?.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater).inflate(R.layout.dialog_stt, null).let { view -> |  | ||||||
|             partialResultsTextView = view.findViewById(R.id.partialResultTextView) |  | ||||||
|             icStt = view.findViewById(R.id.icStt) |  | ||||||
|  |  | ||||||
|             setView(view) |  | ||||||
|  |  | ||||||
|             matchActivity = (activity as MatchActivity).apply { |  | ||||||
|                 matchModel?.apply { |  | ||||||
|                     view.findViewById<TextView>(R.id.sttHintTextView).text = getString( |  | ||||||
|                         R.string.STT_hint, |  | ||||||
|                         players[0].name, |  | ||||||
|                         players[1].name |  | ||||||
|                     ) |  | ||||||
|                     sttIntent = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH).apply { |  | ||||||
|                         putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH) |  | ||||||
|                         putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 10) |  | ||||||
|                         putExtra(RecognizerIntent.EXTRA_PARTIAL_RESULTS, true) |  | ||||||
|                         putExtra(RecognizerIntent.EXTRA_PREFER_OFFLINE, true) |  | ||||||
|                         putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS, 30000) |  | ||||||
|                     } |  | ||||||
|                     stt = SpeechRecognizer.createSpeechRecognizer(activity).apply { |  | ||||||
|                         setRecognitionListener(SttListener()) |  | ||||||
|                         try { |  | ||||||
|                             stopListening() |  | ||||||
|                             startListening(sttIntent) |  | ||||||
|                         } catch (e: ActivityNotFoundException) { |  | ||||||
|                             sttEnabled = false |  | ||||||
|                             dismiss() |  | ||||||
|                             showPopUp(R.string.STT_unavailable) |  | ||||||
|                         } |  | ||||||
|                     } |  | ||||||
|                     pattern = Pattern.compile(getString(R.string.pattern), Pattern.CASE_INSENSITIVE) |  | ||||||
|                 } |  | ||||||
|             } |  | ||||||
|         } |  | ||||||
|     }.create()!! |  | ||||||
|  |  | ||||||
|     override fun onResume() { |  | ||||||
|         super.onResume() |  | ||||||
|  |  | ||||||
|         matchActivity?.apply { |  | ||||||
|             matchModel?.apply { |  | ||||||
|                 stt?.destroy() |  | ||||||
|                 stt = SpeechRecognizer.createSpeechRecognizer(activity).apply { |  | ||||||
|                     setRecognitionListener(SttListener()) |  | ||||||
|                     try { |  | ||||||
|                         stopListening() |  | ||||||
|                         startListening(sttIntent) |  | ||||||
|                     } catch (e: ActivityNotFoundException) { |  | ||||||
|                         sttEnabled = false |  | ||||||
|                         dismiss() |  | ||||||
|                         showPopUp(R.string.STT_unavailable) |  | ||||||
|                     } |  | ||||||
|                 } |  | ||||||
|             } |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     override fun onPause() { |  | ||||||
|         unMuteAudio() |  | ||||||
|         stt?.stopListening() |  | ||||||
|         stt?.destroy() |  | ||||||
|         super.onPause() |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     @Suppress("DEPRECATION") |  | ||||||
|     fun muteAudio() { |  | ||||||
|         activity?.apply { |  | ||||||
|             (getSystemService(Context.AUDIO_SERVICE) as AudioManager).apply { |  | ||||||
|                 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { |  | ||||||
|                     adjustStreamVolume(AudioManager.STREAM_NOTIFICATION, AudioManager.ADJUST_MUTE, 0) |  | ||||||
|                     adjustStreamVolume(AudioManager.STREAM_ALARM, AudioManager.ADJUST_MUTE, 0) |  | ||||||
|                     adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_MUTE, 0) |  | ||||||
|                     adjustStreamVolume(AudioManager.STREAM_RING, AudioManager.ADJUST_MUTE, 0) |  | ||||||
|                     adjustStreamVolume(AudioManager.STREAM_SYSTEM, AudioManager.ADJUST_MUTE, 0) |  | ||||||
|                 } else { |  | ||||||
|                     setStreamMute(AudioManager.STREAM_NOTIFICATION, true) |  | ||||||
|                     setStreamMute(AudioManager.STREAM_ALARM, true) |  | ||||||
|                     setStreamMute(AudioManager.STREAM_MUSIC, true) |  | ||||||
|                     setStreamMute(AudioManager.STREAM_RING, true) |  | ||||||
|                     setStreamMute(AudioManager.STREAM_SYSTEM, true) |  | ||||||
|                 } |  | ||||||
|             } |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     @Suppress("DEPRECATION") |  | ||||||
|     fun unMuteAudio() { |  | ||||||
|         activity?.apply { |  | ||||||
|             (getSystemService(Context.AUDIO_SERVICE) as AudioManager).apply { |  | ||||||
|                 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { |  | ||||||
|                     adjustStreamVolume(AudioManager.STREAM_NOTIFICATION, AudioManager.ADJUST_UNMUTE, 0) |  | ||||||
|                     adjustStreamVolume(AudioManager.STREAM_ALARM, AudioManager.ADJUST_UNMUTE, 0) |  | ||||||
|                     adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_UNMUTE, 0) |  | ||||||
|                     adjustStreamVolume(AudioManager.STREAM_RING, AudioManager.ADJUST_UNMUTE, 0) |  | ||||||
|                     adjustStreamVolume(AudioManager.STREAM_SYSTEM, AudioManager.ADJUST_UNMUTE, 0) |  | ||||||
|                 } else { |  | ||||||
|                     setStreamMute(AudioManager.STREAM_NOTIFICATION, false) |  | ||||||
|                     setStreamMute(AudioManager.STREAM_ALARM, false) |  | ||||||
|                     setStreamMute(AudioManager.STREAM_MUSIC, false) |  | ||||||
|                     setStreamMute(AudioManager.STREAM_RING, false) |  | ||||||
|                     setStreamMute(AudioManager.STREAM_SYSTEM, false) |  | ||||||
|                 } |  | ||||||
|             } |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @ -1,17 +1,17 @@ | |||||||
| package adrienmalin.pingpoints | package adrienmalin.pingpoints | ||||||
|  |  | ||||||
| import android.arch.lifecycle.ViewModelProviders |  | ||||||
| import android.content.Context | import android.content.Context | ||||||
| import android.content.Intent | import android.content.Intent | ||||||
| import android.content.SharedPreferences | import android.content.SharedPreferences | ||||||
| import android.os.Bundle | import android.os.Bundle | ||||||
| import android.support.v7.app.AppCompatActivity |  | ||||||
| import android.support.v7.app.AppCompatDelegate |  | ||||||
| import android.text.method.LinkMovementMethod | import android.text.method.LinkMovementMethod | ||||||
| import android.view.View | import android.view.View | ||||||
| import android.widget.ArrayAdapter | import android.widget.ArrayAdapter | ||||||
| import android.widget.GridView | import android.widget.GridView | ||||||
| import android.widget.TextView | import android.widget.TextView | ||||||
|  | import androidx.appcompat.app.AppCompatActivity | ||||||
|  | import androidx.appcompat.app.AppCompatDelegate | ||||||
|  | import androidx.lifecycle.ViewModelProvider | ||||||
| import kotlin.math.max | import kotlin.math.max | ||||||
| import kotlin.math.min | import kotlin.math.min | ||||||
|  |  | ||||||
| @ -31,17 +31,19 @@ class VictoryActivity : AppCompatActivity() { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     fun initVictoryModel() { |     fun initVictoryModel() { | ||||||
|         victoryModel = ViewModelProviders.of(this).get(VictoryModel::class.java).apply { |         victoryModel = ViewModelProvider(this).get(VictoryModel::class.java).apply { | ||||||
|             if (!matchFinished) { |             if (!matchFinished) { | ||||||
|                 matchFinished = true |                 matchFinished = true | ||||||
|                 winnerName = intent.getStringExtra("winnerName") |                 winnerName = intent.getStringExtra("winnerName") ?: "" | ||||||
|                 players = listOf( |                 players = listOf( | ||||||
|                     Player( |                     Player( | ||||||
|                         intent.getStringExtra("player1Name"), |                         intent.getStringExtra("player1Name") | ||||||
|  |                             ?: getString(R.string.player_1_default_name), | ||||||
|                         intent.getIntExtra("player1Score", 0) |                         intent.getIntExtra("player1Score", 0) | ||||||
|                     ), |                     ), | ||||||
|                     Player( |                     Player( | ||||||
|                         intent.getStringExtra("player2Name"), |                         intent.getStringExtra("player2Name") | ||||||
|  |                             ?: getString(R.string.player_2_default_name), | ||||||
|                         intent.getIntExtra("player2Score", 0) |                         intent.getIntExtra("player2Score", 0) | ||||||
|                     ) |                     ) | ||||||
|                 ) |                 ) | ||||||
| @ -60,17 +62,17 @@ class VictoryActivity : AppCompatActivity() { | |||||||
|                 players[1].score |                 players[1].score | ||||||
|             ) |             ) | ||||||
|             findViewById<TextView>(R.id.player2NameTextView).text = players[1].name |             findViewById<TextView>(R.id.player2NameTextView).text = players[1].name | ||||||
|             findViewById<GridView>(R.id.previousMatchesGrid).adapter = ArrayAdapter<String>( |             findViewById<GridView>(R.id.previousMatchesGrid).adapter = ArrayAdapter( | ||||||
|                 this@VictoryActivity, |                 this@VictoryActivity, | ||||||
|                 R.layout.grid_item, |                 R.layout.grid_item, | ||||||
|                 R.id.grid_item_text, |                 R.id.grid_item_text, | ||||||
|                 previousMatches.split("\t|\n".toRegex()).toMutableList() |                 previousMatches.split("[\t\n]".toRegex()).toMutableList() | ||||||
|             ) |             ) | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         // Set HTML text for icons credits |         // Set HTML text for icons credits | ||||||
|         findViewById<TextView>(R.id.iconsCredit).apply { |         findViewById<TextView>(R.id.iconsCredit).apply { | ||||||
|             setText(fromHtml(getString(R.string.iconCredits))) |             text = fromHtml(getString(R.string.iconCredits)) | ||||||
|             movementMethod = LinkMovementMethod.getInstance() |             movementMethod = LinkMovementMethod.getInstance() | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| @ -88,19 +90,19 @@ class VictoryActivity : AppCompatActivity() { | |||||||
|                         previousMatches |                         previousMatches | ||||||
|                     ) |                     ) | ||||||
|                 ) |                 ) | ||||||
|                 commit() |                 apply() | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|         super.onStop() |         super.onStop() | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     fun newMatch(view: View) { |     fun newMatch(@Suppress("UNUSED_PARAMETER") view: View) { | ||||||
|         startActivity( |         startActivity( | ||||||
|             Intent(this, StarterNameActivity::class.java) |             Intent(this, StarterNameActivity::class.java) | ||||||
|         ) |         ) | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     fun share(view: View) { |     fun share(@Suppress("UNUSED_PARAMETER") view: View) { | ||||||
|         victoryModel?.apply { |         victoryModel?.apply { | ||||||
|             startActivity( |             startActivity( | ||||||
|                 Intent().apply { |                 Intent().apply { | ||||||
|  | |||||||
| @ -1,6 +1,6 @@ | |||||||
| package adrienmalin.pingpoints | package adrienmalin.pingpoints | ||||||
|  |  | ||||||
| import android.arch.lifecycle.ViewModel | import androidx.lifecycle.ViewModel | ||||||
|  |  | ||||||
| class VictoryModel : ViewModel() { | class VictoryModel : ViewModel() { | ||||||
|     var matchFinished: Boolean = false |     var matchFinished: Boolean = false | ||||||
|  | |||||||
| @ -1,6 +1,7 @@ | |||||||
| package adrienmalin.pingpoints | package adrienmalin.pingpoints | ||||||
|  |  | ||||||
| import java.util.regex.* | import java.util.* | ||||||
|  | import java.util.regex.Pattern | ||||||
|  |  | ||||||
| val yNotPrecededByA:Pattern = Pattern.compile("(?<!A)Y") | val yNotPrecededByA:Pattern = Pattern.compile("(?<!A)Y") | ||||||
| val hNotPrecededByCS: Pattern = Pattern.compile("(?<![CS])H") | val hNotPrecededByCS: Pattern = Pattern.compile("(?<![CS])H") | ||||||
| @ -12,7 +13,7 @@ val doubleLetter = Pattern.compile("(\\w)\\1+(?!\\1)") | |||||||
| fun soundex(string: String): String { | fun soundex(string: String): String { | ||||||
|     var s = string |     var s = string | ||||||
|         .trim() |         .trim() | ||||||
|         .toUpperCase() |         .toUpperCase(Locale.ROOT) | ||||||
|         .replace('Â', 'A') |         .replace('Â', 'A') | ||||||
|         .replace('Ä', 'A') |         .replace('Ä', 'A') | ||||||
|         .replace('À', 'A') |         .replace('À', 'A') | ||||||
|  | |||||||
| @ -1,170 +0,0 @@ | |||||||
| <?xml version="1.0" encoding="utf-8"?> |  | ||||||
| <vector xmlns:android="http://schemas.android.com/apk/res/android" |  | ||||||
|     android:width="108dp" |  | ||||||
|     android:height="108dp" |  | ||||||
|     android:viewportHeight="108" |  | ||||||
|     android:viewportWidth="108"> |  | ||||||
|     <path |  | ||||||
|         android:fillColor="#26A69A" |  | ||||||
|         android:pathData="M0,0h108v108h-108z" /> |  | ||||||
|     <path |  | ||||||
|         android:fillColor="#00000000" |  | ||||||
|         android:pathData="M9,0L9,108" |  | ||||||
|         android:strokeColor="#33FFFFFF" |  | ||||||
|         android:strokeWidth="0.8" /> |  | ||||||
|     <path |  | ||||||
|         android:fillColor="#00000000" |  | ||||||
|         android:pathData="M19,0L19,108" |  | ||||||
|         android:strokeColor="#33FFFFFF" |  | ||||||
|         android:strokeWidth="0.8" /> |  | ||||||
|     <path |  | ||||||
|         android:fillColor="#00000000" |  | ||||||
|         android:pathData="M29,0L29,108" |  | ||||||
|         android:strokeColor="#33FFFFFF" |  | ||||||
|         android:strokeWidth="0.8" /> |  | ||||||
|     <path |  | ||||||
|         android:fillColor="#00000000" |  | ||||||
|         android:pathData="M39,0L39,108" |  | ||||||
|         android:strokeColor="#33FFFFFF" |  | ||||||
|         android:strokeWidth="0.8" /> |  | ||||||
|     <path |  | ||||||
|         android:fillColor="#00000000" |  | ||||||
|         android:pathData="M49,0L49,108" |  | ||||||
|         android:strokeColor="#33FFFFFF" |  | ||||||
|         android:strokeWidth="0.8" /> |  | ||||||
|     <path |  | ||||||
|         android:fillColor="#00000000" |  | ||||||
|         android:pathData="M59,0L59,108" |  | ||||||
|         android:strokeColor="#33FFFFFF" |  | ||||||
|         android:strokeWidth="0.8" /> |  | ||||||
|     <path |  | ||||||
|         android:fillColor="#00000000" |  | ||||||
|         android:pathData="M69,0L69,108" |  | ||||||
|         android:strokeColor="#33FFFFFF" |  | ||||||
|         android:strokeWidth="0.8" /> |  | ||||||
|     <path |  | ||||||
|         android:fillColor="#00000000" |  | ||||||
|         android:pathData="M79,0L79,108" |  | ||||||
|         android:strokeColor="#33FFFFFF" |  | ||||||
|         android:strokeWidth="0.8" /> |  | ||||||
|     <path |  | ||||||
|         android:fillColor="#00000000" |  | ||||||
|         android:pathData="M89,0L89,108" |  | ||||||
|         android:strokeColor="#33FFFFFF" |  | ||||||
|         android:strokeWidth="0.8" /> |  | ||||||
|     <path |  | ||||||
|         android:fillColor="#00000000" |  | ||||||
|         android:pathData="M99,0L99,108" |  | ||||||
|         android:strokeColor="#33FFFFFF" |  | ||||||
|         android:strokeWidth="0.8" /> |  | ||||||
|     <path |  | ||||||
|         android:fillColor="#00000000" |  | ||||||
|         android:pathData="M0,9L108,9" |  | ||||||
|         android:strokeColor="#33FFFFFF" |  | ||||||
|         android:strokeWidth="0.8" /> |  | ||||||
|     <path |  | ||||||
|         android:fillColor="#00000000" |  | ||||||
|         android:pathData="M0,19L108,19" |  | ||||||
|         android:strokeColor="#33FFFFFF" |  | ||||||
|         android:strokeWidth="0.8" /> |  | ||||||
|     <path |  | ||||||
|         android:fillColor="#00000000" |  | ||||||
|         android:pathData="M0,29L108,29" |  | ||||||
|         android:strokeColor="#33FFFFFF" |  | ||||||
|         android:strokeWidth="0.8" /> |  | ||||||
|     <path |  | ||||||
|         android:fillColor="#00000000" |  | ||||||
|         android:pathData="M0,39L108,39" |  | ||||||
|         android:strokeColor="#33FFFFFF" |  | ||||||
|         android:strokeWidth="0.8" /> |  | ||||||
|     <path |  | ||||||
|         android:fillColor="#00000000" |  | ||||||
|         android:pathData="M0,49L108,49" |  | ||||||
|         android:strokeColor="#33FFFFFF" |  | ||||||
|         android:strokeWidth="0.8" /> |  | ||||||
|     <path |  | ||||||
|         android:fillColor="#00000000" |  | ||||||
|         android:pathData="M0,59L108,59" |  | ||||||
|         android:strokeColor="#33FFFFFF" |  | ||||||
|         android:strokeWidth="0.8" /> |  | ||||||
|     <path |  | ||||||
|         android:fillColor="#00000000" |  | ||||||
|         android:pathData="M0,69L108,69" |  | ||||||
|         android:strokeColor="#33FFFFFF" |  | ||||||
|         android:strokeWidth="0.8" /> |  | ||||||
|     <path |  | ||||||
|         android:fillColor="#00000000" |  | ||||||
|         android:pathData="M0,79L108,79" |  | ||||||
|         android:strokeColor="#33FFFFFF" |  | ||||||
|         android:strokeWidth="0.8" /> |  | ||||||
|     <path |  | ||||||
|         android:fillColor="#00000000" |  | ||||||
|         android:pathData="M0,89L108,89" |  | ||||||
|         android:strokeColor="#33FFFFFF" |  | ||||||
|         android:strokeWidth="0.8" /> |  | ||||||
|     <path |  | ||||||
|         android:fillColor="#00000000" |  | ||||||
|         android:pathData="M0,99L108,99" |  | ||||||
|         android:strokeColor="#33FFFFFF" |  | ||||||
|         android:strokeWidth="0.8" /> |  | ||||||
|     <path |  | ||||||
|         android:fillColor="#00000000" |  | ||||||
|         android:pathData="M19,29L89,29" |  | ||||||
|         android:strokeColor="#33FFFFFF" |  | ||||||
|         android:strokeWidth="0.8" /> |  | ||||||
|     <path |  | ||||||
|         android:fillColor="#00000000" |  | ||||||
|         android:pathData="M19,39L89,39" |  | ||||||
|         android:strokeColor="#33FFFFFF" |  | ||||||
|         android:strokeWidth="0.8" /> |  | ||||||
|     <path |  | ||||||
|         android:fillColor="#00000000" |  | ||||||
|         android:pathData="M19,49L89,49" |  | ||||||
|         android:strokeColor="#33FFFFFF" |  | ||||||
|         android:strokeWidth="0.8" /> |  | ||||||
|     <path |  | ||||||
|         android:fillColor="#00000000" |  | ||||||
|         android:pathData="M19,59L89,59" |  | ||||||
|         android:strokeColor="#33FFFFFF" |  | ||||||
|         android:strokeWidth="0.8" /> |  | ||||||
|     <path |  | ||||||
|         android:fillColor="#00000000" |  | ||||||
|         android:pathData="M19,69L89,69" |  | ||||||
|         android:strokeColor="#33FFFFFF" |  | ||||||
|         android:strokeWidth="0.8" /> |  | ||||||
|     <path |  | ||||||
|         android:fillColor="#00000000" |  | ||||||
|         android:pathData="M19,79L89,79" |  | ||||||
|         android:strokeColor="#33FFFFFF" |  | ||||||
|         android:strokeWidth="0.8" /> |  | ||||||
|     <path |  | ||||||
|         android:fillColor="#00000000" |  | ||||||
|         android:pathData="M29,19L29,89" |  | ||||||
|         android:strokeColor="#33FFFFFF" |  | ||||||
|         android:strokeWidth="0.8" /> |  | ||||||
|     <path |  | ||||||
|         android:fillColor="#00000000" |  | ||||||
|         android:pathData="M39,19L39,89" |  | ||||||
|         android:strokeColor="#33FFFFFF" |  | ||||||
|         android:strokeWidth="0.8" /> |  | ||||||
|     <path |  | ||||||
|         android:fillColor="#00000000" |  | ||||||
|         android:pathData="M49,19L49,89" |  | ||||||
|         android:strokeColor="#33FFFFFF" |  | ||||||
|         android:strokeWidth="0.8" /> |  | ||||||
|     <path |  | ||||||
|         android:fillColor="#00000000" |  | ||||||
|         android:pathData="M59,19L59,89" |  | ||||||
|         android:strokeColor="#33FFFFFF" |  | ||||||
|         android:strokeWidth="0.8" /> |  | ||||||
|     <path |  | ||||||
|         android:fillColor="#00000000" |  | ||||||
|         android:pathData="M69,19L69,89" |  | ||||||
|         android:strokeColor="#33FFFFFF" |  | ||||||
|         android:strokeWidth="0.8" /> |  | ||||||
|     <path |  | ||||||
|         android:fillColor="#00000000" |  | ||||||
|         android:pathData="M79,19L79,89" |  | ||||||
|         android:strokeColor="#33FFFFFF" |  | ||||||
|         android:strokeWidth="0.8" /> |  | ||||||
| </vector> |  | ||||||
| @ -1,7 +0,0 @@ | |||||||
| <vector |  | ||||||
|     xmlns:android="http://schemas.android.com/apk/res/android" |  | ||||||
|     android:autoMirrored="true" |  | ||||||
|     android:height="48dp" android:width="48dp" |  | ||||||
|     android:viewportHeight="285.876" android:viewportWidth="285.876"> |  | ||||||
|     <path android:fillColor="#FFFFFF" android:pathData="M261.207,76.226c-8.573,9.43 -20.236,13.134 -27.668,9.293c0.605,6.751 -3.436,13.287 -10.141,15.544c-18.231,6.139 -37.408,9.21 -56.583,9.21c-10.257,0 -20.512,-0.885 -30.624,-2.643c15.289,20.576 39.358,32.753 65.156,32.753c8.284,0 15,6.716 15,15s-6.716,15 -15,15c-32.82,0 -63.598,-14.394 -84.591,-39.029l-26.497,44.097c30.164,25.599 53.935,55.258 70.763,88.411c3.749,7.387 0.801,16.415 -6.587,20.165c-2.176,1.104 -4.494,1.627 -6.777,1.627c-5.47,0 -10.742,-3.002 -13.388,-8.214c-14.607,-28.78 -35.188,-54.695 -61.282,-77.281c-3.667,27.708 -13.553,54.145 -29.537,78.86c-2.871,4.438 -7.69,6.855 -12.609,6.855c-2.792,0 -5.614,-0.778 -8.132,-2.406c-6.957,-4.499 -8.935,-13.785 -4.436,-20.741c17.485,-27.035 26.365,-56.402 26.365,-87.284v-3.058c0,-4.645 0.568,-9.303 3.111,-13.535L92.94,83.63c6.162,-13.495 19.867,-12.797 26.78,-11.028l0.941,0.311c30.074,9.922 63.158,9.825 93.164,-0.28c4.559,-1.533 9.328,-0.743 13.052,1.715c-0.392,-6.599 2.662,-14.617 8.781,-21.348c9.621,-10.583 23.14,-13.963 30.195,-7.549C272.908,51.864 270.828,65.643 261.207,76.226zM244.508,138.119c-4.768,0 -8.632,3.865 -8.632,8.632s3.865,8.632 8.632,8.632c4.768,0 8.632,-3.865 8.632,-8.632S249.276,138.119 244.508,138.119zM121.3,62.781c17.337,0 31.391,-14.054 31.391,-31.391S138.636,0 121.3,0c-17.337,0 -31.391,14.054 -31.391,31.391S103.963,62.781 121.3,62.781z"/> |  | ||||||
| </vector> |  | ||||||
| @ -1,7 +0,0 @@ | |||||||
| <vector |  | ||||||
|     xmlns:android="http://schemas.android.com/apk/res/android" |  | ||||||
|     android:autoMirrored="true" |  | ||||||
|     android:height="48dp" android:width="48dp" |  | ||||||
|     android:viewportHeight="285.876" android:viewportWidth="285.876"> |  | ||||||
|     <path android:fillColor="#ffffff" android:pathData="m24.693,76.226c8.573,9.43 20.236,13.134 27.668,9.293 -0.605,6.751 3.436,13.287 10.141,15.544 18.231,6.139 37.408,9.21 56.583,9.21 10.257,0 20.512,-0.885 30.624,-2.643 -15.289,20.576 -39.358,32.753 -65.156,32.753 -8.284,0 -15,6.716 -15,15 -0,8.284 6.716,15 15,15 32.82,0 63.598,-14.394 84.591,-39.029l26.497,44.097c-30.164,25.599 -53.935,55.258 -70.763,88.411 -3.749,7.387 -0.801,16.415 6.587,20.165 2.176,1.104 4.494,1.627 6.777,1.627 5.47,0 10.742,-3.002 13.388,-8.214 14.607,-28.78 35.188,-54.695 61.282,-77.281 3.667,27.708 13.553,54.145 29.537,78.86 2.871,4.438 7.69,6.855 12.609,6.855 2.792,0 5.614,-0.778 8.132,-2.406 6.957,-4.499 8.935,-13.785 4.436,-20.741 -17.485,-27.035 -26.365,-56.402 -26.365,-87.284l-0,-3.058c-0,-4.645 -0.568,-9.303 -3.111,-13.535L192.96,83.63c-6.162,-13.495 -19.867,-12.797 -26.78,-11.028l-0.941,0.311c-30.074,9.922 -63.158,9.825 -93.164,-0.28 -4.559,-1.533 -9.328,-0.743 -13.052,1.715 0.392,-6.599 -2.662,-14.617 -8.781,-21.348 -9.621,-10.583 -23.14,-13.963 -30.195,-7.549 -7.055,6.413 -4.975,20.192 4.646,30.775zM41.392,138.119c4.768,0 8.632,3.865 8.632,8.632 -0,4.767 -3.865,8.632 -8.632,8.632 -4.768,0 -8.632,-3.865 -8.632,-8.632 -0,-4.767 3.864,-8.632 8.632,-8.632zM164.6,62.781c-17.337,0 -31.391,-14.054 -31.391,-31.391C133.209,14.053 147.264,0 164.6,0 181.937,0 195.991,14.054 195.991,31.391c-0,17.337 -14.054,31.39 -31.391,31.39z"/> |  | ||||||
| </vector> |  | ||||||
| @ -1,131 +1,132 @@ | |||||||
| <?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||||||
|  |  | ||||||
| <android.support.design.widget.CoordinatorLayout | <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:tools="http://schemas.android.com/tools" | ||||||
|         xmlns:tools="http://schemas.android.com/tools" android:id="@+id/coordinatorLayout" |         android:id="@+id/coordinatorLayout" | ||||||
|         xmlns:android="http://schemas.android.com/apk/res/android" |         xmlns:android="http://schemas.android.com/apk/res/android" | ||||||
|         xmlns:app="http://schemas.android.com/apk/res-auto" |         xmlns:app="http://schemas.android.com/apk/res-auto" | ||||||
|         android:layout_width="match_parent" |         android:layout_width="match_parent" | ||||||
|         android:layout_height="match_parent" |         android:layout_height="match_parent" | ||||||
|         android:keepScreenOn="true"> |         android:keepScreenOn="true"> | ||||||
|  |  | ||||||
|     <LinearLayout |     <androidx.constraintlayout.widget.ConstraintLayout | ||||||
|             android:layout_width="match_parent" |             android:layout_width="match_parent" | ||||||
|             android:layout_height="match_parent" |             android:layout_height="match_parent"> | ||||||
|             android:orientation="vertical"> |  | ||||||
|  |  | ||||||
|         <LinearLayout |  | ||||||
|                 android:id="@+id/linearLayoutText" |  | ||||||
|                 android:layout_width="match_parent" |  | ||||||
|                 android:layout_height="wrap_content" |  | ||||||
|                 android:layout_marginEnd="8dp" |  | ||||||
|                 android:layout_marginStart="8dp" |  | ||||||
|                 android:orientation="horizontal" |  | ||||||
|                 app:layout_constraintEnd_toEndOf="parent" |  | ||||||
|                 app:layout_constraintStart_toStartOf="parent" |  | ||||||
|                 tools:layout_editor_absoluteY="8dp" android:layout_weight="0"> |  | ||||||
|  |  | ||||||
|         <TextView |         <TextView | ||||||
|                 android:id="@+id/textScore" |                 android:id="@+id/textScore" | ||||||
|                 android:layout_width="wrap_content" |                 android:layout_width="wrap_content" | ||||||
|                 android:layout_height="wrap_content" |                 android:layout_height="wrap_content" | ||||||
|                     android:layout_marginStart="8dp" |                 android:layout_margin="8dp" | ||||||
|                     android:layout_marginLeft="8dp" |                 android:layout_marginStart="32dp" | ||||||
|  |                 android:layout_marginLeft="32dp" | ||||||
|  |                 android:layout_marginTop="32dp" | ||||||
|                 android:layout_weight="1" |                 android:layout_weight="1" | ||||||
|                     android:gravity="left" |                 android:text="@string/score_score" | ||||||
|                 android:textAppearance="@style/TextAppearance.AppCompat.Large" |                 android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||||||
|                 app:layout_constraintStart_toStartOf="parent" |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|                     app:layout_constraintTop_toTopOf="parent" |                 app:layout_constraintTop_toTopOf="parent" /> | ||||||
|                     android:text="@string/score_score" android:layout_margin="8dp"/> |  | ||||||
|         <TextView |         <TextView | ||||||
|                 android:id="@+id/textService" |                 android:id="@+id/textService" | ||||||
|                 android:layout_width="wrap_content" |                 android:layout_width="wrap_content" | ||||||
|                 android:layout_height="wrap_content" |                 android:layout_height="wrap_content" | ||||||
|                     android:layout_marginEnd="8dp" |                 android:layout_margin="8dp" | ||||||
|                     android:layout_marginStart="8dp" |                 android:layout_marginTop="32dp" | ||||||
|  |                 android:layout_marginEnd="32dp" | ||||||
|  |                 android:layout_marginRight="32dp" | ||||||
|                 android:layout_weight="1" |                 android:layout_weight="1" | ||||||
|                     android:gravity="right" |                 android:text="@string/service" | ||||||
|                 android:textAppearance="@style/TextAppearance.AppCompat.Large" |                 android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||||||
|                 app:layout_constraintEnd_toEndOf="parent" |                 app:layout_constraintEnd_toEndOf="parent" | ||||||
|                     app:layout_constraintHorizontal_bias="1.0" |                 app:layout_constraintTop_toTopOf="parent" /> | ||||||
|                     app:layout_constraintStart_toEndOf="@+id/textScore" |  | ||||||
|  |         <ImageView | ||||||
|  |                 android:id="@+id/icStt" | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:layout_margin="8dp" | ||||||
|  |                 android:layout_marginTop="24dp" | ||||||
|  |                 android:alpha="0" | ||||||
|  |                 android:contentDescription="@string/STT" | ||||||
|  |                 app:layout_constraintEnd_toEndOf="@+id/textService" | ||||||
|  |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|                 app:layout_constraintTop_toTopOf="parent" |                 app:layout_constraintTop_toTopOf="parent" | ||||||
|                     android:text="@string/service" android:layout_margin="8dp"/> |                 app:srcCompat="@drawable/ic_stt" /> | ||||||
|  |  | ||||||
|         </LinearLayout> |  | ||||||
|  |  | ||||||
|         <LinearLayout |  | ||||||
|                 android:layout_width="match_parent" |  | ||||||
|                 android:layout_height="match_parent" |  | ||||||
|                 android:orientation="horizontal" android:layout_weight="1"> |  | ||||||
|  |  | ||||||
|         <ImageView |         <ImageView | ||||||
|                 android:id="@+id/imgService0" |                 android:id="@+id/imgService0" | ||||||
|                 android:layout_width="48dp" |                 android:layout_width="48dp" | ||||||
|  |                 android:layout_height="0dp" | ||||||
|                 android:layout_margin="8dp" |                 android:layout_margin="8dp" | ||||||
|                     android:layout_weight="0" |                 android:layout_marginStart="32dp" | ||||||
|  |                 android:layout_marginLeft="32dp" | ||||||
|  |                 android:layout_marginTop="16dp" | ||||||
|  |                 android:layout_marginBottom="32dp" | ||||||
|                 android:contentDescription="@string/service_img_description" |                 android:contentDescription="@string/service_img_description" | ||||||
|                     app:srcCompat="@drawable/ic_service_1" |                 app:layout_constraintBottom_toBottomOf="parent" | ||||||
|                     tools:layout_editor_absoluteY="120dp" android:layout_height="match_parent"/> |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|  |                 app:layout_constraintTop_toBottomOf="@+id/textScore" | ||||||
|  |                 app:srcCompat="@drawable/ic_service_1" /> | ||||||
|  |  | ||||||
|         <Button |         <Button | ||||||
|                 android:id="@+id/buttonPlayer0" |                 android:id="@+id/buttonPlayer0" | ||||||
|                     android:layout_width="match_parent" |                 android:layout_width="0dp" | ||||||
|                     android:layout_height="match_parent" |                 android:layout_height="0dp" | ||||||
|                     android:layout_marginBottom="8dp" |                 android:layout_marginStart="24dp" | ||||||
|                     android:layout_marginLeft="8dp" |                 android:layout_marginLeft="24dp" | ||||||
|                     android:layout_marginStart="8dp" |                 android:layout_marginTop="24dp" | ||||||
|                     android:layout_marginTop="8dp" |                 android:layout_marginEnd="8dp" | ||||||
|  |                 android:layout_marginRight="8dp" | ||||||
|  |                 android:layout_marginBottom="32dp" | ||||||
|                 android:layout_weight="1" |                 android:layout_weight="1" | ||||||
|                 android:bufferType="spannable" |                 android:bufferType="spannable" | ||||||
|                 android:onClick="updateScore" |                 android:onClick="updateScore" | ||||||
|                 android:textAllCaps="false" |                 android:textAllCaps="false" | ||||||
|                     android:textAppearance="@style/TextAppearance.AppCompat.Button" |  | ||||||
|                 android:textSize="24sp" |                 android:textSize="24sp" | ||||||
|                 android:textStyle="bold" |                 android:textStyle="bold" | ||||||
|  |                 android:theme="@style/ColoredButtonStyle" | ||||||
|                 app:layout_constraintBottom_toBottomOf="parent" |                 app:layout_constraintBottom_toBottomOf="parent" | ||||||
|  |                 app:layout_constraintEnd_toStartOf="@+id/buttonPlayer1" | ||||||
|                 app:layout_constraintStart_toEndOf="@+id/imgService0" |                 app:layout_constraintStart_toEndOf="@+id/imgService0" | ||||||
|                     app:layout_constraintTop_toTopOf="parent" |                 app:layout_constraintTop_toBottomOf="@+id/textScore" | ||||||
|                     tools:text="@string/button_text" android:layout_marginRight="8dp" |                 tools:text="@string/button_text" /> | ||||||
|                     android:theme="@style/ScoreButton"/> |  | ||||||
|  |  | ||||||
|         <Button |         <Button | ||||||
|                 android:id="@+id/buttonPlayer1" |                 android:id="@+id/buttonPlayer1" | ||||||
|                     android:layout_width="match_parent" |                 android:layout_width="0dp" | ||||||
|                     android:layout_height="match_parent" |                 android:layout_height="0dp" | ||||||
|                     android:layout_marginBottom="8dp" |  | ||||||
|                     android:layout_marginEnd="8dp" |  | ||||||
|                     android:layout_marginLeft="8dp" |  | ||||||
|                     android:layout_marginRight="8dp" |  | ||||||
|                 android:layout_marginStart="8dp" |                 android:layout_marginStart="8dp" | ||||||
|                     android:layout_marginTop="8dp" |                 android:layout_marginLeft="8dp" | ||||||
|  |                 android:layout_marginTop="24dp" | ||||||
|  |                 android:layout_marginEnd="24dp" | ||||||
|  |                 android:layout_marginRight="24dp" | ||||||
|  |                 android:layout_marginBottom="32dp" | ||||||
|                 android:layout_weight="1" |                 android:layout_weight="1" | ||||||
|                 android:bufferType="spannable" |                 android:bufferType="spannable" | ||||||
|                 android:onClick="updateScore" |                 android:onClick="updateScore" | ||||||
|                 android:textAllCaps="false" |                 android:textAllCaps="false" | ||||||
|                     android:textAppearance="@style/TextAppearance.AppCompat.Button" |  | ||||||
|                 android:textSize="24sp" |                 android:textSize="24sp" | ||||||
|                 android:textStyle="bold" |                 android:textStyle="bold" | ||||||
|  |                 android:theme="@style/ColoredButtonStyle" | ||||||
|                 app:layout_constraintBottom_toBottomOf="parent" |                 app:layout_constraintBottom_toBottomOf="parent" | ||||||
|                 app:layout_constraintEnd_toStartOf="@+id/imgService1" |                 app:layout_constraintEnd_toStartOf="@+id/imgService1" | ||||||
|                 app:layout_constraintStart_toEndOf="@+id/buttonPlayer0" |                 app:layout_constraintStart_toEndOf="@+id/buttonPlayer0" | ||||||
|                     tools:text="@string/button_text" android:theme="@style/ScoreButton"/> |                 app:layout_constraintTop_toBottomOf="@+id/textService" | ||||||
|  |                 tools:text="@string/button_text" /> | ||||||
|  |  | ||||||
|         <ImageView |         <ImageView | ||||||
|                 android:id="@+id/imgService1" |                 android:id="@+id/imgService1" | ||||||
|                 android:layout_width="48dp" |                 android:layout_width="48dp" | ||||||
|                     android:layout_height="match_parent" |                 android:layout_height="0dp" | ||||||
|                 android:layout_margin="8dp" |                 android:layout_margin="8dp" | ||||||
|                     android:layout_weight="0" |                 android:layout_marginTop="16dp" | ||||||
|  |                 android:layout_marginEnd="32dp" | ||||||
|  |                 android:layout_marginRight="32dp" | ||||||
|  |                 android:layout_marginBottom="32dp" | ||||||
|                 android:contentDescription="@string/service_img_description" |                 android:contentDescription="@string/service_img_description" | ||||||
|                     tools:layout_editor_absoluteY="120dp"/> |                 app:layout_constraintBottom_toBottomOf="parent" | ||||||
|  |                 app:layout_constraintEnd_toEndOf="parent" | ||||||
|  |                 app:layout_constraintTop_toBottomOf="@+id/textService" /> | ||||||
|  |     </androidx.constraintlayout.widget.ConstraintLayout> | ||||||
|  |  | ||||||
|         </LinearLayout> | </androidx.coordinatorlayout.widget.CoordinatorLayout> | ||||||
|         <LinearLayout |  | ||||||
|                 android:orientation="horizontal" |  | ||||||
|                 android:layout_width="match_parent" |  | ||||||
|                 android:layout_height="wrap_content" android:layout_weight="0"> |  | ||||||
|         </LinearLayout> |  | ||||||
|  |  | ||||||
|     </LinearLayout> |  | ||||||
|  |  | ||||||
| </android.support.design.widget.CoordinatorLayout> |  | ||||||
| @ -1,101 +1,136 @@ | |||||||
| <?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||||||
|  |  | ||||||
| <android.support.design.widget.CoordinatorLayout | <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:tools="http://schemas.android.com/tools" | ||||||
|         xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android" |         xmlns:android="http://schemas.android.com/apk/res/android" | ||||||
|         xmlns:app="http://schemas.android.com/apk/res-auto" |         xmlns:app="http://schemas.android.com/apk/res-auto" | ||||||
|         android:id="@+id/myCoordinatorLayout" |  | ||||||
|         android:layout_width="match_parent" |         android:layout_width="match_parent" | ||||||
|         android:layout_height="match_parent"> |         android:layout_height="match_parent"> | ||||||
|  |  | ||||||
|     <android.support.constraint.ConstraintLayout |     <androidx.constraintlayout.widget.ConstraintLayout | ||||||
|             xmlns:android="http://schemas.android.com/apk/res/android" |  | ||||||
|             xmlns:tools="http://schemas.android.com/tools" |  | ||||||
|             xmlns:app="http://schemas.android.com/apk/res-auto" |  | ||||||
|             android:layout_width="match_parent" |             android:layout_width="match_parent" | ||||||
|             android:layout_height="match_parent" |             android:layout_height="match_parent" | ||||||
|             tools:context=".StarterNameActivity"> |             tools:context=".StarterNameActivity"> | ||||||
|  |  | ||||||
|         <TextView |  | ||||||
|                 android:layout_width="0dp" |  | ||||||
|                 android:layout_height="wrap_content" |  | ||||||
|                 android:id="@+id/WhoStarts" android:text="@string/who_starts" |  | ||||||
|                 app:layout_constraintStart_toStartOf="parent" android:layout_marginLeft="8dp" |  | ||||||
|                 android:layout_marginStart="8dp" android:textAppearance="@style/TextAppearance.AppCompat.Headline" |  | ||||||
|                 android:layout_marginTop="8dp" app:layout_constraintTop_toTopOf="parent"/> |  | ||||||
|         <RadioGroup |  | ||||||
|                 android:layout_width="0dp" |  | ||||||
|                 android:layout_height="wrap_content" |  | ||||||
|                 android:layout_marginTop="8dp" |  | ||||||
|                 app:layout_constraintTop_toBottomOf="@+id/WhoStarts" android:id="@+id/starterRadioGroup" |  | ||||||
|                 android:layout_marginStart="8dp" app:layout_constraintStart_toStartOf="parent" |  | ||||||
|                 android:layout_marginLeft="8dp" app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp" |  | ||||||
|                 android:layout_marginRight="8dp" android:orientation="horizontal"> |  | ||||||
|             <RadioButton |  | ||||||
|                     android:layout_width="wrap_content" |  | ||||||
|                     android:layout_height="wrap_content" tools:layout_editor_absoluteY="93dp" |  | ||||||
|                     tools:layout_editor_absoluteX="16dp" android:id="@+id/radioPlayer1Starts" android:layout_weight="0" |  | ||||||
|                     android:checked="true"/> |  | ||||||
|             <AutoCompleteTextView |  | ||||||
|                     android:text="@string/player_1_default_name" |  | ||||||
|                     android:layout_width="match_parent" |  | ||||||
|                     android:layout_height="wrap_content" tools:layout_editor_absoluteY="48dp" |  | ||||||
|                     android:id="@+id/player1Name" |  | ||||||
|                     tools:layout_editor_absoluteX="143dp" android:hint="@string/player_1_default_name" |  | ||||||
|                     android:layout_weight="1" |  | ||||||
|                     android:completionThreshold="1" |  | ||||||
|                     android:singleLine="true" |  | ||||||
|                     android:imeOptions="actionNext"/> |  | ||||||
|             <ImageButton |  | ||||||
|                     android:layout_width="wrap_content" |  | ||||||
|                     android:layout_height="wrap_content" app:srcCompat="@drawable/ic_swap_horiz" |  | ||||||
|                     android:layout_weight="0" android:id="@+id/swapNamesButton" |  | ||||||
|                     android:contentDescription="@string/swap_names" android:onClick="swapNames"/> |  | ||||||
|             <RadioButton |  | ||||||
|                     android:layout_width="wrap_content" |  | ||||||
|                     android:layout_height="wrap_content" tools:layout_editor_absoluteY="93dp" |  | ||||||
|                     tools:layout_editor_absoluteX="16dp" android:id="@+id/radioPlayer2Starts" |  | ||||||
|                     android:layout_weight="0" android:checked="true"/> |  | ||||||
|             <AutoCompleteTextView |  | ||||||
|                     android:text="@string/player_2_default_name" |  | ||||||
|                     android:layout_width="match_parent" |  | ||||||
|                     tools:layout_editor_absoluteX="136dp" android:id="@+id/player2Name" |  | ||||||
|                     android:hint="@string/player_2_default_name" android:layout_height="wrap_content" |  | ||||||
|                     android:layout_weight="1" |  | ||||||
|                     android:completionThreshold="1" |  | ||||||
|                     android:singleLine="true" |  | ||||||
|                     android:imeOptions="actionNext"/> |  | ||||||
|         </RadioGroup> |  | ||||||
|         <Switch |  | ||||||
|                 android:text="@string/TTS" |  | ||||||
|                 android:layout_width="0dp" |  | ||||||
|                 android:layout_height="wrap_content" |  | ||||||
|                 android:id="@+id/enableTtsSwitch" |  | ||||||
|                 android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/starterRadioGroup" |  | ||||||
|                 android:layout_marginEnd="8dp" app:layout_constraintEnd_toEndOf="parent" |  | ||||||
|                 android:layout_marginRight="8dp" |  | ||||||
|                 android:layout_marginStart="8dp" app:layout_constraintStart_toStartOf="parent" |  | ||||||
|                 android:layout_marginLeft="8dp"/> |  | ||||||
|         <Switch |  | ||||||
|                 android:text="@string/STT" |  | ||||||
|                 android:layout_width="0dp" |  | ||||||
|                 android:layout_height="wrap_content" |  | ||||||
|                 android:id="@+id/enableSttSwitch" android:layout_marginTop="8dp" |  | ||||||
|                 app:layout_constraintTop_toBottomOf="@+id/enableTtsSwitch" app:layout_constraintEnd_toEndOf="parent" |  | ||||||
|                 android:layout_marginEnd="8dp" android:layout_marginRight="8dp" |  | ||||||
|                 app:layout_constraintStart_toStartOf="parent" android:layout_marginLeft="8dp" |  | ||||||
|                 android:layout_marginStart="8dp"/> |  | ||||||
|         <Button |         <Button | ||||||
|                 android:text="@string/start" |                 android:id="@+id/startButton" | ||||||
|                 android:layout_width="wrap_content" |                 android:layout_width="wrap_content" | ||||||
|                 android:layout_height="wrap_content" |                 android:layout_height="wrap_content" | ||||||
|                 android:id="@+id/startMatchButton" |                 android:layout_marginTop="32dp" | ||||||
|                 android:layout_marginBottom="8dp" |                 android:layout_marginEnd="32dp" | ||||||
|                 app:layout_constraintBottom_toBottomOf="parent" android:layout_marginEnd="8dp" |                 android:layout_marginRight="32dp" | ||||||
|                 app:layout_constraintEnd_toEndOf="parent" android:layout_marginRight="8dp" |  | ||||||
|                 style="@android:style/Widget.DeviceDefault.Button" |  | ||||||
|                 android:drawableStart="@drawable/ic_new_match" |                 android:drawableStart="@drawable/ic_new_match" | ||||||
|                 android:drawableLeft="@drawable/ic_new_match" |                 android:drawableLeft="@drawable/ic_new_match" | ||||||
|                 android:onClick="startMatch"/> |                 android:onClick="startMatch" | ||||||
|     </android.support.constraint.ConstraintLayout> |                 android:text="@string/start" | ||||||
|  |                 app:layout_constraintEnd_toEndOf="parent" | ||||||
|  |                 app:layout_constraintTop_toBottomOf="@+id/enableSttSwitch" /> | ||||||
|  |  | ||||||
| </android.support.design.widget.CoordinatorLayout> |         <TextView | ||||||
|  |                 android:id="@+id/WhoStarts" | ||||||
|  |                 android:layout_width="0dp" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:layout_marginStart="32dp" | ||||||
|  |                 android:layout_marginLeft="32dp" | ||||||
|  |                 android:layout_marginTop="32dp" | ||||||
|  |                 android:text="@string/who_starts" | ||||||
|  |                 android:textAppearance="@style/TextAppearance.AppCompat.Headline" | ||||||
|  |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|  |                 app:layout_constraintTop_toTopOf="parent" /> | ||||||
|  |  | ||||||
|  |         <RadioGroup | ||||||
|  |                 android:id="@+id/starterRadioGroup" | ||||||
|  |                 android:layout_width="0dp" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:layout_marginStart="32dp" | ||||||
|  |                 android:layout_marginLeft="32dp" | ||||||
|  |                 android:layout_marginTop="8dp" | ||||||
|  |                 android:layout_marginEnd="32dp" | ||||||
|  |                 android:layout_marginRight="32dp" | ||||||
|  |                 android:orientation="horizontal" | ||||||
|  |                 app:layout_constraintEnd_toEndOf="parent" | ||||||
|  |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|  |                 app:layout_constraintTop_toBottomOf="@+id/WhoStarts"> | ||||||
|  |  | ||||||
|  |             <RadioButton | ||||||
|  |                     android:id="@+id/radioPlayer1Starts" | ||||||
|  |                     android:layout_width="wrap_content" | ||||||
|  |                     android:layout_height="wrap_content" | ||||||
|  |                     android:layout_weight="0" | ||||||
|  |                     android:checked="true" | ||||||
|  |                     tools:layout_editor_absoluteX="16dp" | ||||||
|  |                     tools:layout_editor_absoluteY="93dp" /> | ||||||
|  |  | ||||||
|  |             <AutoCompleteTextView | ||||||
|  |                     android:id="@+id/player1Name" | ||||||
|  |                     android:layout_width="match_parent" | ||||||
|  |                     android:layout_height="wrap_content" | ||||||
|  |                     android:layout_weight="1" | ||||||
|  |                     android:completionThreshold="1" | ||||||
|  |                     android:hint="@string/player_1_default_name" | ||||||
|  |                     android:imeOptions="actionNext" | ||||||
|  |                     android:singleLine="true" | ||||||
|  |                     android:text="@string/player_1_default_name" | ||||||
|  |                     tools:layout_editor_absoluteX="143dp" | ||||||
|  |                     tools:layout_editor_absoluteY="48dp" /> | ||||||
|  |  | ||||||
|  |             <ImageButton | ||||||
|  |                     android:layout_width="wrap_content" | ||||||
|  |                     android:layout_height="wrap_content" | ||||||
|  |                     android:layout_weight="0" | ||||||
|  |                     android:contentDescription="@string/swap_names" | ||||||
|  |                     android:onClick="swapNames" | ||||||
|  |                     app:srcCompat="@drawable/ic_swap_horiz" /> | ||||||
|  |  | ||||||
|  |             <RadioButton | ||||||
|  |                     android:id="@+id/radioPlayer2Starts" | ||||||
|  |                     android:layout_width="wrap_content" | ||||||
|  |                     android:layout_height="wrap_content" | ||||||
|  |                     android:layout_weight="0" | ||||||
|  |                     android:checked="true" | ||||||
|  |                     tools:layout_editor_absoluteX="16dp" | ||||||
|  |                     tools:layout_editor_absoluteY="93dp" /> | ||||||
|  |  | ||||||
|  |             <AutoCompleteTextView | ||||||
|  |                     android:id="@+id/player2Name" | ||||||
|  |                     android:layout_width="match_parent" | ||||||
|  |                     android:layout_height="wrap_content" | ||||||
|  |                     android:layout_weight="1" | ||||||
|  |                     android:completionThreshold="1" | ||||||
|  |                     android:hint="@string/player_2_default_name" | ||||||
|  |                     android:imeOptions="actionNext" | ||||||
|  |                     android:singleLine="true" | ||||||
|  |                     android:text="@string/player_2_default_name" | ||||||
|  |                     tools:layout_editor_absoluteX="136dp" /> | ||||||
|  |         </RadioGroup> | ||||||
|  |  | ||||||
|  |         <com.google.android.material.switchmaterial.SwitchMaterial | ||||||
|  |                 android:id="@+id/enableTtsSwitch" | ||||||
|  |                 android:layout_width="0dp" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:layout_marginStart="32dp" | ||||||
|  |                 android:layout_marginLeft="32dp" | ||||||
|  |                 android:layout_marginTop="8dp" | ||||||
|  |                 android:layout_marginEnd="32dp" | ||||||
|  |                 android:layout_marginRight="32dp" | ||||||
|  |                 android:text="@string/TTS" | ||||||
|  |                 app:layout_constraintEnd_toEndOf="parent" | ||||||
|  |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|  |                 app:layout_constraintTop_toBottomOf="@+id/starterRadioGroup" /> | ||||||
|  |  | ||||||
|  |         <com.google.android.material.switchmaterial.SwitchMaterial | ||||||
|  |                 android:id="@+id/enableSttSwitch" | ||||||
|  |                 android:layout_width="0dp" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:layout_marginStart="32dp" | ||||||
|  |                 android:layout_marginLeft="32dp" | ||||||
|  |                 android:layout_marginTop="8dp" | ||||||
|  |                 android:layout_marginEnd="32dp" | ||||||
|  |                 android:layout_marginRight="32dp" | ||||||
|  |                 android:text="@string/STT" | ||||||
|  |                 app:layout_constraintEnd_toEndOf="parent" | ||||||
|  |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|  |                 app:layout_constraintTop_toBottomOf="@+id/enableTtsSwitch" /> | ||||||
|  |  | ||||||
|  |     </androidx.constraintlayout.widget.ConstraintLayout> | ||||||
|  |  | ||||||
|  | </androidx.coordinatorlayout.widget.CoordinatorLayout> | ||||||
| @ -1,116 +1,144 @@ | |||||||
| <?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||||||
|  |  | ||||||
| <android.support.design.widget.CoordinatorLayout | <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:tools="http://schemas.android.com/tools" | ||||||
|         xmlns:tools="http://schemas.android.com/tools" android:id="@+id/coordinatorLayout" |         android:id="@+id/coordinatorLayout" | ||||||
|         xmlns:android="http://schemas.android.com/apk/res/android" |         xmlns:android="http://schemas.android.com/apk/res/android" | ||||||
|         xmlns:app="http://schemas.android.com/apk/res-auto" |         xmlns:app="http://schemas.android.com/apk/res-auto" | ||||||
|         android:layout_width="match_parent" |         android:layout_width="match_parent" | ||||||
|         android:layout_height="match_parent" |         android:layout_height="match_parent" | ||||||
|         android:keepScreenOn="true"> |         android:keepScreenOn="true"> | ||||||
|  |  | ||||||
|     <LinearLayout |     <androidx.constraintlayout.widget.ConstraintLayout | ||||||
|             android:layout_width="match_parent" |             android:layout_width="match_parent" | ||||||
|             android:layout_height="match_parent" |             android:layout_height="match_parent"> | ||||||
|             android:orientation="vertical"> |  | ||||||
|  |  | ||||||
|         <LinearLayout |         <TextView | ||||||
|                 android:id="@+id/linearLayoutText" |                 android:id="@+id/textService" | ||||||
|                 android:layout_width="match_parent" |                 android:layout_width="0dp" | ||||||
|                 android:layout_height="wrap_content" |                 android:layout_height="wrap_content" | ||||||
|                 android:layout_marginEnd="8dp" |                 android:layout_margin="8dp" | ||||||
|                 android:layout_marginStart="8dp" |                 android:layout_marginStart="32dp" | ||||||
|                 android:orientation="horizontal" |                 android:layout_marginLeft="32dp" | ||||||
|                 app:layout_constraintEnd_toEndOf="parent" |                 android:layout_marginTop="32dp" | ||||||
|  |                 android:layout_weight="1" | ||||||
|  |                 android:gravity="start" | ||||||
|  |                 android:text="@string/service" | ||||||
|  |                 android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||||||
|                 app:layout_constraintStart_toStartOf="parent" |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|                 tools:layout_editor_absoluteY="8dp" android:layout_weight="0"> |                 app:layout_constraintTop_toTopOf="parent" /> | ||||||
|  |  | ||||||
|  |         <ImageView | ||||||
|  |                 android:id="@+id/icStt" | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:layout_margin="8dp" | ||||||
|  |                 android:layout_marginTop="32dp" | ||||||
|  |                 android:layout_marginEnd="32dp" | ||||||
|  |                 android:layout_marginRight="32dp" | ||||||
|  |                 android:alpha="0" | ||||||
|  |                 android:contentDescription="@string/STT" | ||||||
|  |                 app:layout_constraintEnd_toEndOf="parent" | ||||||
|  |                 app:layout_constraintTop_toTopOf="parent" | ||||||
|  |                 app:srcCompat="@drawable/ic_stt" /> | ||||||
|  |  | ||||||
|         <TextView |         <TextView | ||||||
|                 android:id="@+id/textScore" |                 android:id="@+id/textScore" | ||||||
|                 android:layout_width="wrap_content" |                 android:layout_width="wrap_content" | ||||||
|                 android:layout_height="wrap_content" |                 android:layout_height="wrap_content" | ||||||
|                     android:layout_marginLeft="8dp" |                 android:layout_margin="8dp" | ||||||
|                     android:layout_marginStart="8dp" |                 android:layout_marginStart="32dp" | ||||||
|                     android:gravity="left" |                 android:layout_marginLeft="32dp" | ||||||
|  |                 android:layout_marginTop="16dp" | ||||||
|  |                 android:layout_marginBottom="8dp" | ||||||
|  |                 android:gravity="start" | ||||||
|  |                 android:text="@string/score_score" | ||||||
|                 android:textAppearance="@style/TextAppearance.AppCompat.Large" |                 android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||||||
|  |                 app:layout_constraintBottom_toTopOf="@+id/imgService0" | ||||||
|                 app:layout_constraintStart_toStartOf="parent" |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|                     app:layout_constraintTop_toTopOf="parent" |                 app:layout_constraintTop_toBottomOf="@+id/textService" /> | ||||||
|                     android:layout_marginRight="8dp" android:text="@string/score_score" |  | ||||||
|                     android:layout_weight="1" android:layout_margin="8dp"/> |  | ||||||
|             <TextView |  | ||||||
|                     android:id="@+id/textService" |  | ||||||
|                     android:layout_width="wrap_content" |  | ||||||
|                     android:layout_height="wrap_content" |  | ||||||
|                     android:layout_marginEnd="8dp" |  | ||||||
|                     android:layout_marginStart="8dp" |  | ||||||
|                     android:textAppearance="@style/TextAppearance.AppCompat.Large" |  | ||||||
|                     app:layout_constraintEnd_toEndOf="parent" |  | ||||||
|                     app:layout_constraintHorizontal_bias="1.0" |  | ||||||
|                     app:layout_constraintStart_toEndOf="@+id/textScore" |  | ||||||
|                     app:layout_constraintTop_toTopOf="parent" |  | ||||||
|                     android:gravity="right" android:text="@string/service" |  | ||||||
|                     android:layout_weight="1" android:layout_margin="8dp"/> |  | ||||||
|  |  | ||||||
|         </LinearLayout> |  | ||||||
|  |  | ||||||
|         <LinearLayout |  | ||||||
|                 android:layout_width="match_parent" |  | ||||||
|                 android:layout_height="match_parent" |  | ||||||
|                 android:orientation="vertical" android:layout_weight="1"> |  | ||||||
|  |  | ||||||
|         <ImageView |         <ImageView | ||||||
|                 android:id="@+id/imgService0" |                 android:id="@+id/imgService0" | ||||||
|                 android:layout_width="match_parent" |                 android:layout_width="match_parent" | ||||||
|                 android:layout_height="48dp" |                 android:layout_height="48dp" | ||||||
|                 android:layout_margin="8dp" |                 android:layout_margin="8dp" | ||||||
|  |                 android:layout_marginStart="32dp" | ||||||
|  |                 android:layout_marginLeft="32dp" | ||||||
|  |                 android:layout_marginTop="24dp" | ||||||
|  |                 android:layout_marginEnd="32dp" | ||||||
|  |                 android:layout_marginRight="32dp" | ||||||
|  |                 android:layout_marginBottom="8dp" | ||||||
|                 android:contentDescription="@string/service_img_description" |                 android:contentDescription="@string/service_img_description" | ||||||
|                     app:srcCompat="@drawable/ic_service_1" |                 app:layout_constraintBottom_toTopOf="@+id/buttonPlayer0" | ||||||
|                     tools:layout_editor_absoluteY="120dp"/> |                 app:layout_constraintEnd_toEndOf="parent" | ||||||
|  |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|  |                 app:layout_constraintTop_toBottomOf="@+id/textScore" | ||||||
|  |                 app:srcCompat="@drawable/ic_service_1" /> | ||||||
|  |  | ||||||
|         <Button |         <Button | ||||||
|                 android:id="@+id/buttonPlayer0" |                 android:id="@+id/buttonPlayer0" | ||||||
|                     android:layout_width="match_parent" |                 android:layout_width="0dp" | ||||||
|                     android:layout_height="match_parent" |                 android:layout_height="0dp" | ||||||
|                     android:layout_marginStart="8dp" |                 android:layout_margin="8dp" | ||||||
|  |                 android:layout_marginStart="32dp" | ||||||
|  |                 android:layout_marginLeft="32dp" | ||||||
|  |                 android:layout_marginTop="24dp" | ||||||
|  |                 android:layout_marginEnd="32dp" | ||||||
|  |                 android:layout_marginRight="32dp" | ||||||
|  |                 android:layout_marginBottom="8dp" | ||||||
|  |                 android:layout_weight="1" | ||||||
|                 android:bufferType="spannable" |                 android:bufferType="spannable" | ||||||
|                 android:onClick="updateScore" |                 android:onClick="updateScore" | ||||||
|                 android:textAllCaps="false" |                 android:textAllCaps="false" | ||||||
|                     android:textAppearance="@style/TextAppearance.AppCompat.Button" |  | ||||||
|                 android:textSize="24sp" |                 android:textSize="24sp" | ||||||
|                 android:textStyle="bold" |                 android:textStyle="bold" | ||||||
|                     app:layout_constraintBottom_toBottomOf="parent" |                 android:theme="@style/ColoredButtonStyle" | ||||||
|                     app:layout_constraintStart_toEndOf="@+id/imgService0" |                 app:layout_constraintBottom_toTopOf="@+id/buttonPlayer1" | ||||||
|                     app:layout_constraintTop_toTopOf="parent" |                 app:layout_constraintEnd_toEndOf="parent" | ||||||
|                     tools:text="@string/button_text" android:layout_margin="8dp" android:layout_weight="1" |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|                     android:theme="@style/ScoreButton" android:layout_marginLeft="8dp"/> |                 app:layout_constraintTop_toBottomOf="@+id/imgService0" | ||||||
|  |                 tools:text="@string/button_text" /> | ||||||
|  |  | ||||||
|         <Button |         <Button | ||||||
|                 android:id="@+id/buttonPlayer1" |                 android:id="@+id/buttonPlayer1" | ||||||
|                     android:layout_width="match_parent" |                 android:layout_width="0dp" | ||||||
|                     android:layout_height="match_parent" |                 android:layout_height="0dp" | ||||||
|                     android:layout_marginEnd="8dp" |                 android:layout_margin="8dp" | ||||||
|                     android:layout_marginStart="8dp" |                 android:layout_marginStart="32dp" | ||||||
|  |                 android:layout_marginLeft="32dp" | ||||||
|  |                 android:layout_marginTop="8dp" | ||||||
|  |                 android:layout_marginEnd="32dp" | ||||||
|  |                 android:layout_marginRight="32dp" | ||||||
|  |                 android:layout_marginBottom="8dp" | ||||||
|  |                 android:layout_weight="1" | ||||||
|                 android:bufferType="spannable" |                 android:bufferType="spannable" | ||||||
|                 android:onClick="updateScore" |                 android:onClick="updateScore" | ||||||
|                 android:textAllCaps="false" |                 android:textAllCaps="false" | ||||||
|                     android:textAppearance="@style/TextAppearance.AppCompat.Button" |  | ||||||
|                 android:textSize="24sp" |                 android:textSize="24sp" | ||||||
|                 android:textStyle="bold" |                 android:textStyle="bold" | ||||||
|                     app:layout_constraintBottom_toBottomOf="parent" |                 android:theme="@style/ColoredButtonStyle" | ||||||
|                     app:layout_constraintEnd_toStartOf="@+id/imgService1" |                 app:layout_constraintBottom_toTopOf="@+id/imgService1" | ||||||
|                     app:layout_constraintStart_toEndOf="@+id/buttonPlayer0" |                 app:layout_constraintEnd_toEndOf="parent" | ||||||
|                     tools:text="@string/button_text" android:layout_margin="8dp" android:layout_weight="1" |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|                     android:theme="@style/ScoreButton"/> |                 app:layout_constraintTop_toBottomOf="@+id/buttonPlayer0" | ||||||
|  |                 tools:text="@string/button_text" /> | ||||||
|  |  | ||||||
|         <ImageView |         <ImageView | ||||||
|                 android:id="@+id/imgService1" |                 android:id="@+id/imgService1" | ||||||
|                 android:layout_width="match_parent" |                 android:layout_width="match_parent" | ||||||
|                 android:layout_height="48dp" |                 android:layout_height="48dp" | ||||||
|                 android:layout_margin="8dp" |                 android:layout_margin="8dp" | ||||||
|  |                 android:layout_marginStart="32dp" | ||||||
|  |                 android:layout_marginLeft="32dp" | ||||||
|  |                 android:layout_marginTop="8dp" | ||||||
|  |                 android:layout_marginEnd="32dp" | ||||||
|  |                 android:layout_marginRight="32dp" | ||||||
|  |                 android:layout_marginBottom="32dp" | ||||||
|                 android:contentDescription="@string/service_img_description" |                 android:contentDescription="@string/service_img_description" | ||||||
|                     tools:layout_editor_absoluteY="120dp"/> |                 app:layout_constraintBottom_toBottomOf="parent" | ||||||
|  |                 app:layout_constraintEnd_toEndOf="parent" | ||||||
|  |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|  |                 app:layout_constraintTop_toBottomOf="@+id/buttonPlayer1" /> | ||||||
|  |     </androidx.constraintlayout.widget.ConstraintLayout> | ||||||
|  |  | ||||||
|         </LinearLayout> | </androidx.coordinatorlayout.widget.CoordinatorLayout> | ||||||
|  |  | ||||||
|     </LinearLayout> |  | ||||||
|  |  | ||||||
| </android.support.design.widget.CoordinatorLayout> |  | ||||||
| @ -1,116 +1,158 @@ | |||||||
| <?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||||||
|  |  | ||||||
| <android.support.design.widget.CoordinatorLayout | <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:tools="http://schemas.android.com/tools" | ||||||
|         xmlns:tools="http://schemas.android.com/tools" android:id="@+id/coordinatorLayout" |         android:id="@+id/coordinatorLayout" | ||||||
|         xmlns:android="http://schemas.android.com/apk/res/android" |         xmlns:android="http://schemas.android.com/apk/res/android" | ||||||
|         xmlns:app="http://schemas.android.com/apk/res-auto" |         xmlns:app="http://schemas.android.com/apk/res-auto" | ||||||
|         android:layout_width="match_parent" |         android:layout_width="match_parent" | ||||||
|         android:layout_height="match_parent"> |         android:layout_height="match_parent"> | ||||||
|  |  | ||||||
|     <android.support.constraint.ConstraintLayout |     <androidx.constraintlayout.widget.ConstraintLayout | ||||||
|         xmlns:android="http://schemas.android.com/apk/res/android" |  | ||||||
|         xmlns:tools="http://schemas.android.com/tools" |  | ||||||
|         xmlns:app="http://schemas.android.com/apk/res-auto" |  | ||||||
|             android:layout_width="match_parent" |             android:layout_width="match_parent" | ||||||
|             android:layout_height="match_parent" |             android:layout_height="match_parent" | ||||||
|             tools:context=".StarterNameActivity"> |             tools:context=".StarterNameActivity"> | ||||||
|  |  | ||||||
|         <TextView |         <TextView | ||||||
|  |                 android:id="@+id/WhoStarts" | ||||||
|                 android:layout_width="0dp" |                 android:layout_width="0dp" | ||||||
|                 android:layout_height="wrap_content" |                 android:layout_height="wrap_content" | ||||||
|                 android:id="@+id/WhoStarts" android:text="@string/who_starts" |                 android:layout_marginStart="32dp" | ||||||
|                 app:layout_constraintStart_toStartOf="parent" android:layout_marginLeft="8dp" |                 android:layout_marginLeft="32dp" | ||||||
|                 android:layout_marginStart="8dp" android:textAppearance="@style/TextAppearance.AppCompat.Headline" |                 android:layout_marginTop="32dp" | ||||||
|                 android:layout_marginTop="8dp" app:layout_constraintTop_toTopOf="parent"/> |                 android:text="@string/who_starts" | ||||||
|         <LinearLayout |                 android:textAppearance="@style/TextAppearance.AppCompat.Headline" | ||||||
|                 android:orientation="horizontal" |  | ||||||
|                 android:layout_width="match_parent" |  | ||||||
|                 android:layout_height="wrap_content" |  | ||||||
|                 android:layout_marginTop="8dp" |  | ||||||
|                 app:layout_constraintTop_toBottomOf="@+id/WhoStarts" |  | ||||||
|                 app:layout_constraintStart_toStartOf="parent" |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|                 android:layout_marginLeft="8dp" android:layout_marginStart="8dp" app:layout_constraintEnd_toEndOf="parent" |                 app:layout_constraintTop_toTopOf="parent" /> | ||||||
|                 android:layout_marginEnd="8dp" android:layout_marginRight="8dp" android:id="@+id/linearLayout" |  | ||||||
|                 android:layout_margin="8dp"> |  | ||||||
|         <RadioGroup |         <RadioGroup | ||||||
|  |                 android:id="@+id/starterRadioGroup" | ||||||
|                 android:layout_width="wrap_content" |                 android:layout_width="wrap_content" | ||||||
|                     android:layout_height="match_parent" |                 android:layout_height="0dp" | ||||||
|  |                 android:layout_marginStart="32dp" | ||||||
|  |                 android:layout_marginLeft="32dp" | ||||||
|                 android:layout_marginTop="8dp" |                 android:layout_marginTop="8dp" | ||||||
|                     app:layout_constraintTop_toBottomOf="@+id/WhoStarts" android:id="@+id/starterRadioGroup" |                 android:layout_marginBottom="8dp" | ||||||
|                     android:layout_marginStart="8dp" app:layout_constraintStart_toStartOf="parent" |                 app:layout_constraintBottom_toBottomOf="@+id/player2Name" | ||||||
|                     android:layout_marginLeft="8dp" app:layout_constraintEnd_toEndOf="parent" |  | ||||||
|                     android:layout_marginEnd="8dp" |  | ||||||
|                     android:layout_marginRight="8dp" android:layout_marginBottom="8dp"> |  | ||||||
|                 <RadioButton |  | ||||||
|                         android:layout_width="wrap_content" |  | ||||||
|                         android:layout_height="wrap_content" tools:layout_editor_absoluteY="93dp" |  | ||||||
|                         tools:layout_editor_absoluteX="16dp" android:id="@+id/radioPlayer1Starts" |  | ||||||
|                         android:layout_weight="1" android:gravity="top" android:checked="true"/> |  | ||||||
|                 <RadioButton |  | ||||||
|                         android:layout_height="wrap_content" tools:layout_editor_absoluteY="93dp" |  | ||||||
|                         tools:layout_editor_absoluteX="16dp" android:id="@+id/radioPlayer2Starts" |  | ||||||
|                         android:layout_width="wrap_content" android:layout_weight="1" |  | ||||||
|                         android:gravity="bottom" |  | ||||||
|                         android:checked="false"/> |  | ||||||
|             </RadioGroup> |  | ||||||
|             <LinearLayout |  | ||||||
|                     android:orientation="vertical" |  | ||||||
|                     android:layout_width="match_parent" |  | ||||||
|                     android:layout_height="wrap_content"> |  | ||||||
|                 <AutoCompleteTextView |  | ||||||
|                         android:text="@string/player_1_default_name" |  | ||||||
|                         android:layout_width="match_parent" |  | ||||||
|                         android:layout_height="wrap_content" tools:layout_editor_absoluteY="48dp" |  | ||||||
|                         android:id="@+id/player1Name" |  | ||||||
|                         tools:layout_editor_absoluteX="143dp" android:hint="@string/player_1_default_name" |  | ||||||
|                         android:selectAllOnFocus="true" |  | ||||||
|                         android:completionThreshold="1" |  | ||||||
|                         android:singleLine="true" |  | ||||||
|                         android:imeOptions="actionNext"/> |  | ||||||
|                 <ImageButton |  | ||||||
|                         android:layout_width="match_parent" |  | ||||||
|                         android:layout_height="wrap_content" app:srcCompat="@drawable/ic_swap_vert" |  | ||||||
|                         android:id="@+id/swapNamesButton" android:contentDescription="@string/swap_names" |  | ||||||
|                         android:onClick="swapNames"/> |  | ||||||
|                 <AutoCompleteTextView |  | ||||||
|                         android:text="@string/player_2_default_name" |  | ||||||
|                         tools:layout_editor_absoluteX="136dp" android:id="@+id/player2Name" |  | ||||||
|                         android:hint="@string/player_2_default_name" android:layout_height="wrap_content" |  | ||||||
|                         android:layout_width="match_parent" android:selectAllOnFocus="true" |  | ||||||
|                         android:completionThreshold="1" |  | ||||||
|                         android:singleLine="true" |  | ||||||
|                         android:imeOptions="actionNext"/> |  | ||||||
|             </LinearLayout> |  | ||||||
|         </LinearLayout> |  | ||||||
|         <Switch |  | ||||||
|                 android:text="@string/TTS" |  | ||||||
|                 android:layout_width="0dp" |  | ||||||
|                 android:layout_height="wrap_content" |  | ||||||
|                 android:id="@+id/enableTtsSwitch" |  | ||||||
|                 app:layout_constraintStart_toStartOf="parent" |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|                 android:layout_marginLeft="8dp" android:layout_marginStart="8dp" app:layout_constraintEnd_toEndOf="parent" |                 app:layout_constraintTop_toTopOf="@+id/player1Name"> | ||||||
|                 android:layout_marginEnd="6dp" android:layout_marginRight="6dp" app:layout_constraintHorizontal_bias="0.0" |  | ||||||
|                 android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/linearLayout"/> |             <RadioButton | ||||||
|         <Switch |                     android:id="@+id/radioPlayer1Starts" | ||||||
|                 android:text="@string/STT" |  | ||||||
|                 android:layout_width="0dp" |  | ||||||
|                 android:layout_height="wrap_content" |  | ||||||
|                 android:id="@+id/enableSttSwitch" |  | ||||||
|                 android:layout_marginTop="8dp" |  | ||||||
|                 app:layout_constraintTop_toBottomOf="@+id/enableTtsSwitch" android:layout_marginStart="8dp" |  | ||||||
|                 app:layout_constraintStart_toStartOf="parent" android:layout_marginLeft="8dp" android:layout_marginEnd="8dp" |  | ||||||
|                 app:layout_constraintEnd_toEndOf="parent" android:layout_marginRight="8dp"/> |  | ||||||
|         <Button |  | ||||||
|                 android:text="@string/start" |  | ||||||
|                     android:layout_width="wrap_content" |                     android:layout_width="wrap_content" | ||||||
|                     android:layout_height="wrap_content" |                     android:layout_height="wrap_content" | ||||||
|                 android:id="@+id/startMatchButton" |                     android:layout_weight="1" | ||||||
|                 style="@android:style/Widget.DeviceDefault.Button" |                     android:checked="true" | ||||||
|                 android:layout_marginEnd="8dp" app:layout_constraintEnd_toEndOf="parent" android:layout_marginRight="8dp" |                     android:gravity="top" | ||||||
|                 android:layout_marginBottom="8dp" app:layout_constraintBottom_toBottomOf="parent" |                     tools:layout_editor_absoluteX="16dp" | ||||||
|  |                     tools:layout_editor_absoluteY="93dp" /> | ||||||
|  |  | ||||||
|  |             <RadioButton | ||||||
|  |                     android:id="@+id/radioPlayer2Starts" | ||||||
|  |                     android:layout_width="wrap_content" | ||||||
|  |                     android:layout_height="wrap_content" | ||||||
|  |                     android:layout_weight="1" | ||||||
|  |                     android:checked="false" | ||||||
|  |                     android:gravity="bottom" | ||||||
|  |                     tools:layout_editor_absoluteX="16dp" | ||||||
|  |                     tools:layout_editor_absoluteY="93dp" /> | ||||||
|  |         </RadioGroup> | ||||||
|  |  | ||||||
|  |         <AutoCompleteTextView | ||||||
|  |                 android:id="@+id/player1Name" | ||||||
|  |                 android:layout_width="0dp" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:layout_marginStart="8dp" | ||||||
|  |                 android:layout_marginLeft="8dp" | ||||||
|  |                 android:layout_marginTop="8dp" | ||||||
|  |                 android:layout_marginEnd="32dp" | ||||||
|  |                 android:layout_marginRight="32dp" | ||||||
|  |                 android:completionThreshold="1" | ||||||
|  |                 android:hint="@string/player_1_default_name" | ||||||
|  |                 android:imeOptions="actionNext" | ||||||
|  |                 android:selectAllOnFocus="true" | ||||||
|  |                 android:singleLine="true" | ||||||
|  |                 android:text="@string/player_1_default_name" | ||||||
|  |                 app:layout_constraintEnd_toEndOf="parent" | ||||||
|  |                 app:layout_constraintStart_toEndOf="@+id/starterRadioGroup" | ||||||
|  |                 app:layout_constraintTop_toBottomOf="@+id/WhoStarts" /> | ||||||
|  |  | ||||||
|  |         <ImageButton | ||||||
|  |                 android:id="@+id/imageButton" | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:layout_marginStart="32dp" | ||||||
|  |                 android:layout_marginLeft="32dp" | ||||||
|  |                 android:layout_marginTop="8dp" | ||||||
|  |                 android:layout_marginEnd="32dp" | ||||||
|  |                 android:layout_marginRight="32dp" | ||||||
|  |                 android:contentDescription="@string/swap_names" | ||||||
|  |                 android:onClick="swapNames" | ||||||
|  |                 app:layout_constraintEnd_toEndOf="parent" | ||||||
|  |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|  |                 app:layout_constraintTop_toBottomOf="@+id/player1Name" | ||||||
|  |                 app:srcCompat="@drawable/ic_swap_vert" /> | ||||||
|  |  | ||||||
|  |         <AutoCompleteTextView | ||||||
|  |                 android:id="@+id/player2Name" | ||||||
|  |                 android:layout_width="0dp" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:layout_marginStart="8dp" | ||||||
|  |                 android:layout_marginLeft="8dp" | ||||||
|  |                 android:layout_marginEnd="32dp" | ||||||
|  |                 android:layout_marginRight="32dp" | ||||||
|  |                 android:completionThreshold="1" | ||||||
|  |                 android:hint="@string/player_2_default_name" | ||||||
|  |                 android:imeOptions="actionNext" | ||||||
|  |                 android:selectAllOnFocus="true" | ||||||
|  |                 android:singleLine="true" | ||||||
|  |                 android:text="@string/player_2_default_name" | ||||||
|  |                 app:layout_constraintEnd_toEndOf="parent" | ||||||
|  |                 app:layout_constraintStart_toEndOf="@+id/starterRadioGroup" | ||||||
|  |                 app:layout_constraintTop_toBottomOf="@+id/imageButton" /> | ||||||
|  |  | ||||||
|  |         <com.google.android.material.switchmaterial.SwitchMaterial | ||||||
|  |                 android:id="@+id/enableTtsSwitch" | ||||||
|  |                 android:layout_width="0dp" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:layout_marginStart="32dp" | ||||||
|  |                 android:layout_marginLeft="32dp" | ||||||
|  |                 android:layout_marginTop="8dp" | ||||||
|  |                 android:layout_marginEnd="32dp" | ||||||
|  |                 android:layout_marginRight="32dp" | ||||||
|  |                 android:text="@string/TTS" | ||||||
|  |                 app:layout_constraintEnd_toEndOf="parent" | ||||||
|  |                 app:layout_constraintHorizontal_bias="0.0" | ||||||
|  |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|  |                 app:layout_constraintTop_toBottomOf="@+id/player2Name" /> | ||||||
|  |  | ||||||
|  |         <com.google.android.material.switchmaterial.SwitchMaterial | ||||||
|  |                 android:id="@+id/enableSttSwitch" | ||||||
|  |                 android:layout_width="0dp" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:layout_marginStart="32dp" | ||||||
|  |                 android:layout_marginLeft="32dp" | ||||||
|  |                 android:layout_marginTop="8dp" | ||||||
|  |                 android:layout_marginEnd="32dp" | ||||||
|  |                 android:layout_marginRight="32dp" | ||||||
|  |                 android:text="@string/STT" | ||||||
|  |                 app:layout_constraintEnd_toEndOf="parent" | ||||||
|  |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|  |                 app:layout_constraintTop_toBottomOf="@+id/enableTtsSwitch" /> | ||||||
|  |  | ||||||
|  |         <Button | ||||||
|  |                 android:id="@+id/startButton" | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:layout_marginTop="32dp" | ||||||
|  |                 android:layout_marginEnd="32dp" | ||||||
|  |                 android:layout_marginRight="32dp" | ||||||
|                 android:drawableStart="@drawable/ic_new_match" |                 android:drawableStart="@drawable/ic_new_match" | ||||||
|                 android:drawableLeft="@drawable/ic_new_match" android:onClick="startMatch"/> |                 android:drawableLeft="@drawable/ic_new_match" | ||||||
|  |                 android:onClick="startMatch" | ||||||
|  |                 android:text="@string/start" | ||||||
|  |                 app:layout_constraintEnd_toEndOf="parent" | ||||||
|  |                 app:layout_constraintTop_toBottomOf="@+id/enableSttSwitch" /> | ||||||
|  |  | ||||||
|     </android.support.constraint.ConstraintLayout> |     </androidx.constraintlayout.widget.ConstraintLayout> | ||||||
|  |  | ||||||
| </android.support.design.widget.CoordinatorLayout> | </androidx.coordinatorlayout.widget.CoordinatorLayout> | ||||||
| @ -1,133 +1,175 @@ | |||||||
| <?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||||||
|  |  | ||||||
| <android.support.design.widget.CoordinatorLayout | <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:tools="http://schemas.android.com/tools" | ||||||
|         xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android" |         xmlns:android="http://schemas.android.com/apk/res/android" | ||||||
|         xmlns:app="http://schemas.android.com/apk/res-auto" |         xmlns:app="http://schemas.android.com/apk/res-auto" | ||||||
|         android:id="@+id/coordinatorLayout" |         android:id="@+id/coordinatorLayout" | ||||||
|         android:layout_width="match_parent" |         android:layout_width="match_parent" | ||||||
|         android:layout_height="match_parent"> |         android:layout_height="match_parent"> | ||||||
|  |  | ||||||
|     <android.support.constraint.ConstraintLayout |     <androidx.constraintlayout.widget.ConstraintLayout | ||||||
|             xmlns:android="http://schemas.android.com/apk/res/android" |  | ||||||
|             xmlns:tools="http://schemas.android.com/tools" |  | ||||||
|             xmlns:app="http://schemas.android.com/apk/res-auto" |  | ||||||
|             android:layout_width="match_parent" |             android:layout_width="match_parent" | ||||||
|             android:layout_height="match_parent" |             android:layout_height="match_parent" | ||||||
|             tools:context=".VictoryActivity"> |             tools:context=".VictoryActivity"> | ||||||
|  |  | ||||||
|         <TextView |         <TextView | ||||||
|                 android:layout_width="wrap_content" |  | ||||||
|                 android:layout_height="wrap_content" |  | ||||||
|                 android:id="@+id/congrats" |                 android:id="@+id/congrats" | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:layout_marginStart="32dp" | ||||||
|  |                 android:layout_marginLeft="32dp" | ||||||
|  |                 android:layout_marginTop="32dp" | ||||||
|  |                 android:layout_marginEnd="32dp" | ||||||
|  |                 android:layout_marginRight="32dp" | ||||||
|  |                 android:text="@string/congrats" | ||||||
|                 android:textAppearance="@style/TextAppearance.AppCompat.Headline" |                 android:textAppearance="@style/TextAppearance.AppCompat.Headline" | ||||||
|                 android:layout_marginEnd="8dp" app:layout_constraintEnd_toEndOf="parent" |  | ||||||
|                 android:layout_marginRight="8dp" android:layout_marginStart="8dp" |  | ||||||
|                 app:layout_constraintStart_toStartOf="parent" android:layout_marginLeft="8dp" |  | ||||||
|                 android:text="@string/congrats" android:layout_marginTop="8dp" |  | ||||||
|                 app:layout_constraintTop_toTopOf="parent"/> |  | ||||||
|         <LinearLayout |  | ||||||
|                 android:orientation="horizontal" |  | ||||||
|                 android:layout_width="match_parent" |  | ||||||
|                 android:layout_height="wrap_content" app:layout_constraintTop_toBottomOf="@+id/congrats" |  | ||||||
|                 android:id="@+id/resultLinearLayout" android:layout_marginTop="8dp" |  | ||||||
|                 app:layout_constraintStart_toStartOf="parent" android:layout_marginLeft="8dp" |  | ||||||
|                 android:layout_marginStart="8dp" app:layout_constraintEnd_toEndOf="parent" |  | ||||||
|                 android:layout_marginEnd="8dp" android:layout_marginRight="8dp" android:layout_marginBottom="8dp" |  | ||||||
|                 app:layout_constraintBottom_toTopOf="@+id/previousMatchesTextView"> |  | ||||||
|             <TextView |  | ||||||
|                     android:text="@string/player_1_default_name" |  | ||||||
|                     android:layout_width="0dp" |  | ||||||
|                     android:layout_height="wrap_content" |  | ||||||
|                     android:id="@+id/player1NameTextView" |  | ||||||
|                     android:textAppearance="@style/TextAppearance.AppCompat.Medium" |  | ||||||
|                     android:gravity="right" tools:layout_editor_absoluteX="8dp" android:layout_weight="1"/> |  | ||||||
|             <TextView |  | ||||||
|                     android:text="@string/score" |  | ||||||
|                     android:layout_width="wrap_content" |  | ||||||
|                     android:layout_height="wrap_content" android:id="@+id/scoreTextView" |  | ||||||
|                     android:textAppearance="@style/TextAppearance.AppCompat.Medium" |  | ||||||
|                     android:layout_marginStart="24dp" |  | ||||||
|                     android:layout_marginLeft="24dp" android:layout_weight="0" android:layout_marginRight="24dp"/> |  | ||||||
|             <TextView |  | ||||||
|                     android:text="@string/player_2_default_name" |  | ||||||
|                     android:layout_width="0dp" |  | ||||||
|                     android:layout_height="wrap_content" |  | ||||||
|                     android:id="@+id/player2NameTextView" |  | ||||||
|                     android:layout_marginLeft="24dp" android:layout_marginStart="24dp" |  | ||||||
|                     android:textAppearance="@style/TextAppearance.AppCompat.Medium" android:layout_marginEnd="8dp" |  | ||||||
|                     android:layout_marginRight="8dp" android:gravity="left" |  | ||||||
|                     android:layout_weight="1"/> |  | ||||||
|         </LinearLayout> |  | ||||||
|         <TextView |  | ||||||
|                 android:text="@string/previous_matches" |  | ||||||
|                 android:layout_width="wrap_content" |  | ||||||
|                 android:layout_height="wrap_content" |  | ||||||
|                 android:textAppearance="@style/TextAppearance.AppCompat.Medium" android:textAllCaps="true" |  | ||||||
|                 android:id="@+id/previousMatchesTextView" |  | ||||||
|                 app:layout_constraintStart_toStartOf="parent" |  | ||||||
|                 android:layout_marginLeft="8dp" android:layout_marginStart="8dp" |  | ||||||
|                 app:layout_constraintEnd_toEndOf="parent" |                 app:layout_constraintEnd_toEndOf="parent" | ||||||
|                 app:layout_constraintTop_toBottomOf="@id/resultLinearLayout" |  | ||||||
|                 android:layout_marginEnd="8dp" |  | ||||||
|                 android:layout_marginRight="8dp" android:layout_marginTop="32dp"/> |  | ||||||
|         <GridView |  | ||||||
|                 android:layout_width="0dp" |  | ||||||
|                 android:numColumns="3" android:id="@+id/previousMatchesGrid" android:clickable="false" |  | ||||||
|                 android:gravity="center" |  | ||||||
|                 app:layout_constraintStart_toStartOf="parent" |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|                 android:layout_marginLeft="16dp" android:layout_marginStart="16dp" |                 app:layout_constraintTop_toTopOf="parent" /> | ||||||
|                 android:layout_marginEnd="16dp" app:layout_constraintEnd_toEndOf="parent" |  | ||||||
|                 android:layout_marginRight="16dp" |         <TextView | ||||||
|                 android:layout_height="0dp" |                 android:id="@+id/player1NameTextView" | ||||||
|                 app:layout_constraintTop_toBottomOf="@+id/previousMatchesTextView" android:layout_marginTop="8dp" |                 android:layout_width="0dp" | ||||||
|                 android:layout_marginBottom="8dp" app:layout_constraintBottom_toTopOf="@+id/pingPointsCredit"/> |  | ||||||
|         <Button |  | ||||||
|                 android:text="@string/new_match" |  | ||||||
|                 android:layout_width="wrap_content" |  | ||||||
|                 android:layout_height="wrap_content" |                 android:layout_height="wrap_content" | ||||||
|                 android:id="@+id/buttonNewMatch" app:layout_constraintEnd_toEndOf="parent" |                 android:layout_marginTop="8dp" | ||||||
|                 android:layout_marginEnd="8dp" |                 android:layout_marginEnd="8dp" | ||||||
|                 android:layout_marginRight="8dp" |                 android:layout_marginRight="8dp" | ||||||
|  |                 android:layout_marginBottom="8dp" | ||||||
|  |                 android:layout_weight="1" | ||||||
|  |                 android:text="@string/player_1_default_name" | ||||||
|  |                 android:textAppearance="@style/TextAppearance.AppCompat.Medium" | ||||||
|  |                 app:layout_constraintBottom_toTopOf="@+id/previousMatchesTextView" | ||||||
|  |                 app:layout_constraintEnd_toStartOf="@+id/scoreTextView" | ||||||
|  |                 app:layout_constraintTop_toBottomOf="@+id/congrats" /> | ||||||
|  |  | ||||||
|  |         <TextView | ||||||
|  |                 android:id="@+id/scoreTextView" | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:layout_marginTop="8dp" | ||||||
|  |                 android:layout_marginEnd="8dp" | ||||||
|  |                 android:layout_marginRight="8dp" | ||||||
|  |                 android:layout_marginBottom="8dp" | ||||||
|  |                 android:layout_weight="0" | ||||||
|  |                 android:text="@string/score" | ||||||
|  |                 android:textAppearance="@style/TextAppearance.AppCompat.Medium" | ||||||
|  |                 app:layout_constraintBottom_toTopOf="@+id/previousMatchesTextView" | ||||||
|  |                 app:layout_constraintEnd_toEndOf="parent" | ||||||
|  |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|  |                 app:layout_constraintTop_toBottomOf="@+id/congrats" /> | ||||||
|  |  | ||||||
|  |         <TextView | ||||||
|  |                 android:id="@+id/player2NameTextView" | ||||||
|  |                 android:layout_width="0dp" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:layout_marginStart="8dp" | ||||||
|  |                 android:layout_marginLeft="8dp" | ||||||
|  |                 android:layout_marginTop="8dp" | ||||||
|  |                 android:layout_marginBottom="8dp" | ||||||
|  |                 android:layout_weight="1" | ||||||
|  |                 android:text="@string/player_2_default_name" | ||||||
|  |                 android:textAppearance="@style/TextAppearance.AppCompat.Medium" | ||||||
|  |                 app:layout_constraintBottom_toTopOf="@+id/previousMatchesTextView" | ||||||
|  |                 app:layout_constraintStart_toEndOf="@+id/scoreTextView" | ||||||
|  |                 app:layout_constraintTop_toBottomOf="@+id/congrats" /> | ||||||
|  |  | ||||||
|  |         <TextView | ||||||
|  |                 android:id="@+id/previousMatchesTextView" | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:layout_marginStart="32dp" | ||||||
|  |                 android:layout_marginLeft="32dp" | ||||||
|  |                 android:layout_marginTop="8dp" | ||||||
|  |                 android:layout_marginEnd="32dp" | ||||||
|  |                 android:layout_marginRight="32dp" | ||||||
|  |                 android:text="@string/previous_matches" | ||||||
|  |                 android:textAllCaps="true" | ||||||
|  |                 android:textAppearance="@style/TextAppearance.AppCompat.Medium" | ||||||
|  |                 app:layout_constraintEnd_toEndOf="parent" | ||||||
|  |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|  |                 app:layout_constraintTop_toBottomOf="@+id/player1NameTextView" /> | ||||||
|  |  | ||||||
|  |         <GridView | ||||||
|  |                 android:id="@+id/previousMatchesGrid" | ||||||
|  |                 android:layout_width="0dp" | ||||||
|  |                 android:layout_height="0dp" | ||||||
|  |                 android:layout_marginStart="32dp" | ||||||
|  |                 android:layout_marginLeft="32dp" | ||||||
|  |                 android:layout_marginTop="8dp" | ||||||
|  |                 android:layout_marginEnd="32dp" | ||||||
|  |                 android:layout_marginRight="32dp" | ||||||
|  |                 android:layout_marginBottom="8dp" | ||||||
|  |                 android:clickable="false" | ||||||
|  |                 android:gravity="center" | ||||||
|  |                 android:numColumns="3" | ||||||
|  |                 app:layout_constraintBottom_toTopOf="@+id/pingPointsCredit" | ||||||
|  |                 app:layout_constraintEnd_toEndOf="parent" | ||||||
|  |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|  |                 app:layout_constraintTop_toBottomOf="@+id/previousMatchesTextView"> | ||||||
|  |  | ||||||
|  |         </GridView> | ||||||
|  |  | ||||||
|  |         <TextView | ||||||
|  |                 android:id="@+id/pingPointsCredit" | ||||||
|  |                 android:layout_width="0dp" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:layout_marginStart="32dp" | ||||||
|  |                 android:layout_marginLeft="32dp" | ||||||
|  |                 android:layout_marginTop="8dp" | ||||||
|  |                 android:layout_marginEnd="32dp" | ||||||
|  |                 android:layout_marginRight="32dp" | ||||||
|  |                 android:layout_weight="0" | ||||||
|  |                 android:text="@string/PingPointsCredits" | ||||||
|  |                 app:layout_constraintBottom_toTopOf="@+id/iconsCredit" | ||||||
|  |                 app:layout_constraintEnd_toEndOf="parent" | ||||||
|  |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|  |                 app:layout_constraintTop_toBottomOf="@+id/previousMatchesGrid" /> | ||||||
|  |  | ||||||
|  |         <TextView | ||||||
|  |                 android:id="@+id/iconsCredit" | ||||||
|  |                 android:layout_width="0dp" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:layout_marginStart="32dp" | ||||||
|  |                 android:layout_marginLeft="32dp" | ||||||
|  |                 android:layout_marginEnd="32dp" | ||||||
|  |                 android:layout_marginRight="32dp" | ||||||
|  |                 android:layout_marginBottom="24dp" | ||||||
|  |                 android:layout_weight="0" | ||||||
|  |                 android:maxLines="1" | ||||||
|  |                 android:text="@string/iconCredits" | ||||||
|  |                 app:layout_constraintBottom_toTopOf="@+id/buttonShare" | ||||||
|  |                 app:layout_constraintEnd_toEndOf="parent" | ||||||
|  |                 app:layout_constraintHorizontal_bias="1.0" | ||||||
|  |                 app:layout_constraintStart_toStartOf="parent" /> | ||||||
|  |  | ||||||
|  |         <Button | ||||||
|  |                 android:id="@+id/buttonNewMatch" | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:layout_marginEnd="32dp" | ||||||
|  |                 android:layout_marginRight="32dp" | ||||||
|  |                 android:layout_marginBottom="32dp" | ||||||
|                 android:drawableStart="@drawable/ic_new_match" |                 android:drawableStart="@drawable/ic_new_match" | ||||||
|                 android:drawableLeft="@drawable/ic_new_match" |                 android:drawableLeft="@drawable/ic_new_match" | ||||||
|                 android:onClick="newMatch" |                 android:onClick="newMatch" | ||||||
|                 android:layout_marginBottom="8dp" |                 android:text="@string/new_match" | ||||||
|                 app:layout_constraintBottom_toBottomOf="parent"/> |                 app:layout_constraintBottom_toBottomOf="parent" | ||||||
|  |                 app:layout_constraintEnd_toEndOf="parent" /> | ||||||
|  |  | ||||||
|         <Button |         <Button | ||||||
|                 android:text="@string/share" |                 android:id="@+id/buttonShare" | ||||||
|                 android:layout_width="wrap_content" |                 android:layout_width="wrap_content" | ||||||
|                 android:layout_height="wrap_content" |                 android:layout_height="wrap_content" | ||||||
|                 android:id="@+id/buttonShare" |                 android:layout_marginStart="32dp" | ||||||
|                 app:layout_constraintStart_toStartOf="parent" |                 android:layout_marginLeft="32dp" | ||||||
|                 android:layout_marginLeft="8dp" android:layout_marginStart="8dp" |                 android:layout_marginBottom="32dp" | ||||||
|                 android:drawableStart="@drawable/ic_share" |                 android:drawableStart="@drawable/ic_share" | ||||||
|                 android:drawableLeft="@drawable/ic_share" android:onClick="share" |                 android:drawableLeft="@drawable/ic_share" | ||||||
|                 android:layout_marginBottom="8dp" app:layout_constraintBottom_toBottomOf="parent"/> |                 android:onClick="share" | ||||||
|         <TextView |                 android:text="@string/share" | ||||||
|                 android:id="@+id/pingPointsCredit" |                 app:layout_constraintBottom_toBottomOf="parent" | ||||||
|                 android:layout_width="match_parent" |                 app:layout_constraintStart_toStartOf="parent" /> | ||||||
|                 android:layout_height="wrap_content" |  | ||||||
|                 android:text="@string/PingPointsCredits" |  | ||||||
|                 app:layout_constraintStart_toStartOf="parent" |  | ||||||
|                 android:layout_marginStart="8dp" |  | ||||||
|                 app:layout_constraintEnd_toEndOf="parent" |  | ||||||
|                 android:layout_marginEnd="8dp" |  | ||||||
|                 android:layout_weight="0" android:layout_marginLeft="8dp" android:layout_marginRight="8dp" |  | ||||||
|                 app:layout_constraintBottom_toTopOf="@+id/iconsCredit" |  | ||||||
|         /> |  | ||||||
|         <TextView |  | ||||||
|                 android:id="@+id/iconsCredit" |  | ||||||
|                 android:layout_width="match_parent" |  | ||||||
|                 android:layout_height="wrap_content" |  | ||||||
|                 android:text="@string/iconCredits" |  | ||||||
|                 app:layout_constraintStart_toStartOf="parent" |  | ||||||
|                 android:layout_marginStart="8dp" app:layout_constraintEnd_toEndOf="parent" |  | ||||||
|                 android:layout_marginEnd="8dp" |  | ||||||
|                 android:layout_weight="0" android:layout_marginLeft="8dp" android:layout_marginRight="8dp" |  | ||||||
|                 android:maxLines="1" |  | ||||||
|                 app:layout_constraintHorizontal_bias="1.0" |  | ||||||
|                 android:layout_marginBottom="8dp" app:layout_constraintBottom_toTopOf="@+id/buttonShare"/> |  | ||||||
|  |  | ||||||
|     </android.support.constraint.ConstraintLayout> |     </androidx.constraintlayout.widget.ConstraintLayout> | ||||||
|  |  | ||||||
| </android.support.design.widget.CoordinatorLayout> | </androidx.coordinatorlayout.widget.CoordinatorLayout> | ||||||
| @ -1,24 +0,0 @@ | |||||||
| <?xml version="1.0" encoding="utf-8"?> |  | ||||||
| <LinearLayout |  | ||||||
|         xmlns:android="http://schemas.android.com/apk/res/android" |  | ||||||
|         xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" |  | ||||||
|         android:orientation="vertical" |  | ||||||
|         android:layout_width="match_parent" |  | ||||||
|         android:layout_height="match_parent" |  | ||||||
|         tools:context=".SttDialog"> |  | ||||||
|     <ImageView |  | ||||||
|             app:srcCompat="@drawable/ic_stt" |  | ||||||
|             android:layout_width="match_parent" |  | ||||||
|             android:layout_height="wrap_content" android:id="@+id/icStt" android:layout_margin="8dp" |  | ||||||
|             android:contentDescription="@string/STT"/> |  | ||||||
|     <TextView |  | ||||||
|             android:layout_width="match_parent" |  | ||||||
|             android:layout_height="wrap_content" |  | ||||||
|             android:text="@string/STT_hint" android:id="@+id/sttHintTextView" |  | ||||||
|             android:textAppearance="@style/TextAppearance.AppCompat.Medium" android:gravity="center" |  | ||||||
|             android:layout_marginLeft="8dp" android:layout_marginRight="8dp"/> |  | ||||||
|     <TextView |  | ||||||
|             android:layout_width="match_parent" |  | ||||||
|             android:layout_height="wrap_content" android:id="@+id/partialResultTextView" |  | ||||||
|             android:layout_margin="8dp" android:gravity="center"/> |  | ||||||
| </LinearLayout> |  | ||||||
| @ -1,14 +1,22 @@ | |||||||
| <?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||||||
| <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||||||
|                                              xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" |         xmlns:app="http://schemas.android.com/apk/res-auto" | ||||||
|  |         android:layout_width="match_parent" | ||||||
|         android:layout_height="match_parent"> |         android:layout_height="match_parent"> | ||||||
|  |  | ||||||
|     <TextView |     <TextView | ||||||
|             android:layout_width="wrap_content" |             android:layout_width="wrap_content" | ||||||
|             android:layout_height="wrap_content" |             android:layout_height="wrap_content" | ||||||
|             android:id="@+id/grid_item_text" android:gravity="center" app:layout_constraintEnd_toEndOf="parent" |             android:id="@+id/grid_item_text" | ||||||
|             android:layout_marginEnd="8dp" android:layout_marginRight="8dp" |             android:gravity="center" | ||||||
|             app:layout_constraintStart_toStartOf="parent" android:layout_marginLeft="8dp" |             app:layout_constraintEnd_toEndOf="parent" | ||||||
|             android:layout_marginStart="8dp" android:layout_marginTop="8dp" app:layout_constraintTop_toTopOf="parent" |             android:layout_marginEnd="8dp" | ||||||
|             android:layout_marginBottom="8dp" app:layout_constraintBottom_toBottomOf="parent"/> |             android:layout_marginRight="8dp" | ||||||
| </android.support.constraint.ConstraintLayout> |             app:layout_constraintStart_toStartOf="parent" | ||||||
|  |             android:layout_marginLeft="8dp" | ||||||
|  |             android:layout_marginStart="8dp" | ||||||
|  |             android:layout_marginTop="8dp" | ||||||
|  |             app:layout_constraintTop_toTopOf="parent" | ||||||
|  |             android:layout_marginBottom="8dp" | ||||||
|  |             app:layout_constraintBottom_toBottomOf="parent" /> | ||||||
|  | </androidx.constraintlayout.widget.ConstraintLayout> | ||||||
| @ -12,8 +12,6 @@ | |||||||
|     <string name="iconCredits">Icônes par <a href="http://www.freepik.com" title="Freepik">Freepik</a> chez <a href="https://www.flaticon.com/" title="Flaticon">flaticon.com</a> Licence <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a></string> |     <string name="iconCredits">Icônes par <a href="http://www.freepik.com" title="Freepik">Freepik</a> chez <a href="https://www.flaticon.com/" title="Flaticon">flaticon.com</a> Licence <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a></string> | ||||||
|     <string name="TTS_unavailable">Désolé, votre appareil ne permet pas la synthèse vocale.</string> |     <string name="TTS_unavailable">Désolé, votre appareil ne permet pas la synthèse vocale.</string> | ||||||
|     <string name="STT_unavailable">Désolé, votre appareil ne permet pas la reconnaissance vocale.</string> |     <string name="STT_unavailable">Désolé, votre appareil ne permet pas la reconnaissance vocale.</string> | ||||||
|     <string name="OK">OK</string> |  | ||||||
|     <string name="cancel">Annuler</string> |  | ||||||
|     <string name="audio_record_permission_denied">La reconnaissance vocale a besoin de la permission d\'enregistrer des |     <string name="audio_record_permission_denied">La reconnaissance vocale a besoin de la permission d\'enregistrer des | ||||||
|         fichiers audio pour fonctionner. |         fichiers audio pour fonctionner. | ||||||
|     </string> |     </string> | ||||||
| @ -22,8 +20,6 @@ | |||||||
|     <string name="service_img_description">Service</string> |     <string name="service_img_description">Service</string> | ||||||
|     <string name="update_score_speech">"%d - %d. Service : %s. "</string> |     <string name="update_score_speech">"%d - %d. Service : %s. "</string> | ||||||
|     <string name="button_hint">Cliquez sur le joueur qui a marqué</string> |     <string name="button_hint">Cliquez sur le joueur qui a marqué</string> | ||||||
|     <string name="redo">Rétablir</string> |  | ||||||
|     <string name="undo">Annuler</string> |  | ||||||
|     <string name="congrats">Bravo %s !</string> |     <string name="congrats">Bravo %s !</string> | ||||||
|     <string name="previous_matches">Matchs précédents</string> |     <string name="previous_matches">Matchs précédents</string> | ||||||
|     <string name="new_match">Nouveau match</string> |     <string name="new_match">Nouveau match</string> | ||||||
| @ -33,7 +29,6 @@ | |||||||
|     <string name="share_message">"%s contre %s:\n%s a gagné par %d à %d\nPing Points est disponible sur Google Play"</string> |     <string name="share_message">"%s contre %s:\n%s a gagné par %d à %d\nPing Points est disponible sur Google Play"</string> | ||||||
|     <string name="match_point">Balle de match</string> |     <string name="match_point">Balle de match</string> | ||||||
|     <string name="STT_hint">Dîtes : \"Point pour %s\"\nou \"Point pour %s\"</string> |     <string name="STT_hint">Dîtes : \"Point pour %s\"\nou \"Point pour %s\"</string> | ||||||
|     <string name="pattern">point pour (.+)</string> |  | ||||||
|     <string name="not_understood">Pouvez-vous répéter ?</string> |     <string name="not_understood">Pouvez-vous répéter ?</string> | ||||||
|     <string name="STT_disabled">Reconnaissance vocale désactivée.</string> |     <string name="soundex">point pour %s</string> | ||||||
| </resources> | </resources> | ||||||
| @ -3,4 +3,5 @@ | |||||||
|     <color name="colorPrimary">#016df5</color> |     <color name="colorPrimary">#016df5</color> | ||||||
|     <color name="colorPrimaryDark">#004aa7</color> |     <color name="colorPrimaryDark">#004aa7</color> | ||||||
|     <color name="colorAccent">#0088ff</color> |     <color name="colorAccent">#0088ff</color> | ||||||
|  |     <color name="white">#ffffff</color> | ||||||
| </resources> | </resources> | ||||||
| @ -15,8 +15,6 @@ | |||||||
|     </string> |     </string> | ||||||
|     <string name="TTS_unavailable">Sorry, your device doesn\'t support text to speech.</string> |     <string name="TTS_unavailable">Sorry, your device doesn\'t support text to speech.</string> | ||||||
|     <string name="STT_unavailable">Sorry, your device doesn\'t support voice recognition.</string> |     <string name="STT_unavailable">Sorry, your device doesn\'t support voice recognition.</string> | ||||||
|     <string name="OK">OK</string> |  | ||||||
|     <string name="cancel">Cancel</string> |  | ||||||
|     <string name="audio_record_permission_denied">Audio recording permission required to use voice recognition.</string> |     <string name="audio_record_permission_denied">Audio recording permission required to use voice recognition.</string> | ||||||
|     <string name="service">Service: %s</string> |     <string name="service">Service: %s</string> | ||||||
|     <string name="score_score">Score: %d - %d</string> |     <string name="score_score">Score: %d - %d</string> | ||||||
| @ -26,8 +24,6 @@ | |||||||
|     </string> |     </string> | ||||||
|     <string name="update_score_speech">"%d - %d. Service: %s. "</string> |     <string name="update_score_speech">"%d - %d. Service: %s. "</string> | ||||||
|     <string name="button_hint">Click on the scoring player</string> |     <string name="button_hint">Click on the scoring player</string> | ||||||
|     <string name="undo">Undo</string> |  | ||||||
|     <string name="redo">Redo</string> |  | ||||||
|     <string name="congrats">Congratulations, %s!</string> |     <string name="congrats">Congratulations, %s!</string> | ||||||
|     <string name="previous_matches">Previous matches</string> |     <string name="previous_matches">Previous matches</string> | ||||||
|     <string name="new_match">New match</string> |     <string name="new_match">New match</string> | ||||||
| @ -38,8 +34,7 @@ | |||||||
|     <string name="share_message">%s vs. %s:\n%s won by %d to %d\nGet Ping Points on Google Play</string> |     <string name="share_message">%s vs. %s:\n%s won by %d to %d\nGet Ping Points on Google Play</string> | ||||||
|     <string name="match_point">Match point</string> |     <string name="match_point">Match point</string> | ||||||
|     <string name="STT_hint">Say: \"Point for %s\"\nor \"Point for %s\"</string> |     <string name="STT_hint">Say: \"Point for %s\"\nor \"Point for %s\"</string> | ||||||
|     <string name="pattern">point for (.+)</string> |     <string name="soundex">point for %s</string> | ||||||
|     <string name="not_understood">Can you repeat, please?</string> |     <string name="not_understood">Can you repeat, please?</string> | ||||||
|     <string name="score" translatable="false">%d - %d</string> |     <string name="score" translatable="false">%d - %d</string> | ||||||
|     <string name="STT_disabled">Voice recognition disabled.</string> |  | ||||||
| </resources> | </resources> | ||||||
|  | |||||||
| @ -1,17 +1,23 @@ | |||||||
| <resources> | <resources> | ||||||
|     <!-- the theme applied to the application or activity --> |     <!-- the theme applied to the application or activity --> | ||||||
|     <style name="PingPointsTheme" parent="Base.V22.Theme.AppCompat"> |     <style name="PingPointsTheme" parent="@style/Platform.MaterialComponents"> | ||||||
|  |         <item name="colorPrimary">@color/colorPrimary</item> | ||||||
|  |         <item name="colorPrimaryDark">@color/colorPrimaryDark</item> | ||||||
|  |         <item name="colorAccent">@color/colorAccent</item> | ||||||
|  |         <item name="colorControlNormal">#FFFFFF</item> | ||||||
|         <item name="android:actionBarStyle">@style/ColoredActionBarBackground</item> |         <item name="android:actionBarStyle">@style/ColoredActionBarBackground</item> | ||||||
|         <!-- Support library compatibility --> |         <!-- Support library compatibility --> | ||||||
|         <item name="actionBarStyle">@style/ColoredActionBarBackground</item> |         <item name="actionBarStyle">@style/ColoredActionBarBackground</item> | ||||||
|     </style> |     </style> | ||||||
|     <style name="ColoredActionBarBackground" |  | ||||||
|            parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse"> |     <style name="ColoredActionBarBackground" parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse"> | ||||||
|         <item name="android:background">@color/colorPrimaryDark</item> |         <item name="android:background">@color/colorPrimary</item> | ||||||
|         <!-- Support library compatibility --> |         <!-- Support library compatibility --> | ||||||
|         <item name="background">@color/colorPrimaryDark</item> |         <item name="background">@color/colorPrimary</item> | ||||||
|     </style> |     </style> | ||||||
|     <style name="ScoreButton"> |  | ||||||
|  |     <style name="ColoredButtonStyle" parent="Widget.AppCompat.Button.Colored"> | ||||||
|         <item name="colorButtonNormal">@color/colorAccent</item> |         <item name="colorButtonNormal">@color/colorAccent</item> | ||||||
|  |         <item name="android:textColor">@color/white</item> | ||||||
|     </style> |     </style> | ||||||
| </resources> | </resources> | ||||||
|  | |||||||
							
								
								
									
										4
									
								
								app/src/main/res/xml/backup_descriptor.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								app/src/main/res/xml/backup_descriptor.xml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,4 @@ | |||||||
|  | <?xml version="1.0" encoding="utf-8"?> | ||||||
|  | <full-backup-content> | ||||||
|  |     <!-- Exclude specific shared preferences that contain GCM registration Id --> | ||||||
|  | </full-backup-content> | ||||||
| @ -1,3 +1,4 @@ | |||||||
|  | <!--suppress XmlHighlighting --> | ||||||
| <vector android:autoMirrored="true" android:height="24dp" | <vector android:autoMirrored="true" android:height="24dp" | ||||||
|         android:viewportHeight="430.556" android:viewportWidth="430.556" |         android:viewportHeight="430.556" android:viewportWidth="430.556" | ||||||
|         android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> |         android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> | ||||||
|  | |||||||
| @ -1,13 +1,13 @@ | |||||||
| // Top-level build file where you can add configuration options common to all sub-projects/modules. | // Top-level build file where you can add configuration options common to all sub-projects/modules. | ||||||
|  |  | ||||||
| buildscript { | buildscript { | ||||||
|     ext.kotlin_version = '1.2.71' |     ext.kotlin_version = '1.4.0' | ||||||
|     repositories { |     repositories { | ||||||
|         google() |         google() | ||||||
|         jcenter() |         jcenter() | ||||||
|     } |     } | ||||||
|     dependencies { |     dependencies { | ||||||
|         classpath 'com.android.tools.build:gradle:3.2.1' |         classpath 'com.android.tools.build:gradle:4.0.1' | ||||||
|         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" |         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | ||||||
|  |  | ||||||
|         // NOTE: Do not place your application dependencies here; they belong |         // NOTE: Do not place your application dependencies here; they belong | ||||||
|  | |||||||
| @ -10,12 +10,11 @@ | |||||||
| # Specifies the JVM arguments used for the daemon process. | # Specifies the JVM arguments used for the daemon process. | ||||||
| # The setting is particularly useful for tweaking memory settings. | # The setting is particularly useful for tweaking memory settings. | ||||||
| org.gradle.jvmargs=-Xmx1536m | org.gradle.jvmargs=-Xmx1536m | ||||||
|  |  | ||||||
| # When configured, Gradle will run in incubating parallel mode. | # When configured, Gradle will run in incubating parallel mode. | ||||||
| # This option should only be used with decoupled projects. More details, visit | # This option should only be used with decoupled projects. More details, visit | ||||||
| # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects | ||||||
| # org.gradle.parallel=true | # org.gradle.parallel=true | ||||||
|  |  | ||||||
|  |  | ||||||
| # Kotlin code style for this project: "official" or "obsolete": | # Kotlin code style for this project: "official" or "obsolete": | ||||||
| kotlin.code.style=official | kotlin.code.style=official | ||||||
|  | android.useAndroidX=true | ||||||
|  | android.enableJetifier=true | ||||||
|  | |||||||
							
								
								
									
										3
									
								
								gradle/wrapper/gradle-wrapper.properties
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								gradle/wrapper/gradle-wrapper.properties
									
									
									
									
										vendored
									
									
								
							| @ -1,5 +1,6 @@ | |||||||
|  | #Tue Sep 08 21:52:23 CEST 2020 | ||||||
| distributionBase=GRADLE_USER_HOME | distributionBase=GRADLE_USER_HOME | ||||||
| distributionPath=wrapper/dists | distributionPath=wrapper/dists | ||||||
| distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip |  | ||||||
| zipStoreBase=GRADLE_USER_HOME | zipStoreBase=GRADLE_USER_HOME | ||||||
| zipStorePath=wrapper/dists | zipStorePath=wrapper/dists | ||||||
|  | distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-all.zip | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user