Skip to content

Commit 013e7e4

Browse files
authored
feat: add branded splash page (#5)
1 parent 9b29724 commit 013e7e4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+779
-79
lines changed

.github/workflows/pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: "Pull Request"
22

3-
on: [ workflow_dispatch, pull_request ]
3+
on: [ push, pull_request, workflow_dispatch ]
44

55
jobs:
66

core-sdk-samples/higgs-shop-sample-app/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ The purpose of the app is to highlight the following features:
1212

1313
## Getting Started
1414

15-
1. In this repo, open a sample app (inside samples folder) in Android Studio
15+
1. Open this repository in Android Studio after cloning
1616

17-
2. Update the `HIGGS_SHOP_SAMPLE_APP_KEY` variable with your mParticle Android API Key inside app/build.gradle.kts file
17+
2. Update the `HIGGS_SHOP_SAMPLE_APP_KEY` and `HIGGS_SHOP_SAMPLE_APP_SECRET` variable with your mParticle Android API Key inside app/build.gradle.kts file
1818

1919
- Visit your [mParticle Workspace](https://app.mparticle.com/setup/inputs/apps) to generate API Credentials
2020

21-
3. Run the project in Android emulator. This will open the Higgs Shop Sample App
21+
3. Run the Higgs Shop sample app project (inside core-sdk-samples folder) in Android emulator. This will open the Higgs Shop Sample App
2222

2323
### API Credentials
2424

core-sdk-samples/higgs-shop-sample-app/app/build.gradle.kts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ android {
2020
buildConfigField("String", "HIGGS_SHOP_SAMPLE_APP_KEY", "\"${System.getenv("HIGGS_SHOP_SAMPLE_APP_KEY")}\"")
2121
buildConfigField("String", "HIGGS_SHOP_SAMPLE_APP_SECRET", "\"${System.getenv("HIGGS_SHOP_SAMPLE_APP_SECRET")}\"")
2222
}
23-
2423
buildTypes {
2524
getByName("release") {
2625
isMinifyEnabled = false
@@ -37,12 +36,18 @@ dependencies {
3736
implementation("androidx.constraintlayout:constraintlayout:2.1.3")
3837
implementation("androidx.appcompat:appcompat:1.4.1")
3938
implementation("com.google.android.material:material:1.5.0")
40-
41-
implementation("com.mparticle:android-core:5.35.2")
42-
43-
androidTestImplementation("androidx.test.ext:junit:1.1.3")
44-
androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0")
39+
implementation("com.mparticle:android-core:5.35.3")
4540
testImplementation("junit:junit:4.13.2")
41+
androidTestImplementation("androidx.test:core:1.4.0")
42+
androidTestImplementation("androidx.test:core-ktx:1.4.0")
43+
androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0")
44+
androidTestImplementation("androidx.test:rules:1.4.0")
45+
androidTestImplementation("androidx.test.ext:junit:1.1.3")
46+
androidTestImplementation("androidx.test.ext:junit-ktx:1.1.3")
47+
androidTestImplementation("androidx.test.ext:truth:1.4.0")
48+
androidTestImplementation("com.google.truth:truth:1.1.3")
49+
androidTestImplementation("androidx.test:runner:1.4.0")
50+
androidTestUtil("androidx.test:orchestrator:1.4.1")
4651
}
4752

4853
fun buildVersionCode(): Int {

core-sdk-samples/higgs-shop-sample-app/app/src/androidTest/kotlin/com/mparticle/example/higgsshopsampleapp/ExampleInstrumentedTest.kt

Lines changed: 0 additions & 19 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package com.mparticle.example.higgsshopsampleapp
2+
3+
import androidx.test.ext.junit.rules.activityScenarioRule
4+
import androidx.test.espresso.Espresso.onView
5+
import androidx.test.espresso.assertion.ViewAssertions.matches
6+
import androidx.test.espresso.matcher.ViewMatchers.withId
7+
import androidx.test.espresso.matcher.ViewMatchers.withText
8+
import androidx.test.filters.LargeTest
9+
import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner
10+
import androidx.test.platform.app.InstrumentationRegistry
11+
import com.mparticle.example.higgsshopsampleapp.activities.LandingActivity
12+
import org.junit.Assert.*
13+
import org.junit.Rule
14+
import org.junit.Test
15+
import org.junit.runner.RunWith
16+
17+
18+
@RunWith(AndroidJUnit4ClassRunner::class)
19+
@LargeTest
20+
class ExampleInstrumentedTests {
21+
22+
@get:Rule
23+
var activityScenarioRule = activityScenarioRule<LandingActivity>()
24+
25+
@Test
26+
fun testUseAppContext() {
27+
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
28+
assertEquals("com.mparticle.example.higgsshopsampleapp", appContext.packageName)
29+
}
30+
31+
@Test
32+
fun testShowLandingCTA() {
33+
onView(withId(R.id.landing_cta)).check(matches(withText(R.string.landing_cta)))
34+
}
35+
}

core-sdk-samples/higgs-shop-sample-app/app/src/main/AndroidManifest.xml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,21 @@
1111
android:label="@string/app_name"
1212
android:roundIcon="@mipmap/ic_launcher_round"
1313
android:supportsRtl="true"
14-
android:theme="@style/Theme.HiggsShopSampleApp">
14+
android:theme="@style/Theme.mParticle.Activity.Landing">
1515
<activity
16-
android:name="com.mparticle.example.higgsshopsampleapp.SplashActivity"
17-
android:noHistory="true"
18-
android:theme="@style/Theme.mParticle.Activity.Splash"
16+
android:name="com.mparticle.example.higgsshopsampleapp.activities.SplashActivity"
17+
android:theme="@style/Theme.mParticle.Activity.Landing"
1918
android:exported="true">
2019
<intent-filter>
2120
<action android:name="android.intent.action.MAIN" />
2221
<category android:name="android.intent.category.DEFAULT" />
2322
<category android:name="android.intent.category.LAUNCHER" />
2423
</intent-filter>
2524
</activity>
25+
<activity
26+
android:name="com.mparticle.example.higgsshopsampleapp.activities.LandingActivity"
27+
android:theme="@style/Theme.mParticle.Activity.Landing"
28+
android:exported="true">
29+
</activity>
2630
</application>
2731
</manifest>
46.2 KB
Loading

core-sdk-samples/higgs-shop-sample-app/app/src/main/kotlin/com/mparticle/example/higgsshopsampleapp/HiggsShopSampleApplication.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,4 @@ class HiggsShopSampleApplication: Application() {
1717

1818
MParticle.start(options)
1919
}
20-
2120
}

core-sdk-samples/higgs-shop-sample-app/app/src/main/kotlin/com/mparticle/example/higgsshopsampleapp/SplashActivity.kt

Lines changed: 0 additions & 11 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.mparticle.example.higgsshopsampleapp.activities
2+
3+
import android.os.Bundle
4+
import androidx.appcompat.app.AppCompatActivity
5+
import com.mparticle.MParticle
6+
import com.mparticle.example.higgsshopsampleapp.R
7+
8+
9+
class LandingActivity : AppCompatActivity() {
10+
override fun onCreate(savedInstanceState: Bundle?) {
11+
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
12+
13+
super.onCreate(savedInstanceState)
14+
setContentView(R.layout.activity_landing)
15+
MParticle.getInstance()?.logScreen("Landing")
16+
}
17+
}

0 commit comments

Comments
 (0)