-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add RoborazziComposeActivityScenarioCreationOption to handle theme
- Loading branch information
Showing
6 changed files
with
58 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 15 additions & 2 deletions
17
roborazzi/src/main/java/com/github/takahirom/roborazzi/RoborazziTransparentActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,24 @@ | ||
package com.github.takahirom.roborazzi | ||
|
||
import android.content.Context | ||
import android.content.Intent | ||
import android.os.Bundle | ||
import androidx.activity.ComponentActivity | ||
|
||
class RoborazziTransparentActivity: ComponentActivity() { | ||
@Deprecated("Use RoborazziActivity instead", ReplaceWith("RoborazziActivity"), level = DeprecationLevel.ERROR) | ||
class RoborazziTransparentActivity: RoborazziActivity() | ||
|
||
open class RoborazziActivity: ComponentActivity() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
setTheme(android.R.style.Theme_Translucent_NoTitleBar_Fullscreen) | ||
setTheme(intent.getIntExtra(EXTRA_THEME, android.R.style.Theme_Translucent_NoTitleBar_Fullscreen)) | ||
super.onCreate(savedInstanceState) | ||
} | ||
companion object { | ||
const val EXTRA_THEME = "EXTRA_THEME" | ||
fun createIntent(context: Context, theme: Int = android.R.style.Theme_Translucent_NoTitleBar_Fullscreen): Intent { | ||
return Intent(context, RoborazziActivity::class.java).apply { | ||
putExtra(EXTRA_THEME, theme) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters