Skip to content

Commit

Permalink
Merge branch 'master' into fosdem-2024
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/build.yaml
  • Loading branch information
johnjohndoe committed Feb 19, 2024
2 parents aadaba3 + 7854ff7 commit e5d8e0e
Show file tree
Hide file tree
Showing 100 changed files with 719 additions and 709 deletions.
67 changes: 49 additions & 18 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '11'
Expand All @@ -16,43 +17,73 @@ jobs:
run: ./gradlew assembleFosdem

- name: Unit Tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 21
script: ./gradlew testDebug :engelsystem:test testFosdemDebugUnitTest assembleFosdemDebug lintAnalyzeFosdemDebug
run: ./gradlew testDebug :engelsystem:test testFosdemDebugUnitTest assembleFosdemDebug lintAnalyzeFosdemDebug

- name: Publish unit-test results
uses: EnricoMi/publish-unit-test-result-action@v1
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
check_name: Test results (test)
files: |
build/test-results/**/*.xml
*/build/test-results/**/*.xml
android_tests:
# see https://github.com/reactivecircus/android-emulator-runner,
# needs to run on macos as only there virtualization is available!
runs-on: macos-latest
runs-on: ubuntu-latest
strategy:
matrix:
api-level: [ 21 ]
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v4

- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Gradle cache
uses: gradle/actions/setup-gradle@v3

- name: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}

- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."

- name: Set up JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '11'

- name: Instrumentation Tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 21
script: ./gradlew connectedFosdemDebugAndroidTest
api-level: ${{ matrix.api-level }}
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: ./gradlew :database:connectedAndroidTest

- name: Publish unit-test results
uses: EnricoMi/publish-unit-test-result-action/composite@v1
uses: EnricoMi/publish-unit-test-result-action/composite@v2
if: always()
with:
check_name: Test results (androidTest), API level ${{ matrix.api-level }}
files: |
build/test-results/**/*.xml
*/build/test-results/**/*.xml
*/build/outputs/androidTest-results/connected/*.xml
**/androidTest-results/**/*.xml
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dist: focal
dist: jammy

language: java

Expand Down
22 changes: 11 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@ You are very welcome to contribute to this project.
In order to simplify the process please try to follow the following suggestions:

## How to start
* Use English for all communication to include as many people as possible.
* Create an issue to discuss your idea before you invest a lot of time into designing or coding.
* Use English for all communications to include as many people as possible.
* Create an issue to discuss your idea before you spend a lot of time into designing or coding.
* Leave an `I like to work on this` comment on an existing issue to let the maintainer know about it.
* Fork the repository into your personal GitHub account to start working.
* Fork the repository into your personal GitHub account to get started.
* Create a separate branch for each topic.

## While contributing
* Make sure to apply [automatic code formatting and organize imports][code-formatting] as it is provided by Android Studio.
* Make sure to apply [automatic code formatting and organizing imports][code-formatting] as it is provided by Android Studio.
* Write unit tests.
* Check and update the [README.md](README.md). Your changes might affect sections in the document.
* Review and update the [README.md](README.md). Your changes may affect sections of the document.

## Git best practices
* Compose contextual atomic commits.
* Aim to answer the question `Why?` in every commit message.
* Aim to answer the `Why?` question in every commit message.
* Make sure each commit compiles.
* Rebase your branch onto the latest commit on `master`.
* Do not merge `master` into your branch. The project maintainer will merge your branch into `master` once it is approved.
* Do not merge `master` into your branch. The project maintainer will merge your branch into `master` as soon as it is approved.
* Feel free to reorganize the commits on your branch by using `git rebase --interactive` or `git push --force`.
* Use the issue and pull request templates prepared for the GitHub repository.
* Describe the intention of your pull request. Add screenshots if suitable. They help others to understand the before and after state.
* Make sure to add a textual description both in your commit(s) and in the pull request if you implement a new feature or you change the behavior of an existing one.
* Use the issue and pull request templates provided for the GitHub repository.
* Describe the intent of your pull request. Include screenshots if appropriate. They help others to understand the before and after state.
* Be sure to include a textual description in both your commit(s) and in the pull request if you are implementing a new feature or changing the behavior of an existing one.

