Skip to content

Commit bd6f553

Browse files
authored
Add firebase-inappmessaging-display sample app for SDK size test. (#633)
* Add firebase-inappmessaging-display sample app for SDK size test.
1 parent 6955146 commit bd6f553

File tree

5 files changed

+100
-2
lines changed

5 files changed

+100
-2
lines changed

tools/measurement/apksize/apksize.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ android {
2121
flavorDimensions "apkSize"
2222
}
2323

24+
apply from: "src/config/config.gradle"
2425
apply from: "src/database/database.gradle"
25-
apply from: "src/storage/storage.gradle"
2626
apply from: "src/firestore/firestore.gradle"
2727
apply from: "src/functions/functions.gradle"
28-
apply from: "src/config/config.gradle"
28+
apply from: "src/inappmessagingdisplay/inappmessaging-display.gradle"
29+
apply from: "src/storage/storage.gradle"
2930

3031
/**
3132
* This task builds all supported variants (only aggressive as of writing) and writes the

tools/measurement/apksize/sdks.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ functions-release:6
88
storage-release:7
99
config-aggressive:9
1010
config-release:10
11+
inappmessagingdisplay-aggressive:11
12+
inappmessagingdisplay-release:12
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright 2019 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
16+
android {
17+
productFlavors {
18+
inappmessagingdisplay {
19+
dimension "apkSize"
20+
applicationId "com.google.apksize.inappmessaging_display"
21+
}
22+
}
23+
sourceSets {
24+
inappmessagingdisplay {
25+
java.srcDirs = [
26+
"src/inappmessagingdisplay/java",
27+
]
28+
}
29+
}
30+
}
31+
dependencies {
32+
inappmessagingdisplayImplementation project(":firebase-inappmessaging-display")
33+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Copyright 2019 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package com.google.apksize;
16+
17+
import android.content.Context;
18+
import com.google.firebase.inappmessaging.FirebaseInAppMessagingClickListener;
19+
import com.google.firebase.inappmessaging.model.Action;
20+
import com.google.firebase.inappmessaging.model.CampaignMetadata;
21+
import com.google.firebase.inappmessaging.model.InAppMessage;
22+
23+
public class InAppMessagingDisplay implements SampleCode {
24+
25+
public class MyClickListener implements FirebaseInAppMessagingClickListener {
26+
@Override
27+
public void messageClicked(InAppMessage inAppMessage, Action action) {
28+
String url = action.getActionUrl();
29+
CampaignMetadata metadata = inAppMessage.getCampaignMetadata();
30+
}
31+
}
32+
33+
@Override
34+
public void runSample(Context context) {
35+
MyClickListener listener = new MyClickListener();
36+
FirebaseInAppMessaging.getInstance().addClickListener(listener);
37+
}
38+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Copyright 2019 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package com.google.apksize;
16+
17+
import android.content.Context;
18+
19+
public class SampleCodeLoader {
20+
21+
public void runSamples(Context context) {
22+
new InAppMessagingDisplay().runSample(context);
23+
}
24+
}

0 commit comments

Comments
 (0)