| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A lightweight Android library for rendering structured content from JSON using a flexible segment-based system.
This library provides two main components:
Both components use a segment-based rendering system that supports:
Add the dependency to your app's build.gradle:
dependencies {
implementation 'com.github.Source-Digital.native-sdk:sourcesync-android:1.0.0'
}public class MainActivity extends AppCompatActivity {
private Activation activation;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Create container for activation views
FrameLayout container = new FrameLayout(this);
setContentView(container);
// Create activation
activation = new Activation(this);
container.addView(activation);
// Show preview
JSONObject previewData = new JSONObject()
.put("title", "Hello World")
.put("subtitle", "Click for details")
.put("backgroundColor", "#000000")
.put("backgroundOpacity", 0.66);
activation.showPreview(previewData, v -> showDetail());
}
private void showDetail() {
JSONObject detailData = new JSONObject()
.put("template", new JSONArray()
.put(new JSONObject()
.put("type", "text")
.put("content", "Detailed content here")
.put("attributes", new JSONObject()
.put("size", "lg")
.put("color", "#FFFFFF"))));
activation.showDetail(detailData, () -> activation.hideDetail());
}
}{
"title": "Title text",
"subtitle": "Subtitle text",
"backgroundColor": "#000000",
"backgroundOpacity": 0.66,
"template": [
{
"type": "text",
"content": "Custom content",
"attributes": {
"size": "lg",
"color": "#FFFFFF"
}
}
]
}{
"template": [
{
"type": "text",
"content": "Text content",
"attributes": {
"size": "lg",
"color": "#FFFFFF"
}
},
{
"type": "image",
"content": "https://example.com/image.jpg",
"attributes": {
"width": "100%"
}
},
{
"type": "row",
"children": [
{
"type": "button",
"content": "Button 1",
"attributes": {
"width": "50%"
}
},
{
"type": "button",
"content": "Button 2",
"attributes": {
"width": "50%"
}
}
]
}
]
}Text ("type": "text")
Image ("type": "image")
Button ("type": "button")
Row ("type": "row")
Column ("type": "column")
Copyright © 2025 Source Digital, Inc.
Licensed under the Apache License, Version 2.0
| Back | FazBrowse Home | New Git URL |