-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expand file tree
/
Copy pathDotIndicatorOptions.java
More file actions
39 lines (30 loc) · 1.37 KB
/
DotIndicatorOptions.java
File metadata and controls
39 lines (30 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.reactnativenavigation.options;
import android.content.Context;
import androidx.annotation.Nullable;
import com.reactnativenavigation.options.params.Bool;
import com.reactnativenavigation.options.params.NullBool;
import com.reactnativenavigation.options.params.NullNumber;
import com.reactnativenavigation.options.params.Number;
import com.reactnativenavigation.options.params.ThemeColour;
import com.reactnativenavigation.options.params.NullThemeColour;
import com.reactnativenavigation.options.parsers.BoolParser;
import com.reactnativenavigation.options.parsers.NumberParser;
import org.json.JSONObject;
public class DotIndicatorOptions {
public static DotIndicatorOptions parse(Context context, @Nullable JSONObject json) {
DotIndicatorOptions options = new DotIndicatorOptions();
if (json == null) return options;
options.color = ThemeColour.parse(context, json.optJSONObject("color"));
options.size = NumberParser.parse(json, "size");
options.visible = BoolParser.parse(json, "visible");
options.animate = BoolParser.parse(json, "animate");
return options;
}
public ThemeColour color = new NullThemeColour();
public Number size = new NullNumber();
public Bool visible = new NullBool();
public Bool animate = new NullBool();
public boolean hasValue() {
return visible.hasValue();
}
}