Skip to content
Permalink
Browse files
Merge pull request #6282 from mahdihijazi/replace_file_browser
[Android] Replace current file browser
  • Loading branch information
degasus committed Jan 10, 2018
2 parents 57640a4 + 409ae4c commit a1467f0
Show file tree
Hide file tree
Showing 13 changed files with 252 additions and 396 deletions.
@@ -96,6 +96,8 @@ dependencies {

// Allows FRP-style asynchronous operations in Android.
api 'io.reactivex:rxandroid:1.2.1'

compile 'com.nononsenseapps:filepicker:4.1.0'
}

def getVersion() {
@@ -50,11 +50,6 @@
</intent-filter>
</activity>

<activity
android:name=".activities.AddDirectoryActivity"
android:theme="@style/DolphinGamecube"
android:label="@string/add_directory_title"/>

<activity
android:name=".ui.settings.SettingsActivity"
android:theme="@style/DolphinSettingsGamecube"
@@ -64,6 +59,15 @@
android:name=".activities.EmulationActivity"
android:theme="@style/DolphinEmulationGamecube"/>

<activity
android:name=".activities.CustomFilePickerActivity"
android:label="@string/app_name"
android:theme="@style/FilePickerTheme">
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

<service android:name=".services.DirectoryInitializationService"/>

@@ -74,6 +78,16 @@
android:exported="false">
</provider>

<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="${applicationId}.filesprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/nnf_provider_paths" />
</provider>

</application>

</manifest>

This file was deleted.

@@ -0,0 +1,28 @@
package org.dolphinemu.dolphinemu.activities;

import android.os.Environment;
import android.support.annotation.Nullable;

import com.nononsenseapps.filepicker.AbstractFilePickerFragment;
import com.nononsenseapps.filepicker.FilePickerActivity;

import org.dolphinemu.dolphinemu.fragments.CustomFilePickerFragment;

import java.io.File;

public class CustomFilePickerActivity extends FilePickerActivity

{
@Override
protected AbstractFilePickerFragment<File> getFragment(
@Nullable final String startPath, final int mode, final boolean allowMultiple,
final boolean allowCreateDir, final boolean allowExistingFile,
final boolean singleClick)
{
AbstractFilePickerFragment<File> fragment = new CustomFilePickerFragment();
// startPath is allowed to be null. In that case, default folder should be SD-card and not "/"
fragment.setArgs(startPath != null ? startPath : Environment.getExternalStorageDirectory().getPath(),
mode, allowMultiple, allowCreateDir, allowExistingFile, singleClick);
return fragment;
}
}

0 comments on commit a1467f0

Please sign in to comment.