Skip to content

Commit f3bff57

Browse files
committed
Working on Color
1 parent eec2dc2 commit f3bff57

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

Sources/GraphicsDrawableColorDrawable.swift

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,19 @@ public class AndroidGraphicsDrawableColorDrawable: Android.Graphics.Drawable.Dra
3535
JNI.DeleteLocalRef( __object )
3636
}
3737

38+
public convenience init?( casting object: java_swift.JavaObject,
39+
_ file: StaticString = #file,
40+
_ line: Int = #line ) {
41+
42+
self.init(javaObject: nil)
43+
44+
object.withJavaObject {
45+
self.javaObject = $0
46+
}
47+
}
48+
3849
/// Creates a new ColorDrawable with the specified color.
39-
public convenience init(color: Int){
50+
public convenience init(color: Int) {
4051

4152
var __locals = [jobject]()
4253

@@ -56,7 +67,7 @@ public class AndroidGraphicsDrawableColorDrawable: Android.Graphics.Drawable.Dra
5667
JNI.DeleteLocalRef( __object )
5768
}
5869

59-
public var color : Int {
70+
public var color : Int32 {
6071
get {
6172
return getColor() ?? 0
6273
}
@@ -81,7 +92,7 @@ public class AndroidGraphicsDrawableColorDrawable: Android.Graphics.Drawable.Dra
8192

8293
public extension AndroidGraphicsDrawableColorDrawable {
8394

84-
internal func getColor() -> Int? {
95+
internal func getColor() -> Int32? {
8596

8697
var __locals = [jobject]()
8798

@@ -95,10 +106,10 @@ public extension AndroidGraphicsDrawableColorDrawable {
95106
args: &__args,
96107
locals: &__locals )
97108

98-
return Int(__return)
109+
return Int32(__return)
99110
}
100111

101-
internal func setColor(_ color: Int) {
112+
internal func setColor(_ color: Int32) {
102113

103114
var __locals = [jobject]()
104115

0 commit comments

Comments
 (0)