## Translations
* Contribute to translate the app into many languages. [Crowdin][crowdin-eventfahrplan] is used to organize all languages and texts.
* Contribute to the translation of the app into many languages. [Crowdin][crowdin-eventfahrplan] is used to organize all languages and texts.

[code-formatting]: http://stackoverflow.com/a/5581992/356895
[crowdin-eventfahrplan]: https://crowdin.com/project/eventfahrplan
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# EventFahrplan

EventFahrplan is a viewer for event schedules for instance
[Chaos Computer Club e.V. events][ccc-events] such as [Chaos Communication Camp][camp-website],
EventFahrplan is a viewer for event schedules such as
[Chaos Computer Club e.V. events][ccc-events] like [Chaos Communication Camp][camp-website],
[Chaos Communication Congress][congress-website] or [JahresEndVeranstaltungen][jev-website].

- Chaos Communication Camp Schedule app: [F-Droid][camp-app-fdroid], [Google Play][camp-app-google-play]
Expand Down Expand Up @@ -64,13 +64,13 @@ Please read the instructions in the [contribution guide](CONTRIBUTING.md) in ord

* The feedback system of [Frab][frab-website] and [Pretalx][pretalx-website]
* [c3nav][c3nav-github] - An indoor navigation project
* [Engelsystem][engelsystem-website] - Online tool for coordinating helpers and shifts on large events
* [Engelsystem][engelsystem-website] - Online tool for coordinating helpers and shifts at large events
* [Chaosflix][chaosflix-github] - Android app for media.ccc.de, share Fahrplan favorites with Chaosflix to import them as bookmarks


## Android versions

The application is designed to work both on smartphones and on tablets.
The application is designed to work on both smartphones and on tablets.
Android 5.0 (Lollipop) and newer versions are supported.


Expand All @@ -80,18 +80,18 @@ Android 5.0 (Lollipop) and newer versions are supported.
as provided by [Frab][frab-website], [Pretalx][pretalx-website] or [Wafer][wafer-website].
The file format produced by the predecessor software, [Pentabarf][pentabarf-github],
cannot be consumed out of the box.
* In general it is possible to re-deployed the app for other events which
* In general, it is possible to re-deploy the app for other events which
provide the same event file format.

## Build instructions

To start development open the project in Android Studio.
To begin development, open the project in Android Studio.

The [customization guide][customization-guide] explains in all details how to create an app for your event.
The [customization guide][customization-guide] explains in detail how to create an app for your event.

If you want to create your own signed release builds, copy the `gradle.properties.example` file in the `app` folder
and rename it to `gradle.properties`. This file contains the signing information which is used in the build process.
Make sure to edit the file contents to point to your own keystore files.
Be sure to edit the contents of the file to point to your own keystore files.

## Translations

Expand All @@ -104,22 +104,22 @@ can be downloaded. The file also contains usage examples.

## History

* The project was started as ["CampFahrplan"][campfahrplan-github] in 2011 and has been developed
by [Daniel Dorau][tuxmobil-github]. He published the app for Chaos Communication Camp
and Chaos Communication Congress in the following years. The app served as a digital
* The project was started in 2011 as ["CampFahrplan"][campfahrplan-github] and was developed
by [Daniel Dorau][tuxmobil-github]. He released the app for the Chaos Communication Camp
and the Chaos Communication Congress in the following years. The app served as a digital
schedule for thousands of users.
* In 2013, [Tobias Preuss][johnjohndoe-github] started contributing. Soon after he
started to redeploy the app for other events such as FOSSGIS, FrOSCon, MRMCD and
started to re-deploy the app for other events like FOSSGIS, FrOSCon, MRMCD and
other conferences.
* In August 2017 the project moved to a new location and was renamed to
["EventFahrplan"][eventfahrplan-github] to acknowledge its broader usage.
["EventFahrplan"][eventfahrplan-github] to acknowledge its broader use.

## Funding

