Skip to content
This repository was archived by the owner on Oct 12, 2025. It is now read-only.

Commit 686a69f

Browse files
committed
fixed navbar not scaling with android buttons, countdown timer, and also home screen info/icons
1 parent 8ae2e5e commit 686a69f

File tree

7 files changed

+43
-17
lines changed

7 files changed

+43
-17
lines changed

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ android {
2424
applicationId "org.hackillinois.android"
2525
minSdkVersion 23
2626
targetSdkVersion 34
27-
versionCode 66
28-
versionName "2025.01.1"
27+
versionCode 67
28+
versionName "2025.01.2"
2929
multiDexEnabled true
3030
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
3131
vectorDrawables.useSupportLibrary = true

app/src/main/java/org/hackillinois/android/view/MainActivity.kt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,13 @@ import android.util.Log
77
import android.widget.ImageButton
88
import android.widget.Toast
99
import androidx.appcompat.app.AppCompatActivity
10+
import androidx.coordinatorlayout.widget.CoordinatorLayout
1011
import androidx.core.content.ContextCompat
12+
import androidx.core.view.ViewCompat
1113
import androidx.core.view.WindowCompat
14+
import androidx.core.view.WindowInsetsCompat
15+
import androidx.core.view.updateLayoutParams
16+
import androidx.core.view.updatePadding
1217
import androidx.fragment.app.Fragment
1318
import androidx.fragment.app.FragmentTransaction
1419
import androidx.lifecycle.ViewModelProvider
@@ -39,9 +44,28 @@ class MainActivity : AppCompatActivity() {
3944

4045
override fun onCreate(savedInstanceState: Bundle?) {
4146
super.onCreate(savedInstanceState)
47+
4248
WindowCompat.setDecorFitsSystemWindows(window, false)
4349
setContentView(R.layout.activity_main)
4450

51+
ViewCompat.setOnApplyWindowInsetsListener(bottomAppBar) { view, insets ->
52+
val systemBarsInsets = insets.getInsets(WindowInsetsCompat.Type.systemBars())
53+
// Convert 16dp to pixels (you can change this value as needed)
54+
val extraMargin = (0 * resources.displayMetrics.density).toInt()
55+
view.updateLayoutParams<CoordinatorLayout.LayoutParams> {
56+
bottomMargin = systemBarsInsets.bottom + extraMargin
57+
}
58+
insets
59+
}
60+
61+
ViewCompat.setOnApplyWindowInsetsListener(contentFrame) { view, insets ->
62+
val systemBarsInsets = insets.getInsets(WindowInsetsCompat.Type.systemBars())
63+
// Your BottomAppBar has a fixed height of 72dp.
64+
val bottomAppBarHeightPx = (36 * resources.displayMetrics.density).toInt()
65+
view.updatePadding(bottom = bottomAppBarHeightPx + systemBarsInsets.bottom)
66+
insets
67+
}
68+
4569
setupBottomAppBar()
4670
setupScannerButton()
4771

app/src/main/java/org/hackillinois/android/view/home/CountdownManager.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ import java.util.*
77

88
class CountdownManager(val listener: CountDownListener) {
99

10-
// 02-23-2024 15:30:00
10+
// 02-28-2025 : 14:30
1111
private val eventStartTime: Calendar = Calendar.getInstance().apply {
1212
timeZone = TimeZone.getTimeZone("America/Chicago")
13-
timeInMillis = 1740722400000 // 1708723800000
13+
timeInMillis = 1740774600000 // 1708723800000
1414
}
1515

16-
// 02-23-2024 19:00:00
16+
// 02-28-2025 : 18:00
1717
private val hackingStartTime: Calendar = Calendar.getInstance().apply {
1818
timeZone = TimeZone.getTimeZone("America/Chicago")
19-
timeInMillis = 1708736400000
19+
timeInMillis = 1740787200000
2020
}
2121

22-
// 02-25-2024 7:00:00
22+
// 03-02-2025 11:30
2323
private val hackingEndTime: Calendar = Calendar.getInstance().apply {
2424
timeZone = TimeZone.getTimeZone("America/Chicago")
25-
timeInMillis = 1708866000000
25+
timeInMillis = 1740936600000
2626
}
2727

2828
private var times = listOf(eventStartTime, hackingStartTime, hackingEndTime)

app/src/main/java/org/hackillinois/android/view/home/HomeFragment.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,21 @@ class HomeFragment : Fragment(), CountdownManager.CountDownListener, EventProgre
6262
super.onStart()
6363
isActive = true
6464
countDownManager.start()
65-
// eventProgressManager.start()
65+
eventProgressManager.start()
6666
}
6767

6868
override fun onPause() {
6969
super.onPause()
7070
isActive = false
7171
countDownManager.onPause()
72-
// eventProgressManager.onPause()
72+
eventProgressManager.onPause()
7373
}
7474

7575
override fun onResume() {
7676
super.onResume()
7777
isActive = true
7878
countDownManager.onResume()
79-
// eventProgressManager.onResume()
79+
eventProgressManager.onResume()
8080
}
8181

8282
override fun onStop() {
@@ -102,7 +102,7 @@ class HomeFragment : Fragment(), CountdownManager.CountDownListener, EventProgre
102102

103103
override fun updateBackground(newBackgroundResource: Int) {
104104
if (isActive) {
105-
// homeBackgroundImageView.setImageResource(newBackgroundResource)
105+
homeBackgroundImageView.setImageResource(newBackgroundResource)
106106
}
107107
}
108108

11.6 KB
Loading

app/src/main/res/layout/activity_main.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
xmlns:android="http://schemas.android.com/apk/res/android"
44
xmlns:app="http://schemas.android.com/apk/res-auto"
55
android:layout_width="match_parent"
6-
android:layout_height="match_parent"
7-
android:paddingBottom="16dp">
6+
android:layout_height="match_parent">
87

98
<!-- Main Content -->
109
<androidx.fragment.app.FragmentContainerView
@@ -132,4 +131,7 @@
132131
app:fabCustomSize="60dp"
133132
app:srcCompat="@drawable/camera_png" />
134133

134+
<!-- android:layout_alignParentBottom="true"-->
135+
<!-- android:layout_alignParentEnd="true"-->
136+
135137
</androidx.coordinatorlayout.widget.CoordinatorLayout>

app/src/main/res/layout/fragment_home_2025.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
android:id="@+id/home_layout"
66
android:layout_width="match_parent"
77
android:layout_height="match_parent"
8-
android:background="@color/witchyPurple">
8+
android:background="@color/cream">
99

1010

1111
<!-- <ImageView-->
@@ -48,8 +48,8 @@
4848
android:layout_marginHorizontal="0dp"
4949
android:layout_marginTop="0dp"
5050
android:adjustViewBounds="false"
51-
android:scaleType="centerInside"
52-
android:src="@drawable/home_tags_svg_flipped"
51+
android:scaleType="fitXY"
52+
android:src="@drawable/home_tags"
5353
android:visibility="invisible"
5454
app:layout_constraintLeft_toLeftOf="parent"
5555
app:layout_constraintRight_toRightOf="parent" />

0 commit comments

Comments
 (0)