-
Notifications
You must be signed in to change notification settings - Fork 25
Wallpaper JSON
Leif Niemczik edited this page Oct 16, 2019
·
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 Wallpaper -
author
: Author of Wallpaper -
url
: Image URL of your Wallpaper, use raw link. -
thumbUrl
: Image URL of your wallpaper's thumbnail, use raw link.
- 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 an example
import candybar.lib.utils.JsonStructure;
public class CandyBar extends CandyBarApplication {
@NonNull
@Override
public Configuration onInit() {
Configuration configuration = new Configuration();
// This is Default JSON Structure
configuration.setWallpaperJsonStructure(
new JsonStructure.Builder(null) //--> 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 following Default JSON structure, you don't need to add this.
{
"wallpapers": [ //--> This is Array
{
"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") //--> 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