Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Updated flavor definition to allow resource separation #634

Merged
merged 10 commits into from
Dec 5, 2023
2 changes: 1 addition & 1 deletion .github/workflows/archive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
distribution: 'temurin'
- name: checkout
uses: actions/checkout@v2
- run: ./gradlew clean assembleDevFullRelease
- run: ./gradlew clean assembleOoniDevFullRelease
- name: uploads dev apk
uses: actions/upload-artifact@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
strategy:
matrix:
version:
- "StableFullRelease"
- "StableFdroidRelease"
- "OoniStableFullRelease"
- "OoniStableFdroidRelease"
aanorbel marked this conversation as resolved.
Show resolved Hide resolved
steps:
- uses: actions/setup-java@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/emulator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
arch: x86_64
profile: Nexus 6
ram-size: 2048M
script: ./gradlew connectedStableFullDebugAndroidTest
script: ./gradlew connectedOoniStableFullDebugAndroidTest
- name: uploads test results
uses: actions/upload-artifact@v2
if: failure()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
distribution: 'temurin'
- name: checkout
uses: actions/checkout@v2
- run: ./gradlew testStableFullRelease
- run: ./gradlew testOoniStableFullRelease
- name: uploads test results
uses: actions/upload-artifact@v2
if: failure()
Expand Down
30 changes: 17 additions & 13 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,20 @@ android {
}
}

flavorDimensions 'testing', 'license'
flavorDimensions = ['provider', 'testing', 'license']
aanorbel marked this conversation as resolved.
Show resolved Hide resolved

productFlavors {
ooni {
dimension 'provider'
}
dw {
dimension 'provider'
applicationId 'com.dw.ooniprobe'
resValue "string", "APP_ID", 'com.dw.ooniprobe'
resValue "string", "APP_NAME", "News Media Scan"
buildConfigField 'String', 'BASE_SOFTWARE_NAME', '"news-media-scan-android"'
buildConfigField "boolean", "SHOW_DISABLED_CARDS", "false"
}
stable {
dimension 'testing'
buildConfigField 'String', 'BASE_SOFTWARE_NAME', '"ooniprobe-android"'
Expand All @@ -59,7 +71,6 @@ android {
versionNameSuffix "-beta.1"
versionCode versionCodeDate()
buildConfigField 'String', 'BASE_SOFTWARE_NAME', '"ooniprobe-android-dev"'
resValue "string", "APP_ID", 'org.openobservatory.ooniprobe.dev'
resValue "string", "APP_NAME", "OONI Dev"
buildConfigField 'String', 'COUNTLY_KEY', '"e6c2cfe53e85951d50567467cef3f9fa2eab32c3"'
}
Expand All @@ -69,7 +80,6 @@ android {
versionNameSuffix "-experimental.1"
versionCode versionCodeDate()
buildConfigField 'String', 'BASE_SOFTWARE_NAME', '"ooniprobe-android-experimental"'
resValue "string", "APP_ID", 'org.openobservatory.ooniprobe.experimental'
resValue "string", "APP_NAME", "OONI Exp"
buildConfigField 'String', 'COUNTLY_KEY', '"e6c2cfe53e85951d50567467cef3f9fa2eab32c3"'
}
Expand All @@ -79,16 +89,10 @@ android {
full {
dimension 'license'
}
dw {
dimension 'testing'
applicationId 'com.dw.ooniprobe'
resValue "string", "APP_ID", 'com.dw.ooniprobe'
resValue "string", "APP_NAME", "News Media Scan"
buildConfigField 'String', 'BASE_SOFTWARE_NAME', '"news-media-scan-android"'
buildConfigField "boolean", "SHOW_DISABLED_CARDS", "false"
//versionName '0.0.1'
//versionCode 1
}
}
applicationVariants.all { variant ->
variant.resValue "string", "APP_ID", "\"${applicationId}\""
// TODO(aanorbel): Use similar solution to set `APP_NAME` in the format `provider` `testing`.
aanorbel marked this conversation as resolved.
Show resolved Hide resolved
}
variantFilter { variant ->
def names = variant.flavors*.name
Expand Down
56 changes: 56 additions & 0 deletions app/src/dw/dev/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
aanorbel marked this conversation as resolved.
Show resolved Hide resolved
"project_info": {
"project_number": "951667061699",
"firebase_url": "https://ooniprobe-android.firebaseio.com",
"project_id": "ooniprobe-android",
"storage_bucket": "ooniprobe-android.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:951667061699:android:6293922d7e8d4180374376",
"android_client_info": {
"package_name": "com.dw.ooniprobe.dev"
}
},
"oauth_client": [
{
"client_id": "951667061699-6ijvga26pl048jrqfnd33o60bqcn0g7c.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.dw.ooniprobe.dev",
"certificate_hash": "a8f4bc5bef49e43d386647bdffdad32c07a8d3b8"
}
},
{
"client_id": "951667061699-2aq9bnbot04qdjbed2bpnl9ee4ro0c39.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyBsbX_pOQoqlyOOyZ6yf7CJf0lZZn6O1yg"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "951667061699-2aq9bnbot04qdjbed2bpnl9ee4ro0c39.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "951667061699-tuprsdjjv9eje6506lkvkski1p6v87lp.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "org.openobservatory.ooniprobe",
"app_store_id": "1199566366"
}
}
]
}
}
}
],
"configuration_version": "1"
}
56 changes: 56 additions & 0 deletions app/src/dw/experimental/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"project_info": {
"project_number": "951667061699",
"firebase_url": "https://ooniprobe-android.firebaseio.com",
"project_id": "ooniprobe-android",
"storage_bucket": "ooniprobe-android.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:951667061699:android:6293922d7e8d4180374376",
"android_client_info": {
"package_name": "com.dw.ooniprobe.experimental"
}
},
"oauth_client": [
{
"client_id": "951667061699-6ijvga26pl048jrqfnd33o60bqcn0g7c.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.dw.ooniprobe.experimental",
"certificate_hash": "a8f4bc5bef49e43d386647bdffdad32c07a8d3b8"
}
},
{
"client_id": "951667061699-2aq9bnbot04qdjbed2bpnl9ee4ro0c39.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyBsbX_pOQoqlyOOyZ6yf7CJf0lZZn6O1yg"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "951667061699-2aq9bnbot04qdjbed2bpnl9ee4ro0c39.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "951667061699-tuprsdjjv9eje6506lkvkski1p6v87lp.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "org.openobservatory.ooniprobe",
"app_store_id": "1199566366"
}
}
]
}
}
}
],
"configuration_version": "1"
}
Binary file modified app/src/dw/ic_launcher-playstore.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 app/src/dw/res/drawable-xxxhdpi/info_banner.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 removed app/src/dw/res/drawable-xxxhdpi/onboarding_1.png
Binary file not shown.
Binary file removed app/src/dw/res/drawable-xxxhdpi/onboarding_2.png
Binary file not shown.
Binary file removed app/src/dw/res/drawable-xxxhdpi/onboarding_3.png
Binary file not shown.
Binary file added app/src/dw/res/drawable/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 3 additions & 4 deletions app/src/dw/res/layout/activity_info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_collapseMode="parallax" >
<ImageView
<include
android:id="@+id/image"
android:layout_height="200dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="@drawable/info_banner" />
layout="@layout/banner"/>
<TextView
android:id="@+id/version"
android:layout_width="match_parent"
Expand Down
21 changes: 21 additions & 0 deletions app/src/dw/res/layout/banner.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="180dp">
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@drawable/info_banner" />
<ImageView
android:layout_marginTop="-90dp"
android:layout_marginBottom="-70dp"
android:layout_marginStart="-10dp"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentTop="true"
android:src="@drawable/logo"/>
</RelativeLayout>
56 changes: 56 additions & 0 deletions app/src/dw/res/layout/fragment_onboarding_1.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/onboarding_background"
android:orientation="vertical">

