File tree Expand file tree Collapse file tree 3 files changed +58
-4
lines changed
app/src/main/java/com/android/developers/androidify Expand file tree Collapse file tree 3 files changed +58
-4
lines changed Original file line number Diff line number Diff line change 42
42
env :
43
43
DEBUG_GOOGLE_SERVICES_JSON_BASE64 : ${{ secrets.DEBUG_GOOGLE_SERVICES_JSON_BASE64 }}
44
44
run : |
45
- echo $DEBUG_GOOGLE_SERVICES_JSON_BASE64 | base64 --decode > app/google-services.json
45
+ if [ -z "$DEBUG_GOOGLE_SERVICES_JSON_BASE64" ]; then
46
+ echo "DEBUG_GOOGLE_SERVICES_JSON_BASE64 is empty. Copying test-google-services.json."
47
+ cp test-google-services.json app/google-services.json
48
+ else
49
+ echo "Decoding DEBUG_GOOGLE_SERVICES_JSON_BASE64."
50
+ echo $DEBUG_GOOGLE_SERVICES_JSON_BASE64 | base64 --decode > app/google-services.json
51
+ fi
46
52
47
53
- name : Apply Spotless
48
54
run : ./gradlew spotlessApply
@@ -131,7 +137,13 @@ jobs:
131
137
env :
132
138
DEBUG_GOOGLE_SERVICES_JSON_BASE64 : ${{ secrets.DEBUG_GOOGLE_SERVICES_JSON_BASE64 }}
133
139
run : |
134
- echo $DEBUG_GOOGLE_SERVICES_JSON_BASE64 | base64 --decode > app/google-services.json
140
+ if [ -z "$DEBUG_GOOGLE_SERVICES_JSON_BASE64" ]; then
141
+ echo "DEBUG_GOOGLE_SERVICES_JSON_BASE64 is empty. Copying test-google-services.json."
142
+ cp test-google-services.json app/google-services.json
143
+ else
144
+ echo "Decoding DEBUG_GOOGLE_SERVICES_JSON_BASE64."
145
+ echo $DEBUG_GOOGLE_SERVICES_JSON_BASE64 | base64 --decode > app/google-services.json
146
+ fi
135
147
136
148
- name : Build
137
149
run : ./gradlew assembleDebug assembleDebugAndroidTest
Original file line number Diff line number Diff line change @@ -33,12 +33,16 @@ import com.android.developers.androidify.navigation.MainNavigation
33
33
import com.android.developers.androidify.theme.AndroidifyTheme
34
34
import com.android.developers.androidify.util.LocalOcclusion
35
35
import dagger.hilt.android.AndroidEntryPoint
36
+ import java.util.function.Consumer
36
37
37
38
@ExperimentalMaterial3ExpressiveApi
38
39
@AndroidEntryPoint
39
40
class MainActivity : ComponentActivity () {
40
41
41
42
private val isWindowOccluded = mutableStateOf(false )
43
+ private val presentationListener = Consumer <Boolean > { isMinFractionRendered ->
44
+ isWindowOccluded.value = ! isMinFractionRendered
45
+ }
42
46
43
47
override fun onCreate (savedInstanceState : Bundle ? ) {
44
48
super .onCreate(savedInstanceState)
@@ -76,8 +80,17 @@ class MainActivity : ComponentActivity() {
76
80
windowManager.registerTrustedPresentationListener(
77
81
window.decorView.windowToken,
78
82
presentationThreshold,
79
- mainExecutor
80
- ) { isMinFractionRendered -> isWindowOccluded.value = ! isMinFractionRendered }
83
+ mainExecutor,
84
+ presentationListener
85
+ )
86
+ }
87
+ }
88
+
89
+ override fun onDetachedFromWindow () {
90
+ super .onDetachedFromWindow()
91
+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .VANILLA_ICE_CREAM ) {
92
+ val windowManager = getSystemService(WINDOW_SERVICE ) as WindowManager
93
+ windowManager.unregisterTrustedPresentationListener(presentationListener)
81
94
}
82
95
}
83
96
Original file line number Diff line number Diff line change
1
+ {
2
+ "project_info" : {
3
+ "project_number" : " abc" ,
4
+ "project_id" : " YourProjectId" ,
5
+ "storage_bucket" : " abc"
6
+ },
7
+ "client" : [
8
+ {
9
+ "client_info" : {
10
+ "mobilesdk_app_id" : " APlaceholderAPIKeyWith-ThirtyNineCharsX" ,
11
+ "android_client_info" : {
12
+ "package_name" : " com.android.developers.androidify"
13
+ }
14
+ },
15
+ "oauth_client" : [],
16
+ "api_key" : [
17
+ {
18
+ "current_key" : " APlaceholderAPIKeyWith-ThirtyNineCharsX"
19
+ }
20
+ ],
21
+ "services" : {
22
+ "appinvite_service" : {
23
+ "other_platform_oauth_client" : []
24
+ }
25
+ }
26
+ }
27
+ ],
28
+ "configuration_version" : " 1"
29
+ }
You can’t perform that action at this time.
0 commit comments