-
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.
Merge pull request #612 from pedromfmachado/add-activity-theme-option
Added RoborazziComposeActivityThemeOption
- Loading branch information
Showing
8 changed files
with
98 additions
and
25 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
<application> | ||
<activity android:name=".RoborazziTransparentActivity" | ||
android:theme="@style/RoborazziTransparentTheme"/> | ||
<activity | ||
android:name=".RoborazziTransparentActivity" | ||
android:theme="@style/RoborazziTransparentTheme" /> | ||
<activity android:name=".RoborazziActivity" /> | ||
</application> | ||
</manifest> | ||
</manifest> |
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