Skip to content

Commit 2cb1878

Browse files
ErikUggeldahlErikUggeldahl
andcommitted
style(Android): Many warnings and style fixes (#10886) abb33a5433
Warnings: - Move from deprecated functions - var -> val - Clang tidy static suggestion - Clang tidy for const in header functions - Delete unused JNI reference methods - Use auto when suggested by Clang - Remove unused JNIEnv and thisObj references - Add suggested function annotations - Change visibility of deleted members - Modernize includes - Null handling - Struct syntax - Narrowing/casts - Unnecessary pBuffer checks - Naming (typo checker) - Unneeded `GetTargetValue` checks - Deprecation warnings on tests - Superclass name match - Unnecessary casts - Use non-deprecated functions - Unused vars - Shadowing of `it` - Remove app bar hiding part of the bind button - Warning around modifier being first optional param - Double null coercion - Duplicate in gitignore - Update 10dp -> 11sp (minimum) - Warned height value - Kotlin APIs Style: - Automatic style changes - Move to #pragma once - Naming - Spaces/newlines - Inferred generic - Use resource class - Hide app bar on main menu - Capitalize app name - Automated XML formatting - Remove template comments - Minor style tweaks to RiveButton and ButtonActivity Documentation: - Clarify premake5 locations - Update authors - Update issue template Cleanup: - Unused C++ testing directory - Unmaintained docs code - Unused raw assets - Unused ids.xml - Irrelevant test - Remove single Rive Renderer split Chore: - Bump Material version - Bump Gradle Git Version plugin Fix: - Doc import - Remove blank issues, add support links Co-authored-by: Erik <[email protected]>
1 parent 06533ef commit 2cb1878

File tree

520 files changed

+763
-8572
lines changed

Some content is hidden

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

520 files changed

+763
-8572
lines changed

.github/ISSUE_TEMPLATE/i-have-a-problem-with-rive-android.md

Lines changed: 48 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,71 +4,82 @@ about: Tell us what's wrong
44
title: ''
55
labels: ''
66
assignees: ''
7-
87
---
98

10-
<-- Thanks for using Rive!
11-
12-
If something isn't working like you expected, please:
9+
<!-- Thanks for using Rive!
1310
14-
- Make sure you've updated rive-android to the latest version:
15-
https://search.maven.org/artifact/app.rive/rive-android
16-
- Check out our documentation
17-
https://rive.app/community/doc
18-
- Get help on our forums
19-
https://rive.app/community/forums/home
20-
- You can file a new feature request at
21-
https://rive.app/community/forums/feature-requests/fsnweJpNLqIh
11+
If something isn't working as expected, please:
2212
23-
If you think you found a bug or if you can't find what you're looking for
24-
in our docs, fill out the template below.
13+
- Make sure you've updated rive-android to the
14+
[latest version](https://central.sonatype.com/artifact/app.rive/rive-android).
15+
- Check out [our documentation](https://rive.app/docs/runtimes/)
16+
- Get help in our [community](https://community.rive.app/)
17+
- You can file a [new general feature request](https://community.rive.app/c/feature-requests/) in
18+
our community
2519
20+
If you think you've found a bug or if you can't find what you're looking for in our docs, fill out
21+
the template below.
2622
-->
2723

2824
### Description
2925

30-
<-- A clear and concise description of what the problem is. -->
26+
<!-- A clear and concise description of what the problem is.
27+
28+
Please include a stack trace if one is available and relevant. Ideally it is symbolicated. -->
29+
30+
### Versions, Device, and Other Information
31+
32+
<!-- Please complete the following information. -->
33+
34+
- Rive Android Runtime Version: <!-- e.g. 10.0.0 -->
35+
- Rive API: <!-- e.g. Compose or Legacy -->
36+
- Device: <!-- e.g. Android Emulator, Pixel 4a -->
37+
- App Minimum SDK Level: <!-- e.g. Android SDK API Level 21 -->
38+
- App Target SDK Level: <!-- e.g. Android SDK API Level 36 -->
39+
- App NDK Level: <!-- [e.g. Android NDK API Level 21 -->
40+
- Frequency: <!-- e.g. Every time, often, rarely. More information is better -->
3141

32-
### Provide a Repro
42+
<!-- Optional Information -->
3343

34-
<--
35-
Please provide the most **minimal repro** you can:
44+
- Other Rive runtimes affected: <!-- e.g. iOS, Flutter, React Native -->
45+
- Dependencies with native libraries: <!-- e.g. ExoPlayer, OpenCV, TensorFlow Lite -->
46+
47+
### Reproduction Steps
48+
49+
<!-- Please provide the most **minimal reproduction** you can:
3650
3751
- If the problem is small enough, paste a code snippet
3852
- Otherwise, you can attach a ZIP archive or paste a link to a GitHub repository with the app bundle
3953
that is reproducing the issue
4054
4155
-->
4256

43-
#### Source `.riv`/`.rev` file
57+
### Source `.riv`/`.rev` File
58+
59+
<!--
60+
Attaching the exported `.riv` file that reproduces the issue is immensely helpful for our team to
61+
identify the problem as fast as possible and fix it.
4462
45-
<--
46-
Attaching runtime-exported `.riv` file that reproduces the issue is immensely helpful for our team
47-
to identify the problem as fast as possible and fix it.
48-
Please also include the source (`.rev`)
49-
by [downloading a backup](https://rive.app/community/doc/exporting/dockj1y5YeDd#for-backup) from the Editor.
63+
Please also include the source (`.rev`) by
64+
[downloading a backup](https://rive.app/docs/editor/exporting/exporting-for-backup) from the
65+
editor.
5066
51-
N.B. Because GitHub only supports certain file types use a ZIP archive to upload `.riv`/`.rev` files
52-
to this issue.
67+
Note: Because GitHub only supports certain file types, use a ZIP archive to upload your `.riv`/
68+
`.rev` files for this issue.
5369
5470
You can also privately share the `.riv`/`.rev` file with us at [email protected].
5571
-->
5672

57-
### Expected behavior
73+
### Expected Behavior
5874

59-
<-- A clear and concise description of what you expected to happen. -->
75+
<!-- A clear and concise description of what you expected to happen. -->
6076

61-
#### Screenshots
77+
### Screenshots
6278

63-
<-- If applicable, add screenshots to help explain your problem. -->
79+
<!-- If applicable, add screenshots or video to help explain your problem. -->
6480

6581
![Screenshot](url)
6682

67-
### Device & Versions (please complete the following information)
68-
69-
- Device: [e.g. Android Emulator, Pixel 4a]
70-
- SDK Level [e.g. Android SDK API Level 30]
71-
72-
#### Additional context
83+
### Additional context
7384

74-
<-- Add any other context about the problem here. -->
85+
<!-- Add any other context about the problem here. -->

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,3 @@ bugreport*.zip
4747

4848
# Test history
4949
test_history.csv
50-
51-
# OS files
52-
.DS_Store

.rive_head

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c1e0f7b5951eda512b3b1417cf297d3f041a8216
1+
abb33a5433f43b5205b2b595a7f89e6402875d11

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ dependencies {
8080
implementation "androidx.fragment:fragment-ktx:1.8.9"
8181
implementation "androidx.startup:startup-runtime:1.2.0"
8282
implementation "com.android.volley:volley:1.2.1"
83-
implementation "com.google.android.material:material:1.12.0"
83+
implementation "com.google.android.material:material:1.13.0"
8484

8585
debugImplementation project(path: ":kotlin")
8686
releaseImplementation project(path: ":kotlin")

app/src/androidTest/java/app/rive/runtime/example/DeviceRunner.kt

Lines changed: 0 additions & 22 deletions
This file was deleted.

app/src/androidTest/java/app/rive/runtime/example/RiveActivityLifecycleTest.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ class RiveActivityLifecycleTest {
150150
assertNull(controller.activeArtboard)
151151
}
152152

153-
154153
@Test
155154
fun resizeRiveView() {
156155
val activityScenario = ActivityScenario.launch(SingleActivity::class.java)

app/src/androidTest/java/app/rive/runtime/example/RiveRendererActivityTest.kt

Lines changed: 0 additions & 46 deletions
This file was deleted.

app/src/androidTest/java/app/rive/runtime/example/TestUtils.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ class TestUtils {
2727
throw TimeoutException("Took too long.")
2828
}
2929
} while (!condition())
30-
3130
}
3231

3332
// Helper function to check whether it's running on an emulator

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,4 @@
9393
<activity android:name=".EmptyActivity" />
9494
</application>
9595

96-
</manifest>
96+
</manifest>

app/src/main/java/app/rive/runtime/example/AndroidPlayerActivity.kt

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,10 @@ class AndroidPlayerActivity : AppCompatActivity() {
7979
}
8080
}
8181

82-
8382
fun onLoopModeSelected(view: View) {
8483
if (view is RadioButton && view.isChecked) {
8584
// Check which radio button was clicked
86-
when (view.getId()) {
85+
when (view.id) {
8786
R.id.loop_auto ->
8887
loop = Loop.AUTO
8988

@@ -102,7 +101,7 @@ class AndroidPlayerActivity : AppCompatActivity() {
102101
fun onDirectionSelected(view: View) {
103102
if (view is RadioButton && view.isChecked) {
104103
// Check which radio button was clicked
105-
when (view.getId()) {
104+
when (view.id) {
106105
R.id.direction_auto ->
107106
direction = Direction.AUTO
108107

@@ -153,15 +152,13 @@ class AndroidPlayerActivity : AppCompatActivity() {
153152
}
154153
stopButtonMap[animationName] = stopButton
155154

156-
157155
layout.addView(text)
158156
layout.addView(playButton)
159157
layout.addView(pauseButton)
160158
layout.addView(stopButton)
161159
return layout
162160
}
163161

164-
165162
fun addStateMachineControl(artboard: Artboard, stateMachineName: String): List<View> {
166163
val views = mutableListOf<View>()
167164
val layout = LinearLayout(this)
@@ -203,7 +200,6 @@ class AndroidPlayerActivity : AppCompatActivity() {
203200
layout.addView(stopButton)
204201
views.add(layout)
205202

206-
207203
stateMachine.inputs.forEach {
208204
val innerLayout = LinearLayout(this)
209205
innerLayout.orientation = LinearLayout.HORIZONTAL
@@ -312,7 +308,6 @@ class AndroidPlayerActivity : AppCompatActivity() {
312308
}
313309
}
314310

315-
316311
fun setResourceSpinner() {
317312
animationResources.let { _ ->
318313
val dropdown = findViewById<Spinner>(R.id.resources)
@@ -337,7 +332,6 @@ class AndroidPlayerActivity : AppCompatActivity() {
337332
}
338333
}
339334

340-
341335
override fun onCreate(savedInstanceState: Bundle?) {
342336
super.onCreate(savedInstanceState)
343337
setContentView(R.layout.android_player)
@@ -432,4 +426,3 @@ class AndroidPlayerActivity : AppCompatActivity() {
432426
animationView.registerListener(listener)
433427
}
434428
}
435-

0 commit comments

Comments
 (0)