diff --git a/app/src/main/java/com/example/game2d/NameActivity.java b/app/src/main/java/com/example/game2d/NameActivity.java
index 7126b93707d63078a22bfab5c7cadc0b10f85901..feef863c708ed0f77f0bb2a0b4cb685ba68294bb 100644
--- a/app/src/main/java/com/example/game2d/NameActivity.java
+++ b/app/src/main/java/com/example/game2d/NameActivity.java
@@ -8,8 +8,13 @@ import android.content.SharedPreferences;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
+import android.view.Gravity;
+import android.view.LayoutInflater;
import android.view.View;
+import android.view.ViewGroup;
import android.widget.Button;
+import android.widget.PopupWindow;
+import android.widget.RelativeLayout;
import android.widget.TextView;
import android.os.Handler;
@@ -26,11 +31,19 @@ public class NameActivity extends AppCompatActivity implements View.OnClickListe
int currentQuestionIndex = 0;
String selectedAnswer = "";
+ //for pop up intro
+ RelativeLayout layout;
+
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_name);
+
+ //for pop up intro
+ layout = findViewById(R.id.nameActivity); // relative is the id of the layout of the page
+ CreatepopUpwindow();
+
totalQuestionsTextView = findViewById(R.id.total_question);
nameTextView = findViewById(R.id.names);
yes = findViewById(R.id.yes);
@@ -50,6 +63,32 @@ public class NameActivity extends AppCompatActivity implements View.OnClickListe
loadNewQuestion();
+ }
+
+ //for pop up window
+ private void CreatepopUpwindow() {
+ LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
+ View popUpView=inflater.inflate(R.layout.mainpopup,null);
+
+ int width = ViewGroup.LayoutParams.MATCH_PARENT;
+ int height= ViewGroup.LayoutParams.MATCH_PARENT;
+ boolean focusable = true;
+ PopupWindow popupWindow = new PopupWindow(popUpView, width,height,focusable);
+ layout.post(new Runnable() {
+ @Override
+ public void run() {
+ popupWindow.showAtLocation(layout, Gravity.BOTTOM,0,0);
+ }
+ });
+ TextView Continue;
+ Continue = popUpView.findViewById(R.id.Continue);
+ Continue.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ popupWindow.dismiss();
+ }
+ });
+
}
@Override
public void onClick(View view) {
diff --git a/app/src/main/java/com/example/game2d/mainpopup.java b/app/src/main/java/com/example/game2d/mainpopup.java
new file mode 100644
index 0000000000000000000000000000000000000000..4ca620d69a9650552bb39f8ac4bfbd584063949b
--- /dev/null
+++ b/app/src/main/java/com/example/game2d/mainpopup.java
@@ -0,0 +1,5 @@
+package com.example.game2d;
+
+public class mainpopup {
+}
+
diff --git a/app/src/main/res/drawable/buttonbg.xml b/app/src/main/res/drawable/buttonbg.xml
new file mode 100644
index 0000000000000000000000000000000000000000..09b38618b8919b1200810c2fa3ca879ba966e36c
--- /dev/null
+++ b/app/src/main/res/drawable/buttonbg.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/popupbg.xml b/app/src/main/res/drawable/popupbg.xml
new file mode 100644
index 0000000000000000000000000000000000000000..c604bea8c836ac2a7e10a1685cc496da8be51529
--- /dev/null
+++ b/app/src/main/res/drawable/popupbg.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_name.xml b/app/src/main/res/layout/activity_name.xml
index c937b10e10879ba18a6d70d6642aba9fc98c420b..27da7e9edba1a6bde22d15f1593359faa3fa67af 100644
--- a/app/src/main/res/layout/activity_name.xml
+++ b/app/src/main/res/layout/activity_name.xml
@@ -10,6 +10,7 @@
android:layout_height="match_parent"
android:background="@color/white_200"
android:padding="24dp"
+ android:id="@+id/nameActivity"
tools:context=".MainActivity">
diff --git a/app/src/main/res/layout/mainpopup.xml b/app/src/main/res/layout/mainpopup.xml
new file mode 100644
index 0000000000000000000000000000000000000000..4ec11b796737b9e355ba1a8faefaf366128349b3
--- /dev/null
+++ b/app/src/main/res/layout/mainpopup.xml
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/local.properties b/local.properties
index fff1b21e9ee523425fc8cf1b7a01b18b4f45c396..fc78f57915033656a4fc0c45fed4528ba7a9bb5d 100644
--- a/local.properties
+++ b/local.properties
@@ -4,5 +4,5 @@
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
-#Tue Apr 04 09:53:09 EDT 2023
-sdk.dir=/home/elena/Android/Sdk
+#Wed Apr 19 15:38:28 EDT 2023
+sdk.dir=/Users/joharper/Library/Android/sdk