IanTDuncan / MealTime

Project for CSC 480
0 stars 0 forks source link

Replace Login Page with Splash Screen #162

Closed Cade5480 closed 3 months ago

Cade5480 commented 3 months ago

Replace Login page with a Splash Screen


Description:

Take the Main Activity and replace the login logic with the logic for a splash screen in order to give the user something to look at other than a login or registration.

Steps to Reproduce:

Open app and voila

Expected vs. Actual Behavior:

App opens and plays splash screen and loads to main menu

Code Snippets:

`package com.example.mealtime1

import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.os.Handler
import android.widget.VideoView
import androidx.activity.ComponentActivity
import androidx.activity.enableEdgeToEdge
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat

class SplashActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_splash)

        val videoView = findViewById<VideoView>(R.id.Splash)
        val videoPath = "android.resource://"+ packageName + "/" + R.raw.splash

        val videoUri = Uri.parse(videoPath)
        videoView.setVideoURI(videoUri)
        videoView.start()

        videoView.setOnCompletionListener {
            val intent = Intent(this, MainMenuActivity::class.java)
            startActivity(intent)
            finish()
        }
    }
}`

Environment Details:

Android Studio IDE Adobe XD for Splash Screen

For Issue Resolution:

N/A

For Investigations/Research:

I have done research and I will be using Canvas for the creation of the splash screen

Current Status:

Done

bdshanks-28 commented 3 months ago

I need to create that page. I'll get it done by Wednesday but I don't have a splash-art to throw on it for now so it might just be some words and a button saying "Get started!"

Cade5480 commented 3 months ago

Splash Screen Ready to be pulled

bdshanks-28 commented 3 months ago

Good to close issue then?