Skip to content

Commit

Permalink
Merge pull request #464 from Reco1I/remove-im
Browse files Browse the repository at this point in the history
Remove InputManager
  • Loading branch information
Rian8337 authored Dec 16, 2024
2 parents 1e1fb4b + ea5b57a commit 62cc4a1
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 112 deletions.
14 changes: 1 addition & 13 deletions src/com/edlplan/ui/fragment/SearchBarFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,15 @@ import com.edlplan.ui.EasingHelper
import com.reco1l.osu.mainThread
import com.reco1l.toolkt.android.cornerRadius
import com.reco1l.toolkt.android.dp
import org.anddev.andengine.engine.handler.IUpdateHandler
import org.anddev.andengine.entity.scene.Scene
import ru.nsu.ccfit.zuev.osu.*
import ru.nsu.ccfit.zuev.osu.helper.InputManager
import ru.nsu.ccfit.zuev.osu.helper.StringTable
import ru.nsu.ccfit.zuev.osu.menu.IFilterMenu
import ru.nsu.ccfit.zuev.osu.menu.SongMenu
import ru.nsu.ccfit.zuev.osuplus.R
import ru.nsu.ccfit.zuev.osu.GlobalManager.getInstance as getGlobal

class SearchBarFragment : BaseFragment(), IUpdateHandler, IFilterMenu {
class SearchBarFragment : BaseFragment(), IFilterMenu {
private var configContext: Context? = null
private var savedFolder: String? = null
private var savedFavOnly = false
Expand Down Expand Up @@ -322,16 +320,6 @@ class SearchBarFragment : BaseFragment(), IUpdateHandler, IFilterMenu {
updater?.update()
}

override fun onUpdate(pSecondsElapsed: Float) {
if (InputManager.getInstance().isChanged) {
filter.setText(InputManager.getInstance().text)
}
}

override fun reset() {
TODO("Not yet implemented")
}

// Due to how the fragment lifecycle works in this context, the state needs to be saved manually
private companion object {
var folder: String? = null
Expand Down
15 changes: 0 additions & 15 deletions src/ru/nsu/ccfit/zuev/osu/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
import ru.nsu.ccfit.zuev.audio.serviceAudio.SaveServiceObject;
import ru.nsu.ccfit.zuev.audio.serviceAudio.SongService;
import ru.nsu.ccfit.zuev.osu.helper.FileUtils;
import ru.nsu.ccfit.zuev.osu.helper.InputManager;
import ru.nsu.ccfit.zuev.osu.helper.StringTable;
import ru.nsu.ccfit.zuev.osu.menu.LoadingScreen;
import ru.nsu.ccfit.zuev.osu.menu.ModMenu;
Expand Down Expand Up @@ -122,7 +121,6 @@ public Engine onLoadEngine() {
//Debug.setDebugLevel(Debug.DebugLevel.NONE);
StringTable.setContext(this);
ToastLogger.init(this);
InputManager.setContext(this);
OnlineManager.getInstance().init();
crashlytics.setUserId(Config.getOnlineDeviceID());

Expand Down Expand Up @@ -774,9 +772,6 @@ public boolean onKeyDown(final int keyCode, final KeyEvent event) {
&& GlobalManager.getInstance().getSongMenu().getScene().hasChildScene()) {
if (GlobalManager.getInstance().getSongMenu().getScene().getChildScene() ==
GlobalManager.getInstance().getSongMenu().getSearchBar().getScene()) {
if (keyCode == KeyEvent.KEYCODE_ENTER) {
InputManager.getInstance().toggleKeyboard();
}
GlobalManager.getInstance().getSongMenu().getSearchBar().hideMenu();
}

Expand Down Expand Up @@ -828,16 +823,6 @@ public boolean onKeyDown(final int keyCode, final KeyEvent event) {
return true;
}

if (InputManager.getInstance().isStarted()) {
if (keyCode == KeyEvent.KEYCODE_DEL) {
InputManager.getInstance().pop();
} else if (keyCode != KeyEvent.KEYCODE_ENTER) {
final char c = (char) event.getUnicodeChar();
if (c != 0) {
InputManager.getInstance().append(c);
}
}
}
return super.onKeyDown(keyCode, event);
}

Expand Down
84 changes: 0 additions & 84 deletions src/ru/nsu/ccfit/zuev/osu/helper/InputManager.java

This file was deleted.

0 comments on commit 62cc4a1

Please sign in to comment.