Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ dependencies {
implementation(libs.play.services.location)
implementation(libs.androidx.recyclerview)
implementation(libs.androidx.media3.ui)
implementation(libs.firebase.database.ktx)
val room_version = "2.6.1"
val lifecycle_version = "2.8.1"
val mediaVersion = "1.3.1"
Expand Down
106 changes: 0 additions & 106 deletions app/src/androidTest/java/com/example/trainhub/PostFireBaseModelTest.kt

This file was deleted.

124 changes: 0 additions & 124 deletions app/src/androidTest/java/com/example/trainhub/UserFirebaseModelTest.kt

This file was deleted.

4 changes: 1 addition & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,13 @@
tools:targetApi="34">
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_api_key" />
android:value="${GOOGLE_API_KEY}" />
<activity
android:name=".MainActivity"
android:exported="true"
android:theme="@style/Theme.TrainHub">

<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Expand Down
33 changes: 3 additions & 30 deletions app/src/main/java/com/example/trainhub/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import com.example.trainhub.fragments.LocationFragment
import com.example.trainhub.fragments.ProfileFragment
import com.google.android.material.bottomnavigation.BottomNavigationView


class MainActivity : AppCompatActivity() {
private var navController: NavController? = null
private val homeFragment = HomeFragment()
Expand All @@ -35,7 +34,6 @@ class MainActivity : AppCompatActivity() {
}



bottomNavigationView?.setOnItemSelectedListener {
when(it.itemId){
R.id.icHome -> replaceFragment(homeFragment)
Expand All @@ -44,6 +42,7 @@ class MainActivity : AppCompatActivity() {
R.id.icLocation -> replaceFragment(locationFragment)
R.id.icProfile -> replaceFragment(profileFragment)
}

true
}

Expand All @@ -57,42 +56,16 @@ class MainActivity : AppCompatActivity() {
}
}

bottomNavigationView?.setOnItemSelectedListener { item ->
when (item.itemId) {

R.id.icHome -> {

navController?.navigate(R.id.homeFragment)
true
}
R.id.icDiscover -> {

navController?.navigate(R.id.discoverFragment)
true
}
R.id.icAddPost -> {
navController?.navigate(R.id.addPostFragment)
true
}
R.id.icLocation -> {
navController?.navigate(R.id.locationFragment)
true
}
R.id.icProfile -> {
navController?.navigate(R.id.profileFragment)
true
}
else -> false

}
}

}

fun moveToHome(){
bottomNavigationView?.selectedItemId = R.id.icHome
replaceFragment(homeFragment)
}


fun replaceFragment(fragment: Fragment){
if(fragment!=null){
val transaction = supportFragmentManager.beginTransaction()
Expand Down
Loading