Add custom watermark templates, logos, and fonts to PRISM.
Create file in res/layout/. Required view IDs:
| ID | Type | Purpose |
|---|---|---|
watermarkBG | ViewGroup | Root container |
watermarkLogo | ImageView | Logo display |
watermarkText | TextView | Main text |
watermarkDeviceText | TextView | Device name |
watermarkEXIFDataText | TextView | EXIF info |
Use android:tag="divider" for vertical dividers.
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/watermarkBG"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="24dp"
android:gravity="center_vertical"
android:background="@color/watermark_bg_light">
<ImageView
android:id="@+id/watermarkLogo"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginEnd="16dp" />
<View
android:layout_width="2dp"
android:layout_height="40dp"
android:layout_marginEnd="16dp"
android:background="@color/watermark_divider"
android:tag="divider" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/watermarkText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:id="@+id/watermarkDeviceText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:textSize="14sp"
android:visibility="gone" />
<TextView
android:id="@+id/watermarkEXIFDataText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:textSize="12sp"
android:alpha="0.7" />
</LinearLayout>
</LinearLayout>
<string name="style_custom">Custom</string>
<string name="style_custom_desc">Your custom style</string>
WatermarkStyle(
id = "custom",
nameResId = R.string.style_custom,
layoutResId = R.layout.watermark_custom,
descriptionResId = R.string.style_custom_desc
)
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#000000"
android:pathData="M12,12m-3.2,0a3.2,3.2..." />
</vector>
<string name="logo_camera">Camera</string>
LogoResource(
id = "camera",
nameResId = R.string.logo_camera,
drawableResId = R.drawable.logo_camera,
isMonochrome = true
)
isMonochrome = true for single-color logos. They adapt to text color automatically.
Place TTF/OTF in res/font/. Use lowercase with underscores:
res/font/opensans_regular.ttfres/font/opensans_bold.ttf<string name="font_opensans">Open Sans</string>
FontResource(
id = "opensans",
nameResId = R.string.font_opensans,
fontResId = R.font.opensans_regular
)
Lock colors so they cannot be changed by users.
data class ColorLocks(
val backgroundColorLocked: Boolean = false,
val mainTextColorLocked: Boolean = false,
val exifTextColorLocked: Boolean = false,
val forcedBackgroundColor: Int? = null,
val forcedMainTextColor: Int? = null,
val forcedExifTextColor: Int? = null
)
WatermarkStyle(
id = "branded_dark",
nameResId = R.string.style_branded_dark,
layoutResId = R.layout.watermark_standard,
descriptionResId = R.string.style_branded_dark_desc,
colorLocks = ColorLocks(
backgroundColorLocked = true,
mainTextColorLocked = true,
exifTextColorLocked = true,
forcedBackgroundColor = Color.parseColor("#1a1a2e"),
forcedMainTextColor = Color.parseColor("#edf2f4"),
forcedExifTextColor = Color.parseColor("#8d99ae")
)
)
backgroundColorLocked and mainTextColorLocked are true, the Light/Dark theme selector is automatically disabled.
Central place for all built-in resources.
object ResourceRegistry {
val fonts: List<FontResource> = listOf(
FontResource(
id = "roboto",
nameResId = R.string.font_roboto,
fontResId = R.font.roboto_regular
)
)
val defaultFont = fonts.first()
val builtInLogos: List<LogoResource> = listOf(
LogoResource.NO_LOGO.copy(nameResId = R.string.logo_none),
LogoResource(
id = "prism",
nameResId = R.string.logo_prism,
drawableResId = R.drawable.logo_prism,
isMonochrome = false
)
)
val defaultLogo = builtInLogos[1]
val styles: List<WatermarkStyle> = listOf(
WatermarkStyle(
id = "standard",
nameResId = R.string.style_standard,
layoutResId = R.layout.watermark_standard,
descriptionResId = R.string.style_standard_desc
)
)
val defaultStyle = styles.first()
fun findFontById(id: String) = fonts.find { it.id == id }
fun findLogoById(id: String) = builtInLogos.find { it.id == id }
fun findStyleById(id: String) = styles.find { it.id == id }
}