Added six axis controller description image that can be displayed by click on small icon
Esse commit está contido em:
Arquivo binário não exibido.
|
Depois Largura: | Altura: | Tamanho: 4.7 KiB |
Arquivo binário não exibido.
|
Antes Largura: | Altura: | Tamanho: 18 KiB |
Arquivo binário não exibido.
|
Depois Largura: | Altura: | Tamanho: 78 KiB |
BIN
Arquivo binário não exibido.
|
Depois Largura: | Altura: | Tamanho: 3.3 KiB |
@@ -53,14 +53,15 @@
|
||||
</TableLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="0dp"
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_gravity="top"
|
||||
android:layout_weight=".8"
|
||||
android:paddingBottom="5dp" >
|
||||
|
||||
<ImageView
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/display"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="fill_parent"
|
||||
@@ -68,7 +69,27 @@
|
||||
android:contentDescription="@string/display_desc"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/ardrone_front" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ps3image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="invisible"
|
||||
android:contentDescription="@string/display_desc"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/sixaxis_controller_decription_portrait" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ps3imagesmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@string/display_desc"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/sixaxis_controller_decription_portrait_smal"
|
||||
android:layout_gravity="top|right"/>
|
||||
</FrameLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/takeOffOrland"
|
||||
|
||||
@@ -54,6 +54,7 @@ public class MainActivity extends Activity implements DroneVideoListener, OnShar
|
||||
static ARDrone drone;
|
||||
|
||||
ImageView display;
|
||||
ImageView ps3Image;
|
||||
TextView state;
|
||||
TextView joystick_state;
|
||||
Button connectButton;
|
||||
@@ -108,6 +109,7 @@ public class MainActivity extends Activity implements DroneVideoListener, OnShar
|
||||
state = (TextView) findViewById(R.id.state);
|
||||
joystick_state = (TextView) findViewById(R.id.joystick_state);
|
||||
display = (ImageView) findViewById(R.id.display);
|
||||
ps3Image = (ImageView) findViewById(R.id.ps3image);
|
||||
connectButton = (Button) findViewById(R.id.connect);
|
||||
|
||||
btnTakeOffOrLand = (Button) findViewById(R.id.takeOffOrland);
|
||||
@@ -198,6 +200,11 @@ public class MainActivity extends Activity implements DroneVideoListener, OnShar
|
||||
btnConnectUsbControllerButton.performClick();
|
||||
}
|
||||
|
||||
findViewById(R.id.ps3imagesmall).setOnClickListener(new View.OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
ps3Image.setVisibility(ps3Image.getVisibility() != View.INVISIBLE ? View.INVISIBLE : View.VISIBLE);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void tryConnectPS3Controller(UsbDevice device) {
|
||||
|
||||
@@ -28,6 +28,7 @@ import com.codeminders.ardrone.controllers.GameControllerState;
|
||||
import com.codeminders.ardrone.controllers.ControllerStateChange;
|
||||
import com.codeminders.ardrone.controllers.KeyboardController;
|
||||
import com.codeminders.ardrone.controllers.hid.manager.HIDControllerFinder;
|
||||
import com.codeminders.ardrone.decoder.TestH264DataDecoder;
|
||||
import com.codeminders.controltower.config.AssignableControl.ControllerButton;
|
||||
import com.codeminders.controltower.config.ControlMap;
|
||||
import com.codeminders.hidapi.ClassPathLibraryLoader;
|
||||
@@ -196,6 +197,8 @@ public class ControlTower extends javax.swing.JFrame implements DroneStatusChang
|
||||
});
|
||||
|
||||
System.err.println("Connecting to the drone");
|
||||
TestH264DataDecoder extVideoDecoder = new TestH264DataDecoder(drone, 102400);
|
||||
drone.setExternalVideoDataDecoder(extVideoDecoder);
|
||||
drone.connect();
|
||||
drone.waitForReady(CONNECT_TIMEOUT);
|
||||
drone.clearEmergencySignal();
|
||||
|
||||
@@ -84,5 +84,10 @@
|
||||
<artifactId>h264-decoder</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jcodec</groupId>
|
||||
<artifactId>jcodec</artifactId>
|
||||
<version>0.0.5</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário