Skip to content

Commit 361fa2d

Browse files
committed
run spotless apply
1 parent ed62729 commit 361fa2d

File tree

8 files changed

+92
-98
lines changed

8 files changed

+92
-98
lines changed

.idea/kotlinc.xml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/androidTest/java/com/raygun/raygun4android/sample/MainActivityTest.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,9 @@ import org.junit.runner.RunWith
1919

2020
@RunWith(AndroidJUnit4::class)
2121
class MainActivityTest {
22-
@get:Rule
23-
val activityRule = ActivityScenarioRule(MainActivity::class.java)
22+
@get:Rule val activityRule = ActivityScenarioRule(MainActivity::class.java)
2423

25-
@get:Rule
26-
val intentRule = IntentsTestRule(MainActivity::class.java)
24+
@get:Rule val intentRule = IntentsTestRule(MainActivity::class.java)
2725

2826
@Test
2927
fun testPackageContext() {

app/src/main/java/com/raygun/raygun4android/sample/MainActivity.kt

Lines changed: 39 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ class MainActivity : AppCompatActivity() {
4242
val textViewProviderVersion = findViewById<TextView>(R.id.textView_providerVersion)
4343
val buttonSecondActivity = findViewById<Button>(R.id.button_secondActivity)
4444
val buttonNavigationActivity = findViewById<Button>(R.id.button_navigationActivity)
45-
val buttonFragmentSwapActivity = findViewById<Button>(R.id.button_navigationFragmentSwapActivity)
45+
val buttonFragmentSwapActivity =
46+
findViewById<Button>(R.id.button_navigationFragmentSwapActivity)
4647

4748
buttonSend.setOnClickListener {
4849
val tw = HashMap<String, String>()
@@ -58,12 +59,12 @@ class MainActivity : AppCompatActivity() {
5859
// Manual exception creation & sending via 2 strings
5960
RaygunClient.send("My custom message", "The reason for the error", null, tw)
6061

61-
Snackbar.make(
62-
it,
63-
getString(R.string.you_have_just_sent_an_error_with_raygun4android),
64-
Snackbar.LENGTH_SHORT,
65-
)
66-
.show()
62+
Snackbar
63+
.make(
64+
it,
65+
getString(R.string.you_have_just_sent_an_error_with_raygun4android),
66+
Snackbar.LENGTH_SHORT,
67+
).show()
6768
}
6869

6970
buttonCrash.setOnClickListener {
@@ -92,24 +93,24 @@ class MainActivity : AppCompatActivity() {
9293
"This is here purely so that our alternative value for i gets used and not optimised away " +
9394
"in a release build: $i",
9495
)
95-
Snackbar.make(
96-
it,
97-
getString(R.string.you_just_created_and_caught_an_exception),
98-
Snackbar.LENGTH_SHORT,
99-
)
100-
.show()
96+
Snackbar
97+
.make(
98+
it,
99+
getString(R.string.you_just_created_and_caught_an_exception),
100+
Snackbar.LENGTH_SHORT,
101+
).show()
101102
}
102103
}
103104

104105
buttonSetUserAnon.setOnClickListener {
105106
val user = RaygunUserInfo()
106107
RaygunClient.setUser(user)
107-
Snackbar.make(
108-
it,
109-
getString(R.string.user_is_now_set_to_anonymous_for_future_raygun_reports),
110-
Snackbar.LENGTH_SHORT,
111-
)
112-
.show()
108+
Snackbar
109+
.make(
110+
it,
111+
getString(R.string.user_is_now_set_to_anonymous_for_future_raygun_reports),
112+
Snackbar.LENGTH_SHORT,
113+
).show()
113114
}
114115

115116
buttonSetUserA.setOnClickListener {
@@ -119,12 +120,12 @@ class MainActivity : AppCompatActivity() {
119120
user.email = "e@f.com.com"
120121
RaygunClient.setUser(user)
121122
RaygunClient.recordBreadcrumb("I'm now user A")
122-
Snackbar.make(
123-
it,
124-
getString(R.string.user_is_now_set_to_user_a_for_future_raygun_reports),
125-
Snackbar.LENGTH_SHORT,
126-
)
127-
.show()
123+
Snackbar
124+
.make(
125+
it,
126+
getString(R.string.user_is_now_set_to_user_a_for_future_raygun_reports),
127+
Snackbar.LENGTH_SHORT,
128+
).show()
128129
}
129130

130131
buttonSetUserB.setOnClickListener {
@@ -134,12 +135,12 @@ class MainActivity : AppCompatActivity() {
134135
user.email = "g@h.com"
135136
RaygunClient.setUser(user)
136137
RaygunClient.recordBreadcrumb("I'm now user B")
137-
Snackbar.make(
138-
it,
139-
getString(R.string.user_is_now_set_to_user_b_for_future_raygun_reports),
140-
Snackbar.LENGTH_SHORT,
141-
)
142-
.show()
138+
Snackbar
139+
.make(
140+
it,
141+
getString(R.string.user_is_now_set_to_user_b_for_future_raygun_reports),
142+
Snackbar.LENGTH_SHORT,
143+
).show()
143144
}
144145

145146
buttonSecondActivity.setOnClickListener {
@@ -175,17 +176,15 @@ class MainActivity : AppCompatActivity() {
175176
}
176177

177178
private val startSecondActivity =
178-
registerForActivityResult(
179-
ActivityResultContracts.StartActivityForResult(),
180-
) { result ->
179+
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
181180
if (result.resultCode == RESULT_OK) {
182181
val rootView: View = findViewById(android.R.id.content)
183-
Snackbar.make(
184-
rootView,
185-
getString(R.string.we_returned_to_first_activity),
186-
Snackbar.LENGTH_SHORT,
187-
)
188-
.show()
182+
Snackbar
183+
.make(
184+
rootView,
185+
getString(R.string.we_returned_to_first_activity),
186+
Snackbar.LENGTH_SHORT,
187+
).show()
189188
}
190189
}
191190
}

app/src/main/java/com/raygun/raygun4android/sample/SecondActivity.kt

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ class SecondActivity : AppCompatActivity() {
4444
null,
4545
tw,
4646
)
47-
Snackbar.make(
48-
it,
49-
getString(R.string.you_have_just_sent_an_error_with_raygun4android),
50-
Snackbar.LENGTH_SHORT,
51-
)
52-
.show()
47+
Snackbar
48+
.make(
49+
it,
50+
getString(R.string.you_have_just_sent_an_error_with_raygun4android),
51+
Snackbar.LENGTH_SHORT,
52+
).show()
5353
}
5454

5555
buttonCrash.setOnClickListener {
@@ -78,24 +78,24 @@ class SecondActivity : AppCompatActivity() {
7878
"This is here purely so that our alternative value for i gets used and not optimised away " +
7979
"in a release build: $i",
8080
)
81-
Snackbar.make(
82-
it,
83-
getString(R.string.you_just_created_and_caught_an_exception),
84-
Snackbar.LENGTH_SHORT,
85-
)
86-
.show()
81+
Snackbar
82+
.make(
83+
it,
84+
getString(R.string.you_just_created_and_caught_an_exception),
85+
Snackbar.LENGTH_SHORT,
86+
).show()
8787
}
8888
}
8989

9090
buttonSetUserAnon.setOnClickListener {
9191
val user = RaygunUserInfo()
9292
RaygunClient.setUser(user)
93-
Snackbar.make(
94-
it,
95-
getString(R.string.user_is_now_set_to_anonymous_for_future_raygun_reports),
96-
Snackbar.LENGTH_SHORT,
97-
)
98-
.show()
93+
Snackbar
94+
.make(
95+
it,
96+
getString(R.string.user_is_now_set_to_anonymous_for_future_raygun_reports),
97+
Snackbar.LENGTH_SHORT,
98+
).show()
9999
}
100100

101101
buttonSetUserA.setOnClickListener {
@@ -105,12 +105,12 @@ class SecondActivity : AppCompatActivity() {
105105
user.email = "e@f.com.com"
106106
RaygunClient.setUser(user)
107107
RaygunClient.recordBreadcrumb("I'm now user A")
108-
Snackbar.make(
109-
it,
110-
getString(R.string.user_is_now_set_to_user_a_for_future_raygun_reports),
111-
Snackbar.LENGTH_SHORT,
112-
)
113-
.show()
108+
Snackbar
109+
.make(
110+
it,
111+
getString(R.string.user_is_now_set_to_user_a_for_future_raygun_reports),
112+
Snackbar.LENGTH_SHORT,
113+
).show()
114114
}
115115

116116
buttonSetUserB.setOnClickListener {
@@ -120,12 +120,12 @@ class SecondActivity : AppCompatActivity() {
120120
user.email = "g@h.com"
121121
RaygunClient.setUser(user)
122122
RaygunClient.recordBreadcrumb("I'm now user B")
123-
Snackbar.make(
124-
it,
125-
getString(R.string.user_is_now_set_to_user_b_for_future_raygun_reports),
126-
Snackbar.LENGTH_SHORT,
127-
)
128-
.show()
123+
Snackbar
124+
.make(
125+
it,
126+
getString(R.string.user_is_now_set_to_user_b_for_future_raygun_reports),
127+
Snackbar.LENGTH_SHORT,
128+
).show()
129129
}
130130

131131
textViewAppVersion.text =
@@ -160,7 +160,8 @@ class SecondActivity : AppCompatActivity() {
160160
customData["someotherkey"] = "someothervalue"
161161

162162
val breadcrumbMessage =
163-
RaygunBreadcrumbMessage.Builder("I'm here in SecondActivity")
163+
RaygunBreadcrumbMessage
164+
.Builder("I'm here in SecondActivity")
164165
.level(RaygunBreadcrumbLevel.ERROR)
165166
.category("Launch")
166167
.lineNumber(78)
@@ -170,12 +171,12 @@ class SecondActivity : AppCompatActivity() {
170171

171172
RaygunClient.recordBreadcrumb(breadcrumbMessage)
172173
val rootView: View = findViewById(android.R.id.content)
173-
Snackbar.make(
174-
rootView,
175-
getString(R.string.we_re_now_on_the_second_activity_screen),
176-
Snackbar.LENGTH_SHORT,
177-
)
178-
.show()
174+
Snackbar
175+
.make(
176+
rootView,
177+
getString(R.string.we_re_now_on_the_second_activity_screen),
178+
Snackbar.LENGTH_SHORT,
179+
).show()
179180
}
180181

181182
// Handle action bar item clicks

app/src/main/java/com/raygun/raygun4android/sample/fragments/Fragment1.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ import android.view.ViewGroup
77
import androidx.fragment.app.Fragment
88
import com.raygun.raygun4android.sample.R
99

10-
/**
11-
* A simple empty [Fragment].
12-
*/
10+
/** A simple empty [Fragment]. */
1311
class Fragment1 : Fragment() {
1412
override fun onCreateView(
1513
inflater: LayoutInflater,

app/src/main/java/com/raygun/raygun4android/sample/fragments/NavigationActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import com.raygun.raygun4android.sample.R
1414
*
1515
* [Fragment1] is defined in the activity_navigation.xml in a FragmentContainerView.
1616
*
17-
* RUM registers the FragmentManager from this Activity automatically,
18-
* reporting the Fragment lifecycle events as RUM navigation events.
17+
* RUM registers the FragmentManager from this Activity automatically, reporting the Fragment
18+
* lifecycle events as RUM navigation events.
1919
*/
2020
class NavigationActivity : AppCompatActivity() {
2121
override fun onCreate(savedInstanceState: Bundle?) {

provider/src/test/java/com/raygun/raygun4android/rum/RUMActivityTest.kt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,12 @@ class RUMActivityTest {
4444
rumActivity.onActivityDestroyed(mockActivity)
4545

4646
// onActivityResumed should have called to sendRUMTimingEvent
47-
verify(mockRUM).sendRUMTimingEvent(
48-
eq(RaygunRUMEventType.ACTIVITY_LOADED),
49-
eq("AppCompatActivity"),
50-
anyLong(),
51-
)
47+
verify(mockRUM)
48+
.sendRUMTimingEvent(
49+
eq(RaygunRUMEventType.ACTIVITY_LOADED),
50+
eq("AppCompatActivity"),
51+
anyLong(),
52+
)
5253

5354
// seen should be called for each "onActivity..."
5455
verify(mockRUM, times(6)).seen()

provider/src/test/java/com/raygun/raygun4android/rum/RUMFragmentTest.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,8 @@ class RUMFragmentTest {
4444
rumFragment.onFragmentDestroyed(mockFragmentManager, fragment)
4545

4646
// onFragmentResumed should have called to sendRUMTimingEvent
47-
verify(mockRUM).sendRUMTimingEvent(
48-
eq(RaygunRUMEventType.FRAGMENT_LOADED),
49-
eq("Fragment"),
50-
anyLong(),
51-
)
47+
verify(mockRUM)
48+
.sendRUMTimingEvent(eq(RaygunRUMEventType.FRAGMENT_LOADED), eq("Fragment"), anyLong())
5249

5350
// seen should be called for each "onFragment..."
5451
verify(mockRUM, times(6)).seen()

0 commit comments

Comments
 (0)