Commit 708bb507 authored by Krish Shah's avatar Krish Shah
Browse files

Removed the MainActivity page top bar, added sprite images, added app logo to...

Removed the MainActivity page top bar, added sprite images, added app logo to MainActivity page, replaced text play button with image play button, created short comments in activity_main
parent 85f8eac9
Loading
Loading
Loading
Loading
(6 KiB)

File changed.

No diff preview for this file type.

(6 KiB)

File changed.

No diff preview for this file type.

(6 KiB)

File changed.

No diff preview for this file type.

+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@
        <!--Locks the orientation of main activity to only allow portrait mode-->
        <activity
            android:name=".GameActivity"
            android:theme="@style/Theme.Design.NoActionBar"
            android:theme="@style/Theme.AppCompat.NoActionBar"
            android:configChanges="orientation"
            android:screenOrientation="portrait"/>
        <activity
+13 −0
Original line number Diff line number Diff line
@@ -5,14 +5,27 @@ import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_main);

        // the if statement below hides the action bar
        // https://www.geeksforgeeks.org/different-ways-to-hide-action-bar-in-android-with-examples/
        if (getSupportActionBar() != null) {
            getSupportActionBar().hide();
        }

        // initalizes 8-bit Invaders Logo

        ImageView myImageView = (ImageView) findViewById(R.id.image_logo);
        myImageView.setImageResource(R.drawable.logobit);

        // Creates new Intent and starts GameActivity if 'play' is pressed on MainActivity screen.
        findViewById(R.id.play_button).setOnClickListener(new View.OnClickListener() {
            @Override
Loading