mirror of
https://github.com/AU-COVIDSafe/mobile-android.git
synced 2025-01-18 08:46:35 +00:00
COVIDSafe code from version 2.5 (#49)
This commit is contained in:
parent
bdf19e8b62
commit
a63cc33286
8 changed files with 136 additions and 7 deletions
13
.circleci/README.md
Normal file
13
.circleci/README.md
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
|
||||||
|
## Introduction
|
||||||
|
|
||||||
|
CircleCI has a workflow configured to build UAT builds once a merge is done to the master branch. In the same way, there is a workflow for production and it runs when a commit is done to any /release_* branch.
|
||||||
|
|
||||||
|
|
||||||
|
## CircleCI Project Configuration
|
||||||
|
|
||||||
|
No environment variables are needed as the gradle project is configured and the repo has all dependencies.
|
||||||
|
|
||||||
|
## Distribution
|
||||||
|
|
||||||
|
Please download the APK from the generated artefacts for distribution
|
60
.circleci/config.yml
Normal file
60
.circleci/config.yml
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
# Circle CI Build config for COVIDSafe
|
||||||
|
version: 2.1
|
||||||
|
|
||||||
|
orbs:
|
||||||
|
android: circleci/android@0.2.0
|
||||||
|
|
||||||
|
executors:
|
||||||
|
android-executor: android/android
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
# test the build
|
||||||
|
test-build:
|
||||||
|
executor: android-executor
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- run: touch local.properties
|
||||||
|
|
||||||
|
# do a UAT apk build
|
||||||
|
uat-build:
|
||||||
|
executor: android-executor
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- run:
|
||||||
|
command: ./gradlew assembleDebug
|
||||||
|
- store_artifacts:
|
||||||
|
path: ./app/build/outputs
|
||||||
|
|
||||||
|
# do a release build
|
||||||
|
release-build:
|
||||||
|
executor: android-executor
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- run:
|
||||||
|
command: ./gradlew assembleRelease
|
||||||
|
- store_artifacts:
|
||||||
|
path: ./app/build/outputs
|
||||||
|
|
||||||
|
workflows:
|
||||||
|
version: 2
|
||||||
|
build-deploy:
|
||||||
|
jobs:
|
||||||
|
# test the build on every commit on every branch
|
||||||
|
- test-build
|
||||||
|
|
||||||
|
# build a UAT apk on commit to master
|
||||||
|
- uat-build:
|
||||||
|
requires:
|
||||||
|
- test-build
|
||||||
|
filters:
|
||||||
|
branches:
|
||||||
|
only: master
|
||||||
|
|
||||||
|
# release a build on commit to any release branch
|
||||||
|
- release-build:
|
||||||
|
requires:
|
||||||
|
- test-build
|
||||||
|
filters:
|
||||||
|
branches:
|
||||||
|
only: /release_*/
|
|
@ -29,8 +29,8 @@ android {
|
||||||
applicationId "au.gov.health.covidsafe"
|
applicationId "au.gov.health.covidsafe"
|
||||||
minSdkVersion rootProject.ext.minSdkVersion
|
minSdkVersion rootProject.ext.minSdkVersion
|
||||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||||
versionCode 124
|
versionCode 125
|
||||||
versionName "2.4"
|
versionName "2.5"
|
||||||
buildConfigField "String", "GITHASH", "\"${getGitHash()}\""
|
buildConfigField "String", "GITHASH", "\"${getGitHash()}\""
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ object LinkBuilder {
|
||||||
return url
|
return url
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getPrivacyTopicsUrl(): String {
|
fun getPrivacyTopicsUrl(): String {
|
||||||
val url = buildLocalisedURL(PRIVACY_TOPICS_BASE)
|
val url = buildLocalisedURL(PRIVACY_TOPICS_BASE)
|
||||||
CentralLog.d(TAG, "getPrivacyTopicsUrl() $url")
|
CentralLog.d(TAG, "getPrivacyTopicsUrl() $url")
|
||||||
return url
|
return url
|
||||||
|
|
|
@ -8,6 +8,7 @@ import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.IntentFilter
|
import android.content.IntentFilter
|
||||||
import android.graphics.Typeface
|
import android.graphics.Typeface
|
||||||
|
import android.net.Uri
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.text.method.LinkMovementMethod
|
import android.text.method.LinkMovementMethod
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
|
@ -40,6 +41,7 @@ import au.gov.health.covidsafe.utils.AnimationUtils.slideAnimation
|
||||||
import au.gov.health.covidsafe.utils.NetworkConnectionCheck
|
import au.gov.health.covidsafe.utils.NetworkConnectionCheck
|
||||||
import au.gov.health.covidsafe.utils.SlideDirection
|
import au.gov.health.covidsafe.utils.SlideDirection
|
||||||
import au.gov.health.covidsafe.utils.SlideType
|
import au.gov.health.covidsafe.utils.SlideType
|
||||||
|
import kotlinx.android.synthetic.main.fragment_data_privacy.view.*
|
||||||
import kotlinx.android.synthetic.main.fragment_home.*
|
import kotlinx.android.synthetic.main.fragment_home.*
|
||||||
import kotlinx.android.synthetic.main.fragment_home_case_statistics.*
|
import kotlinx.android.synthetic.main.fragment_home_case_statistics.*
|
||||||
import kotlinx.android.synthetic.main.fragment_home_external_links.*
|
import kotlinx.android.synthetic.main.fragment_home_external_links.*
|
||||||
|
@ -51,9 +53,7 @@ import kotlinx.android.synthetic.main.view_home_setup_incomplete.*
|
||||||
import kotlinx.android.synthetic.main.view_national_case_statistics.national_case_layout
|
import kotlinx.android.synthetic.main.view_national_case_statistics.national_case_layout
|
||||||
import kotlinx.android.synthetic.main.view_state_case_statistics.*
|
import kotlinx.android.synthetic.main.view_state_case_statistics.*
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.ensureActive
|
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import org.json.JSONObject
|
|
||||||
import pub.devrel.easypermissions.AppSettingsDialog
|
import pub.devrel.easypermissions.AppSettingsDialog
|
||||||
import pub.devrel.easypermissions.EasyPermissions
|
import pub.devrel.easypermissions.EasyPermissions
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
|
@ -250,6 +250,7 @@ class HomeFragment : BaseFragment(), EasyPermissions.PermissionCallbacks, Networ
|
||||||
initializeAppShareNavigation()
|
initializeAppShareNavigation()
|
||||||
initializeHelpTopicsNavigation()
|
initializeHelpTopicsNavigation()
|
||||||
initializeChangeLanguageNavigation()
|
initializeChangeLanguageNavigation()
|
||||||
|
initializePrivacyNavigation()
|
||||||
|
|
||||||
registerBroadcastListener()
|
registerBroadcastListener()
|
||||||
|
|
||||||
|
@ -343,6 +344,15 @@ class HomeFragment : BaseFragment(), EasyPermissions.PermissionCallbacks, Networ
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun initializePrivacyNavigation() {
|
||||||
|
privacy_link.setOnClickListener {
|
||||||
|
val browserIntent = Intent(Intent.ACTION_VIEW)
|
||||||
|
val url = LinkBuilder.getPrivacyTopicsUrl()
|
||||||
|
browserIntent.data = Uri.parse(url)
|
||||||
|
startActivity(browserIntent)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun initializeChangeLanguageNavigation() {
|
private fun initializeChangeLanguageNavigation() {
|
||||||
change_language_link.setOnClickListener {
|
change_language_link.setOnClickListener {
|
||||||
HelpFragment.anchor = "#other-languages"
|
HelpFragment.anchor = "#other-languages"
|
||||||
|
|
15
app/src/main/res/drawable/ic_privace.xml
Normal file
15
app/src/main/res/drawable/ic_privace.xml
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="20dp"
|
||||||
|
android:height="22dp"
|
||||||
|
android:viewportWidth="20"
|
||||||
|
android:viewportHeight="22">
|
||||||
|
<path
|
||||||
|
android:pathData="M10,15.7504C7.0276,15.7504 4.6094,13.3229 4.6094,10.3392C4.6094,7.3554 7.0276,4.9279 10,4.9279C12.9724,4.9279 15.3906,7.3554 15.3906,10.3392C15.3906,13.3229 12.9724,15.7504 10,15.7504ZM10,6.4279C7.8547,6.4279 6.1094,8.1825 6.1094,10.3392C6.1094,12.4958 7.8547,14.2504 10,14.2504C12.1453,14.2504 13.8906,12.4958 13.8906,10.3392C13.8906,8.1825 12.1453,6.4279 10,6.4279Z"
|
||||||
|
android:fillColor="#000000"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M8.6708,12.1926L7.318,10.614L8.4571,9.6379L9.2768,10.5945L11.6084,8.2095L12.681,9.2581L9.7767,12.2289C9.6353,12.3734 9.0938,12.5781 8.6708,12.1926Z"
|
||||||
|
android:fillColor="#000000"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M9.2736,21.7908C2.914,18.8165 0.3846,11.7612 0.5378,5.1399C0.5457,4.7977 0.785,4.5044 1.119,4.4275C2.9126,4.0138 4.3178,2.7239 4.304,0.7833C4.3023,0.3739 4.644,0.0313 5.0541,0.0313H14.9488C15.3589,0.0313 15.7005,0.3737 15.6989,0.7831C15.6592,2.6089 17.0626,4.1278 18.8367,4.4182C19.1942,4.4767 19.4587,4.782 19.4653,5.1437C19.5833,11.6798 16.7057,18.4837 10.7649,21.7287C10.5148,21.8653 10.0583,22.1577 9.2736,21.7908ZM9.8833,20.4222C9.9351,20.4452 9.9941,20.4425 10.045,20.4147C11.9114,19.3953 17.9046,15.3651 17.9688,5.7555C16.0295,5.1968 14.514,3.5439 14.2425,1.529H5.7605C5.4887,3.5454 3.9713,5.1991 2.0302,5.7567C2.0197,11.5028 4.2542,17.9225 9.8833,20.4222C9.9351,20.4453 9.091,20.0705 9.8833,20.4222Z"
|
||||||
|
android:fillColor="#000000"/>
|
||||||
|
</vector>
|
|
@ -48,11 +48,10 @@
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:id="@+id/share_card_view"
|
android:id="@+id/privacy_card"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/space_24"
|
android:layout_marginTop="@dimen/space_24"
|
||||||
app:cardBackgroundColor="@color/white"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/change_language_card"
|
app:layout_constraintTop_toBottomOf="@+id/change_language_card"
|
||||||
card_view:cardBackgroundColor="@color/white"
|
card_view:cardBackgroundColor="@color/white"
|
||||||
card_view:cardCornerRadius="0dp"
|
card_view:cardCornerRadius="0dp"
|
||||||
|
@ -60,6 +59,36 @@
|
||||||
card_view:cardUseCompatPadding="true"
|
card_view:cardUseCompatPadding="true"
|
||||||
card_view:contentPadding="0dp">
|
card_view:contentPadding="0dp">
|
||||||
|
|
||||||
|
<au.gov.health.covidsafe.ui.home.view.ExternalLinkCard
|
||||||
|
android:id="@+id/privacy_link"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/white"
|
||||||
|
android:minHeight="@dimen/external_link_height"
|
||||||
|
android:paddingTop="@dimen/space_4"
|
||||||
|
android:paddingBottom="@dimen/space_4"
|
||||||
|
app:external_linkCard_content="@string/privacy_policy_description"
|
||||||
|
app:external_linkCard_start_icon="@drawable/ic_privace"
|
||||||
|
app:external_linkCard_start_icon_background="@drawable/background_circular_green"
|
||||||
|
app:external_linkCard_start_icon_padding="@dimen/space_8"
|
||||||
|
app:external_linkCard_title="@string/privacy_policy" />
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/share_card_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/space_24"
|
||||||
|
app:cardBackgroundColor="@color/white"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/privacy_card"
|
||||||
|
card_view:cardBackgroundColor="@color/white"
|
||||||
|
card_view:cardCornerRadius="0dp"
|
||||||
|
card_view:cardMaxElevation="@dimen/card_elevation_10dp"
|
||||||
|
card_view:cardUseCompatPadding="true"
|
||||||
|
card_view:contentPadding="0dp"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
<include layout="@layout/view_covid_share_tile" />
|
<include layout="@layout/view_covid_share_tile" />
|
||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
|
@ -475,6 +475,8 @@
|
||||||
<string name="postcode_api_error">There was an error. Check your internet connection and try again.</string>
|
<string name="postcode_api_error">There was an error. Check your internet connection and try again.</string>
|
||||||
<string name="postcode_change_label">Current postcode in Australia </string>
|
<string name="postcode_change_label">Current postcode in Australia </string>
|
||||||
<string name="postcode_success">Your postcode has been updated</string>
|
<string name="postcode_success">Your postcode has been updated</string>
|
||||||
|
<string name="privacy_policy">Privacy policy</string>
|
||||||
|
<string name="privacy_policy_description">Read the privacy policy for COVIDSafe app</string>
|
||||||
<string name="queensland">Queensland</string>
|
<string name="queensland">Queensland</string>
|
||||||
<string name="ReceivePinIssue">Issues receiving your PIN?</string>
|
<string name="ReceivePinIssue">Issues receiving your PIN?</string>
|
||||||
<string name="recovered">Total cases recovered</string>
|
<string name="recovered">Total cases recovered</string>
|
||||||
|
|
Loading…
Reference in a new issue