Skip to content
Snippets Groups Projects
Commit c5673c35 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Open extension settings activity from browser

parent 8a62a14e
No related branches found
No related tags found
No related merge requests found
package org.videolan.vlc.gui.browser;
import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.app.Fragment;
......@@ -20,6 +21,7 @@ import org.videolan.vlc.gui.view.DividerItemDecoration;
import org.videolan.vlc.gui.view.SwipeRefreshLayout;
import org.videolan.vlc.media.MediaUtils;
import org.videolan.vlc.media.MediaWrapper;
import org.videolan.vlc.plugin.ExtensionListing;
import org.videolan.vlc.plugin.PluginService;
import org.videolan.vlc.plugin.Utils;
import org.videolan.vlc.plugin.api.VLCExtensionItem;
......@@ -114,7 +116,12 @@ public class ExtensionBrowser extends Fragment implements View.OnClickListener,
@Override
public void onClick(View v) {
if (v.getId() == mAddDirectoryFAB.getId()){
//TODO start plugin activity
ExtensionListing plugin = mPluginService.getCurrentPlugin();
if (plugin == null)
return;
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setComponent(plugin.settingsActivity());
startActivity(intent);
}
}
......
......@@ -135,6 +135,11 @@ public class PluginService extends Service {
connectService(index);
}
public ExtensionListing getCurrentPlugin() {
return mPlugins.get(mCurrentIndex);
}
public void connectService(final int index) {
ExtensionListing info = mPlugins.get(index);
......@@ -207,7 +212,7 @@ public class PluginService extends Service {
public void disconnect() {
if (mCurrentIndex == -1)
return;
ExtensionListing plugin = mPlugins.get(mCurrentIndex);
ExtensionListing plugin = getCurrentPlugin();
Connection conn = plugin.getConnection();
if (conn != null) {
try {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment