diff --git a/.gitignore b/.gitignore index a0a668eb3c26531fe58f3282fe35eb796d1d93b0..effed228619b104704cdac55d86d1a82b94f0443 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ /KvizClient/.idea/vcs.xml /KvizServer/.idea/vcs.xml /KvizClient/.idea/misc.xml +/KvizClient/.idea/caches/build_file_checksums.ser +/KvizServer/.idea/codeStyles/Project.xml +/KvizServer/.idea/caches/build_file_checksums.ser +/KvizClient/.idea/codeStyles/Project.xml diff --git a/KvizClient/app/build.gradle b/KvizClient/app/build.gradle index 0ebe570a900d5d6d9819d13d91fe261714ce15bc..f6b278aa82cbac648188bdfa0c36c49efe711cc9 100644 --- a/KvizClient/app/build.gradle +++ b/KvizClient/app/build.gradle @@ -27,5 +27,5 @@ dependencies { testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.1' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' - compile 'com.google.code.gson:gson:2.8.2' + implementation 'com.google.code.gson:gson:2.8.2' } diff --git a/KvizClient/app/src/main/java/onlab/kvizclient/GameActivity.java b/KvizClient/app/src/main/java/onlab/kvizclient/GameActivity.java index 0f714833786cd58678964cf6cea9215077abf29e..e6528270b7a5bfd69bb3d3b65d8f224098dd3c4f 100644 --- a/KvizClient/app/src/main/java/onlab/kvizclient/GameActivity.java +++ b/KvizClient/app/src/main/java/onlab/kvizclient/GameActivity.java @@ -95,7 +95,7 @@ public class GameActivity extends AppCompatActivity implements MultipleChoiceFra @Override public void run() { String[] params = msg.split("##"); - if (params.length > 2) { + if (params.length > 1) { replaceFragment(params); } } @@ -117,6 +117,8 @@ public class GameActivity extends AppCompatActivity implements MultipleChoiceFra } else if (strings[0].equals("answerG")) { frag = AnsweredQuestionFragment.newInstance(strings[1], Integer.parseInt(strings[2]), strings[3], Integer.parseInt(strings[4])); + } else if (strings[0].equals("message")) { + frag = MessageFragment.newInstance(strings[1]); } fragmentTransaction.replace(R.id.FragmentContainer, frag); fragmentTransaction.commit(); diff --git a/KvizClient/app/src/main/res/layout/activity_game.xml b/KvizClient/app/src/main/res/layout/activity_game.xml index 2a42a64c5d7167977ca5014b7b4bd945e5f5fa4b..2f8fcd6d1708ad44d1f3664e0b2e94084db8cfbf 100644 --- a/KvizClient/app/src/main/res/layout/activity_game.xml +++ b/KvizClient/app/src/main/res/layout/activity_game.xml @@ -14,8 +14,7 @@ <TextView android:layout_width="match_parent" android:layout_height="wrap_content" - android:id="@+id/DisplayTextView" - android:text="Ez a TextView nem tartozik a fragmenthez"/> + android:id="@+id/DisplayTextView"/> <LinearLayout android:layout_width="match_parent" diff --git a/KvizClient/build.gradle b/KvizClient/build.gradle index 8d65c573cda63ff6eb3c3ed85a034ea3f50f65ef..abdaa8e4ac1ea3b27b98e280fc3e3ae82821f171 100644 --- a/KvizClient/build.gradle +++ b/KvizClient/build.gradle @@ -7,7 +7,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.0.1' + classpath 'com.android.tools.build:gradle:3.1.1' // NOTE: Do not place your application dependencies here; they belong diff --git a/KvizClient/gradle/wrapper/gradle-wrapper.properties b/KvizClient/gradle/wrapper/gradle-wrapper.properties index c4d06ffdcc76eeb72b656ce139ab790afdf233d0..661689da560b44bb6e77f44109f94b7dc8ca70c7 100644 --- a/KvizClient/gradle/wrapper/gradle-wrapper.properties +++ b/KvizClient/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Thu Feb 15 17:43:04 CET 2018 +#Mon Apr 23 18:29:22 CEST 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip diff --git a/KvizServer/app/build.gradle b/KvizServer/app/build.gradle index 39c79abfd670ec64b1f597783f214f5f49a4f3a5..73589aff7fea8c336c837c734af8c4366dcc263c 100644 --- a/KvizServer/app/build.gradle +++ b/KvizServer/app/build.gradle @@ -23,9 +23,10 @@ dependencies { implementation 'com.android.support:appcompat-v7:26.1.0' implementation 'com.android.support.constraint:constraint-layout:1.0.2' implementation 'com.android.support:design:26.1.0' + implementation 'com.android.support:support-v4:26.1.0' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.1' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' - compile 'com.github.rustamg:file-dialogs:1.0' - compile 'com.google.code.gson:gson:2.8.2' + implementation 'com.github.rustamg:file-dialogs:1.0' + implementation 'com.google.code.gson:gson:2.8.2' } diff --git a/KvizServer/app/src/main/java/onlab/kvizserver/GameActivity.java b/KvizServer/app/src/main/java/onlab/kvizserver/GameActivity.java index dc51a79234a90163c2a09cd16c075e64904ca514..291de44b9094d2067512b5b3796f399d6a7c7387 100644 --- a/KvizServer/app/src/main/java/onlab/kvizserver/GameActivity.java +++ b/KvizServer/app/src/main/java/onlab/kvizserver/GameActivity.java @@ -1,14 +1,11 @@ package onlab.kvizserver; +import android.app.FragmentManager; +import android.app.FragmentTransaction; import android.os.Handler; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; -import android.util.TypedValue; -import android.view.View; -import android.widget.Button; -import android.widget.LinearLayout; -import android.widget.TextView; import com.google.gson.Gson; @@ -22,39 +19,26 @@ import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; import onlab.kvizserver.model.PlayerAnswer; import onlab.kvizserver.model.Question; -public class GameActivity extends AppCompatActivity { +public class GameActivity extends AppCompatActivity implements GameControlFragment.OnFragmentInteractionListener { private List<Question> questions; - private int questionIndex = 0; - - private List<BufferedReader> inputs = new ArrayList<>(); - - private List<PrintWriter> outputs = new ArrayList<>(); - private int numberOfPlayers; - - private final List<TextView> playerAnswerTextViews = new ArrayList<>(); - private final List<String> answers = new ArrayList<>(); - private PlayerAnswer[] playerAnswers; - private int correctAnswer; - - private Handler updateConversationHandler; - private String questionString; - private TextView correctAnswerTextView; - + private List<BufferedReader> inputs = new ArrayList<>(); + private List<PrintWriter> outputs = new ArrayList<>(); + private Handler updateConversationHandler; private Gson gson; + private GameControlFragment gameControlFragment; @Override protected void onCreate(Bundle savedInstanceState) { @@ -67,6 +51,14 @@ public class GameActivity extends AppCompatActivity { updateConversationHandler = new Handler(); + numberOfPlayers = ClientHolder.size(); + + FragmentManager fm = getFragmentManager(); + FragmentTransaction fragmentTransaction = fm.beginTransaction(); + gameControlFragment = GameControlFragment.newInstance(numberOfPlayers); + fragmentTransaction.replace(R.id.RootLayout, gameControlFragment); + fragmentTransaction.commit(); + InputStream inputStream = null; try { if (questionFileName == null) { @@ -79,32 +71,6 @@ public class GameActivity extends AppCompatActivity { } questions = readQuestions(inputStream); - final Button nextQuestionBtn = (Button) findViewById(R.id.NextQuestion); - final Button correctAnswerButton = (Button) findViewById(R.id.CorrectAnswer); - final TextView questionText = (TextView) findViewById(R.id.QuestionText); - final List<TextView> answerTextViews = new ArrayList<>(); - answerTextViews.add((TextView) findViewById(R.id.Answer1TextView)); - answerTextViews.add((TextView) findViewById(R.id.Answer2TextView)); - answerTextViews.add((TextView) findViewById(R.id.Answer3TextView)); - answerTextViews.add((TextView) findViewById(R.id.Answer4TextView)); - correctAnswerTextView = (TextView) findViewById(R.id.CorrectAnswerTextView); - final LinearLayout playerAnswersLinearLayout = (LinearLayout) findViewById(R.id.PlayerAnswers); - - numberOfPlayers = ClientHolder.size(); - - playerAnswers = new PlayerAnswer[numberOfPlayers]; - for (int i=0;i<numberOfPlayers;i++) { - playerAnswers[i] = new PlayerAnswer(ClientHolder.get(i).getName()); - } - - for (int i=0;i<numberOfPlayers;i++) { - final TextView playerAnswerTextView = new TextView(this); - playerAnswerTextView.setText("The answer of " + playerAnswers[i].getPlayerName() + ": "); - playerAnswerTextView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 30); - playerAnswersLinearLayout.addView(playerAnswerTextView); - playerAnswerTextViews.add(playerAnswerTextView); - } - try { for (int i=0;i<ClientHolder.size();i++) { inputs.add(new BufferedReader(new InputStreamReader(ClientHolder.get(i).getClientsocket().getInputStream()))); @@ -118,86 +84,10 @@ public class GameActivity extends AppCompatActivity { e.printStackTrace(); } - nextQuestionBtn.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - if (questionIndex < questions.size()) { - Question question = questions.get(questionIndex); - questionString = question.getQuestionText(); - questionText.setText(questionString); - correctAnswerTextView.setText("Correct answer: " + question.getCorrectAnswer()); - - for (int i=0;i<numberOfPlayers;i++) { - playerAnswers[i].setValue(-1); - playerAnswers[i].setWinner(false); - } - - answers.clear(); - answers.addAll(question.getAnswers()); - for (int i=0;i<4;i++) { - if (question.getType() == Question.MULTIPLE_CHOICE) { - answerTextViews.get(i).setText(answers.get(i)); - } else { - answerTextViews.get(i).setText(""); - } - } - - String correct = question.getCorrectAnswer(); - if (question.getType() == Question.MULTIPLE_CHOICE) { - for (int i=0;i<4;i++) { - if (answers.get(i).equals(correct)) { - correctAnswer = i; - } - } - } else { - correctAnswer = Integer.parseInt(correct); - } - - String playerAnswersString = gson.toJson(playerAnswers); - for (int i=0;i<outputs.size();i++) { - playerAnswerTextViews.get(i).setText("The answer of " + playerAnswers[i].getPlayerName() + ": "); - if (question.getType() == Question.MULTIPLE_CHOICE) { - outputs.get(i).println("questionMC##" + questionString + "##" + answers.get(0) + "##" + answers.get(1) - + "##" + answers.get(2) + "##" + answers.get(3) + "##" + playerAnswersString - + "##" + Integer.toString(i) + "##-1"); - } else { - outputs.get(i).println("questionG##" + questionString + "##-1"); - } - } - questionIndex++; - } else { - questionText.setText("No more questions."); - for (int i=0;i<4;i++) { - answerTextViews.get(i).setText(""); - } - for (int i=0;i<numberOfPlayers;i++) { - playerAnswerTextViews.get(i).setText(""); - } - correctAnswerTextView.setText(""); - nextQuestionBtn.setEnabled(false); - correctAnswerButton.setEnabled(false); - } - } - }); - - correctAnswerButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - for (int i=0;i<outputs.size();i++) { - if (answers.size() == 4) { - String playerAnswersString = gson.toJson(playerAnswers); - outputs.get(i).println("answerMC##" + questionString + "##" + answers.get(0) + "##" + answers.get(1) - + "##" + answers.get(2) + "##" + answers.get(3) + "##" + playerAnswersString - + "##" + Integer.toString(i) + "##" + Integer.toString(correctAnswer)); - } else { - calculateGuessQuestionWinner(); - String playerAnswersString = gson.toJson(playerAnswers); - outputs.get(i).println("answerG##" + questionString + "##" + Integer.toString(correctAnswer) - + "##" + playerAnswersString + "##" + Integer.toString(i)); - } - } - } - }); + playerAnswers = new PlayerAnswer[numberOfPlayers]; + for (int i=0;i<numberOfPlayers;i++) { + playerAnswers[i] = new PlayerAnswer(ClientHolder.get(i).getName()); + } for (int i=0;i<numberOfPlayers;i++) { CommunicationThread commThread = new CommunicationThread(i); @@ -253,7 +143,8 @@ public class GameActivity extends AppCompatActivity { @Override public void run() { - playerAnswerTextViews.get(index).setText("The answer of " + playerAnswers[index].getPlayerName() + ": " + msg); + gameControlFragment.displayAnswerOfPlayer(index, + "The answer of " + playerAnswers[index].getPlayerName() + ": " + msg); } } @@ -289,4 +180,72 @@ public class GameActivity extends AppCompatActivity { playerAnswers[indexOfBestAnswer].setWinner(true); } + @Override + public void nextQuestionButtonClicked() { + if (questionIndex < questions.size()) { + Question question = questions.get(questionIndex); + questionString = question.getQuestionText(); + + for (int i=0;i<numberOfPlayers;i++) { + playerAnswers[i].setValue(-1); + playerAnswers[i].setWinner(false); + } + + answers.clear(); + answers.addAll(question.getAnswers()); + if (question.getType() == Question.MULTIPLE_CHOICE) { + gameControlFragment.displayMultipleChoiceQuestion( + questionString, answers, question.getCorrectAnswer()); + } else { + gameControlFragment.displayGuessQuestion(questionString, question.getCorrectAnswer()); + } + + String correct = question.getCorrectAnswer(); + if (question.getType() == Question.MULTIPLE_CHOICE) { + for (int i=0;i<4;i++) { + if (answers.get(i).equals(correct)) { + correctAnswer = i; + } + } + } else { + correctAnswer = Integer.parseInt(correct); + } + + String playerAnswersString = gson.toJson(playerAnswers); + for (int i=0;i<outputs.size();i++) { + gameControlFragment.displayAnswerOfPlayer(i,"The answer of " + playerAnswers[i].getPlayerName() + ": "); + if (question.getType() == Question.MULTIPLE_CHOICE) { + outputs.get(i).println("questionMC##" + questionString + "##" + answers.get(0) + "##" + answers.get(1) + + "##" + answers.get(2) + "##" + answers.get(3) + "##" + playerAnswersString + + "##" + Integer.toString(i) + "##-1"); + } else { + outputs.get(i).println("questionG##" + questionString + "##-1"); + } + } + questionIndex++; + } else { + gameControlFragment.displayEndOfGame(); + for (int i=0;i<outputs.size();i++) { + outputs.get(i).println("message##Játék vége"); + } + } + } + + @Override + public void correctAnswerButtonClicked() { + for (int i=0;i<outputs.size();i++) { + if (answers.size() == 4) { + String playerAnswersString = gson.toJson(playerAnswers); + outputs.get(i).println("answerMC##" + questionString + "##" + answers.get(0) + "##" + answers.get(1) + + "##" + answers.get(2) + "##" + answers.get(3) + "##" + playerAnswersString + + "##" + Integer.toString(i) + "##" + Integer.toString(correctAnswer)); + } else { + calculateGuessQuestionWinner(); + String playerAnswersString = gson.toJson(playerAnswers); + outputs.get(i).println("answerG##" + questionString + "##" + Integer.toString(correctAnswer) + + "##" + playerAnswersString + "##" + Integer.toString(i)); + } + } + } + } diff --git a/KvizServer/app/src/main/java/onlab/kvizserver/GameControlFragment.java b/KvizServer/app/src/main/java/onlab/kvizserver/GameControlFragment.java new file mode 100644 index 0000000000000000000000000000000000000000..26018d47af3cad7b3358eff217a2ec987715a60f --- /dev/null +++ b/KvizServer/app/src/main/java/onlab/kvizserver/GameControlFragment.java @@ -0,0 +1,154 @@ +package onlab.kvizserver; + +import android.app.Activity; +import android.app.Fragment; +import android.os.Bundle; +import android.support.annotation.Nullable; +import android.util.TypedValue; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.LinearLayout; +import android.widget.TextView; + +import java.util.ArrayList; +import java.util.List; + +public class GameControlFragment extends Fragment { + + private static final String NUMBER_OF_PLAYERS = "NUMBER_OF_PLAYERS"; + + private int numberOfPlayers; + + private OnFragmentInteractionListener mListener; + + private TextView correctAnswerTextView; + private final List<TextView> playerAnswerTextViews = new ArrayList<>(); + private TextView questionText; + private final List<TextView> answerTextViews = new ArrayList<>(); + private Button nextQuestionBtn; + private Button correctAnswerButton; + + public GameControlFragment() { + // Required empty public constructor + } + + public static GameControlFragment newInstance(int numberOfPlayers) { + GameControlFragment fragment = new GameControlFragment(); + Bundle args = new Bundle(); + args.putInt(NUMBER_OF_PLAYERS, numberOfPlayers); + fragment.setArguments(args); + return fragment; + } + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + if (getArguments() != null) { + numberOfPlayers = getArguments().getInt(NUMBER_OF_PLAYERS); + } + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_game_control, container, false); + } + + @Override + public void onActivityCreated(@Nullable Bundle savedInstanceState) { + super.onActivityCreated(savedInstanceState); + + nextQuestionBtn = (Button) getView().findViewById(R.id.NextQuestion); + correctAnswerButton = (Button) getView().findViewById(R.id.CorrectAnswer); + questionText = (TextView) getView().findViewById(R.id.QuestionText); + answerTextViews.add((TextView) getView().findViewById(R.id.Answer1TextView)); + answerTextViews.add((TextView) getView().findViewById(R.id.Answer2TextView)); + answerTextViews.add((TextView) getView().findViewById(R.id.Answer3TextView)); + answerTextViews.add((TextView) getView().findViewById(R.id.Answer4TextView)); + correctAnswerTextView = (TextView) getView().findViewById(R.id.CorrectAnswerTextView); + final LinearLayout playerAnswersLinearLayout = (LinearLayout) getView().findViewById(R.id.PlayerAnswers); + + for (int i=0;i<numberOfPlayers;i++) { + final TextView playerAnswerTextView = new TextView(getActivity()); + playerAnswerTextView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 30); + playerAnswersLinearLayout.addView(playerAnswerTextView); + playerAnswerTextViews.add(playerAnswerTextView); + } + + correctAnswerButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + mListener.correctAnswerButtonClicked(); + } + }); + + nextQuestionBtn.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + mListener.nextQuestionButtonClicked(); + } + }); + } + + public void displayMultipleChoiceQuestion(String questionTextString, List<String> answers, String correctAnswerString) { + questionText.setText(questionTextString); + correctAnswerTextView.setText(correctAnswerString); + for (int i=0;i<4;i++) { + answerTextViews.get(i).setVisibility(View.VISIBLE); + answerTextViews.get(i).setText(answers.get(i)); + } + } + + public void displayGuessQuestion(String questionTextString, String correctAnswerString) { + questionText.setText(questionTextString); + correctAnswerTextView.setText("Correct answer: " + correctAnswerString); + for (int i=0;i<4;i++) { + answerTextViews.get(i).setVisibility(View.GONE); + } + } + + public void displayEndOfGame() { + questionText.setText("No more questions."); + for (int i=0;i<4;i++) { + answerTextViews.get(i).setText(""); + } + for (int i=0;i<numberOfPlayers;i++) { + playerAnswerTextViews.get(i).setText(""); + } + correctAnswerTextView.setText(""); + nextQuestionBtn.setEnabled(false); + correctAnswerButton.setEnabled(false); + } + + public void displayAnswerOfPlayer(int index, String answer) { + playerAnswerTextViews.get(index).setText(answer); + } + + @Override + public void onAttach(Activity context) { + super.onAttach(context); + if (context instanceof OnFragmentInteractionListener) { + mListener = (OnFragmentInteractionListener) context; + } else { + throw new RuntimeException(context.toString() + + " must implement OnFragmentInteractionListener"); + } + } + + @Override + public void onDetach() { + super.onDetach(); + mListener = null; + } + + public interface OnFragmentInteractionListener { + + public void nextQuestionButtonClicked(); + + public void correctAnswerButtonClicked(); + + } +} diff --git a/KvizServer/app/src/main/res/layout/activity_game.xml b/KvizServer/app/src/main/res/layout/activity_game.xml index 3be72661c967744dac2d076051bf53df0da5db64..139d36f6f1310041edbe4cddd994e830c5c4d82b 100644 --- a/KvizServer/app/src/main/res/layout/activity_game.xml +++ b/KvizServer/app/src/main/res/layout/activity_game.xml @@ -9,65 +9,8 @@ <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" - android:orientation="vertical"> - - <TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:id="@+id/QuestionText" - android:textSize="30sp"/> - - <TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:id="@+id/Answer1TextView" - android:textSize="30sp"/> - - <TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:id="@+id/Answer2TextView" - android:textSize="30sp"/> - - <TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:id="@+id/Answer3TextView" - android:textSize="30sp"/> - - <TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:id="@+id/Answer4TextView" - android:textSize="30sp"/> - - <TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:id="@+id/CorrectAnswerTextView" - android:textSize="30sp"/> - - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="vertical" - android:id="@+id/PlayerAnswers"> - - </LinearLayout> - - <Button - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="Next Question" - android:id="@+id/NextQuestion" - android:textSize="20sp" /> - - <Button - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="Show correct answer to players" - android:id="@+id/CorrectAnswer" - android:textSize="20sp" /> + android:orientation="vertical" + android:id="@+id/RootLayout"> </LinearLayout> diff --git a/KvizServer/app/src/main/res/layout/fragment_game_control.xml b/KvizServer/app/src/main/res/layout/fragment_game_control.xml new file mode 100644 index 0000000000000000000000000000000000000000..d70c45cf873a2caa3ffcfc82e6eb79e5633fe8bf --- /dev/null +++ b/KvizServer/app/src/main/res/layout/fragment_game_control.xml @@ -0,0 +1,73 @@ +<?xml version="1.0" encoding="utf-8"?> +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".GameControlFragment"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:id="@+id/QuestionText" + android:textSize="30sp"/> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:id="@+id/Answer1TextView" + android:textSize="30sp"/> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:id="@+id/Answer2TextView" + android:textSize="30sp"/> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:id="@+id/Answer3TextView" + android:textSize="30sp"/> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:id="@+id/Answer4TextView" + android:textSize="30sp"/> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:id="@+id/CorrectAnswerTextView" + android:textSize="30sp"/> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:id="@+id/PlayerAnswers"> + + </LinearLayout> + + <Button + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Next Question" + android:id="@+id/NextQuestion" + android:textSize="20sp" /> + + <Button + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Show correct answer to players" + android:id="@+id/CorrectAnswer" + android:textSize="20sp" /> + + </LinearLayout> + +</FrameLayout> \ No newline at end of file diff --git a/KvizServer/app/src/main/res/values/strings.xml b/KvizServer/app/src/main/res/values/strings.xml index 4a8d73b84dd532027da2c2763f2edb3b1e92cbda..1f7660e1586c89cfc926c1f784777433903926d5 100644 --- a/KvizServer/app/src/main/res/values/strings.xml +++ b/KvizServer/app/src/main/res/values/strings.xml @@ -1,4 +1,7 @@ <resources> <string name="app_name">KvizServer</string> <string name="title_activity_lobby">LobbyActivity</string> + + <!-- TODO: Remove or change this placeholder text --> + <string name="hello_blank_fragment">Hello blank fragment</string> </resources> diff --git a/KvizServer/build.gradle b/KvizServer/build.gradle index 8d65c573cda63ff6eb3c3ed85a034ea3f50f65ef..abdaa8e4ac1ea3b27b98e280fc3e3ae82821f171 100644 --- a/KvizServer/build.gradle +++ b/KvizServer/build.gradle @@ -7,7 +7,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.0.1' + classpath 'com.android.tools.build:gradle:3.1.1' // NOTE: Do not place your application dependencies here; they belong diff --git a/KvizServer/gradle/wrapper/gradle-wrapper.properties b/KvizServer/gradle/wrapper/gradle-wrapper.properties index 85b0e7cdc45e46f0d3c33e3ead03ac1ac71709bf..3210d4767276865144e267a1bf7d110d05241769 100644 --- a/KvizServer/gradle/wrapper/gradle-wrapper.properties +++ b/KvizServer/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Thu Feb 15 17:41:34 CET 2018 +#Mon Apr 23 18:27:25 CEST 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip