From 07369781a94fdeccc1556217aa87654e2fb0f73b Mon Sep 17 00:00:00 2001 From: Marius Schlueter Date: Tue, 10 May 2022 15:16:29 +0200 Subject: [PATCH 1/8] open nav.tum.sexy to show location --- .../tumui/calendar/CalendarDetailsFragment.kt | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/de/tum/in/tumcampusapp/component/tumui/calendar/CalendarDetailsFragment.kt b/app/src/main/java/de/tum/in/tumcampusapp/component/tumui/calendar/CalendarDetailsFragment.kt index 5d52b0c0a4..cd5973bace 100644 --- a/app/src/main/java/de/tum/in/tumcampusapp/component/tumui/calendar/CalendarDetailsFragment.kt +++ b/app/src/main/java/de/tum/in/tumcampusapp/component/tumui/calendar/CalendarDetailsFragment.kt @@ -1,8 +1,8 @@ package de.tum.`in`.tumcampusapp.component.tumui.calendar -import android.app.SearchManager import android.content.Intent import android.graphics.Color +import android.net.Uri import android.os.Bundle import android.view.LayoutInflater import android.view.View @@ -18,7 +18,6 @@ import de.tum.`in`.tumcampusapp.component.other.navigation.NavDestination import de.tum.`in`.tumcampusapp.component.other.navigation.NavigationManager import de.tum.`in`.tumcampusapp.component.tumui.calendar.model.CalendarItem import de.tum.`in`.tumcampusapp.component.tumui.calendar.model.DeleteEventResponse -import de.tum.`in`.tumcampusapp.component.tumui.roomfinder.RoomFinderActivity import de.tum.`in`.tumcampusapp.database.TcaDb import de.tum.`in`.tumcampusapp.databinding.FragmentCalendarDetailsBinding import de.tum.`in`.tumcampusapp.utils.Const @@ -189,10 +188,18 @@ class CalendarDetailsFragment : RoundedBottomSheetDialogFragment() { } private fun onLocationClicked(location: String) { - val findStudyRoomIntent = Intent() - findStudyRoomIntent.putExtra(SearchManager.QUERY, Utils.extractRoomNumberFromLocation(location)) - findStudyRoomIntent.setClass(requireContext(), RoomFinderActivity::class.java) - startActivity(findStudyRoomIntent) +// val findStudyRoomIntent = Intent() +// findStudyRoomIntent.putExtra(SearchManager.QUERY, Utils.extractRoomNumberFromLocation(location)) +// findStudyRoomIntent.setClass(requireContext(), RoomFinderActivity::class.java) +// startActivity(findStudyRoomIntent) + + val encoded_location = java.net.URLEncoder.encode(location, "utf-8") + val url = "https://nav.tum.sexy/search?q=${encoded_location}" + + val sendIntent: Intent = Intent().apply { + setData(Uri.parse(url)) + } + startActivity(sendIntent) } companion object { From dabe1d189e258de58832900c434df1d7f931b566 Mon Sep 17 00:00:00 2001 From: Marius Schlueter Date: Mon, 16 May 2022 17:23:19 +0200 Subject: [PATCH 2/8] calender detail call navigatumactivity --- .../tumui/calendar/CalendarDetailsFragment.kt | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/de/tum/in/tumcampusapp/component/tumui/calendar/CalendarDetailsFragment.kt b/app/src/main/java/de/tum/in/tumcampusapp/component/tumui/calendar/CalendarDetailsFragment.kt index 4e493f9490..dcb0aef2c6 100644 --- a/app/src/main/java/de/tum/in/tumcampusapp/component/tumui/calendar/CalendarDetailsFragment.kt +++ b/app/src/main/java/de/tum/in/tumcampusapp/component/tumui/calendar/CalendarDetailsFragment.kt @@ -187,16 +187,8 @@ class CalendarDetailsFragment : RoundedBottomSheetDialogFragment() { } private fun onLocationClicked(location: String) { -// val findStudyRoomIntent = Intent() -// findStudyRoomIntent.putExtra(SearchManager.QUERY, Utils.extractRoomNumberFromLocation(location)) -// findStudyRoomIntent.setClass(requireContext(), RoomFinderActivity::class.java) -// startActivity(findStudyRoomIntent) - - val encoded_location = java.net.URLEncoder.encode(location, "utf-8") - val url = "https://nav.tum.sexy/search?q=${encoded_location}" - - val sendIntent: Intent = Intent().apply { - setData(Uri.parse(url)) + val sendIntent: Intent = Intent(getContext(),NavigatumActivity::class.java).apply { + putExtra("location",location) } startActivity(sendIntent) } From 61b8a583f186350a2eabd857bd0b1d1e7cb7004c Mon Sep 17 00:00:00 2001 From: Marius Schlueter Date: Mon, 16 May 2022 17:38:41 +0200 Subject: [PATCH 3/8] add NavigatumActivity to manifest --- app/src/main/AndroidManifest.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index d3ff5a74c6..c7b0643920 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -371,6 +371,12 @@ android:value=".component.ui.overview.MainActivity" /> + + + Date: Mon, 16 May 2022 17:42:56 +0200 Subject: [PATCH 4/8] create NavigatumActivity --- .../tumui/calendar/NavigatumActivity.kt | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 app/src/main/java/de/tum/in/tumcampusapp/component/tumui/calendar/NavigatumActivity.kt diff --git a/app/src/main/java/de/tum/in/tumcampusapp/component/tumui/calendar/NavigatumActivity.kt b/app/src/main/java/de/tum/in/tumcampusapp/component/tumui/calendar/NavigatumActivity.kt new file mode 100644 index 0000000000..45490d1e65 --- /dev/null +++ b/app/src/main/java/de/tum/in/tumcampusapp/component/tumui/calendar/NavigatumActivity.kt @@ -0,0 +1,21 @@ +package de.tum.`in`.tumcampusapp.component.tumui.calendar + +import android.annotation.SuppressLint +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import android.webkit.WebView + +class NavigatumActivity : AppCompatActivity() { + @SuppressLint("SetJavaScriptEnabled") + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + val intent = getIntent() + val location = intent.getStringExtra("location") + val encoded_location = java.net.URLEncoder.encode(location, "utf-8") + val url = "https://nav.tum.sexy/search?q=${encoded_location}" + val webview = WebView(this) + setContentView(webview) + webview.settings.javaScriptEnabled = true + webview.loadUrl(url) + } +} \ No newline at end of file From 1d09b503e0212b99d617a15ac5e75907fdd61529 Mon Sep 17 00:00:00 2001 From: Marius Schlueter Date: Mon, 16 May 2022 17:54:37 +0200 Subject: [PATCH 5/8] remove unused import --- .../component/tumui/calendar/CalendarDetailsFragment.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/main/java/de/tum/in/tumcampusapp/component/tumui/calendar/CalendarDetailsFragment.kt b/app/src/main/java/de/tum/in/tumcampusapp/component/tumui/calendar/CalendarDetailsFragment.kt index dcb0aef2c6..09bac93bcf 100644 --- a/app/src/main/java/de/tum/in/tumcampusapp/component/tumui/calendar/CalendarDetailsFragment.kt +++ b/app/src/main/java/de/tum/in/tumcampusapp/component/tumui/calendar/CalendarDetailsFragment.kt @@ -2,7 +2,6 @@ package de.tum.`in`.tumcampusapp.component.tumui.calendar import android.content.Intent import android.graphics.Color -import android.net.Uri import android.os.Bundle import android.view.LayoutInflater import android.view.View From 1159326dd9fbab53f29ee35a97fd42090dddc836 Mon Sep 17 00:00:00 2001 From: Marius Date: Mon, 16 May 2022 17:56:59 +0200 Subject: [PATCH 6/8] change namestyle Co-authored-by: Frank Elsinga --- .../tumcampusapp/component/tumui/calendar/NavigatumActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/de/tum/in/tumcampusapp/component/tumui/calendar/NavigatumActivity.kt b/app/src/main/java/de/tum/in/tumcampusapp/component/tumui/calendar/NavigatumActivity.kt index 45490d1e65..f271cba063 100644 --- a/app/src/main/java/de/tum/in/tumcampusapp/component/tumui/calendar/NavigatumActivity.kt +++ b/app/src/main/java/de/tum/in/tumcampusapp/component/tumui/calendar/NavigatumActivity.kt @@ -5,7 +5,7 @@ import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import android.webkit.WebView -class NavigatumActivity : AppCompatActivity() { +class NavigaTUMActivity : AppCompatActivity() { @SuppressLint("SetJavaScriptEnabled") override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) From 083dc087c6667c8a58780e7676a2ff1e0ef5b6a5 Mon Sep 17 00:00:00 2001 From: Marius Date: Mon, 16 May 2022 17:57:20 +0200 Subject: [PATCH 7/8] change namestyle Co-authored-by: Frank Elsinga --- .../component/tumui/calendar/CalendarDetailsFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/de/tum/in/tumcampusapp/component/tumui/calendar/CalendarDetailsFragment.kt b/app/src/main/java/de/tum/in/tumcampusapp/component/tumui/calendar/CalendarDetailsFragment.kt index 09bac93bcf..42dcb3f948 100644 --- a/app/src/main/java/de/tum/in/tumcampusapp/component/tumui/calendar/CalendarDetailsFragment.kt +++ b/app/src/main/java/de/tum/in/tumcampusapp/component/tumui/calendar/CalendarDetailsFragment.kt @@ -186,7 +186,7 @@ class CalendarDetailsFragment : RoundedBottomSheetDialogFragment() { } private fun onLocationClicked(location: String) { - val sendIntent: Intent = Intent(getContext(),NavigatumActivity::class.java).apply { + val sendIntent: Intent = Intent(getContext(),NavigaTUMActivity::class.java).apply { putExtra("location",location) } startActivity(sendIntent) From 68037bcd9ef76868a0567f5bf02c7d065adf047f Mon Sep 17 00:00:00 2001 From: Marius Date: Mon, 16 May 2022 17:57:33 +0200 Subject: [PATCH 8/8] change namestyle Co-authored-by: Frank Elsinga --- app/src/main/AndroidManifest.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c7b0643920..9bb1a312bd 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -372,8 +372,8 @@