mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-22 10:49:02 +00:00
[Android] Simplify the setting of the AlertDialog in function detectDevice. setMessage allows setting the message through just the message string ID.
This commit is contained in:
parent
4368467977
commit
26e9bef7ac
@ -222,14 +222,14 @@ public final class MainMenuFragment extends PreferenceListFragment implements On
|
|||||||
|
|
||||||
final Context ctx = getActivity();
|
final Context ctx = getActivity();
|
||||||
final boolean mentionPlayStore = !Build.MODEL.equals("OUYA Console");
|
final boolean mentionPlayStore = !Build.MODEL.equals("OUYA Console");
|
||||||
final String message = (mentionPlayStore ? getString(R.string.detect_device_msg_general) : getString(R.string.detect_device_msg_ouya));
|
final int messageId = (mentionPlayStore ? R.string.detect_device_msg_general : R.string.detect_device_msg_ouya);
|
||||||
|
|
||||||
Log.i("Device MODEL", Build.MODEL);
|
Log.i("Device MODEL", Build.MODEL);
|
||||||
if (Build.MODEL.equals("SHIELD"))
|
if (Build.MODEL.equals("SHIELD"))
|
||||||
{
|
{
|
||||||
AlertDialog.Builder alert = new AlertDialog.Builder(ctx);
|
AlertDialog.Builder alert = new AlertDialog.Builder(ctx);
|
||||||
alert.setTitle(R.string.nvidia_shield_detected);
|
alert.setTitle(R.string.nvidia_shield_detected);
|
||||||
alert.setMessage(message);
|
alert.setMessage(messageId);
|
||||||
alert.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener()
|
alert.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
@ -253,7 +253,7 @@ public final class MainMenuFragment extends PreferenceListFragment implements On
|
|||||||
{
|
{
|
||||||
AlertDialog.Builder alert = new AlertDialog.Builder(ctx);
|
AlertDialog.Builder alert = new AlertDialog.Builder(ctx);
|
||||||
alert.setTitle(R.string.game_mid_detected);
|
alert.setTitle(R.string.game_mid_detected);
|
||||||
alert.setMessage(message);
|
alert.setMessage(messageId);
|
||||||
alert.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener()
|
alert.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
@ -276,7 +276,7 @@ public final class MainMenuFragment extends PreferenceListFragment implements On
|
|||||||
{
|
{
|
||||||
AlertDialog.Builder alert = new AlertDialog.Builder(ctx);
|
AlertDialog.Builder alert = new AlertDialog.Builder(ctx);
|
||||||
alert.setTitle(R.string.ouya_detected);
|
alert.setTitle(R.string.ouya_detected);
|
||||||
alert.setMessage(message);
|
alert.setMessage(messageId);
|
||||||
alert.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener()
|
alert.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
@ -299,7 +299,7 @@ public final class MainMenuFragment extends PreferenceListFragment implements On
|
|||||||
{
|
{
|
||||||
AlertDialog.Builder alert = new AlertDialog.Builder(ctx);
|
AlertDialog.Builder alert = new AlertDialog.Builder(ctx);
|
||||||
alert.setTitle(R.string.xperia_play_detected);
|
alert.setTitle(R.string.xperia_play_detected);
|
||||||
alert.setMessage(message);
|
alert.setMessage(messageId);
|
||||||
alert.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener()
|
alert.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
@ -324,7 +324,7 @@ public final class MainMenuFragment extends PreferenceListFragment implements On
|
|||||||
{
|
{
|
||||||
AlertDialog.Builder alert = new AlertDialog.Builder(ctx);
|
AlertDialog.Builder alert = new AlertDialog.Builder(ctx);
|
||||||
alert.setTitle(R.string.nexus_7_2013_detected);
|
alert.setTitle(R.string.nexus_7_2013_detected);
|
||||||
alert.setMessage(message);
|
alert.setMessage(messageId);
|
||||||
alert.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener()
|
alert.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user