-
-
Notifications
You must be signed in to change notification settings - Fork 66
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 #101 from huang1988519/main
feat(iOS): add doubleTap,rotate screen, active element
- Loading branch information
Showing
5 changed files
with
189 additions
and
4 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
43 changes: 43 additions & 0 deletions
43
src/main/java/org/cloud/sonic/driver/ios/enums/Orientation.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,43 @@ | ||
package org.cloud.sonic.driver.ios.enums; | ||
|
||
import com.alibaba.fastjson.JSON; | ||
import com.alibaba.fastjson.JSONObject; | ||
|
||
import java.util.HashMap; | ||
|
||
public enum Orientation { | ||
UNKNOWN(0), | ||
PORTRAIT(1), | ||
PORTRAITUPSIDEDOWN(2), | ||
LANDSCAPELEFT(3), | ||
LANDSCAPERIGHT(4); | ||
|
||
private final int orientation; | ||
|
||
Orientation(int orientation) { | ||
this.orientation = orientation; | ||
} | ||
|
||
public JSONObject getValue() { | ||
JSONObject value = new JSONObject(); | ||
value.put("x",0); | ||
value.put("y",0); | ||
switch (this.orientation) { | ||
case 1: | ||
value.put("z",0); | ||
break; | ||
case 2: | ||
value.put("z",180); | ||
break; | ||
case 3: | ||
value.put("z",90); | ||
break; | ||
case 4: | ||
value.put("z",270); | ||
break; | ||
} | ||
|
||
return value; | ||
} | ||
|
||
} |
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