In 2023 & 2024 this project was funded through the [NGI0 Entrust Fund](https://nlnet.nl/entrust), a fund
In 2023 & 2024, this project was funded by the [NGI0 Entrust Fund](https://nlnet.nl/entrust), a fund
established by [NLnet](https://nlnet.nl) with financial support from the European Commission's
[Next Generation Internet](https://ngi.eu) program, under the aegis of DG Communications Networks,
Content and Technology under grant agreement No 101069594.
Content and Technology under grant agreement No. 101069594.

![Logo NLnet: abstract logo of four people seen from above](gfx/nlnet-banner-160x60.png)

Expand All @@ -141,9 +141,9 @@ Dominik Stadler, entropynil, erebion, ideadapt, isi_ko404, IsoLinearCHiP,
Jasper van der Graaf, Joergi, Julius Vitkauskas, koelnkalkverbot, Larissa Yasin,
lepawa, ligi, lucadelu, Luis Azcuaga, María Arias de Reyna, Mateus Baptista,
Matthias Geisler, Matthias Hunstock, Matthias Mair, MichaelRocks, Miguel Beltran,
mtpa, Nghiem Xuan Hien, NiciDieNase, Noemis, Omicron, Poschi, Qwertele, rotrot,
Sjors van Mierlo, Stefan Medack, SubOptimal, taseret, Teeranai.P, Torsten Grote,
Victor Herasme, Vladimir Alabov, Yanicka
mtpa, Nghiem Xuan Hien, NiciDieNase, Noemis, Omicron, Poschi, Qwertele,
Róbert Papp,rotrot, Sjors van Mierlo, Stefan Medack, SubOptimal, taseret,
Teeranai.P, Torsten Grote, Victor Herasme, Vladimir Alabov, Yanicka
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
11 changes: 5 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ android {
buildToolsVersion = Android.buildToolsVersion

defaultConfig {
versionCode 99
versionName "1.63.1"
versionCode 100
versionName "1.63.2"
minSdk Android.minSdkVersion
targetSdk Android.targetSdkVersion
archivesBaseName = "Fahrplan-$versionName"
Expand Down Expand Up @@ -273,11 +273,10 @@ dependencies {

testImplementation project(":commons-testing")
testImplementation Libs.annotation
testImplementation(Libs.assertjAndroid) {
exclude group: "com.android.support", module: "support-annotations"
}
testImplementation Libs.coreTesting
testImplementation Libs.junit
testImplementation Libs.junitJupiterApi
testRuntimeOnly Libs.junitJupiterEngine
testImplementation Libs.junitJupiterParams
testImplementation(Libs.kotlinCoroutinesTest) {
// workaround for https://github.com/Kotlin/kotlinx.coroutines/issues/2023
exclude group: "org.jetbrains.kotlinx", module: "kotlinx-coroutines-debug"
Expand Down
1 change: 1 addition & 0 deletions app/src/ccc37c3/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<color name="schedule_room_name_header_text">@color/colorAccent</color>

<!-- Session details -->
<color name="session_details_list_item">@color/colorPrimary</color>
<color name="session_detailbar_background">#202020</color>
<color name="session_detailbar_text">#9DFAFD</color>
<color name="session_detailbar_icon">#BF55F8</color>
Expand Down
1 change: 1 addition & 0 deletions app/src/cccamp2023/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<color name="text_link_on_light">#32CC1B</color>
<color name="multi_choice_background">#ffc600</color>
<color name="session_background">#ffffff</color>
<color name="session_details_list_item">@color/colorPrimaryDark</color>
<color name="session_detailbar_background">@color/colorPrimaryDark</color>
<color name="session_detailbar_text">#fff</color>
<color name="session_detailbar_icon">#8AFF78</color>
Expand Down
1 change: 1 addition & 0 deletions app/src/jev2022/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@

<!-- Session details -->
<color name="session_details_text">@color/text_primary</color>
<color name="session_details_list_item">@color/colorAccent</color>

</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@ class SessionDetailsFragment : Fragment() {
}
}

// Custom list items.
// Docs: https://noties.io/Markwon/docs/v4/core/theme.html#list
private fun createListItemsPlugin(context: Context) = object : AbstractMarkwonPlugin() {
override fun configureTheme(builder: MarkwonTheme.Builder) {
val itemColor = ContextCompat.getColor(context, R.color.session_details_list_item)
builder
.bulletWidth(16)
.listItemColor(itemColor)
}
}

@JvmStatic
fun replaceAtBackStack(fragmentManager: FragmentManager, @IdRes containerViewId: Int, sidePane: Boolean) {
val fragment = SessionDetailsFragment().withArguments(
Expand Down Expand Up @@ -128,6 +139,7 @@ class SessionDetailsFragment : Fragment() {
notificationHelper = NotificationHelper(context)
markwon = Markwon.builder(requireContext())
.usePlugin(HEADINGS_PLUGIN)
.usePlugin(createListItemsPlugin(context))
.usePlugin(LinkifyPlugin.create())
.build()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import nerd.tuxmobil.fahrplan.congress.utils.ConferenceTimeFrame
/**
* Represents a "conference day" that is not bound to a specific date. Sessions can take place on
* different days but still be grouped together in a virtual day. It does not have typical boundaries
* like a "natural day" (00:00 to 23:59) has.
* like a "natural day" (00:00:00 to 23:59:59) has. The [timeRange] property returns the time range
* of all sessions spanning from the start of the earliest session to the end of the latest session.
*
* Similar: [Conference], [ConferenceTimeFrame].
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,10 +362,11 @@ object AppRepository {
val parsingStatus = if (meta.numDays == 0) InitialParsing else Parsing
mutableLoadScheduleState.tryEmit(parsingStatus)
parseSchedule(
fetchScheduleResult.scheduleXml,
fetchScheduleResult.httpHeader,
onParsingDone,
onLoadingShiftsDone
scheduleXml = fetchScheduleResult.scheduleXml,
httpHeader = fetchScheduleResult.httpHeader,
oldMeta = meta,
onParsingDone = onParsingDone,
onLoadingShiftsDone = onLoadingShiftsDone
)
} else if (fetchResult.isNotModified) {
loadShifts(onLoadingShiftsDone)
Expand All @@ -375,6 +376,7 @@ object AppRepository {

private fun parseSchedule(scheduleXml: String,
httpHeader: HttpHeader,
oldMeta: Meta,
onParsingDone: (parseScheduleResult: ParseResult) -> Unit,
onLoadingShiftsDone: (loadShiftsResult: LoadShiftsResult) -> Unit) {
scheduleNetworkRepository.parseSchedule(scheduleXml, httpHeader,
Expand All @@ -391,9 +393,12 @@ object AppRepository {
val validMeta = meta.validate()
updateMeta(validMeta)
},
onParsingDone = { result: Boolean, version: String ->
val parseResult = ParseScheduleResult(result, version)
val parseScheduleStatus = if (result) ParseSuccess else ParseFailure(parseResult)
onParsingDone = { isSuccess: Boolean, version: String ->
if (!isSuccess) {
updateMeta(oldMeta.copy(httpHeader = HttpHeader(eTag = "", lastModified = "")))
}
val parseResult = ParseScheduleResult(isSuccess, version)
val parseScheduleStatus = if (isSuccess) ParseSuccess else ParseFailure(parseResult)
mutableLoadScheduleState.tryEmit(parseScheduleStatus)
onParsingDone(parseResult)
loadShifts(onLoadingShiftsDone)
Expand Down Expand Up @@ -553,14 +558,6 @@ object AppRepository {
.filter { it.isChanged || it.changedIsCanceled || it.changedIsNew }
.also { logging.d(LOG_TAG, "${it.size} sessions changed.") }

/**
* Loads the first session of the first day from the database.
* Throws an exception if no session is present.
*/
@WorkerThread
fun loadEarliestSession() = loadSessionsForAllDays(true)
.first()

/**
* Loads all Engelsystem shifts for all days from the database.
*/
Expand Down
Loading

0 comments on commit e5d8e0e

Please sign in to comment.