Skip to content
Snippets Groups Projects
Commit 43b50cc5 authored by Ethan Charles Vasquez's avatar Ethan Charles Vasquez
Browse files

screen1

parent 51a66ad9
Branches main
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings"> <component name="GradleSettings">
<option name="linkedExternalProjectsSettings"> <option name="linkedExternalProjectsSettings">
<GradleProjectSettings> <GradleProjectSettings>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="DesignSurface">
<option name="filePathToZoomLevelMap">
<map>
<entry key="..\:/MyDesktop/school/AndroidFinalProject/app/src/main/res/layout/activity_main.xml" value="0.2595108695652174" />
<entry key="..\:/MyDesktop/school/AndroidFinalProject/app/src/main/res/layout/fragment_map.xml" value="0.23125" />
<entry key="..\:/MyDesktop/school/AndroidFinalProject/app/src/main/res/layout/fragment_schedule.xml" value="0.2563405797101449" />
</map>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="Android Studio default JDK" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="Android Studio default JDK" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" /> <output url="file://$PROJECT_DIR$/build/classes" />
</component> </component>
......
...@@ -47,4 +47,5 @@ dependencies { ...@@ -47,4 +47,5 @@ dependencies {
implementation 'com.google.android.gms:play-services-maps:18.1.0' implementation 'com.google.android.gms:play-services-maps:18.1.0'
implementation 'androidx.fragment:fragment-ktx:1.5.4' implementation 'androidx.fragment:fragment-ktx:1.5.4'
} }
\ No newline at end of file
...@@ -2,10 +2,16 @@ package com.example.androidfinalproject ...@@ -2,10 +2,16 @@ package com.example.androidfinalproject
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle import android.os.Bundle
import com.google.android.gms.maps.SupportMapFragment
class MainActivity : AppCompatActivity() { class MainActivity : AppCompatActivity() {
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)
} }
} }
\ No newline at end of file
...@@ -11,10 +11,18 @@ import com.google.android.gms.maps.OnMapReadyCallback ...@@ -11,10 +11,18 @@ import com.google.android.gms.maps.OnMapReadyCallback
import com.google.android.gms.maps.SupportMapFragment import com.google.android.gms.maps.SupportMapFragment
import com.google.android.gms.maps.model.LatLng import com.google.android.gms.maps.model.LatLng
import com.google.android.gms.maps.model.LatLngBounds import com.google.android.gms.maps.model.LatLngBounds
import com.google.android.gms.maps.model.MarkerOptions
class MapFragment : Fragment(), OnMapReadyCallback { class MapFragment : Fragment(), OnMapReadyCallback {
private lateinit var mMap: GoogleMap
override fun onCreateView( override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?, inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle? savedInstanceState: Bundle?
...@@ -31,11 +39,13 @@ class MapFragment : Fragment(), OnMapReadyCallback { ...@@ -31,11 +39,13 @@ class MapFragment : Fragment(), OnMapReadyCallback {
} }
override fun onMapReady(gMap: GoogleMap) { override fun onMapReady(gMap: GoogleMap) {
val australiaBounds = LatLngBounds( mMap = gMap
LatLng((-44.0), 113.0), // SW bounds
LatLng((-10.0), 154.0) // NE bounds // Add a marker in Sydney and move the camera
) val sydney = LatLng(-34.0, 151.0)
gMap.moveCamera(CameraUpdateFactory.newLatLngZoom(australiaBounds.center, 10f)) mMap.addMarker(MarkerOptions().position(sydney).title("Marker in Sydney"))
mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney))
} }
} }
\ No newline at end of file
package com.example.androidfinalproject
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private const val ARG_PARAM1 = "param1"
private const val ARG_PARAM2 = "param2"
/**
* A simple [Fragment] subclass.
* Use the [ScheduleFragment.newInstance] factory method to
* create an instance of this fragment.
*/
class ScheduleFragment : Fragment() {
// TODO: Rename and change types of parameters
private var param1: String? = null
private var param2: String? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
arguments?.let {
param1 = it.getString(ARG_PARAM1)
param2 = it.getString(ARG_PARAM2)
}
}
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_schedule, container, false)
}
companion object {
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment ScheduleFragment.
*/
// TODO: Rename and change types and number of parameters
@JvmStatic
fun newInstance(param1: String, param2: String) =
ScheduleFragment().apply {
arguments = Bundle().apply {
putString(ARG_PARAM1, param1)
putString(ARG_PARAM2, param2)
}
}
}
}
\ No newline at end of file
AndroidFinalProject/app/src/main/res/drawable/mcbryde.jpg

379 KiB

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ScheduleFragment">
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:text="Select a Time Frame"
android:textSize="35sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:text="Building: McBryde"
android:textSize="15sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView2" />
<ImageView
android:id="@+id/imageView"
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_marginTop="15dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView3"
tools:src="@drawable/mcbryde" />
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:layout_marginEnd="100dp"
android:text="Time Start"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView" />
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginEnd="100dp"
android:text="Time End"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView4" />
<TextView
android:id="@+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginEnd="100dp"
android:text="Date"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView5" />
<TextView
android:id="@+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginEnd="100dp"
android:text="Particpants"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView6" />
<Spinner
android:id="@+id/spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="284dp"
android:layout_marginTop="50dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.202"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView" />
<Spinner
android:id="@+id/spinner2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="250dp"
android:layout_marginTop="20dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.442"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/spinner" />
<EditText
android:id="@+id/editTextDate"
android:layout_width="97dp"
android:layout_height="25dp"
android:layout_marginStart="250dp"
android:layout_marginTop="15dp"
android:ems="10"
android:inputType="date"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.39"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/spinner2" />
<EditText
android:id="@+id/editTextNumber"
android:layout_width="97dp"
android:layout_height="25dp"
android:layout_marginStart="250dp"
android:layout_marginTop="13dp"
android:ems="10"
android:inputType="number"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.39"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/editTextDate" />
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="SUBMIT"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:layout_editor_absoluteY="585dp" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -9,5 +9,14 @@ ...@@ -9,5 +9,14 @@
android:id="@+id/mapFragment" android:id="@+id/mapFragment"
android:name="com.example.androidfinalproject.MapFragment" android:name="com.example.androidfinalproject.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_scheduleFragment"
app:destination="@id/scheduleFragment" />
</fragment>
<fragment
android:id="@+id/scheduleFragment"
android:name="com.example.androidfinalproject.ScheduleFragment"
android:label="fragment_schedule"
tools:layout="@layout/fragment_schedule" />
</navigation> </navigation>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment