Skip to content

Commit

Permalink
Merge branch 'develop' into dependabot/gradle/mockito-5.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
miquelbeltran authored Jan 30, 2025
2 parents 1b20628 + 5c846a1 commit 79a446c
Show file tree
Hide file tree
Showing 58 changed files with 1,629 additions and 801 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: "CI"

on: [push]

# Cancel running job if a new push is made to the same branch
# https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
JAVA_VERSION: 17
# See https://github.com/actions/setup-java?tab=readme-ov-file#supported-distributions
JAVA_DISTRIBUTION: 'adopt'

jobs:
spotless:
name: "Spotless"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-version: ${{ env.JAVA_VERSION }}
- run: ./gradlew spotlessCheck

app-lint:
name: "app:lint"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-version: ${{ env.JAVA_VERSION }}
- run: ./gradlew app:lint

provider-lint:
name: "provider:lint"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-version: ${{ env.JAVA_VERSION }}
- run: ./gradlew provider:lint

app-assemble-debug:
name: "app:assembleDebug"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-version: ${{ env.JAVA_VERSION }}
- run: ./gradlew app:assembleDebug

provider-assemble-debug:
name: "provider:assembleDebug"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-version: ${{ env.JAVA_VERSION }}
- run: ./gradlew provider:assembleDebug

provider-test:
name: "provider:test"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-version: ${{ env.JAVA_VERSION }}
- run: ./gradlew provider:test
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/migrations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 1 addition & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ If you need to support Android 4.1+, please use Raygun4Android 4.0.1.

Raygun4Android 4.0.1 is currently considered to be the stable release of the provider and is tagged in the repository and supports Android 4.1+ (API 16+)

The `develop` branch reflects ongoing work on the 4.1 line as tagged snapshots and only support
The `develop` branch reflects ongoing work on the 4.1/5 line as tagged snapshots and only support

The `master` branch used to be the branch for ongoing work and releases until `4.1.0-alpha1`. In the future, the `master` branch will reflect release builds.

Expand Down Expand Up @@ -66,14 +66,6 @@ In your app's **AndroidManifest.xml**, make sure you have granted Internet permi
Inside the ```<application>``` element, add:

```xml
<service android:name="com.raygun.raygun4android.services.CrashReportingPostService"
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE"
android:process=":crashreportingpostservice"/>
<service android:name="com.raygun.raygun4android.services.RUMPostService"
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE"
android:process=":rumpostservice"/>
<meta-data android:name="com.raygun.raygun4android.apikey"
android:value="PASTE_YOUR_API_KEY_HERE" />
```
Expand Down
11 changes: 9 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ android {
}
}

compileSdk 34
compileSdk 35

defaultConfig {
applicationId "com.raygun.raygun4android"
minSdkVersion 21
targetSdkVersion 34
targetSdkVersion 35
buildConfigField("long", "VERSION_CODE", VERSION_CODE)
buildConfigField("String","VERSION_NAME","\"${VERSION_NAME}-sample\"")
multiDexEnabled true
Expand Down Expand Up @@ -115,6 +115,12 @@ android {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
kotlin {
jvmToolchain(17)
}

// Setup RG tasks
createRaygunNotifyDeploymentTask(RAYGUN_API_TOKEN, RAYGUN_API_KEY, RAYGUN_GROUP, defaultConfig.versionName, localUserName, localUserEmail)
Expand All @@ -136,6 +142,7 @@ dependencies {
implementation(libs.androidx.constraintlayout.constraintlayout)
implementation(libs.android.material.material)
implementation(libs.androidx.multidex.multidex)
implementation(libs.androidx.activity)

testImplementation(libs.junit)
testImplementation(libs.mockito.core)
Expand Down
28 changes: 12 additions & 16 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,27 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity" android:exported="true">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity
android:name=".SecondActivity"
android:parentActivityName=".MainActivity">
</activity>

<service
android:name="com.raygun.raygun4android.services.CrashReportingPostService"
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE"
android:process=":crashreportingpostservice"/>
<service
android:name="com.raygun.raygun4android.services.RUMPostService"
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE"
android:process=":rumpostservice"/>
android:parentActivityName=".MainActivity" />
<activity
android:name=".fragments.NavigationActivity"
android:parentActivityName=".MainActivity" />
<activity
android:name=".fragments.NavigationFragmentSwapActivity"
android:parentActivityName=".MainActivity" />
<meta-data
android:name="com.raygun.raygun4android.apikey"
android:value="PASTE_YOUR_API_KEY_HERE" />
android:value="YOUR_API_KEY_HERE" />
</application>

</manifest>
14 changes: 14 additions & 0 deletions app/src/main/java/com/raygun/raygun4android/sample/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import androidx.appcompat.app.AppCompatActivity
import com.google.android.material.snackbar.Snackbar
import com.raygun.raygun4android.RaygunClient
import com.raygun.raygun4android.messages.shared.RaygunUserInfo
import com.raygun.raygun4android.sample.fragments.NavigationActivity
import com.raygun.raygun4android.sample.fragments.NavigationFragmentSwapActivity

class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
Expand Down Expand Up @@ -39,6 +41,8 @@ class MainActivity : AppCompatActivity() {
val textViewAppVersion = findViewById<TextView>(R.id.textView_appVersion)
val textViewProviderVersion = findViewById<TextView>(R.id.textView_providerVersion)
val buttonSecondActivity = findViewById<Button>(R.id.button_secondActivity)
val buttonNavigationActivity = findViewById<Button>(R.id.button_navigationActivity)
val buttonFragmentSwapActivity = findViewById<Button>(R.id.button_navigationFragmentSwapActivity)

buttonSend.setOnClickListener {
val tw = HashMap<String, String>()
Expand Down Expand Up @@ -142,6 +146,16 @@ class MainActivity : AppCompatActivity() {
startSecondActivity.launch(SecondActivity.getIntent(this@MainActivity))
}

buttonNavigationActivity.setOnClickListener {
// Launches an Activity containing a Fragment
this.startActivity(NavigationActivity.getIntent(this))
}

buttonFragmentSwapActivity.setOnClickListener {
// Launches an Activity containing a Fragment
this.startActivity(NavigationFragmentSwapActivity.getIntent(this))
}

textViewAppVersion.text =
getString(
R.string.app_version_text,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class SecondActivity : AppCompatActivity() {
com.raygun.raygun4android.BuildConfig.BUILD_TYPE,
)

// Handle hardware and back presses
// Handle hardware button and back presses
onBackPressedDispatcher.addCallback(
this,
object : OnBackPressedCallback(true) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.raygun.raygun4android.sample.fragments

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import com.raygun.raygun4android.sample.R

/**
* A simple empty [Fragment].
*/
class Fragment1 : Fragment() {
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?,
): View? {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_1, container, false)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.raygun.raygun4android.sample.fragments

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import androidx.fragment.app.Fragment
import com.raygun.raygun4android.sample.R

class FragmentSwap1 : Fragment() {
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?,
): View? {
val view = inflater.inflate(R.layout.fragment_swap1, container, false)
view.findViewById<Button>(R.id.button).setOnClickListener {
parentFragmentManager.beginTransaction().apply {
replace(R.id.fragment_container_view, FragmentSwap2())
commit()
}
}
return view
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.raygun.raygun4android.sample.fragments

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import androidx.fragment.app.Fragment
import com.raygun.raygun4android.sample.R

class FragmentSwap2 : Fragment() {
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?,
): View? {
val view = inflater.inflate(R.layout.fragment_swap2, container, false)
view.findViewById<Button>(R.id.button).setOnClickListener {
parentFragmentManager.beginTransaction().apply {
replace(R.id.fragment_container_view, FragmentSwap1())
commit()
}
}
return view
}
}
Loading

0 comments on commit 79a446c

Please sign in to comment.