Skip to content

Commit

Permalink
Merge branch 'master' into add-safearea-everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
JAicewizard authored Feb 15, 2023
2 parents 83f9f20 + 4f00baf commit 4b714ca
Show file tree
Hide file tree
Showing 75 changed files with 1,624 additions and 1,352 deletions.
26 changes: 9 additions & 17 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- master

env:
FLUTTER_VERSION: 3.3.6
FLUTTER_VERSION: 3.7.0

jobs:
linting:
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:

- name: "Start Simulator"
env:
DEVICE: "iPhone 12 Pro Simulator (15.2)"
DEVICE: ${{ vars.IOS_SIMULATOR }}
run: |
UDID=$(xcrun xctrace list devices | grep "^$DEVICE (" | awk '{gsub(/[()]/,""); print $NF}')
echo $UDID
Expand All @@ -78,7 +78,7 @@ jobs:
- name: Install Flutter dependencies
run: flutter pub get
- name: Run integration tests
run: flutter test integration_test -r expanded
run: flutter test integration_test/main.dart -r expanded

deploy-ios:
name: Deploy - iOS
Expand All @@ -104,14 +104,6 @@ jobs:
- name: Flutter version
run: flutter --version

- name: Pods cache
uses: actions/cache@v3
with:
path: ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
Expand All @@ -130,13 +122,13 @@ jobs:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_GIT_PRIVATE_KEY: ${{ secrets.PASSWORDS_REPO_DEPLOY_KEY }}
THALIA_API_HOST: thalia.nu
THALIA_API_HOST: ${{ vars.THALIA_API_HOST }}
THALIA_OAUTH_APP_ID: ${{ secrets.THALIA_OAUTH_APP_ID }}
THALIA_OAUTH_APP_SECRET: ${{ secrets.THALIA_OAUTH_APP_SECRET }}
TOSTI_API_HOST: tosti.science.ru.nl
TOSTI_API_HOST: ${{ vars.TOSTI_API_HOST }}
TOSTI_OAUTH_APP_ID: ${{ secrets.TOSTI_OAUTH_APP_ID }}
TOSTI_OAUTH_APP_SECRET: ${{ secrets.TOSTI_OAUTH_APP_SECRET }}
CHANGELOG: ${{ github.event.pull_request.title }}
CHANGELOG: ${{ github.ref }}
run: bundle exec fastlane ios deploy_internal changelog:"$CHANGELOG"

deploy-android:
Expand Down Expand Up @@ -166,7 +158,7 @@ jobs:
GOOGLE_PLAY_CONFIG: ${{ secrets.GOOGLE_PLAY_CONFIG_JSON }}
RELEASE_CONFIG_STORE_PASS: ${{ secrets.ANDROID_RELEASE_CONFIG_STORE_PASS }}
RELEASE_CONFIG_KEY_PASS: ${{ secrets.ANDROID_RELEASE_CONFIG_KEY_PASS }}
RELEASE_CONFIG_KEY_ALIAS: ${{ secrets.ANDROID_RELEASE_CONFIG_KEY_ALIAS }}
RELEASE_CONFIG_KEY_ALIAS: ${{ vars.ANDROID_RELEASE_CONFIG_KEY_ALIAS }}
run: |
echo $GOOGLE_PLAY_CONFIG > $GITHUB_WORKSPACE/google-play.json
echo "storeFile=$GITHUB_WORKSPACE/thaliapp-passwords/upload.keystore" > $GITHUB_WORKSPACE/android/key.properties
Expand Down Expand Up @@ -206,10 +198,10 @@ jobs:
- name: Build app
env:
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
THALIA_API_HOST: thalia.nu
THALIA_API_HOST: ${{ vars.THALIA_API_HOST }}
THALIA_OAUTH_APP_ID: ${{ secrets.THALIA_OAUTH_APP_ID }}
THALIA_OAUTH_APP_SECRET: ${{ secrets.THALIA_OAUTH_APP_SECRET }}
TOSTI_API_HOST: tosti.science.ru.nl
TOSTI_API_HOST: ${{ vars.TOSTI_API_HOST }}
TOSTI_OAUTH_APP_ID: ${{ secrets.TOSTI_OAUTH_APP_ID }}
TOSTI_OAUTH_APP_SECRET: ${{ secrets.TOSTI_OAUTH_APP_SECRET }}
run: bundle exec fastlane android deploy_internal
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Podfile.lock
/build/
*.ipa

ios/Podfile.lock
ios/build/

# Web related
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,8 @@ To build and deploy the app with Github Actions, we need to set up a number of s
| Secret | Description | How to get it |
| :----- | :---------- | :------------ |
| `ANDROID_RELEASE_CONFIG_STORE_PASS` | Password of the keystore to use for android signing | Get from `ThaliaApp-Passwords/Upload Signing Keystore` |
| `ANDROID_RELEASE_CONFIG_KEY_ALIAS` | Alias of the key to use for android signing | `appsigning` |
| `ANDROID_RELEASE_CONFIG_KEY_PASS` | Password of the key to use for android signing | Get from `ThaliaApp-Passwords/Upload Signing Key` |
| `APPLE_API_KEY` | Base64 encoded App Store Connect API key | Get with `cat ThaliaApp-Passwords/app-store.p8 | base64` |
| `APPLE_API_KEY` | Base64 encoded App Store Connect API key | Get with `cat ThaliaApp-Passwords/app-store.p8 \| base64` |
| `GOOGLE_PLAY_CONFIG_JSON` | Configuration file for Google Play | Get from `ThaliaApp-Passwords/google-play.json` |
| `MATCH_PASSWORD` | Password for Fastlane Match | Get from `ThaliaApp-Passwords/Fastlane Match` |
| `PASSWORDS_REPO_DEPLOY_KEY` | A deploy key for the ThaliaApp-Passwords repository | Create one (with `ssh-keygen`), add to passwords repo, and use the full content of the private key file |
Expand Down
117 changes: 65 additions & 52 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,106 +1,119 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.thaliapp">


