-
Notifications
You must be signed in to change notification settings - Fork 210
Added device compatibility mode snippets. #492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Here is the summary of changes. You are about to add 4 region tags.
This comment is generated by snippet-bot.
|
…ts into device_compatibility_mode
gradle/libs.versions.toml
Outdated
@@ -62,6 +62,7 @@ wear = "1.3.0" | |||
wearComposeFoundation = "1.4.1" | |||
wearComposeMaterial = "1.4.1" | |||
wearToolingPreview = "1.0.0" | |||
junitVersion = "1.2.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit - this should be androidx-test-junit
since this is a version for androidx.test extensions of junit
, not junit
itself which there's also a version for defined above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
misc/build.gradle.kts
Outdated
@@ -46,7 +46,7 @@ android { | |||
|
|||
} | |||
dependencies { | |||
val composeBom = platform(libs.androidx.compose.bom) | |||
val composeBom = platform(libs.androidx.compose.bom) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit - this formatting change is unnecessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restored. One of the formatters did that.--I think Android Studio.
import org.junit.Rule; | ||
import static org.junit.Assert.assertFalse; | ||
|
||
public class DeviceCompatibilityModeTestJavaSnippets extends AppCompatActivity { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit - I don't think any of these test classes need to subclass Activity
, they can just be plain classes that don't extend anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct. I got too used to doing this for other snippets. Removed.
// [START android_device_compatibility_mode_assert_isLetterboxed_java] | ||
@Rule | ||
public ActivityScenarioRule<MainActivity> rule = new ActivityScenarioRule<>(MainActivity.class); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should ba annotated with @Test
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added. Good review, Alex. Thanks.
A lot of commits. Edited on a plane without the help of Android Studio. |
import androidx.appcompat.app.AppCompatActivity | ||
import androidx.window.layout.WindowMetricsCalculator | ||
|
||
class DeviceCompatibilityModeKotlinSnippets : AppCompatActivity() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit - this doesn't need to extend AppCompatActivity
either
No description provided.