Add Starter Name Dialog, minor UI changes
This commit is contained in:
		
							
								
								
									
										
											BIN
										
									
								
								.idea/caches/build_file_checksums.ser
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.idea/caches/build_file_checksums.ser
									
									
									
										generated
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							| @ -8,9 +8,10 @@ | |||||||
|         android:label="@string/app_name" |         android:label="@string/app_name" | ||||||
|         android:roundIcon="@mipmap/ic_launcher_round" |         android:roundIcon="@mipmap/ic_launcher_round" | ||||||
|         android:supportsRtl="true" |         android:supportsRtl="true" | ||||||
|         android:theme="@style/Theme.AppCompat"> |         android:theme="@style/PingPoints"> | ||||||
|         <activity android:name=".MainActivity" |         <activity android:name=".MainActivity" | ||||||
|             android:screenOrientation="sensorLandscape"> |             android:screenOrientation="sensorLandscape" | ||||||
|  |             android:theme="@style/PingPoints"> | ||||||
|             <intent-filter> |             <intent-filter> | ||||||
|                 <action android:name="android.intent.action.MAIN"/> |                 <action android:name="android.intent.action.MAIN"/> | ||||||
|  |  | ||||||
|  | |||||||
| @ -11,22 +11,54 @@ import android.support.v4.app.DialogFragment | |||||||
| class EndOfMatchDialog: DialogFragment() { | class EndOfMatchDialog: DialogFragment() { | ||||||
|     override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { |     override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | ||||||
|         val builder = AlertDialog.Builder(activity) |         val builder = AlertDialog.Builder(activity) | ||||||
|  |         val player1Name = arguments?.getString("PLAYER_1_NAME") | ||||||
|  |         val player2Name = arguments?.getString("PLAYER_2_NAME") | ||||||
|         val winnerName = arguments?.getString("WINNER_NAME") |         val winnerName = arguments?.getString("WINNER_NAME") | ||||||
|         val winnerScore = arguments?.getInt("WINNER_SCORE") |         val winnerScore = arguments?.getInt("WINNER_SCORE") | ||||||
|         val loserScore = arguments?.getInt("LOSER_SCORE") |         val loserScore = arguments?.getInt("LOSER_SCORE") | ||||||
|  |  | ||||||
|         builder.setTitle(getString(R.string.end_match_dialog_title, winnerName)) |         builder.setTitle(getString(R.string.end_match_dialog_title, winnerName)) | ||||||
|                 .setMessage(getString(R.string.score, winnerScore, loserScore)) |                 .setMessage(getString(R.string.score, winnerScore, loserScore)) | ||||||
|                 .setPositiveButton( |                 .setPositiveButton( | ||||||
|                         R.string.new_match_button, |                         R.string.new_match, | ||||||
|                         DialogInterface.OnClickListener { |                         DialogInterface.OnClickListener {dialog, id -> | ||||||
|                             dialog, id -> startActivity(Intent(context, MainActivity::class.java)) |                             startActivity(Intent(context, MainActivity::class.java)) | ||||||
|                             activity?.finish() |                             activity?.finish() | ||||||
|                         } |                         } | ||||||
|                 ) |                 ) | ||||||
|  |                 .setNeutralButton( | ||||||
|  |                         R.string.share_button, | ||||||
|  |                         DialogInterface.OnClickListener { dialog, id -> | ||||||
|  |                                 val sendIntent: Intent = Intent().apply { | ||||||
|  |                                 action = Intent.ACTION_SEND | ||||||
|  |                                 putExtra( | ||||||
|  |                                         Intent.EXTRA_SUBJECT, | ||||||
|  |                                         getString( | ||||||
|  |                                                 R.string.share_subject, | ||||||
|  |                                                 player1Name, | ||||||
|  |                                                 player2Name | ||||||
|  |                                         ) | ||||||
|  |                                 ) | ||||||
|  |                                 putExtra( | ||||||
|  |                                         Intent.EXTRA_TEXT, | ||||||
|  |                                         getString( | ||||||
|  |                                                 R.string.share_message, | ||||||
|  |                                                 player1Name, | ||||||
|  |                                                 player2Name, | ||||||
|  |                                                 winnerName, | ||||||
|  |                                                 winnerScore, | ||||||
|  |                                                 loserScore | ||||||
|  |                                         ) | ||||||
|  |                                 ) | ||||||
|  |                                 type = "text/plain" | ||||||
|  |                             } | ||||||
|  |                             startActivity(sendIntent) | ||||||
|  |                         } | ||||||
|  |                 ) | ||||||
|                 .setNegativeButton( |                 .setNegativeButton( | ||||||
|                         R.string.quit_button, |                         R.string.quit_button, | ||||||
|                         DialogInterface.OnClickListener { |                         DialogInterface.OnClickListener { dialog, id -> | ||||||
|                             dialog, id -> activity?.finish() |                             activity?.finish() | ||||||
|                         } |                         } | ||||||
|                 ) |                 ) | ||||||
|  |  | ||||||
|  | |||||||
| @ -11,6 +11,8 @@ import android.text.Spanned | |||||||
| import android.text.TextUtils.join | import android.text.TextUtils.join | ||||||
| import kotlin.math.abs | import kotlin.math.abs | ||||||
| import android.support.design.widget.Snackbar | import android.support.design.widget.Snackbar | ||||||
|  | import android.support.v4.app.DialogFragment | ||||||
|  | import android.widget.Toast | ||||||
|  |  | ||||||
|  |  | ||||||
| @SuppressWarnings("deprecation") | @SuppressWarnings("deprecation") | ||||||
| @ -24,7 +26,7 @@ fun fromHtml(html: String): Spanned { | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| class MainActivity : AppCompatActivity() { | class MainActivity : AppCompatActivity(), StarterNameDialog.StarterNameDialogListener{ | ||||||
|     var players: Array<Player> = arrayOf( |     var players: Array<Player> = arrayOf( | ||||||
|             Player(), |             Player(), | ||||||
|             Player() |             Player() | ||||||
| @ -34,9 +36,7 @@ class MainActivity : AppCompatActivity() { | |||||||
|  |  | ||||||
|  |  | ||||||
|     var textScore: android.widget.TextView? = null |     var textScore: android.widget.TextView? = null | ||||||
|     var stringScore:String = "" |  | ||||||
|     var textService: android.widget.TextView? = null |     var textService: android.widget.TextView? = null | ||||||
|     var stringService:String = "" |  | ||||||
|     var buttons: Array<Button> = emptyArray() |     var buttons: Array<Button> = emptyArray() | ||||||
|  |  | ||||||
|  |  | ||||||
| @ -45,12 +45,12 @@ class MainActivity : AppCompatActivity() { | |||||||
|         setContentView(R.layout.activity_main) |         setContentView(R.layout.activity_main) | ||||||
|  |  | ||||||
|         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) { |         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) { | ||||||
|             setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE); |             requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         val names: Array<String> = resources.getStringArray(R.array.players_names) |         val defaultNames: Array<String> = resources.getStringArray(R.array.players_names) | ||||||
|         for ((player, name) in players.zip(names)) { |         for ((player, defaultName) in players.zip(defaultNames)) { | ||||||
|             player.name = name |             player.name = defaultName | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         textScore = findViewById(R.id.textScore) |         textScore = findViewById(R.id.textScore) | ||||||
| @ -60,12 +60,33 @@ class MainActivity : AppCompatActivity() { | |||||||
|                 findViewById(R.id.buttonPlayer2) |                 findViewById(R.id.buttonPlayer2) | ||||||
|         ) |         ) | ||||||
|  |  | ||||||
|  |         openStarterNameDialog() | ||||||
|  |  | ||||||
|         update_ui() |         update_ui() | ||||||
|  |  | ||||||
|         Snackbar.make(findViewById(R.layout.activity_main), R.string.info, Snackbar.LENGTH_LONG) |         Toast.makeText(applicationContext, R.string.info, Snackbar.LENGTH_LONG) | ||||||
|                 .show() |                 .show() | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     fun openStarterNameDialog() { | ||||||
|  |         val (loser, winner) = players.sortedBy { it.score } | ||||||
|  |         var starterNameDialog: EndOfMatchDialog = EndOfMatchDialog() | ||||||
|  |         starterNameDialog.arguments = Bundle() | ||||||
|  |         starterNameDialog.arguments?.putString("PLAYER_1_NAME", players[0].name) | ||||||
|  |         starterNameDialog.arguments?.putString("PLAYER_2_NAME", players[1].name) | ||||||
|  |         starterNameDialog.show( | ||||||
|  |                 supportFragmentManager, | ||||||
|  |                 join(" ", arrayOf(winner.name, winner.score.toString(), "-", loser.name, loser.score.toString())) | ||||||
|  |         ) | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     override fun onStaterNameDialogPositiveClick(dialog: DialogFragment) { | ||||||
|  |         val inputPlayer1Name: android.widget.EditText? = findViewById(R.id.input_player_1_name) | ||||||
|  |         players[0].name = inputPlayer1Name?.text.toString() | ||||||
|  |         val inputPlayer2Name: android.widget.EditText? = findViewById(R.id.input_player_2_name) | ||||||
|  |         players[1].name = inputPlayer2Name?.text.toString() | ||||||
|  |     } | ||||||
|  |  | ||||||
|     fun update_ui() { |     fun update_ui() { | ||||||
|  |  | ||||||
|         textScore?.text = getString(R.string.score, players[server].score, players[notServer].score) |         textScore?.text = getString(R.string.score, players[server].score, players[notServer].score) | ||||||
| @ -86,39 +107,40 @@ class MainActivity : AppCompatActivity() { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     fun onClickPlayer1(view: View) { |     fun onClickPlayer1(view: View) { | ||||||
|         updateScore(0) |         updateScore(players[0]) | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     fun onClickPlayer2(view: View) { |     fun onClickPlayer2(view: View) { | ||||||
|         updateScore(1) |         updateScore(players[1]) | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     fun updateScore(scoringPlayerId: Int) { |     fun finishedMatch() = ( | ||||||
|         players[scoringPlayerId].score++ |             (players.map { it -> it.score } .max() ?: 0 >= 11) or | ||||||
|  |             (abs(players[0].score - players[1].score) >= 2) | ||||||
|  |     ) | ||||||
|  |  | ||||||
|         if ( |     fun updateScore(scoringPlayer: Player) { | ||||||
|                 (players.map { it -> it.score } .max() ?: 0 < 11) or |         if ( !finishedMatch() ) { | ||||||
|                 (abs(players[0].score - players[1].score) < 2) |             scoringPlayer.score++ | ||||||
|         ) { |  | ||||||
|             if (players.sumBy { it.score } % 2 == 0) { |             if (players.sumBy { it.score } % 2 == 0) { | ||||||
|                 server = notServer.also { notServer = server } |                 server = notServer.also { notServer = server } | ||||||
|             } |             } | ||||||
|  |         } | ||||||
|  |         if ( finishedMatch() ) { | ||||||
|  |             openEndOfMatchDialog() | ||||||
|  |         } | ||||||
|         update_ui() |         update_ui() | ||||||
|         } else { |  | ||||||
|             endOfMatch() |  | ||||||
|         } |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     fun endOfMatch() { |     fun openEndOfMatchDialog() { | ||||||
|         val (loser, winner) = players.sortedBy { it.score } |  | ||||||
|         var endOfMatchDialog: EndOfMatchDialog = EndOfMatchDialog() |         var endOfMatchDialog: EndOfMatchDialog = EndOfMatchDialog() | ||||||
|  |         val (loser, winner) = players.sortedBy { it.score } | ||||||
|         val bundle = Bundle() |         endOfMatchDialog.arguments = Bundle() | ||||||
|         bundle.putString("WINNER_NAME", winner.name) |         endOfMatchDialog.arguments?.putString("PLAYER_1_NAME", players[0].name) | ||||||
|         bundle.putInt("WINNER_SCORE", winner.score) |         endOfMatchDialog.arguments?.putString("PLAYER_2_NAME", players[1].name) | ||||||
|         bundle.putInt("LOSER_SCORE", loser.score) |         endOfMatchDialog.arguments?.putString("WINNER_NAME", winner.name) | ||||||
|  |         endOfMatchDialog.arguments?.putInt("WINNER_SCORE", winner.score) | ||||||
|         endOfMatchDialog.arguments = bundle |         endOfMatchDialog.arguments?.putInt("LOSER_SCORE", loser.score) | ||||||
|         endOfMatchDialog.show( |         endOfMatchDialog.show( | ||||||
|                 supportFragmentManager, |                 supportFragmentManager, | ||||||
|                 join(" ", arrayOf(winner.name, winner.score.toString(), "-", loser.name, loser.score.toString())) |                 join(" ", arrayOf(winner.name, winner.score.toString(), "-", loser.name, loser.score.toString())) | ||||||
|  | |||||||
| @ -1,26 +1,56 @@ | |||||||
| package adrienmalin.pingpoints | package adrienmalin.pingpoints | ||||||
|  |  | ||||||
| import android.os.Bundle |  | ||||||
| import android.support.v4.app.DialogFragment |  | ||||||
| import android.app.AlertDialog | import android.app.AlertDialog | ||||||
| import android.app.Dialog | import android.app.Dialog | ||||||
| import android.content.DialogInterface | import android.os.Bundle | ||||||
|  | import android.support.v4.app.DialogFragment | ||||||
|  |  | ||||||
|  | import java.util.ArrayList | ||||||
|  | import android.app.Activity | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class StarterNameDialog : DialogFragment() { | class StarterNameDialog : DialogFragment() { | ||||||
|  |     interface StarterNameDialogListener { | ||||||
|  |         fun onStaterNameDialogPositiveClick(dialog: DialogFragment) | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     var listener: StarterNameDialogListener? = null | ||||||
|  |  | ||||||
|  |     override fun onAttach(activity: Activity?) { | ||||||
|  |         super.onAttach(activity) | ||||||
|  |         try { | ||||||
|  |             listener = activity as StarterNameDialogListener? | ||||||
|  |         } catch (e: ClassCastException) { | ||||||
|  |             throw ClassCastException(activity!!.toString() + " must implement StarterNameDialogListener") | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|     override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { |     override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | ||||||
|         // Use the Builder class for convenient dialog construction |         val inputPlayer1Name: android.widget.EditText? = findViewById(R.id.input_player_1_name) | ||||||
|  |         val player1Name = arguments?.getString("PLAYER_1_NAME") | ||||||
|  |         inputPlayer1Name?.setText(player1Name, TextView.BufferType.EDITABLE) | ||||||
|  |  | ||||||
|  |         val inputPlayer2Name: android.widget.EditText? = findViewById(R.id.input_player_2_name) | ||||||
|  |         val player2Name = arguments?.getString("PLAYER_2_NAME") | ||||||
|  |         inputPlayer2Name?.setText(player2Name, TextView.BufferType.EDITABLE) | ||||||
|  |  | ||||||
|         val builder = AlertDialog.Builder(activity) |         val builder = AlertDialog.Builder(activity) | ||||||
|         builder.setTitle(R.string.dialog_title) |         // Set the dialog title | ||||||
|                 .setMessage(R.string.dialog_message) |         builder.setTitle(R.string.new_match) | ||||||
|                 .setPositiveButton(R.string.go, DialogInterface.OnClickListener { dialog, id -> |                 // Specify the list array, the items to be selected by default (null for none), | ||||||
|                     // FIRE ZE MISSILES! |                 // and the listener through which to receive callbacks when items are selected | ||||||
|                 }) |                 .setMultiChoiceItems(0, null) | ||||||
|                 .setNegativeButton(R.string.quit, DialogInterface.OnClickListener { dialog, id -> |                 .setPositiveButton(R.string.go_button) { dialog, id -> | ||||||
|                     // User cancelled the dialog |                     // User clicked OK, so save the mSelectedItems results somewhere | ||||||
|                 }) |                     // or return them to the component that opened the dialog | ||||||
|                 .setView(R.layout.dialog) |                     //... | ||||||
|         // Create the AlertDialog object and return it |                 } | ||||||
|  |                 .setNegativeButton(R.string.quit_button) { dialog, id -> | ||||||
|  |                     activity?.finish() | ||||||
|  |                 } | ||||||
|  |  | ||||||
|         return builder.create() |         return builder.create() | ||||||
|     } |     } | ||||||
| } | } | ||||||
							
								
								
									
										44
									
								
								app/src/main/java/adrienmalin/pingpoints/test.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								app/src/main/java/adrienmalin/pingpoints/test.java
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,44 @@ | |||||||
|  | package adrienmalin.pingpoints; | ||||||
|  |  | ||||||
|  | public class test { | ||||||
|  |     @Override | ||||||
|  |     public Dialog onCreateDialog(Bundle savedInstanceState) { | ||||||
|  |         mSelectedItems = new ArrayList();  // Where we track the selected items | ||||||
|  |         AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); | ||||||
|  |         // Set the dialog title | ||||||
|  |         builder.setTitle(R.string.pick_toppings) | ||||||
|  |                 // Specify the list array, the items to be selected by default (null for none), | ||||||
|  |                 // and the listener through which to receive callbacks when items are selected | ||||||
|  |                 .setMultiChoiceItems(R.array.toppings, null, | ||||||
|  |                         new DialogInterface.OnMultiChoiceClickListener() { | ||||||
|  |                             @Override | ||||||
|  |                             public void onClick(DialogInterface dialog, int which, | ||||||
|  |                                                 boolean isChecked) { | ||||||
|  |                                 if (isChecked) { | ||||||
|  |                                     // If the user checked the item, add it to the selected items | ||||||
|  |                                     mSelectedItems.add(which); | ||||||
|  |                                 } else if (mSelectedItems.contains(which)) { | ||||||
|  |                                     // Else, if the item is already in the array, remove it | ||||||
|  |                                     mSelectedItems.remove(Integer.valueOf(which)); | ||||||
|  |                                 } | ||||||
|  |                             } | ||||||
|  |                         }) | ||||||
|  |                 // Set the action buttons | ||||||
|  |                 .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { | ||||||
|  |                     @Override | ||||||
|  |                     public void onClick(DialogInterface dialog, int id) { | ||||||
|  |                         // User clicked OK, so save the mSelectedItems results somewhere | ||||||
|  |                         // or return them to the component that opened the dialog | ||||||
|  |                        ... | ||||||
|  |                     } | ||||||
|  |                 }) | ||||||
|  |                 .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { | ||||||
|  |                     @Override | ||||||
|  |                     public void onClick(DialogInterface dialog, int id) { | ||||||
|  |                        ... | ||||||
|  |                     } | ||||||
|  |                 }); | ||||||
|  |  | ||||||
|  |         return builder.create(); | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -21,20 +21,6 @@ | |||||||
|             app:layout_constraintStart_toStartOf="parent" |             app:layout_constraintStart_toStartOf="parent" | ||||||
|             app:layout_constraintTop_toTopOf="parent"> |             app:layout_constraintTop_toTopOf="parent"> | ||||||
|  |  | ||||||
|             <TextView |  | ||||||
|                 android:id="@+id/textScore" |  | ||||||
|                 android:layout_width="match_parent" |  | ||||||
|                 android:layout_height="wrap_content" |  | ||||||
|                 android:layout_marginLeft="8dp" |  | ||||||
|                 android:layout_marginStart="8dp" |  | ||||||
|                 android:layout_weight="1" |  | ||||||
|                 android:paddingLeft="16dp" |  | ||||||
|                 android:paddingRight="16dp" |  | ||||||
|                 android:text="@string/score" |  | ||||||
|                 android:textAppearance="@style/TextAppearance.AppCompat.Large" |  | ||||||
|                 app:layout_constraintStart_toStartOf="parent" |  | ||||||
|                 app:layout_constraintTop_toTopOf="parent" /> |  | ||||||
|  |  | ||||||
|             <TextView |             <TextView | ||||||
|                 android:id="@+id/textService" |                 android:id="@+id/textService" | ||||||
|                 android:layout_width="match_parent" |                 android:layout_width="match_parent" | ||||||
| @ -51,6 +37,20 @@ | |||||||
|                 app:layout_constraintHorizontal_bias="1.0" |                 app:layout_constraintHorizontal_bias="1.0" | ||||||
|                 app:layout_constraintStart_toEndOf="@+id/textScore" |                 app:layout_constraintStart_toEndOf="@+id/textScore" | ||||||
|                 app:layout_constraintTop_toTopOf="parent" /> |                 app:layout_constraintTop_toTopOf="parent" /> | ||||||
|  |  | ||||||
|  |             <TextView | ||||||
|  |                 android:id="@+id/textScore" | ||||||
|  |                 android:layout_width="match_parent" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:layout_marginLeft="8dp" | ||||||
|  |                 android:layout_marginStart="8dp" | ||||||
|  |                 android:layout_weight="1" | ||||||
|  |                 android:paddingLeft="16dp" | ||||||
|  |                 android:paddingRight="16dp" | ||||||
|  |                 android:text="@string/score" | ||||||
|  |                 android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||||||
|  |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|  |                 app:layout_constraintTop_toTopOf="parent" /> | ||||||
|         </LinearLayout> |         </LinearLayout> | ||||||
|  |  | ||||||
|         <LinearLayout |         <LinearLayout | ||||||
| @ -71,7 +71,7 @@ | |||||||
|  |  | ||||||
|             <Button |             <Button | ||||||
|                 android:id="@+id/buttonPlayer1" |                 android:id="@+id/buttonPlayer1" | ||||||
|                 style="@style/Widget.AppCompat.Button.Colored" |                 style="@style/Base.Widget.AppCompat.Button.Colored" | ||||||
|                 android:layout_width="match_parent" |                 android:layout_width="match_parent" | ||||||
|                 android:layout_height="match_parent" |                 android:layout_height="match_parent" | ||||||
|                 android:layout_marginBottom="8dp" |                 android:layout_marginBottom="8dp" | ||||||
| @ -91,7 +91,8 @@ | |||||||
|                 app:layout_constraintEnd_toStartOf="@+id/buttonPlayer2" |                 app:layout_constraintEnd_toStartOf="@+id/buttonPlayer2" | ||||||
|                 app:layout_constraintHorizontal_chainStyle="spread_inside" |                 app:layout_constraintHorizontal_chainStyle="spread_inside" | ||||||
|                 app:layout_constraintStart_toStartOf="parent" |                 app:layout_constraintStart_toStartOf="parent" | ||||||
|                 app:layout_constraintTop_toBottomOf="@+id/textService" /> |                 app:layout_constraintTop_toBottomOf="@+id/textService" | ||||||
|  |                 tools:text="@string/button_text" /> | ||||||
|  |  | ||||||
|             <Button |             <Button | ||||||
|                 android:id="@+id/buttonPlayer2" |                 android:id="@+id/buttonPlayer2" | ||||||
| @ -114,7 +115,8 @@ | |||||||
|                 app:layout_constraintBottom_toTopOf="@+id/textScore" |                 app:layout_constraintBottom_toTopOf="@+id/textScore" | ||||||
|                 app:layout_constraintEnd_toEndOf="parent" |                 app:layout_constraintEnd_toEndOf="parent" | ||||||
|                 app:layout_constraintStart_toEndOf="@+id/buttonPlayer1" |                 app:layout_constraintStart_toEndOf="@+id/buttonPlayer1" | ||||||
|                 app:layout_constraintTop_toBottomOf="@+id/textService" /> |                 app:layout_constraintTop_toBottomOf="@+id/textService" | ||||||
|  |                 tools:text="@string/button_text" /> | ||||||
|         </LinearLayout> |         </LinearLayout> | ||||||
|  |  | ||||||
| </android.support.constraint.ConstraintLayout> | </android.support.constraint.ConstraintLayout> | ||||||
| @ -2,7 +2,7 @@ | |||||||
| <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||||||
|     xmlns:tools="http://schemas.android.com/tools" |     xmlns:tools="http://schemas.android.com/tools" | ||||||
|     android:layout_width="match_parent" |     android:layout_width="match_parent" | ||||||
|     android:layout_height="match_parent" |     android:layout_height="wrap_content" | ||||||
|     tools:context=".NomsJoueursEtPremierServeurDialog"> |     tools:context=".NomsJoueursEtPremierServeurDialog"> | ||||||
| 
 | 
 | ||||||
|     <!-- TODO: Update blank fragment layout --> |     <!-- TODO: Update blank fragment layout --> | ||||||
| @ -14,10 +14,9 @@ | |||||||
| 
 | 
 | ||||||
|         <RadioButton |         <RadioButton | ||||||
|             android:id="@+id/radioButtonJoueur1" |             android:id="@+id/radioButtonJoueur1" | ||||||
|             android:layout_width="match_parent" |             android:layout_width="wrap_content" | ||||||
|             android:layout_height="match_parent" |             android:layout_height="match_parent" | ||||||
|             android:layout_weight="1" |             android:layout_weight="1" /> | ||||||
|             android:text="RadioButton" /> |  | ||||||
| 
 | 
 | ||||||
|         <android.support.design.widget.TextInputLayout |         <android.support.design.widget.TextInputLayout | ||||||
|             android:layout_width="match_parent" |             android:layout_width="match_parent" | ||||||
| @ -25,18 +24,17 @@ | |||||||
|             android:layout_weight="1"> |             android:layout_weight="1"> | ||||||
| 
 | 
 | ||||||
|             <android.support.design.widget.TextInputEditText |             <android.support.design.widget.TextInputEditText | ||||||
|                 android:id="@+id/InputJoueur1" |                 android:id="@+id/input_player_1_name" | ||||||
|                 android:layout_width="match_parent" |                 android:layout_width="match_parent" | ||||||
|                 android:layout_height="wrap_content" |                 android:layout_height="wrap_content" | ||||||
|                 android:hint="hint" /> |                 android:hint="@string/name" /> | ||||||
|         </android.support.design.widget.TextInputLayout> |         </android.support.design.widget.TextInputLayout> | ||||||
| 
 | 
 | ||||||
|         <RadioButton |         <RadioButton | ||||||
|             android:id="@+id/radioButton2" |             android:id="@+id/radioButton2" | ||||||
|             android:layout_width="match_parent" |             android:layout_width="wrap_content" | ||||||
|             android:layout_height="match_parent" |             android:layout_height="match_parent" | ||||||
|             android:layout_weight="1" |             android:layout_weight="1" /> | ||||||
|             android:text="RadioButton" /> |  | ||||||
| 
 | 
 | ||||||
|         <android.support.design.widget.TextInputLayout |         <android.support.design.widget.TextInputLayout | ||||||
|             android:layout_width="match_parent" |             android:layout_width="match_parent" | ||||||
| @ -44,10 +42,10 @@ | |||||||
|             android:layout_weight="1"> |             android:layout_weight="1"> | ||||||
| 
 | 
 | ||||||
|             <android.support.design.widget.TextInputEditText |             <android.support.design.widget.TextInputEditText | ||||||
|                 android:id="@+id/InputJoueur2" |                 android:id="@+id/input_player_2_name" | ||||||
|                 android:layout_width="match_parent" |                 android:layout_width="match_parent" | ||||||
|                 android:layout_height="wrap_content" |                 android:layout_height="wrap_content" | ||||||
|                 android:hint="hint" /> |                 android:hint="@string/name" /> | ||||||
|         </android.support.design.widget.TextInputLayout> |         </android.support.design.widget.TextInputLayout> | ||||||
|     </RadioGroup> |     </RadioGroup> | ||||||
| </FrameLayout> | </FrameLayout> | ||||||
| @ -1,18 +1,20 @@ | |||||||
| <?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||||||
| <resources> | <resources> | ||||||
|     <string name="app_name">Ping Points</string> |     <string name="app_name">Ping Points</string> | ||||||
|     <string name="go">Allons-y !</string> |  | ||||||
|     <string name="dialog_title">Nouvelle partie</string> |  | ||||||
|     <string name="dialog_message">Qui commence ?</string> |  | ||||||
|     <string name="info">Cliquez sur le joueur qui a marqué</string> |     <string name="info">Cliquez sur le joueur qui a marqué</string> | ||||||
|     <string name="service">Service : %1s</string> |     <string name="service">Service : %1s</string> | ||||||
|     <string name="score">Score : %1d - %2d</string> |     <string name="score">Score : %1d - %2d</string> | ||||||
|     <string name="quit">Quitter</string> |  | ||||||
|     <string-array name="players_names"> |     <string-array name="players_names"> | ||||||
|         <item>Joueur 1</item> |         <item>Joueur 1</item> | ||||||
|         <item>Joueur 2</item> |         <item>Joueur 2</item> | ||||||
|     </string-array> |     </string-array> | ||||||
|     <string name="end_match_dialog_title">Bravo %1s !</string> |     <string name="end_match_dialog_title">Bravo %1s !</string> | ||||||
|     <string name="new_match_button">Nouvelle partie</string> |     <string name="new_match">Nouveau match</string> | ||||||
|     <string name="quit_button">Quitter</string> |     <string name="quit_button">Quitter</string> | ||||||
|  |     <string name="name">Nom</string> | ||||||
|  |     <string name="go_button">Allons-y !</string> | ||||||
|  |     <string name="starter_name_dialog_message">Qui commence ?</string> | ||||||
|  |     <string name="share_button">Partager</string> | ||||||
|  |     <string name="share_subject">Match Ping Points : %1s contre %2s</string> | ||||||
|  |     <string name="share_message">%1s vs. %2s\\nVainqueur : %3s\\nScore : %4d - %5d\\n\\n--\\nArbitré avec l\'application gratuite Ping Points disponible sur Google Play</string> | ||||||
| </resources> | </resources> | ||||||
| @ -1,6 +1,6 @@ | |||||||
| <?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||||||
| <resources> | <resources> | ||||||
|     <color name="colorPrimary">#3f51b5</color> |     <color name="colorPrimary">#4caf50</color> | ||||||
|     <color name="colorPrimaryDark">#303F9F</color> |     <color name="colorPrimaryDark">#009688</color> | ||||||
|     <color name="colorAccent">#FF4081</color> |     <color name="colorAccent">#69f0ae</color> | ||||||
| </resources> | </resources> | ||||||
| @ -1,18 +1,20 @@ | |||||||
| <resources> | <resources> | ||||||
|     <string name="app_name">Ping Points</string> |     <string name="app_name">Ping Points</string> | ||||||
|     <string name="go">Play</string> |     <string name="go_button">Play</string> | ||||||
|     <string name="quit">Quit</string> |     <string name="starter_name_dialog_message">Who starts?</string> | ||||||
|     <string name="dialog_title">New match</string> |  | ||||||
|     <string name="dialog_message">Who starts?</string> |  | ||||||
|     <string name="info">Click on the scoring player</string> |     <string name="info">Click on the scoring player</string> | ||||||
|     <string name="service">Service: %1s</string> |     <string name="service">Service: %1s</string> | ||||||
|     <string name="score">Score: %1d - %2d</string> |     <string name="score">Score: %1d - %2d</string> | ||||||
|     <string name="button_text" translatable="false">%1s <br /> <big> <big> %2d </big> </big></string> |     <string name="button_text" translatable="false">%1s <br /> <br /> <big> <big> %2d </big> </big></string> | ||||||
|     <string name="end_match_dialog_title">Congratulations, %1s!</string> |     <string name="end_match_dialog_title">Congratulations, %1s!</string> | ||||||
|     <string-array name="players_names"> |     <string-array name="players_names"> | ||||||
|         <item>Player 1</item> |         <item>Player 1</item> | ||||||
|         <item>Player 2</item> |         <item>Player 2</item> | ||||||
|     </string-array> |     </string-array> | ||||||
|     <string name="new_match_button">New match</string> |     <string name="new_match">New match</string> | ||||||
|     <string name="quit_button">Quit</string> |     <string name="quit_button">Quit</string> | ||||||
|  |     <string name="name">Name</string> | ||||||
|  |     <string name="share_button">Share</string> | ||||||
|  |     <string name="share_subject">Ping Points Match: %1s vs. %2s</string> | ||||||
|  |     <string name="share_message">%1s vs. %2s\\nWinner: %3s\\nScore: %4d - %5d\\n\\n--\\nRefereed with Ping Points free Android app on Google Play</string> | ||||||
| </resources> | </resources> | ||||||
|  | |||||||
| @ -1,7 +1,7 @@ | |||||||
| <resources> | <resources> | ||||||
|  |  | ||||||
|     <!-- Base application theme. --> |     <!-- Base application theme. --> | ||||||
|     <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> |     <style name="PingPoints" parent="Theme.AppCompat"> | ||||||
|         <!-- Customize your theme here. --> |         <!-- Customize your theme here. --> | ||||||
|         <item name="colorPrimary">@color/colorPrimary</item> |         <item name="colorPrimary">@color/colorPrimary</item> | ||||||
|         <item name="colorPrimaryDark">@color/colorPrimaryDark</item> |         <item name="colorPrimaryDark">@color/colorPrimaryDark</item> | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user