mirror of
https://github.com/amwatson/CitraVR.git
synced 2024-09-20 03:11:40 +02:00
add quit and next buttons
This commit is contained in:
parent
48a45e53a9
commit
dde7d9f3ca
2 changed files with 22 additions and 20 deletions
|
@ -18,19 +18,6 @@ class VrRibbonLayer(activity: VrActivity) : VrUILayer(activity, R.layout.vr_ribb
|
||||||
else NativeLibrary.ButtonState.RELEASED)
|
else NativeLibrary.ButtonState.RELEASED)
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
window?.findViewById<ImageButton>(R.id.buttonHome)?.setOnTouchListener { view, motionEvent ->
|
|
||||||
if (motionEvent.action == MotionEvent.ACTION_DOWN) {
|
|
||||||
(view as ImageButton).setImageResource(R.drawable.button_home_pressed)
|
|
||||||
} else {
|
|
||||||
(view as ImageButton).setImageResource(R.drawable.button_home)
|
|
||||||
}
|
|
||||||
NativeLibrary.onGamePadEvent(NativeLibrary.TouchScreenDevice,
|
|
||||||
NativeLibrary.ButtonType.BUTTON_HOME,
|
|
||||||
if (motionEvent.action == MotionEvent.ACTION_DOWN)
|
|
||||||
NativeLibrary.ButtonState.PRESSED
|
|
||||||
else NativeLibrary.ButtonState.RELEASED)
|
|
||||||
false
|
|
||||||
}
|
|
||||||
window?.findViewById<Button>(R.id.buttonStart)?.setOnTouchListener { _, motionEvent ->
|
window?.findViewById<Button>(R.id.buttonStart)?.setOnTouchListener { _, motionEvent ->
|
||||||
NativeLibrary.onGamePadEvent(NativeLibrary.TouchScreenDevice,
|
NativeLibrary.onGamePadEvent(NativeLibrary.TouchScreenDevice,
|
||||||
NativeLibrary.ButtonType.BUTTON_START,
|
NativeLibrary.ButtonType.BUTTON_START,
|
||||||
|
|
|
@ -73,13 +73,12 @@
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="1" />
|
android:layout_weight="1" />
|
||||||
|
|
||||||
<ImageButton
|
<Button
|
||||||
android:id="@+id/buttonHome"
|
android:id="@+id/buttonStart"
|
||||||
|
style="@style/VrRibbonButtonStyle"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="10dp"
|
android:text="@string/button_start" />
|
||||||
android:background="@null"
|
|
||||||
android:src="@drawable/button_home" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -87,11 +86,27 @@
|
||||||
android:layout_weight="1" />
|
android:layout_weight="1" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/buttonStart"
|
android:id="@+id/buttonExit"
|
||||||
style="@style/VrRibbonButtonStyle"
|
style="@style/VrRibbonButtonStyle"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/button_start" />
|
android:text="@string/emulation_close_game" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="3" />
|
||||||
|
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/buttonNextMenu"
|
||||||
|
style="@style/VrRibbonButtonStyle"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text=">" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
Loading…
Reference in a new issue