mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
+11
-13
@@ -30,7 +30,6 @@ public class AppLinkActivity extends FragmentActivity
|
||||
|
||||
private AppLinkHelper.PlayAction playAction;
|
||||
private DirectoryStateReceiver directoryStateReceiver;
|
||||
private BroadcastReceiver gameFileCacheReceiver;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState)
|
||||
@@ -96,18 +95,17 @@ public class AppLinkActivity extends FragmentActivity
|
||||
}
|
||||
});
|
||||
|
||||
gameFileCacheReceiver =
|
||||
new BroadcastReceiver()
|
||||
{
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent)
|
||||
{
|
||||
if (DirectoryInitialization.areDolphinDirectoriesReady())
|
||||
{
|
||||
tryPlay(playAction);
|
||||
}
|
||||
}
|
||||
};
|
||||
BroadcastReceiver gameFileCacheReceiver = new BroadcastReceiver()
|
||||
{
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent)
|
||||
{
|
||||
if (DirectoryInitialization.areDolphinDirectoriesReady())
|
||||
{
|
||||
tryPlay(playAction);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
LocalBroadcastManager broadcastManager = LocalBroadcastManager.getInstance(this);
|
||||
broadcastManager.registerReceiver(directoryStateReceiver, directoryStateIntentFilter);
|
||||
|
||||
+19
-27
@@ -67,7 +67,6 @@ public final class EmulationActivity extends AppCompatActivity
|
||||
|
||||
private SharedPreferences mPreferences;
|
||||
private MotionListener mMotionListener;
|
||||
private ControllerMappingHelper mControllerMappingHelper;
|
||||
|
||||
private Settings mSettings;
|
||||
|
||||
@@ -317,7 +316,6 @@ public final class EmulationActivity extends AppCompatActivity
|
||||
sIsGameCubeGame = Platform.fromNativeInt(mPlatform) == Platform.GAMECUBE;
|
||||
mDeviceHasTouchScreen = getPackageManager().hasSystemFeature("android.hardware.touchscreen");
|
||||
mMotionListener = new MotionListener(this);
|
||||
mControllerMappingHelper = new ControllerMappingHelper();
|
||||
|
||||
int themeId;
|
||||
if (mDeviceHasTouchScreen)
|
||||
@@ -445,19 +443,17 @@ public final class EmulationActivity extends AppCompatActivity
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent result)
|
||||
{
|
||||
super.onActivityResult(requestCode, resultCode, result);
|
||||
switch (requestCode)
|
||||
if (requestCode == REQUEST_CHANGE_DISC)
|
||||
{
|
||||
case REQUEST_CHANGE_DISC:
|
||||
// If the user picked a file, as opposed to just backing out.
|
||||
if (resultCode == MainActivity.RESULT_OK)
|
||||
// If the user picked a file, as opposed to just backing out.
|
||||
if (resultCode == MainActivity.RESULT_OK)
|
||||
{
|
||||
String newDiscPath = FileBrowserHelper.getSelectedPath(result);
|
||||
if (!TextUtils.isEmpty(newDiscPath))
|
||||
{
|
||||
String newDiscPath = FileBrowserHelper.getSelectedPath(result);
|
||||
if (!TextUtils.isEmpty(newDiscPath))
|
||||
{
|
||||
NativeLibrary.ChangeDisc(newDiscPath);
|
||||
}
|
||||
NativeLibrary.ChangeDisc(newDiscPath);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1041,14 +1037,14 @@ public final class EmulationActivity extends AppCompatActivity
|
||||
|
||||
private void setIRSensitivity()
|
||||
{
|
||||
int ir_pitch = Integer.valueOf(
|
||||
int ir_pitch = Integer.parseInt(
|
||||
mPreferences.getString(SettingsFile.KEY_WIIBIND_IR_PITCH + mSelectedGameId, "15"));
|
||||
|
||||
LayoutInflater inflater = LayoutInflater.from(this);
|
||||
View view = inflater.inflate(R.layout.dialog_ir_sensitivity, null);
|
||||
|
||||
TextView text_slider_value_pitch = (TextView) view.findViewById(R.id.text_ir_pitch);
|
||||
TextView units = (TextView) view.findViewById(R.id.text_ir_pitch_units);
|
||||
TextView text_slider_value_pitch = view.findViewById(R.id.text_ir_pitch);
|
||||
TextView units = view.findViewById(R.id.text_ir_pitch_units);
|
||||
SeekBar seekbar_pitch = view.findViewById(R.id.seekbar_pitch);
|
||||
|
||||
text_slider_value_pitch.setText(String.valueOf(ir_pitch));
|
||||
@@ -1074,11 +1070,11 @@ public final class EmulationActivity extends AppCompatActivity
|
||||
}
|
||||
});
|
||||
|
||||
int ir_yaw = Integer.valueOf(
|
||||
int ir_yaw = Integer.parseInt(
|
||||
mPreferences.getString(SettingsFile.KEY_WIIBIND_IR_YAW + mSelectedGameId, "15"));
|
||||
|
||||
TextView text_slider_value_yaw = (TextView) view.findViewById(R.id.text_ir_yaw);
|
||||
TextView units_yaw = (TextView) view.findViewById(R.id.text_ir_yaw_units);
|
||||
TextView text_slider_value_yaw = view.findViewById(R.id.text_ir_yaw);
|
||||
TextView units_yaw = view.findViewById(R.id.text_ir_yaw_units);
|
||||
SeekBar seekbar_yaw = view.findViewById(R.id.seekbar_width);
|
||||
|
||||
text_slider_value_yaw.setText(String.valueOf(ir_yaw));
|
||||
@@ -1105,14 +1101,12 @@ public final class EmulationActivity extends AppCompatActivity
|
||||
});
|
||||
|
||||
|
||||
int ir_vertical_offset = Integer.valueOf(
|
||||
int ir_vertical_offset = Integer.parseInt(
|
||||
mPreferences.getString(SettingsFile.KEY_WIIBIND_IR_VERTICAL_OFFSET + mSelectedGameId,
|
||||
"10"));
|
||||
|
||||
TextView text_slider_value_vertical_offset =
|
||||
(TextView) view.findViewById(R.id.text_ir_vertical_offset);
|
||||
TextView units_vertical_offset =
|
||||
(TextView) view.findViewById(R.id.text_ir_vertical_offset_units);
|
||||
TextView text_slider_value_vertical_offset = view.findViewById(R.id.text_ir_vertical_offset);
|
||||
TextView units_vertical_offset = view.findViewById(R.id.text_ir_vertical_offset_units);
|
||||
SeekBar seekbar_vertical_offset = view.findViewById(R.id.seekbar_vertical_offset);
|
||||
|
||||
text_slider_value_vertical_offset.setText(String.valueOf(ir_vertical_offset));
|
||||
@@ -1176,9 +1170,7 @@ public final class EmulationActivity extends AppCompatActivity
|
||||
new AlertDialog.Builder(this, R.style.DolphinDialogBase)
|
||||
.setTitle(getString(R.string.emulation_touch_overlay_reset))
|
||||
.setPositiveButton(R.string.yes, (dialogInterface, i) ->
|
||||
{
|
||||
mEmulationFragment.resetInputOverlay();
|
||||
})
|
||||
mEmulationFragment.resetInputOverlay())
|
||||
.setNegativeButton(R.string.cancel, (dialogInterface, i) ->
|
||||
{
|
||||
})
|
||||
@@ -1210,7 +1202,7 @@ public final class EmulationActivity extends AppCompatActivity
|
||||
{
|
||||
int axis = range.getAxis();
|
||||
float origValue = event.getAxisValue(axis);
|
||||
float value = mControllerMappingHelper.scaleAxis(input, axis, origValue);
|
||||
float value = ControllerMappingHelper.scaleAxis(input, axis, origValue);
|
||||
// If the input is still in the "flat" area, that means it's really zero.
|
||||
// This is used to compensate for imprecision in joysticks.
|
||||
if (Math.abs(value) > range.getFlat())
|
||||
|
||||
+3
-1
@@ -3,6 +3,7 @@ package org.dolphinemu.dolphinemu.adapters;
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentPagerAdapter;
|
||||
@@ -28,10 +29,11 @@ public class PlatformPagerAdapter extends FragmentPagerAdapter
|
||||
|
||||
public PlatformPagerAdapter(FragmentManager fm, Context context)
|
||||
{
|
||||
super(fm);
|
||||
super(fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT);
|
||||
mContext = context;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Fragment getItem(int position)
|
||||
{
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ public final class GameDetailsDialog extends DialogFragment
|
||||
textCountry.setText(country);
|
||||
textCompany.setText(gameFile.getCompany());
|
||||
textGameId.setText(gameFile.getGameId());
|
||||
textRevision.setText(Integer.toString(gameFile.getRevision()));
|
||||
textRevision.setText(String.valueOf(gameFile.getRevision()));
|
||||
|
||||
if (!gameFile.shouldShowFileFormatDetails())
|
||||
{
|
||||
|
||||
+9
-12
@@ -44,20 +44,17 @@ public final class MotionAlertDialog extends AlertDialog
|
||||
public boolean onKeyEvent(int keyCode, KeyEvent event)
|
||||
{
|
||||
Log.debug("[MotionAlertDialog] Received key event: " + event.getAction());
|
||||
switch (event.getAction())
|
||||
if (event.getAction() == KeyEvent.ACTION_UP)
|
||||
{
|
||||
case KeyEvent.ACTION_UP:
|
||||
if (!ControllerMappingHelper.shouldKeyBeIgnored(event.getDevice(), keyCode))
|
||||
{
|
||||
setting.onKeyInput(event);
|
||||
dismiss();
|
||||
}
|
||||
// Even if we ignore the key, we still consume it. Thus return true regardless.
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
if (!ControllerMappingHelper.shouldKeyBeIgnored(event.getDevice(), keyCode))
|
||||
{
|
||||
setting.onKeyInput(event);
|
||||
dismiss();
|
||||
}
|
||||
// Even if we ignore the key, we still consume it. Thus return true regardless.
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+3
@@ -1,5 +1,7 @@
|
||||
package org.dolphinemu.dolphinemu.features.settings.ui;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
public enum MenuTag
|
||||
{
|
||||
CONFIG("config"),
|
||||
@@ -46,6 +48,7 @@ public enum MenuTag
|
||||
this.subType = subtype;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
|
||||
+3
-4
@@ -143,11 +143,10 @@ public final class SettingsActivityPresenter
|
||||
|
||||
public boolean handleOptionsItem(int itemId)
|
||||
{
|
||||
switch (itemId)
|
||||
if (itemId == R.id.menu_save_exit)
|
||||
{
|
||||
case R.id.menu_save_exit:
|
||||
mView.finish();
|
||||
return true;
|
||||
mView.finish();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
+7
-19
@@ -2,8 +2,6 @@ package org.dolphinemu.dolphinemu.features.settings.ui;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.SharedPreferences;
|
||||
import android.preference.PreferenceManager;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
@@ -45,7 +43,6 @@ import org.dolphinemu.dolphinemu.features.settings.ui.viewholder.SubmenuViewHold
|
||||
import org.dolphinemu.dolphinemu.features.settings.utils.SettingsFile;
|
||||
import org.dolphinemu.dolphinemu.ui.main.MainPresenter;
|
||||
import org.dolphinemu.dolphinemu.utils.FileBrowserHelper;
|
||||
import org.dolphinemu.dolphinemu.utils.Log;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
import java.util.ArrayList;
|
||||
@@ -97,7 +94,7 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
|
||||
|
||||
case SettingsItem.TYPE_SLIDER:
|
||||
view = inflater.inflate(R.layout.list_item_setting, parent, false);
|
||||
return new SliderViewHolder(view, this);
|
||||
return new SliderViewHolder(view, this, mContext);
|
||||
|
||||
case SettingsItem.TYPE_SUBMENU:
|
||||
view = inflater.inflate(R.layout.list_item_setting_submenu, parent, false);
|
||||
@@ -120,8 +117,7 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
|
||||
return new ConfirmRunnableViewHolder(view, this, mContext, mView);
|
||||
|
||||
default:
|
||||
Log.error("[SettingsAdapter] Invalid view type: " + viewType);
|
||||
return null;
|
||||
throw new IllegalArgumentException("Invalid view type: " + viewType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -243,13 +239,13 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
|
||||
builder.setPositiveButton(R.string.ok, this);
|
||||
mDialog = builder.show();
|
||||
|
||||
mTextSliderValue = (TextView) view.findViewById(R.id.text_value);
|
||||
mTextSliderValue = view.findViewById(R.id.text_value);
|
||||
mTextSliderValue.setText(String.valueOf(mSeekbarProgress));
|
||||
|
||||
TextView units = (TextView) view.findViewById(R.id.text_units);
|
||||
TextView units = view.findViewById(R.id.text_units);
|
||||
units.setText(item.getUnits());
|
||||
|
||||
SeekBar seekbar = (SeekBar) view.findViewById(R.id.seekbar);
|
||||
SeekBar seekbar = view.findViewById(R.id.seekbar);
|
||||
|
||||
seekbar.setMax(item.getMax());
|
||||
seekbar.setProgress(mSeekbarProgress);
|
||||
@@ -273,21 +269,13 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
|
||||
mContext.getString(item.getNameId())));
|
||||
dialog.setButton(AlertDialog.BUTTON_NEGATIVE, mContext.getString(R.string.cancel), this);
|
||||
dialog.setButton(AlertDialog.BUTTON_NEUTRAL, mContext.getString(R.string.clear),
|
||||
(dialogInterface, i) ->
|
||||
{
|
||||
SharedPreferences preferences =
|
||||
PreferenceManager.getDefaultSharedPreferences(mContext);
|
||||
item.clearValue();
|
||||
});
|
||||
(dialogInterface, i) -> item.clearValue());
|
||||
dialog.setOnDismissListener(dialog1 ->
|
||||
{
|
||||
StringSetting setting = new StringSetting(item.getKey(), item.getSection(), item.getValue());
|
||||
notifyItemChanged(position);
|
||||
|
||||
if (setting != null)
|
||||
{
|
||||
mView.putSetting(setting);
|
||||
}
|
||||
mView.putSetting(setting);
|
||||
|
||||
mView.onSettingChanged(item.getKey());
|
||||
});
|
||||
|
||||
+3
-2
@@ -3,6 +3,7 @@ package org.dolphinemu.dolphinemu.features.settings.ui;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
@@ -84,7 +85,7 @@ public final class SettingsFragment extends Fragment implements SettingsFragment
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(Context context)
|
||||
public void onAttach(@NonNull Context context)
|
||||
{
|
||||
super.onAttach(context);
|
||||
|
||||
@@ -115,7 +116,7 @@ public final class SettingsFragment extends Fragment implements SettingsFragment
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(View view, @Nullable Bundle savedInstanceState)
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState)
|
||||
{
|
||||
Bundle args = getArguments();
|
||||
MenuTag menuTag = (MenuTag) args.getSerializable(ARGUMENT_MENU_TAG);
|
||||
|
||||
+1
-5
@@ -59,8 +59,8 @@ public final class SettingsFragmentPresenter
|
||||
public void onCreate(MenuTag menuTag, String gameId, Bundle extras)
|
||||
{
|
||||
mGameID = gameId;
|
||||
|
||||
this.mMenuTag = menuTag;
|
||||
|
||||
if (menuTag.isGCPadMenu() || menuTag.isWiimoteExtensionMenu())
|
||||
{
|
||||
mControllerNumber = menuTag.getSubType();
|
||||
@@ -70,10 +70,6 @@ public final class SettingsFragmentPresenter
|
||||
{
|
||||
mControllerNumber = menuTag.getSubType();
|
||||
}
|
||||
else
|
||||
{
|
||||
mMenuTag = menuTag;
|
||||
}
|
||||
}
|
||||
|
||||
public void onViewCreated(MenuTag menuTag, Settings settings)
|
||||
|
||||
+1
-3
@@ -9,8 +9,6 @@ import android.widget.FrameLayout;
|
||||
*/
|
||||
public final class SettingsFrameLayout extends FrameLayout
|
||||
{
|
||||
private float mVisibleness = 1.0f;
|
||||
|
||||
public SettingsFrameLayout(Context context)
|
||||
{
|
||||
super(context);
|
||||
@@ -44,7 +42,7 @@ public final class SettingsFrameLayout extends FrameLayout
|
||||
|
||||
public float getVisibleness()
|
||||
{
|
||||
return mVisibleness;
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
public void setVisibleness(float visibleness)
|
||||
|
||||
+3
-3
@@ -28,9 +28,9 @@ public final class CheckBoxSettingViewHolder extends SettingViewHolder
|
||||
@Override
|
||||
protected void findViews(View root)
|
||||
{
|
||||
mTextSettingName = (TextView) root.findViewById(R.id.text_setting_name);
|
||||
mTextSettingDescription = (TextView) root.findViewById(R.id.text_setting_description);
|
||||
mCheckbox = (CheckBox) root.findViewById(R.id.checkbox);
|
||||
mTextSettingName = root.findViewById(R.id.text_setting_name);
|
||||
mTextSettingDescription = root.findViewById(R.id.text_setting_description);
|
||||
mCheckbox = root.findViewById(R.id.checkbox);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+3
-5
@@ -35,8 +35,8 @@ public final class ConfirmRunnableViewHolder extends SettingViewHolder
|
||||
@Override
|
||||
protected void findViews(View root)
|
||||
{
|
||||
mTextSettingName = (TextView) root.findViewById(R.id.text_setting_name);
|
||||
mTextSettingDescription = (TextView) root.findViewById(R.id.text_setting_description);
|
||||
mTextSettingName = root.findViewById(R.id.text_setting_name);
|
||||
mTextSettingDescription = root.findViewById(R.id.text_setting_description);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -78,9 +78,7 @@ public final class ConfirmRunnableViewHolder extends SettingViewHolder
|
||||
mView.getActivity().finish();
|
||||
})
|
||||
.setNegativeButton("No", (dialog, whichButton) ->
|
||||
{
|
||||
dialog.dismiss();
|
||||
});
|
||||
dialog.dismiss());
|
||||
|
||||
builder.show();
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,7 +8,6 @@ import org.dolphinemu.dolphinemu.R;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.view.FilePicker;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.view.SettingsItem;
|
||||
import org.dolphinemu.dolphinemu.features.settings.ui.SettingsAdapter;
|
||||
import org.dolphinemu.dolphinemu.features.settings.utils.SettingsFile;
|
||||
import org.dolphinemu.dolphinemu.ui.main.MainPresenter;
|
||||
|
||||
public final class FilePickerViewHolder extends SettingViewHolder
|
||||
@@ -27,8 +26,8 @@ public final class FilePickerViewHolder extends SettingViewHolder
|
||||
@Override
|
||||
protected void findViews(View root)
|
||||
{
|
||||
mTextSettingName = (TextView) root.findViewById(R.id.text_setting_name);
|
||||
mTextSettingDescription = (TextView) root.findViewById(R.id.text_setting_description);
|
||||
mTextSettingName = root.findViewById(R.id.text_setting_name);
|
||||
mTextSettingDescription = root.findViewById(R.id.text_setting_description);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-2
@@ -20,7 +20,7 @@ public final class HeaderViewHolder extends SettingViewHolder
|
||||
@Override
|
||||
protected void findViews(View root)
|
||||
{
|
||||
mHeaderName = (TextView) root.findViewById(R.id.text_header_name);
|
||||
mHeaderName = root.findViewById(R.id.text_header_name);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -34,4 +34,4 @@ public final class HeaderViewHolder extends SettingViewHolder
|
||||
{
|
||||
// no-op
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -30,8 +30,8 @@ public class RumbleBindingViewHolder extends SettingViewHolder
|
||||
@Override
|
||||
protected void findViews(View root)
|
||||
{
|
||||
mTextSettingName = (TextView) root.findViewById(R.id.text_setting_name);
|
||||
mTextSettingDescription = (TextView) root.findViewById(R.id.text_setting_description);
|
||||
mTextSettingName = root.findViewById(R.id.text_setting_name);
|
||||
mTextSettingDescription = root.findViewById(R.id.text_setting_description);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-2
@@ -26,8 +26,8 @@ public final class SingleChoiceViewHolder extends SettingViewHolder
|
||||
@Override
|
||||
protected void findViews(View root)
|
||||
{
|
||||
mTextSettingName = (TextView) root.findViewById(R.id.text_setting_name);
|
||||
mTextSettingDescription = (TextView) root.findViewById(R.id.text_setting_description);
|
||||
mTextSettingName = root.findViewById(R.id.text_setting_name);
|
||||
mTextSettingDescription = root.findViewById(R.id.text_setting_description);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+11
-4
@@ -1,5 +1,6 @@
|
||||
package org.dolphinemu.dolphinemu.features.settings.ui.viewholder;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -10,21 +11,25 @@ import org.dolphinemu.dolphinemu.features.settings.ui.SettingsAdapter;
|
||||
|
||||
public final class SliderViewHolder extends SettingViewHolder
|
||||
{
|
||||
private Context mContext;
|
||||
|
||||
private SliderSetting mItem;
|
||||
|
||||
private TextView mTextSettingName;
|
||||
private TextView mTextSettingDescription;
|
||||
|
||||
public SliderViewHolder(View itemView, SettingsAdapter adapter)
|
||||
public SliderViewHolder(View itemView, SettingsAdapter adapter, Context context)
|
||||
{
|
||||
super(itemView, adapter);
|
||||
|
||||
mContext = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void findViews(View root)
|
||||
{
|
||||
mTextSettingName = (TextView) root.findViewById(R.id.text_setting_name);
|
||||
mTextSettingDescription = (TextView) root.findViewById(R.id.text_setting_description);
|
||||
mTextSettingName = root.findViewById(R.id.text_setting_name);
|
||||
mTextSettingDescription = root.findViewById(R.id.text_setting_description);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -40,7 +45,9 @@ public final class SliderViewHolder extends SettingViewHolder
|
||||
}
|
||||
else
|
||||
{
|
||||
mTextSettingDescription.setText(mItem.getSelectedValue() + mItem.getUnits());
|
||||
mTextSettingDescription.setText(mContext
|
||||
.getString(R.string.slider_setting_value, mItem.getSelectedValue(),
|
||||
mItem.getUnits()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ public final class SubmenuViewHolder extends SettingViewHolder
|
||||
@Override
|
||||
protected void findViews(View root)
|
||||
{
|
||||
mTextSettingName = (TextView) root.findViewById(R.id.text_setting_name);
|
||||
mTextSettingName = root.findViewById(R.id.text_setting_name);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+3
-12
@@ -432,10 +432,8 @@ public final class SettingsFile
|
||||
{
|
||||
File ini = getSettingsFile(fileName);
|
||||
|
||||
PrintWriter writer = null;
|
||||
try
|
||||
try (PrintWriter writer = new PrintWriter(ini, "UTF-8"))
|
||||
{
|
||||
writer = new PrintWriter(ini, "UTF-8");
|
||||
|
||||
Set<String> keySet = sections.keySet();
|
||||
Set<String> sortedKeySet = new TreeSet<>(keySet);
|
||||
@@ -459,13 +457,6 @@ public final class SettingsFile
|
||||
if (view != null)
|
||||
view.showToastMessage("Error saving " + fileName + ".ini: " + e.getMessage());
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (writer != null)
|
||||
{
|
||||
writer.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void saveCustomGameSettings(final String gameId,
|
||||
@@ -534,14 +525,14 @@ public final class SettingsFile
|
||||
DirectoryInitialization.copyFile(defautlWiiProfilePath, wiiConfigPath);
|
||||
|
||||
NativeLibrary.SetProfileSetting(profile, Settings.SECTION_PROFILE, "Device",
|
||||
"Android/" + (Integer.valueOf(padId) + 4) + "/Touchscreen");
|
||||
"Android/" + (Integer.parseInt(padId) + 4) + "/Touchscreen");
|
||||
}
|
||||
|
||||
NativeLibrary.SetProfileSetting(profile, Settings.SECTION_PROFILE, key, value);
|
||||
|
||||
// Enable the profile
|
||||
NativeLibrary.SetUserSetting(gameId, Settings.SECTION_CONTROLS,
|
||||
KEY_WIIMOTE_PROFILE + (Integer.valueOf(padId) + 1), profile);
|
||||
KEY_WIIMOTE_PROFILE + (Integer.parseInt(padId) + 1), profile);
|
||||
}
|
||||
|
||||
private static String mapSectionNameFromIni(String generalSectionName)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user