Skip to content

Commit

Permalink
Merged with master
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaudM committed Dec 3, 2017
2 parents e5a7a1e + 99e38fb commit 685670d
Show file tree
Hide file tree
Showing 22 changed files with 669 additions and 514 deletions.
1 change: 0 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ dependencies {
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.android.support:appcompat-v7:27.0.1'
compile 'com.android.support:design:27.0.1'
compile 'com.google.android.gms:play-services-ads:11.6.2'
}
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.thibaudperso.sonycamera"
android:versionCode="19"
android:versionName="3.0.2">
android:versionCode="20"
android:versionName="3.0.3">

<uses-sdk tools:overrideLibrary=" com.google.android.gms.ads,
com.google.android.gms.ads.impl,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,10 @@ public CameraAPI(Context context) {

public void setDevice(Device device) {
mCameraWS.setWSUrl(device.getWebService());
initialize();

for (DeviceChangedListener listener : mDeviceChangedListeners) listener.onNewDevice(device);
}

private void initialize() {
public void initializeWS() {
if (mIsDeviceInitialized) {
return;
}
Expand Down Expand Up @@ -184,14 +182,14 @@ public void cameraResponse(CameraWS.ResponseCode responseCode, Object response)
}

public void stopLiveView() {

mCameraWS.sendRequest("stopLiveview", new JSONArray(), null);
}


public void actZoom(final ZoomDirection zoomDir) {

JSONArray params = new JSONArray().put(zoomDir == ZoomDirection.IN ? "in" : "out").put("1shot");
JSONArray params = new JSONArray().
put(zoomDir == ZoomDirection.IN ? "in" : "out").put("1shot");
mCameraWS.sendRequest("actZoom", params, null);
}

Expand Down
83 changes: 42 additions & 41 deletions app/src/main/java/com/thibaudperso/sonycamera/sdk/model/Device.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,47 @@

public class Device {

private int mId;
private String mModel;
private String mWebService;

public Device(int id, String model, String webService) {
this.mId = id;
this.mModel = model;
this.mWebService = webService;
}

public int getId() {
return mId;
}

public void setId(int id) {
this.mId = id;
}

public String getWebService() {
return mWebService;
}

@Override
public String toString() {
return mModel;
}

public String toLongString() {
return "model: " + mModel + ", id: " + mId + ", webService: " + mWebService;
}

public static Comparator<Device> COMPARE_BY_DEVICEMODEL = new Comparator<Device>() {
public int compare(Device one, Device other) {
return one.mModel.compareTo(other.mModel);
}
};

@Override
public boolean equals(Object o) {
return o instanceof Device && ((Device) o).mId == mId;
}
private int mId;
private String mModel;
private String mWebService;

public Device(int id, String model, String webService) {
this.mId = id;
this.mModel = model;
this.mWebService = webService;
}

public int getId() {
return mId;
}

public void setId(int id) {
this.mId = id;
}

public String getWebService() {
return mWebService;
}

@Override
public String toString() {
return mModel;
}

public String toLongString() {
return "model: " + mModel + ", id: " + mId + ", webService: " + mWebService;
}

public static Comparator<Device> COMPARE_BY_DEVICEMODEL = new Comparator<Device>() {
public int compare(Device one, Device other) {
return one.mModel.compareTo(other.mModel);
}
};

@Override
public boolean equals(Object o) {
return o instanceof Device && ((Device) o).mId == mId;
}


}
Loading

0 comments on commit 685670d

Please sign in to comment.