Skip to content

Commit

Permalink
Merge pull request #3488 from sigmabeta/android-mvp-main-activity
Browse files Browse the repository at this point in the history
[Android] Refactor Tv/Main Activities to MVP architecture.
  • Loading branch information
Sonicadvance1 committed Jan 10, 2016
2 parents 2071830 + a455305 commit 6e676ca
Show file tree
Hide file tree
Showing 9 changed files with 395 additions and 263 deletions.
2 changes: 1 addition & 1 deletion Source/Android/app/src/main/AndroidManifest.xml
Expand Up @@ -27,7 +27,7 @@
android:banner="@drawable/banner_tv">

<activity
android:name=".activities.MainActivity"
android:name=".ui.main.MainActivity"
android:theme="@style/DolphinGamecube">

<!-- This intentfilter marks this Activity as the one that gets launched from Home screen. -->
Expand Down
@@ -1,5 +1,6 @@
package org.dolphinemu.dolphinemu.activities;

import android.app.Activity;
import android.content.AsyncQueryHandler;
import android.content.ContentValues;
import android.content.Intent;
Expand All @@ -19,6 +20,7 @@
import org.dolphinemu.dolphinemu.adapters.FileAdapter;
import org.dolphinemu.dolphinemu.model.GameDatabase;
import org.dolphinemu.dolphinemu.model.GameProvider;
import org.dolphinemu.dolphinemu.ui.main.MainPresenter;

/**
* An Activity that shows a list of files and folders, allowing the user to tell the app which folder(s)
Expand Down Expand Up @@ -131,4 +133,10 @@ public void updateSubtitle(String path)
{
mToolbar.setSubtitle(path);
}

public static void launch(Activity activity)
{
Intent fileChooser = new Intent(activity, AddDirectoryActivity.class);
activity.startActivityForResult(fileChooser, MainPresenter.REQUEST_ADD_DIRECTORY);
}
}

This file was deleted.

@@ -1,6 +1,7 @@
package org.dolphinemu.dolphinemu.activities;


import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
Expand Down Expand Up @@ -38,4 +39,10 @@ protected void onStop()
Intent settingsSaver = new Intent(this, SettingsSaveService.class);
startService(settingsSaver);
}

public static void launch(Context context)
{
Intent settings = new Intent(context, SettingsActivity.class);
context.startActivity(settings);
}
}

0 comments on commit 6e676ca

Please sign in to comment.