-
Notifications
You must be signed in to change notification settings - Fork 26
Wallpaper JSON
Sarsa Murmu edited this page May 13, 2023
·
7 revisions
This is the default wallpaper JSON structure of CandyBar
[
{
"name": "Toyota Rock Car",
"author": "JC Falcon",
"url": "https://images.unsplash.com/photo-1564844159766-f1565806300b?ixlib=rb-1.2.1&q=80",
"thumbUrl": "https://images.unsplash.com/photo-1564844159766-f1565806300b?ixlib=rb-1.2.1&q=80&w=200"
},
{
"name": "Tasty Fruit",
"author": "Alexandra Kikot",
"url": "https://images.unsplash.com/photo-1564750497011-ead0ce4b9448?ixlib=rb-1.2.1&q=80",
"thumbUrl": "https://images.unsplash.com/photo-1564750497011-ead0ce4b9448?ixlib=rb-1.2.1&q=80&w=200"
},
{
"name": "Coral Coast",
"author": "Seaside Feel",
"url": "https://images.unsplash.com/photo-1564639566047-dc4a1b86a90f?ixlib=rb-1.2.1&q=80",
"thumbUrl": "https://images.unsplash.com/photo-1564639566047-dc4a1b86a90f?ixlib=rb-1.2.1&q=80&w=200"
},
{
"name": "Duotone Dahlias",
"author": "Annie Spratt",
"url": "https://images.unsplash.com/photo-1513682322455-ea8b2d81d418?ixlib=rb-1.2.1&q=80",
"thumbUrl": "https://images.unsplash.com/photo-1513682322455-ea8b2d81d418?ixlib=rb-1.2.1&q=80&w=200"
}
]
-
name
: Name of the wallpaper -
author
: Author of the wallpaper -
url
: Image URL of the Wallpaper, use raw links. -
thumbUrl
: Image URL of the wallpaper's thumbnail, use raw links.
- Open
CandyBar.java
insideapps/java/.../applications/
. - Use
setWallpaperJsonStructure()
fromConfiguration
to define your own JSON structure. Be careful, array name, name, author, url, and thumbUrl are case sensitive.
Here's an example
import candybar.lib.utils.JsonStructure;
public class CandyBar extends CandyBarApplication {
@NonNull
@Override
public Configuration onInit() {
Configuration configuration = new Configuration();
// This is the default JSON structure
configuration.setWallpaperJsonStructure(
new JsonStructure.Builder(null) //--> Wallpaper array's name
.name("name") //--> Wallpaper's name
.author("author") //--> Author's name
.url("url") //--> Wallpaper's URL
.thumbUrl("thumbUrl") //--> Wallpaper's thumbnail's URL
.build());
return configuration;
}
}
NOTE: If you are using the default JSON structure, you don't need to add this.
NOTE: Comments are NOT SUPPORTED in JSON. I am using JavaScript syntax with comments for demonstration. If you are going to copy these, you have to remove the comments.
{
"wallpapers": [ //--> This is the array name
{
"name": "Sample 1",
"author": "Sample Maker",
"url": "https://samplemaker.com/sample-1.jpg",
"thumbUrl": "https://samplemaker.com/sample-1-thumb.jpg"
},
{
"name": "Sample 2",
"author": "Sample Maker",
"url": "https://samplemaker.com/sample-2.jpg",
"thumbUrl": "https://samplemaker.com/sample-2-thumb.jpg"
}
]
}
The Configuration
configuration.setWallpaperJsonStructure(
new JsonStructure.Builder("wallpapers") //--> Wallpaper array name changed
.name("name")
.author("author")
.url("url")
.thumbUrl("thumbUrl")
.build());
[
{
"name": "Sample 1",
"creator": "Sample Maker",
"link": "https://samplemaker.com/sample-1.jpg", //--> Different url Name
//--> No thumbnails
},
{
"name": "Sample 2",
"creator": "Sample Maker",
"link": "https://samplemaker.com/sample-2.jpg", //--> Different url Name
//--> No thumbnails
}
]
The Configuration
configuration.setWallpaperJsonStructure(
new JsonStructure.Builder(null)
.name("name")
.author("creator") //--> Author's name changed
.url("link") //--> Wallpaper's URL name changed
.thumbUrl(null) //--> Wallpaper's Thumbnail's URL name changed
.build());
[
{
//--> No name
"maker": "Sample Maker",
"src": "https://samplemaker.com/sample-1.jpg", //--> Different url name
//--> No Thumbnails
},
{
//--> No name
"maker": "Sample Maker",
"src": "https://samplemaker.com/sample-2.jpg", //--> Different url name
//--> No Thumbnails
}
]
The Configuration
configuration.setWallpaperJsonStructure(
new JsonStructure.Builder(null)
.name(null) //--> No name
.author("maker") //--> Author's name Changed
.url("src") //--> Wallpaper's URL name Changed
.thumbUrl(null)
.build());
If you want more help then join Our Telegram Group.
- Wallpaper JSON
- Setting up the Config JSON
- Advanced Dashboard configurations
- Changing fonts
- Changing navigation drawer icons
- Changing icons of the apply section
- Replacing icon names in icon preview
- Enabling OneSignal notifications
- Enabling InApp purchases (donations and premium requests)
- Customizing the analog clock widget
- Enabling Kustom presets