Merge pull request #137 from 493505110/main

Add calendar support
main
Arty Bishop 2024-08-04 15:20:24 +01:00 zatwierdzone przez GitHub
commit 3a163fb939
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
2 zmienionych plików z 11 dodań i 2 usunięć

Wyświetl plik

@ -17,7 +17,9 @@
*/
package com.rtbishop.look4sat.presentation.radarScreen
import android.content.Intent
import android.os.Bundle
import android.provider.CalendarContract
import android.view.View
import androidx.fragment.app.Fragment
import androidx.fragment.app.viewModels
@ -106,7 +108,15 @@ class RadarFragment : Fragment(R.layout.fragment_radar) {
val direction = RadarFragmentDirections.globalToMap(pass.catNum)
findNavController().navigate(direction)
}
radarBtnNotify.isEnabled = false
radarBtnNotify.clickWithDebounce {
val intent = Intent(Intent.ACTION_INSERT)
.setData(CalendarContract.Events.CONTENT_URI)
.putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, pass.aosTime)
.putExtra(CalendarContract.EXTRA_EVENT_END_TIME, pass.losTime)
.putExtra(CalendarContract.Events.TITLE, pass.name)
.putExtra(CalendarContract.Events.DESCRIPTION, "Look4Sat")
startActivity(intent)
}
radarBtnSettings.clickWithDebounce {
val direction = RadarFragmentDirections.globalToSettings()
findNavController().navigate(direction)

Wyświetl plik

@ -199,7 +199,6 @@
android:layout_width="0dp"
android:layout_marginStart="@dimen/button_margin_side"
android:text="@string/btn_notify"
android:textColor="@color/textDisabled"
app:layout_constraintBottom_toBottomOf="@+id/radar_coordinator"
app:layout_constraintEnd_toStartOf="@+id/radar_visibility"
app:layout_constraintHorizontal_bias="0.5"