Commit 3f1a8274 authored by P P's avatar P P
Browse files

Added pop up introduction to ChalkActivity, add landscape to chalk activity in manifest.

parent 0c5e78df
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -16,7 +16,8 @@
            android:exported="false" />
        <activity
            android:name=".ChalkActivity"
            android:exported="false" />
            android:exported="false"
            android:screenOrientation="landscape"/>
        <activity
            android:name=".MainActivity"
            android:exported="true"
+36 −0
Original line number Diff line number Diff line
@@ -5,8 +5,13 @@ import androidx.appcompat.app.AppCompatActivity;
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;

public class ChalkActivity extends AppCompatActivity implements View.OnClickListener{
@@ -22,11 +27,17 @@ public class ChalkActivity extends AppCompatActivity implements View.OnClickList
    int currentQuestionIndex = 0;
    String selectedAnswer = "";

    //for pop up intro
    RelativeLayout layout;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_chalk);

        //for pop up intro
        layout = findViewById(R.id.chalkActivity); // relative is the id of the layout of the page
        CreatepopUpwindow();

        /*totalQuestionsTextView = findViewById(R.id.total_question);*/
        questionTextView = findViewById(R.id.question);
        ansA = findViewById(R.id.ans_A);
@@ -49,6 +60,31 @@ public class ChalkActivity extends AppCompatActivity implements View.OnClickList

    }

    //for pop up intro
    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) {

+7 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:app="http://schemas.android.com/apk/res-auto"
        app:fontProviderAuthority="com.google.android.gms.fonts"
        app:fontProviderPackage="com.google.android.gms"
        app:fontProviderQuery="ABeeZee"
        app:fontProviderCerts="@array/com_google_android_gms_fonts_certs">
</font-family>
+7 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:app="http://schemas.android.com/apk/res-auto"
        app:fontProviderAuthority="com.google.android.gms.fonts"
        app:fontProviderPackage="com.google.android.gms"
        app:fontProviderQuery="Alfa Slab One"
        app:fontProviderCerts="@array/com_google_android_gms_fonts_certs">
</font-family>
+1 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@
    android:orientation="horizontal"
    android:padding="24dp"
    android:screenOrientation="landscape"
    android:id="@+id/chalkActivity"

    tools:context=".MainActivity">

Loading