Small changes
This commit is contained in:
parent
777b9c4749
commit
f53ed7653f
@ -2,23 +2,26 @@ package com.example.wikispot.activities
|
|||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.Window
|
import androidx.appcompat.app.AlertDialog
|
||||||
import android.view.WindowManager
|
|
||||||
import androidx.navigation.findNavController
|
import androidx.navigation.findNavController
|
||||||
import androidx.navigation.ui.setupWithNavController
|
import androidx.navigation.ui.setupWithNavController
|
||||||
import com.example.wikispot.R
|
import com.example.wikispot.R
|
||||||
import com.example.wikispot.databinding.ActivityMainBinding
|
|
||||||
import com.google.android.material.bottomnavigation.BottomNavigationView
|
import com.google.android.material.bottomnavigation.BottomNavigationView
|
||||||
|
|
||||||
class MainActivity : AppCompatActivity() {
|
class MainActivity : AppCompatActivity() {
|
||||||
|
|
||||||
//private lateinit var binding: ActivityMainBinding
|
override fun onBackPressed() {
|
||||||
|
val builder = AlertDialog.Builder(this)
|
||||||
|
builder.setTitle("Confirm")
|
||||||
|
builder.setMessage("Do you want to quit the application?")
|
||||||
|
builder.setPositiveButton("Yes") {_, _ -> finish()}
|
||||||
|
builder.setNegativeButton("No") {_, _ -> }
|
||||||
|
builder.show()
|
||||||
|
}
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(R.layout.activity_main)
|
setContentView(R.layout.activity_main)
|
||||||
//binding = ActivityMainBinding.inflate(layoutInflater)
|
|
||||||
//setContentView(binding.root)
|
|
||||||
|
|
||||||
val navController = findNavController(R.id.mainFragmentHost)
|
val navController = findNavController(R.id.mainFragmentHost)
|
||||||
val bottomNavView = findViewById<BottomNavigationView>(R.id.mainBottomNavigationView)
|
val bottomNavView = findViewById<BottomNavigationView>(R.id.mainBottomNavigationView)
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/main_activity_navigation"
|
android:id="@+id/main_activity_navigation"
|
||||||
app:startDestination="@id/chatFragment">
|
app:startDestination="@id/homeFragment">
|
||||||
|
|
||||||
<fragment
|
<fragment
|
||||||
android:id="@+id/chatFragment"
|
android:id="@+id/chatFragment"
|
||||||
@ -14,7 +14,7 @@
|
|||||||
android:id="@+id/exploreFragment"
|
android:id="@+id/exploreFragment"
|
||||||
android:name="com.example.wikispot.fragments.exploreFragment"
|
android:name="com.example.wikispot.fragments.exploreFragment"
|
||||||
android:label="fragment_explore"
|
android:label="fragment_explore"
|
||||||
tools:layout="@layout/fragment_explore" >
|
tools:layout="@layout/fragment_explore">
|
||||||
<action
|
<action
|
||||||
android:id="@+id/action_exploreFragment_to_mapFragment"
|
android:id="@+id/action_exploreFragment_to_mapFragment"
|
||||||
app:destination="@id/mapFragment" />
|
app:destination="@id/mapFragment" />
|
||||||
@ -28,7 +28,11 @@
|
|||||||
android:id="@+id/mapFragment"
|
android:id="@+id/mapFragment"
|
||||||
android:name="com.example.wikispot.fragments.mapFragment"
|
android:name="com.example.wikispot.fragments.mapFragment"
|
||||||
android:label="fragment_map"
|
android:label="fragment_map"
|
||||||
tools:layout="@layout/fragment_map" />
|
tools:layout="@layout/fragment_map">
|
||||||
|
<action
|
||||||
|
android:id="@+id/action_mapFragment_to_exploreFragment"
|
||||||
|
app:destination="@id/exploreFragment" />
|
||||||
|
</fragment>
|
||||||
<fragment
|
<fragment
|
||||||
android:id="@+id/settingsFragment"
|
android:id="@+id/settingsFragment"
|
||||||
android:name="com.example.wikispot.fragments.settingsFragment"
|
android:name="com.example.wikispot.fragments.settingsFragment"
|
||||||
|
Loading…
Reference in New Issue
Block a user