// Path: app/src/main/java/project/android/ConnectionFragment.java
// public static HashMap<String, Boolean> sConnectionAlive = new HashMap<>();
// 
// Path: app/src/main/java/project/android/ConnectionFragment.java
// public static Client sSecuredClient;


import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageButton;
import static project.android.ConnectionFragment.sConnectionAlive;
import static project.android.ConnectionFragment.sSecuredClient;

    private void sendMouseButtonData(final String data) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                if (sConnectionAlive.containsValue(true)) {
                    sSecuredClient.sendData("Mouse_Button", data);
                }
            }
        }).start();
    }

    private void processTouch(MotionEvent event) {
        switch (event.getActionMasked()) {
            case MotionEvent.ACTION_DOWN:
                onSingleClick(event, true);
                break;
            case MotionEvent.ACTION_UP:
                onSingleClick(event, false);
                break;
            case MotionEvent.ACTION_MOVE:
                onMove(event);
        }
    }

    private void sendMouseMovementData(final int x, final int y) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                if (sConnectionAlive.containsValue(true)) {
// Path: app/src/main/java/project/android/ConnectionFragment.java
// public static HashMap<String, Boolean> sConnectionAlive = new HashMap<>();
// 
// Path: app/src/main/java/project/android/ConnectionFragment.java
// public static Client sSecuredClient;


// Path: app/src/main/java/project/android/TouchpadFragment.java
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageButton;
import static project.android.ConnectionFragment.sConnectionAlive;
import static project.android.ConnectionFragment.sSecuredClient;


    private void sendMouseButtonData(final String data) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                if (sConnectionAlive.containsValue(true)) {
                    sSecuredClient.sendData("Mouse_Button", data);
                }
            }
        }).start();
    }

    private void processTouch(MotionEvent event) {
        switch (event.getActionMasked()) {
            case MotionEvent.ACTION_DOWN:
                onSingleClick(event, true);
                break;
            case MotionEvent.ACTION_UP:
                onSingleClick(event, false);
                break;
            case MotionEvent.ACTION_MOVE:
                onMove(event);
        }
    }

    private void sendMouseMovementData(final int x, final int y) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                if (sConnectionAlive.containsValue(true)) {
                    sSecuredClient.sendData(x, y);