<!-- Required for add_2_calendar. -->
<queries>
<intent>
<action android:name="android.intent.action.INSERT" />
<data android:mimeType="vnd.android.cursor.item/event" />
</intent>
<intent>
<action
android:name="android.intent.action.INSERT"/>
<data
android:mimeType="vnd.android.cursor.item/event"/>
</intent>
</queries>

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round">

<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>

android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"/>
<!-- Deep linking -->
<meta-data android:name="flutter_deeplinking_enabled" android:value="true" />
<meta-data
android:name="flutter_deeplinking_enabled"
android:value="true"/>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:scheme="thaliapp" />
<data android:host="thalia.nu" />
<data android:path="/pizzas/" />
<data android:path="/events/" />
<data android:path="/association/boards/" />
<data android:path="/association/committees/" />
<data android:path="/association/societies/" />
<data android:pathPattern="/association/boards/.*/" />
<data android:pathPattern="/association/committees/.*/" />
<data android:pathPattern="/association/societies/.*/" />
<data android:pathPattern="/events/.*/" />
<data android:pathPattern="/members/photos/.*/" />
<data android:pathPattern="/sales/order/.*/pay/" />
<action
android:name="android.intent.action.VIEW"/>
<category
android:name="android.intent.category.DEFAULT"/>
<category
android:name="android.intent.category.BROWSABLE"/>
<data
android:scheme="https"/>
<data
android:scheme="thaliapp"/>
<data
android:host="thalia.nu"/>
<data
android:path="/pizzas/"/>
<data
android:path="/events/"/>
<data
android:path="/association/boards/"/>
<data
android:path="/association/committees/"/>
<data
android:path="/association/societies/"/>
<data
android:pathPattern="/association/boards/.*/"/>
<data
android:pathPattern="/association/committees/.*/"/>
<data
android:pathPattern="/association/societies/.*/"/>
<data
android:pathPattern="/events/.*/"/>
<data
android:pathPattern="/members/photos/.*/"/>
<data
android:pathPattern="/sales/order/.*/pay/"/>
</intent-filter>

<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>

<!-- Push notifications icon -->
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/ic_notification" />
<meta-data android:name="com.google.firebase.messaging.default_notification_color"
android:resource="@color/magenta" />

android:resource="@drawable/ic_notification"/>
<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="@color/magenta"/>
<!-- OAuth callback -->
<activity
android:name="com.linusu.flutter_web_auth_2.CallbackActivity"
<activity
android:name="com.linusu.flutter_web_auth_2.CallbackActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="nu.thalia" />
<action
android:name="android.intent.action.VIEW"/>
<category
android:name="android.intent.category.DEFAULT"/>
<category
android:name="android.intent.category.BROWSABLE"/>
<data
android:scheme="nu.thalia"/>
</intent-filter>
</activity>

<!-- Image Cropper -->
<activity
android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>

<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
android:value="2"/>
</application>
</manifest>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
<item>
<bitmap android:gravity="fill" android:src="@drawable/background"/>
</item>
</layer-list>
</layer-list>
2 changes: 1 addition & 1 deletion android/app/src/main/res/drawable/launch_background.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
<item>
<bitmap android:gravity="fill" android:src="@drawable/background"/>
</item>
</layer-list>
</layer-list>
4 changes: 3 additions & 1 deletion android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
<item name="android:forceDarkAllowed">false</item>
<item name="android:windowFullscreen">false</item>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Expand All @@ -16,4 +18,4 @@
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
</resources>
6 changes: 5 additions & 1 deletion assets/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ The placeholder images have background color `#c5c5c5` and foreground `#ffffff`.
- Create a background canvas of twice the required size (e.g. 900x500 for the 450x250 map placeholder), with the background color.
- Add the SVG in the right size (e.g. 400x400 for the map placeholder), and paint it to foreground color.
- Scale the imge to the right size.
- Save and export it to PNG, unchecking any stored info, such as Exif or color profile. If the image does not need to be transparant, do check 'save background color' to reduce file size (the alpha channel is left out).
- Save and export it to PNG, unchecking any stored info, such as Exif or color profile. If the image does not need to be transparant, do check 'save background color' to reduce file size.

Some of them use SVGs of Material Design icons, that can be downloaded from <https://fonts.google.com/icons>.

## Images on background

Some images (sad-cloud.png, tosti-logo.png) are used directly on the app's background, with transparency around it. To have a nice amount of contrast both in dark mode and in light mode, we use a color and transparency. The app's light background is `#fafafa`. The dark background is `#111111`. In order to use a single image that looks good on both, we use color `#898989` which is halfway between the two backgrounds. The transparency is 0.45, so that the image on a background looks good in both modes.

## Google Fonts

See https://pub.dev/packages/google_fonts#font-bundling-in-assets.
Binary file added assets/img/sad-cloud.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/img/tosti-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/sad-cloud.xcf
Binary file not shown.
Binary file modified assets/tosti-logo.xcf
Binary file not shown.
Loading

0 comments on commit 4b714ca

Please sign in to comment.