<include
android:layout_width="match_parent"
android:layout_height="180dp"
layout="@layout/banner"
android:layout_marginBottom="@dimen/onboarding_image_margin_bottom"/>

<TextView
android:id="@+id/WhatIsOONIProbe_Title"
style="@style/TextAppearance.MaterialComponents.Headline6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="@string/Onboarding_WhatIsOONIProbe_Title"
android:textColor="@android:color/white" />

<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginHorizontal="16dp"
android:layout_marginVertical="8dp"
android:layout_weight="1">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/Onboarding_WhatIsOONIProbe_Paragraph"
android:textColor="@android:color/white" />
</ScrollView>

<Button
android:id="@+id/master"
style="@style/TextAppearance.MaterialComponents.Body1"
android:layout_width="match_parent"
android:layout_height="64dp"
android:layout_marginHorizontal="64dp"
android:text="@string/Onboarding_WhatIsOONIProbe_GotIt"
android:textAllCaps="false"
android:textColor="@color/onboarding_background"
app:backgroundTint="@android:color/white"
app:cornerRadius="32dp" />

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="16dp"
android:src="@drawable/dots_1" />
</LinearLayout>
86 changes: 86 additions & 0 deletions app/src/dw/res/layout/fragment_onboarding_2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/onboarding_background_2"
android:orientation="vertical">

<include
android:layout_width="match_parent"
android:layout_height="180dp"
layout="@layout/banner"
android:layout_marginBottom="@dimen/onboarding_image_margin_bottom"/>

<TextView
android:id="@+id/heads_up"
style="@style/TextAppearance.MaterialComponents.Headline6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="@string/Onboarding_ThingsToKnow_Title"
android:textColor="@android:color/white" />

<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginHorizontal="16dp"
android:layout_marginVertical="8dp"
android:layout_weight="1">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:id="@+id/bullet1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/Onboarding_ThingsToKnow_Bullet_1"
android:textColor="@android:color/white" />

<TextView
android:id="@+id/bullet2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/Onboarding_ThingsToKnow_Bullet_2"
android:textColor="@android:color/white" />

<TextView
android:id="@+id/bullet3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/Onboarding_ThingsToKnow_Bullet_3"
android:textColor="@android:color/white" />
</LinearLayout>
</ScrollView>

<Button
android:id="@+id/master"
style="@style/TextAppearance.MaterialComponents.Body1"
android:layout_width="match_parent"
android:layout_height="64dp"
android:layout_marginHorizontal="64dp"
android:text="@string/Onboarding_ThingsToKnow_Button"
android:textAllCaps="false"
android:textColor="@color/onboarding_background"
app:backgroundTint="@android:color/white"
app:cornerRadius="32dp" />

<Button
android:id="@+id/slave"
style="@style/Widget.MaterialComponents.Button.TextButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/Onboarding_ThingsToKnow_LearnMore"
android:textAllCaps="false"
android:textColor="@android:color/white" />

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="16dp"
android:src="@drawable/dots_2" />
</LinearLayout>
Loading
Loading