Skip to content

Commit

Permalink
Updated Splash Screen, Login Screen, and Scanner Screen along with Ho…
Browse files Browse the repository at this point in the history
…me Page changes
  • Loading branch information
AdityaK2905 committed Feb 13, 2025
1 parent 29dd16b commit b089f98
Show file tree
Hide file tree
Showing 21 changed files with 454 additions and 65 deletions.
1 change: 1 addition & 0 deletions app/src/main/assets/swirling_oracle.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import android.os.Build
import android.os.Bundle
import android.util.Log
import android.view.View
import android.widget.ImageView
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
Expand All @@ -36,6 +37,7 @@ class SplashScreenActivity : AppCompatActivity() {
private var needsToUpdate = false
private var hasInternet = true
private var hasClickedOrAnimFinish = false
private lateinit var splashBackground : ImageView

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import java.util.*
class EventProgressManager(val listener: CountDownListener) {

// CORRECT TIMES ARE NOT SET YET
// 02-23-2024 15:30:00
// 02-28-2025 :00:00
private val checkInTime: Calendar = Calendar.getInstance().apply {
timeZone = TimeZone.getTimeZone("America/Chicago")
timeInMillis = 1708723800000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import androidx.lifecycle.ViewModelProvider
import org.hackillinois.android.R
import org.hackillinois.android.common.TimeInfo
import org.hackillinois.android.viewmodel.HomeViewModel
import androidx.core.view.WindowCompat

class HomeFragment : Fragment(), CountdownManager.CountDownListener, EventProgressManager.CountDownListener {

Expand All @@ -30,7 +31,6 @@ class HomeFragment : Fragment(), CountdownManager.CountDownListener, EventProgre

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

viewModel = ViewModelProvider(this).get(HomeViewModel::class.java)
}

Expand All @@ -42,19 +42,19 @@ class HomeFragment : Fragment(), CountdownManager.CountDownListener, EventProgre
minutesValue = view.findViewById(R.id.minutesValue)
countdownTextView = view.findViewById(R.id.countdownTextView)
homeBackgroundImageView = view.findViewById(R.id.homeBackgroundImageView)
// homeBackgroundTagsImageView = view.findViewById(R.id.homeBackgroundTagsImageView)
homeBackgroundTagsImageView = view.findViewById(R.id.homeBackgroundTagsImageView)
infoButton = view.findViewById(R.id.homeInfoImageView)
//
// set info button's functionality to toggle tag descriptions on home page when pressed on/off
// infoButton.setOnClickListener {
// if (homeBackgroundTagsImageView.visibility == View.INVISIBLE) {
// homeBackgroundTagsImageView.visibility = View.VISIBLE
// infoButton.setImageResource(R.drawable.question_mark_toggled)
// } else {
// homeBackgroundTagsImageView.visibility = View.INVISIBLE
// infoButton.setImageResource(R.drawable.question_mark)
// }
// }
infoButton.setOnClickListener {
if (homeBackgroundTagsImageView.visibility == View.INVISIBLE) {
homeBackgroundTagsImageView.visibility = View.VISIBLE
infoButton.setImageResource(R.drawable.question_mark_toggled)
} else {
homeBackgroundTagsImageView.visibility = View.INVISIBLE
infoButton.setImageResource(R.drawable.question_mark)
}
}

return view
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package org.hackillinois.android.view.scanner.buttons

import android.content.Context
import android.util.AttributeSet
import android.view.MotionEvent
import org.hackillinois.android.R

class BurntBrownAnimatedButton : androidx.appcompat.widget.AppCompatButton {
constructor(context: Context?) : super(context!!) {}
constructor(context: Context?, attrs: AttributeSet?) : super(context!!, attrs) {}
constructor(context: Context?, attrs: AttributeSet?, defStyle: Int) : super(context!!, attrs, defStyle) {
}

override fun onTouchEvent(event: MotionEvent?): Boolean {
if (event != null) {
val scale = resources.displayMetrics.density
val dpAsPixels20 = (20 * scale + 0.5f).toInt()
val dpAsPixels30 = (30 * scale + 0.5f).toInt()
if (event.action == MotionEvent.ACTION_DOWN) {
setPadding(0, dpAsPixels30, 0, dpAsPixels20)
setBackgroundResource(R.drawable.burntbrown_scanner_button_pressed)
} else if (event.action == MotionEvent.ACTION_UP || event.action == MotionEvent.ACTION_CANCEL) {
setPadding(0, dpAsPixels20, 0, dpAsPixels30)
setBackgroundResource(R.drawable.burntbrown_scanner_button)
}
}
return super.onTouchEvent(event)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ class PinkAnimatedButton : androidx.appcompat.widget.AppCompatButton {
val dpAsPixels30 = (30 * scale + 0.5f).toInt()
if (event.action == MotionEvent.ACTION_DOWN) {
setPadding(0, dpAsPixels30, 0, dpAsPixels20)
setBackgroundResource(R.drawable.moderateOrange_scanner_button_pressed)
setBackgroundResource(R.drawable.moderateorange_scanner_button_pressed)
} else if (event.action == MotionEvent.ACTION_UP || event.action == MotionEvent.ACTION_CANCEL) {
setPadding(0, dpAsPixels20, 0, dpAsPixels30)
setBackgroundResource(R.drawable.moderateOrange_scanner_button)
setBackgroundResource(R.drawable.moderateorange_scanner_button)
}
}
return super.onTouchEvent(event)
Expand Down
26 changes: 26 additions & 0 deletions app/src/main/res/drawable/burntbrown_scanner_button.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

<!-- Bottom Shadow -->
<item>
<shape android:shape="rectangle">
<solid android:color="@color/burntBrownBorder" />
<corners android:radius="20dp" />
</shape>
</item>

<!-- Button Color -->
<item android:bottom="8dp">
<shape android:shape="rectangle">
<stroke android:color="@color/burntBrownBorder" android:width="4dp" />

<solid android:color="@color/burntBrown" />
<corners android:radius="15dp" />


</shape>

</item>


</layer-list>
17 changes: 17 additions & 0 deletions app/src/main/res/drawable/burntbrown_scanner_button_pressed.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

<!-- Button Color -->
<item android:top="8dp">
<shape android:shape="rectangle">
<stroke android:color="@color/burntBrownBorder" android:width="4dp" />
<solid android:color="@color/burntBrown" />
<corners android:radius="15dp" />


</shape>

</item>


</layer-list>
Loading

0 comments on commit b089f98

Please sign in to comment.