// Path: app/src/main/java/com/yuneec/example/component/custom_callback/OnChangeListener.java
// public interface OnChangeListener {
// 
//     void publishConnectionStatus(String connectionStatus);
// 
//     void publishBatteryChangeStatus(String batteryStatus);
// 
//     void publishHealthChangeStatus(String healthStatus);
// 
//     void publishCameraResult(String result);
// 
//     void publishActionResult(String result);
// 
//     void publishYuneecSt16Result(String result);
// 
//     void publishCameraModeResult(Camera.Mode mode, String result);
// }
// 
// Path: app/src/main/java/com/yuneec/example/component/utils/Common.java
// public class Common {
// 
//     public static final String VideoStreamUrl = "rtsp://192.168.42.1/live";
// 
//     public static final int fixedRotationAngleDeg = 20;
// 
//     public static final String connectionStatusDefault = "Not connected to the drone";
// 
//     public static final String batteryStatusDefault = "Unknown";
// 
//     public static final String healthStatusDefault = "Unknown";
// 
//     public static String connectionStatus = connectionStatusDefault;
// 
//     public static String healthStatus = healthStatusDefault;
// 
//     public static String batteryStatus = batteryStatusDefault;
// 
//     public static boolean isConnected = false;
// 
//     public static int defaultPhotoIntervalInSeconds = 4;
// 
//     public static Toast makeToast(Context context, String message) {
//         Toast toast = Toast.makeText(context, message, Toast.LENGTH_SHORT);
//         TextView v = (TextView) toast.getView().findViewById(android.R.id.message);
//         v.setBackgroundColor(ContextCompat.getColor(context, R.color.greyDark));
//         v.setTextColor(ContextCompat.getColor(context, R.color.white));
//         toast.show();
//         return toast;
//     }
// 
//     public static float currentYaw = 0.0f;
//     public static float currentPitch = 0.0f;
// 
// }


import android.content.Context;
import android.util.Log;
import com.yuneec.example.component.custom_callback.OnChangeListener;
import com.yuneec.example.component.utils.Common;
import com.yuneec.sdk.Telemetry;
package com.yuneec.example.component.listeners;



/**
 * Created by sushma on 8/18/17.
 */

public class TelemetryListener {

    private static Telemetry.BatteryListener batteryListener = null;

    private static Telemetry.HealthListener healthListener = null;

    private static final String TAG = TelemetryListener.class.getCanonicalName();

    private static OnChangeListener onChangeListener;

    public static void registerBatteryListener(final Context context) {

        onChangeListener = (OnChangeListener) context;
        if (batteryListener == null) {
            Log.d(TAG, "Initialized battery result listener");
// Path: app/src/main/java/com/yuneec/example/component/custom_callback/OnChangeListener.java
// public interface OnChangeListener {
// 
//     void publishConnectionStatus(String connectionStatus);
// 
//     void publishBatteryChangeStatus(String batteryStatus);
// 
//     void publishHealthChangeStatus(String healthStatus);
// 
//     void publishCameraResult(String result);
// 
//     void publishActionResult(String result);
// 
//     void publishYuneecSt16Result(String result);
// 
//     void publishCameraModeResult(Camera.Mode mode, String result);
// }
// 
// Path: app/src/main/java/com/yuneec/example/component/utils/Common.java
// public class Common {
// 
//     public static final String VideoStreamUrl = "rtsp://192.168.42.1/live";
// 
//     public static final int fixedRotationAngleDeg = 20;
// 
//     public static final String connectionStatusDefault = "Not connected to the drone";
// 
//     public static final String batteryStatusDefault = "Unknown";
// 
//     public static final String healthStatusDefault = "Unknown";
// 
//     public static String connectionStatus = connectionStatusDefault;
// 
//     public static String healthStatus = healthStatusDefault;
// 
//     public static String batteryStatus = batteryStatusDefault;
// 
//     public static boolean isConnected = false;
// 
//     public static int defaultPhotoIntervalInSeconds = 4;
// 
//     public static Toast makeToast(Context context, String message) {
//         Toast toast = Toast.makeText(context, message, Toast.LENGTH_SHORT);
//         TextView v = (TextView) toast.getView().findViewById(android.R.id.message);
//         v.setBackgroundColor(ContextCompat.getColor(context, R.color.greyDark));
//         v.setTextColor(ContextCompat.getColor(context, R.color.white));
//         toast.show();
//         return toast;
//     }
// 
//     public static float currentYaw = 0.0f;
//     public static float currentPitch = 0.0f;
// 
// }


// Path: app/src/main/java/com/yuneec/example/component/listeners/TelemetryListener.java
import android.content.Context;
import android.util.Log;
import com.yuneec.example.component.custom_callback.OnChangeListener;
import com.yuneec.example.component.utils.Common;
import com.yuneec.sdk.Telemetry;

package com.yuneec.example.component.listeners;



/**
 * Created by sushma on 8/18/17.
 */

public class TelemetryListener {

    private static Telemetry.BatteryListener batteryListener = null;

    private static Telemetry.HealthListener healthListener = null;

    private static final String TAG = TelemetryListener.class.getCanonicalName();

    private static OnChangeListener onChangeListener;

    public static void registerBatteryListener(final Context context) {

        onChangeListener = (OnChangeListener) context;
        if (batteryListener == null) {
            Log.d(TAG, "Initialized battery result listener");
            batteryListener = new Telemetry.BatteryListener() {