Android: Merge launchInstallWad into launchOpenFileActivity
This commit is contained in:
parent
80b56b6575
commit
4a394ffc9c
|
@ -175,21 +175,12 @@ public final class MainActivity extends AppCompatActivity implements MainView
|
|||
}
|
||||
|
||||
@Override
|
||||
public void launchOpenFileActivity()
|
||||
public void launchOpenFileActivity(int requestCode)
|
||||
{
|
||||
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
|
||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
intent.setType("*/*");
|
||||
startActivityForResult(intent, MainPresenter.REQUEST_GAME_FILE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void launchInstallWAD()
|
||||
{
|
||||
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
|
||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
intent.setType("*/*");
|
||||
startActivityForResult(intent, MainPresenter.REQUEST_WAD_FILE);
|
||||
startActivityForResult(intent, requestCode);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -91,11 +91,12 @@ public final class MainPresenter
|
|||
return true;
|
||||
|
||||
case R.id.menu_open_file:
|
||||
mView.launchOpenFileActivity();
|
||||
mView.launchOpenFileActivity(REQUEST_GAME_FILE);
|
||||
return true;
|
||||
|
||||
case R.id.menu_install_wad:
|
||||
new AfterDirectoryInitializationRunner().run(context, true, mView::launchInstallWAD);
|
||||
new AfterDirectoryInitializationRunner().run(context, true,
|
||||
() -> mView.launchOpenFileActivity(REQUEST_WAD_FILE));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,9 +21,7 @@ public interface MainView
|
|||
|
||||
void launchFileListActivity();
|
||||
|
||||
void launchOpenFileActivity();
|
||||
|
||||
void launchInstallWAD();
|
||||
void launchOpenFileActivity(int requestCode);
|
||||
|
||||
/**
|
||||
* To be called when the game file cache is updated.
|
||||
|
|
|
@ -180,21 +180,12 @@ public final class TvMainActivity extends FragmentActivity implements MainView
|
|||
}
|
||||
|
||||
@Override
|
||||
public void launchOpenFileActivity()
|
||||
public void launchOpenFileActivity(int requestCode)
|
||||
{
|
||||
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
|
||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
intent.setType("*/*");
|
||||
startActivityForResult(intent, MainPresenter.REQUEST_GAME_FILE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void launchInstallWAD()
|
||||
{
|
||||
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
|
||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
intent.setType("*/*");
|
||||
startActivityForResult(intent, MainPresenter.REQUEST_WAD_FILE);
|
||||
startActivityForResult(intent, requestCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue