Skip to content
Permalink
Browse files

Android: Bring back the game details dialog

It was made inaccessible in e19922c (I'm not sure why)
and then removed by 593b697.
  • Loading branch information
JosJuice committed Jun 15, 2019
1 parent 8709127 commit 00c4dad7849e7b88c006475c961ce125a29ccb8a
@@ -146,7 +146,8 @@ public boolean onLongClick(View view)
}

GameSettingsDialog fragment =
GameSettingsDialog.newInstance(gameId, holder.gameFile.getPlatform());
GameSettingsDialog.
newInstance(holder.gameFile.getPath(), gameId, holder.gameFile.getPlatform());
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction()
.add(fragment, GameSettingsDialog.TAG).commit();
return true;
@@ -91,7 +91,8 @@ public void onBindViewHolder(ViewHolder viewHolder, Object item)
}

GameSettingsDialog fragment =
GameSettingsDialog.newInstance(gameId, holder.gameFile.getPlatform());
GameSettingsDialog.newInstance(holder.gameFile.getPath(), gameId,
holder.gameFile.getPlatform());
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction()
.add(fragment, GameSettingsDialog.TAG).commit();

@@ -1,14 +1,16 @@
package org.dolphinemu.dolphinemu.dialogs;

import android.app.AlertDialog;
import android.app.Dialog;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.app.DialogFragment;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment;

import com.google.android.material.floatingactionbutton.FloatingActionButton;

import com.squareup.picasso.Picasso;

import org.dolphinemu.dolphinemu.R;
@@ -38,7 +40,7 @@ public Dialog onCreateDialog(Bundle savedInstanceState)
{
GameFile gameFile = GameFileCacheService.addOrGet(getArguments().getString(ARG_GAME_PATH));

AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
AlertDialog.Builder builder = new AlertDialog.Builder(requireActivity());
ViewGroup contents = (ViewGroup) getActivity().getLayoutInflater()
.inflate(R.layout.dialog_game_details, null);

@@ -6,6 +6,7 @@
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.FragmentActivity;

import android.widget.Toast;

@@ -20,14 +21,16 @@
public class GameSettingsDialog extends DialogFragment
{
public static final String TAG = "GameSettingsDialog";
public static final String ARG_PATH = "path";
public static final String ARG_GAMEID = "game_id";
public static final String ARG_PLATFORM = "platform";

public static GameSettingsDialog newInstance(String gameId, int platform)
public static GameSettingsDialog newInstance(String path, String gameId, int platform)
{
GameSettingsDialog fragment = new GameSettingsDialog();

Bundle arguments = new Bundle();
arguments.putString(ARG_PATH, path);
arguments.putString(ARG_GAMEID, gameId);
arguments.putInt(ARG_PLATFORM, platform);
fragment.setArguments(arguments);
@@ -41,6 +44,7 @@ public Dialog onCreateDialog(Bundle savedInstanceState)
{
AlertDialog.Builder builder = new AlertDialog.Builder(requireContext());

String path = requireArguments().getString(ARG_PATH);
String gameId = requireArguments().getString(ARG_GAMEID);
int platform = requireArguments().getInt(ARG_PLATFORM);

@@ -52,22 +56,26 @@ public Dialog onCreateDialog(Bundle savedInstanceState)
switch (which)
{
case 0:
SettingsActivity.launch(getContext(), MenuTag.CONFIG, gameId);
GameDetailsDialog.newInstance(path).show((requireActivity())
.getSupportFragmentManager(), "game_details");
break;
case 1:
SettingsActivity.launch(getContext(), MenuTag.GRAPHICS, gameId);
SettingsActivity.launch(getContext(), MenuTag.CONFIG, gameId);
break;
case 2:
SettingsActivity.launch(getContext(), MenuTag.GCPAD_TYPE, gameId);
SettingsActivity.launch(getContext(), MenuTag.GRAPHICS, gameId);
break;
case 3:
SettingsActivity.launch(getContext(), MenuTag.GCPAD_TYPE, gameId);
break;
case 4:
// Clear option for GC, Wii controls for else
if (platform == Platform.GAMECUBE.toInt())
clearGameSettings(gameId);
else
SettingsActivity.launch(getActivity(), MenuTag.WIIMOTE, gameId);
break;
case 4:
case 5:
clearGameSettings(gameId);
break;
}
@@ -336,12 +336,14 @@
</string-array>

<string-array name="gameSettingsMenusGC">
<item>Details</item>
<item>Core Settings</item>
<item>GFX Settings</item>
<item>GameCube Controller Settings</item>
<item>Clear Game Settings</item>
</string-array>
<string-array name="gameSettingsMenusWii">
<item>Details</item>
<item>Core Settings</item>
<item>GFX Settings</item>
<item>GameCube Controller Settings</item>

0 comments on commit 00c4dad

Please sign in to comment.
You can’t perform that action at this time.