Object Signature.Companion
-
- All Implemented Interfaces:
public class Signature.Companion
-
-
Field Summary
Fields Modifier and Type Field Description public final static Signature.Companion
INSTANCE
-
Method Summary
Modifier and Type Method Description final Signature
createInkSignature(@ColorInt() Integer inkColor, Float lineWidthPdf, List<List<PointF>> lines, BiometricSignatureData biometricSignatureData, Float drawWidthRatio)
Helper method to create an ink signature. final Signature
createStampSignature(Bitmap bitmap, RectF stampRect, BiometricSignatureData biometricSignatureData, Float drawWidthRatio)
Helper method to create a stamp signature. final Signature
fromJson(JSONObject signatureJson)
Creates a signature object by parsing the provided JSON object. final Signature
fromJson(Long id, JSONObject signatureJson)
Creates a signature object by parsing the provided JSON object. final Bitmap
textToBitmap(String text, Font font, @ColorInt() Integer color, @FloatRange(from = 0.0) Float scaleFactor, DisplayMetrics displayMetrics)
Creates a bitmap from text that the user typed and a font the user chose. -
-
Method Detail
-
createInkSignature
final Signature createInkSignature(@ColorInt() Integer inkColor, Float lineWidthPdf, List<List<PointF>> lines, BiometricSignatureData biometricSignatureData, Float drawWidthRatio)
Helper method to create an ink signature. See Signature constructor for details on parameters.
-
createStampSignature
final Signature createStampSignature(Bitmap bitmap, RectF stampRect, BiometricSignatureData biometricSignatureData, Float drawWidthRatio)
Helper method to create a stamp signature. See Signature constructor for details on parameters.
-
fromJson
final Signature fromJson(JSONObject signatureJson)
Creates a signature object by parsing the provided JSON object. The JSON object you provide should be initially obtained via toJson.
- Parameters:
signatureJson
- JSON object to parse.- Returns:
Signature created from the provided JSON object.
-
fromJson
final Signature fromJson(Long id, JSONObject signatureJson)
Creates a signature object by parsing the provided JSON object. The JSON object you provide should be initially obtained via toJson. This method also allows you to specify an id which will be assigned to the signature created from the given JSON. This id will also be assigned by the framework when retrieving the signatures from the default storage.
- Parameters:
id
- Id to be assigned to the signature.signatureJson
- JSON object to parse.- Returns:
Signature created from the provided JSON object.
-
textToBitmap
final Bitmap textToBitmap(String text, Font font, @ColorInt() Integer color, @FloatRange(from = 0.0) Float scaleFactor, DisplayMetrics displayMetrics)
Creates a bitmap from text that the user typed and a font the user chose.
- Parameters:
text
- The text to be displayed.font
- The font to use to show the text.color
- The color to render the text.scaleFactor
- A factor, always positive, by which to scale the bitmap size.displayMetrics
- DisplayMetrics instance.- Returns:
a bitmap from text that the user typed and a font the user chose.
-
-
-
-