Skip to content

Commit

Permalink
shortcuts: Fixed a bug that cannot save inputType to shortcut. Change…
Browse files Browse the repository at this point in the history
… the position of game controller settings.
  • Loading branch information
longjunyu2 committed Aug 22, 2024
1 parent 21a8b41 commit e7a767c
Show file tree
Hide file tree
Showing 3 changed files with 138 additions and 111 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ private void createContentView() {
int controlsProfile = sControlsProfile.getSelectedItemPosition() > 0 ? profiles.get(sControlsProfile.getSelectedItemPosition()-1).id : 0;
shortcut.putExtra("controlsProfile", controlsProfile > 0 ? String.valueOf(controlsProfile) : null);
shortcut.putExtra("simTouchScreen", cbSimulateTouchScreen.isChecked() ? "1" : "0");
shortcut.putExtra("inputType", finalInputType == inputType ? null : String.valueOf(finalInputType));
shortcut.putExtra("inputType", String.valueOf(finalInputType));
shortcut.saveData();
}
});
Expand Down
123 changes: 68 additions & 55 deletions app/src/main/res/layout/container_detail_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -186,68 +186,13 @@
android:layout_width="match_parent"
android:id="@+id/SMIDISoundFont" />

<LinearLayout
android:id="@+id/LLDinputMapperType"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/directinput_mapper_type" />

<Spinner
style="@style/ComboBox"
android:id="@+id/SDInputType"
android:layout_width="match_parent"
android:entries="@array/dinput_mapper_type_entries" />
</LinearLayout>

<CheckBox
android:id="@+id/CBShowFPS"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/show_fps"
android:layout_marginTop="8dp" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="8dp">

<CheckBox
android:id="@+id/CBEnableXInput"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/enable_xinput_for_wine_game" />

<ImageView
android:id="@+id/BTXInputHelp"
style="@style/HelpButton"
android:layout_gravity="center" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="8dp">

<CheckBox
android:id="@+id/CBEnableDInput"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/enable_dinput_for_wine_game" />

<ImageView
android:id="@+id/BTDInputHelp"
style="@style/HelpButton"
android:layout_gravity="center" />
</LinearLayout>

<com.google.android.material.tabs.TabLayout
android:id="@+id/TabLayout"
android:layout_width="match_parent"
Expand Down Expand Up @@ -617,6 +562,74 @@
android:text="@string/system" />
</FrameLayout>

<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp">

<LinearLayout style="@style/FieldSet">

<LinearLayout
android:id="@+id/LLDinputMapperType"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/directinput_mapper_type" />

<Spinner
style="@style/ComboBox"
android:id="@+id/SDInputType"
android:layout_width="match_parent"
android:entries="@array/dinput_mapper_type_entries" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="8dp">

<CheckBox
android:id="@+id/CBEnableXInput"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/enable_xinput_for_wine_game" />

<ImageView
android:id="@+id/BTXInputHelp"
style="@style/HelpButton"
android:layout_gravity="center" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="8dp">

<CheckBox
android:id="@+id/CBEnableDInput"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/enable_dinput_for_wine_game" />

<ImageView
android:id="@+id/BTDInputHelp"
style="@style/HelpButton"
android:layout_gravity="center" />
</LinearLayout>
</LinearLayout>

<TextView
style="@style/FieldSetLabel"
android:text="@string/game_controller" />
</FrameLayout>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand Down
124 changes: 69 additions & 55 deletions app/src/main/res/layout/shortcut_settings_dialog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -169,61 +169,6 @@
android:layout_width="match_parent"
android:id="@+id/SMIDISoundFont" />

<LinearLayout
android:id="@+id/LLDinputMapperType"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/directinput_mapper_type" />

<Spinner
style="@style/ComboBox"
android:id="@+id/SDInputType"
android:layout_width="match_parent"
android:entries="@array/dinput_mapper_type_entries" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="8dp">

<CheckBox
android:id="@+id/CBEnableXInput"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/enable_xinput_for_wine_game" />

<ImageView
android:id="@+id/BTXInputHelp"
style="@style/HelpButton"
android:layout_gravity="center" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="8dp">

<CheckBox
android:id="@+id/CBEnableDInput"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/enable_dinput_for_wine_game" />

<ImageView
android:id="@+id/BTDInputHelp"
style="@style/HelpButton"
android:layout_gravity="center" />
</LinearLayout>

<com.google.android.material.tabs.TabLayout
android:id="@+id/TabLayout"
android:layout_width="match_parent"
Expand Down Expand Up @@ -394,6 +339,75 @@
android:text="@string/input_controls" />
</FrameLayout>

<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp">

<LinearLayout style="@style/FieldSet">

<LinearLayout
android:id="@+id/LLDinputMapperType"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/directinput_mapper_type" />

<Spinner
style="@style/ComboBox"
android:id="@+id/SDInputType"
android:layout_width="match_parent"
android:entries="@array/dinput_mapper_type_entries" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="8dp">

<CheckBox
android:id="@+id/CBEnableXInput"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/enable_xinput_for_wine_game" />

<ImageView
android:id="@+id/BTXInputHelp"
style="@style/HelpButton"
android:layout_gravity="center" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="8dp">

<CheckBox
android:id="@+id/CBEnableDInput"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/enable_dinput_for_wine_game" />

<ImageView
android:id="@+id/BTDInputHelp"
style="@style/HelpButton"
android:layout_gravity="center" />
</LinearLayout>
</LinearLayout>

<TextView
style="@style/FieldSetLabel"
android:background="#ffffff"
android:text="@string/game_controller" />
</FrameLayout>

<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down

0 comments on commit e7a767c

Please sign in to comment.