mirror of
https://github.com/mandarine3ds/mandarine.git
synced 2025-02-21 15:10:59 +00:00
android: cleanup some java references
This commit is contained in:
parent
edf3728696
commit
315bac7961
@ -27,8 +27,8 @@ class ScreenAdjustmentUtil(private val windowManager: WindowManager,
|
||||
|
||||
fun cycleLayouts() {
|
||||
// TODO: figure out how to pull these from R.array
|
||||
val landscape_values = intArrayOf(6,1,3,4,0,5);
|
||||
val portrait_values = intArrayOf(0,1);
|
||||
val landscape_values = intArrayOf(6,1,3,4,0,5)
|
||||
val portrait_values = intArrayOf(0,1)
|
||||
if (NativeLibrary.isPortraitMode) {
|
||||
val current_layout = IntSetting.PORTRAIT_SCREEN_LAYOUT.int
|
||||
val pos = portrait_values.indexOf(current_layout)
|
||||
|
@ -28,7 +28,7 @@ enum class PortraitScreenLayout(val int: Int) {
|
||||
|
||||
companion object {
|
||||
fun from(int: Int): PortraitScreenLayout {
|
||||
return entries.firstOrNull { it.int == int } ?: TOP_FULL_WIDTH;
|
||||
return entries.firstOrNull { it.int == int } ?: TOP_FULL_WIDTH
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -274,12 +274,12 @@ class SettingsAdapter(
|
||||
value = sliderProgress.toFloat()
|
||||
textSliderValue!!.addTextChangedListener( object : TextWatcher {
|
||||
override fun afterTextChanged(s: Editable) {
|
||||
val textValue = s.toString().toIntOrNull();
|
||||
val textValue = s.toString().toIntOrNull()
|
||||
if (textValue == null || textValue < valueFrom || textValue > valueTo) {
|
||||
textInputLayout!!.error = "Inappropriate value"
|
||||
} else {
|
||||
textInputLayout!!.error = null
|
||||
value = textValue.toFloat();
|
||||
value = textValue.toFloat()
|
||||
}
|
||||
}
|
||||
override fun beforeTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) {}
|
||||
|
@ -110,7 +110,7 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
|
||||
|
||||
/** Returns the portrait mode width */
|
||||
private fun getWidth(): Int {
|
||||
val dm = Resources.getSystem().displayMetrics;
|
||||
val dm = Resources.getSystem().displayMetrics
|
||||
return if (dm.widthPixels < dm.heightPixels)
|
||||
dm.widthPixels
|
||||
else
|
||||
@ -118,7 +118,7 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
|
||||
}
|
||||
|
||||
private fun getHeight(): Int {
|
||||
val dm = Resources.getSystem().displayMetrics;
|
||||
val dm = Resources.getSystem().displayMetrics
|
||||
return if (dm.widthPixels < dm.heightPixels)
|
||||
dm.heightPixels
|
||||
else
|
||||
|
@ -28,7 +28,7 @@ class GameIconFetcher(
|
||||
) : Fetcher {
|
||||
override suspend fun fetch(): FetchResult {
|
||||
return DrawableResult(
|
||||
drawable = getGameIcon(game.icon)!!.toDrawable(options.context.resources),
|
||||
drawable = getGameIcon(game.icon).toDrawable(options.context.resources),
|
||||
isSampled = false,
|
||||
dataSource = DataSource.DISK
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user