mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-03 01:39:18 +02:00
synchronization with beta branch
This commit is contained in:
parent
f5e353c29e
commit
ef90f7a11d
5 changed files with 28 additions and 26 deletions
|
@ -84,4 +84,5 @@ public interface Api {
|
|||
|
||||
String getTapZoneAction(String name, int h, int v, boolean singleTap) throws ApiException;
|
||||
void setTapZoneAction(String name, int h, int v, boolean singleTap, String action) throws ApiException;
|
||||
String getTapActionByCoordinates(String name, int x, int y, int width, int height, boolean singleTap) throws ApiException;
|
||||
}
|
||||
|
|
|
@ -439,6 +439,17 @@ public class ApiClientImplementation implements ServiceConnection, Api, ApiMetho
|
|||
});
|
||||
}
|
||||
|
||||
public String getTapActionByCoordinates(String name, int x, int y, int width, int height, boolean singleTap) throws ApiException {
|
||||
return requestString(GET_TAP_ACTION_BY_COORDINATES, new ApiObject[] {
|
||||
ApiObject.envelope(name),
|
||||
ApiObject.envelope(x),
|
||||
ApiObject.envelope(y),
|
||||
ApiObject.envelope(width),
|
||||
ApiObject.envelope(height),
|
||||
ApiObject.envelope(singleTap)
|
||||
});
|
||||
}
|
||||
|
||||
public void setTapZoneAction(String name, int h, int v, boolean singleTap, String action) throws ApiException {
|
||||
request(SET_TAPZONE_ACTION, new ApiObject[] {
|
||||
ApiObject.envelope(name),
|
||||
|
|
|
@ -74,4 +74,5 @@ interface ApiMethods {
|
|||
|
||||
int GET_TAPZONE_ACTION = 931;
|
||||
int SET_TAPZONE_ACTION = 932;
|
||||
int GET_TAP_ACTION_BY_COORDINATES = 933;
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@ public abstract class ApiObject implements Parcelable {
|
|||
int BOOLEAN = 3;
|
||||
int DATE = 4;
|
||||
int LONG = 5;
|
||||
int FLOAT = 6;
|
||||
int TEXT_POSITION = 10;
|
||||
}
|
||||
|
||||
|
@ -54,25 +53,6 @@ public abstract class ApiObject implements Parcelable {
|
|||
}
|
||||
}
|
||||
|
||||
static class Float extends ApiObject {
|
||||
final float Value;
|
||||
|
||||
Float(float value) {
|
||||
Value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int type() {
|
||||
return Type.FLOAT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel parcel, int flags) {
|
||||
super.writeToParcel(parcel, flags);
|
||||
parcel.writeFloat(Value);
|
||||
}
|
||||
}
|
||||
|
||||
static class Long extends ApiObject {
|
||||
final long Value;
|
||||
|
||||
|
@ -172,10 +152,6 @@ public abstract class ApiObject implements Parcelable {
|
|||
return new Integer(value);
|
||||
}
|
||||
|
||||
static ApiObject envelope(float value) {
|
||||
return new Float(value);
|
||||
}
|
||||
|
||||
static ApiObject envelope(long value) {
|
||||
return new Long(value);
|
||||
}
|
||||
|
@ -231,8 +207,6 @@ public abstract class ApiObject implements Parcelable {
|
|||
return Void.Instance;
|
||||
case Type.INT:
|
||||
return new Integer(parcel.readInt());
|
||||
case Type.FLOAT:
|
||||
return new Float(parcel.readFloat());
|
||||
case Type.LONG:
|
||||
return new Long(parcel.readLong());
|
||||
case Type.BOOLEAN:
|
||||
|
|
|
@ -186,6 +186,15 @@ public class ApiServerImplementation extends ApiInterface.Stub implements Api, A
|
|||
((ApiObject.Integer)parameters[2]).Value,
|
||||
((ApiObject.Boolean)parameters[3]).Value
|
||||
));
|
||||
case GET_TAP_ACTION_BY_COORDINATES:
|
||||
return ApiObject.envelope(getTapActionByCoordinates(
|
||||
((ApiObject.String)parameters[0]).Value,
|
||||
((ApiObject.Integer)parameters[1]).Value,
|
||||
((ApiObject.Integer)parameters[2]).Value,
|
||||
((ApiObject.Integer)parameters[3]).Value,
|
||||
((ApiObject.Integer)parameters[4]).Value,
|
||||
((ApiObject.Boolean)parameters[5]).Value
|
||||
));
|
||||
case SET_TAPZONE_ACTION:
|
||||
setTapZoneAction(
|
||||
((ApiObject.String)parameters[0]).Value,
|
||||
|
@ -559,6 +568,12 @@ public class ApiServerImplementation extends ApiInterface.Stub implements Api, A
|
|||
);
|
||||
}
|
||||
|
||||
public String getTapActionByCoordinates(String name, int x, int y, int width, int height, boolean singleTap) {
|
||||
return TapZoneMap.zoneMap(name).getActionByCoordinates(
|
||||
x, y, width, height, singleTap ? TapZoneMap.Tap.singleNotDoubleTap : TapZoneMap.Tap.doubleTap
|
||||
);
|
||||
}
|
||||
|
||||
public void setTapZoneAction(String name, int h, int v, boolean singleTap, String action) {
|
||||
TapZoneMap.zoneMap(name).setActionForZone(h, v, singleTap, action);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue