-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #99 from BlinkID/feature/v4.7.0
Feature/v4.7.0
- Loading branch information
Showing
48 changed files
with
4,184 additions
and
6,717 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...egap/plugins/microblink/overlays/serialization/BlinkCardOverlaySettingsSerialization.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.phonegap.plugins.microblink.overlays.serialization; | ||
|
||
import com.microblink.entities.recognizers.RecognizerBundle; | ||
import com.microblink.uisettings.BlinkCardUISettings; | ||
import com.microblink.uisettings.UISettings; | ||
import com.phonegap.plugins.microblink.overlays.OverlaySettingsSerialization; | ||
|
||
import org.json.JSONObject; | ||
|
||
public final class BlinkCardOverlaySettingsSerialization implements OverlaySettingsSerialization { | ||
@Override | ||
public UISettings createUISettings(JSONObject jsonUISettings, RecognizerBundle recognizerBundle) { | ||
BlinkCardUISettings settings = new BlinkCardUISettings(recognizerBundle); | ||
|
||
String firstSideInstructions = getStringFromJSONObject(jsonUISettings, "firstSideInstructions"); | ||
if (firstSideInstructions != null) { | ||
settings.setFirstSideInstructions(firstSideInstructions); | ||
} | ||
String secondSideInstructions = getStringFromJSONObject(jsonUISettings, "secondSideInstructions"); | ||
if (secondSideInstructions != null) { | ||
settings.setSecondSideInstructions(secondSideInstructions); | ||
} | ||
|
||
return settings; | ||
} | ||
|
||
private String getStringFromJSONObject(JSONObject map, String key) { | ||
String value = map.optString(key, null); | ||
if ("null".equals(value)) { | ||
value = null; | ||
} | ||
return value; | ||
} | ||
|
||
@Override | ||
public String getJsonName() { | ||
return "BlinkCardOverlaySettings"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.