From 7bbb5b69717393d87869ae6f16d6aff0578a81bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Tue, 9 Dec 2014 15:58:09 +0100 Subject: Save custom providers to sdcard. --- .../se/leap/bitmaskclient/ConfigurationWizard.java | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'app/src/release/java/se') diff --git a/app/src/release/java/se/leap/bitmaskclient/ConfigurationWizard.java b/app/src/release/java/se/leap/bitmaskclient/ConfigurationWizard.java index ef7986f1..42736444 100644 --- a/app/src/release/java/se/leap/bitmaskclient/ConfigurationWizard.java +++ b/app/src/release/java/se/leap/bitmaskclient/ConfigurationWizard.java @@ -24,12 +24,11 @@ import android.widget.*; import com.pedrogomez.renderers.*; -import java.io.*; import java.net.*; import java.util.*; import butterknife.*; -import org.jetbrains.annotations.NotNull; + import org.json.*; import javax.inject.Inject; @@ -38,8 +37,6 @@ import se.leap.bitmaskclient.DownloadFailedDialog.DownloadFailedDialogInterface; import se.leap.bitmaskclient.NewProviderDialog.NewProviderDialogInterface; import se.leap.bitmaskclient.ProviderAPIResultReceiver.Receiver; import se.leap.bitmaskclient.ProviderDetailFragment.ProviderDetailFragmentInterface; -import se.leap.bitmaskclient.ProviderListContent.ProviderItem; -import se.leap.bitmaskclient.FragmentManagerEnhanced; import se.leap.bitmaskclient.eip.Constants; /** @@ -112,7 +109,7 @@ implements NewProviderDialogInterface, ProviderDetailFragmentInterface, Download super.onCreate(savedInstanceState); preferences = getSharedPreferences(Dashboard.SHARED_PREFERENCES, MODE_PRIVATE); fragment_manager = new FragmentManagerEnhanced(getFragmentManager()); - provider_manager = new ProviderManager(getAssets()); + provider_manager = ProviderManager.getInstance(getAssets(), getExternalFilesDir(null)); setUpInitialUI(); @@ -163,16 +160,6 @@ implements NewProviderDialogInterface, ProviderDetailFragmentInterface, Download private void setUpProviderList() { initProviderList(); - // provider_list_fragment = ProviderListFragment.newInstance(); - - // Bundle arguments = new Bundle(); - // int configuration_wizard_request_code = getIntent().getIntExtra(Dashboard.REQUEST_CODE, -1); - // if(configuration_wizard_request_code == Dashboard.SWITCH_PROVIDER) - // arguments.putBoolean(ProviderListFragment.SHOW_ALL_PROVIDERS, true); - - // provider_list_fragment.setArguments(arguments); - - // putProviderListFragment(); } private void putProviderListFragment() { @@ -397,7 +384,8 @@ implements NewProviderDialogInterface, ProviderDetailFragmentInterface, Download public void showAndSelectProvider(String provider_main_url) { try { selected_provider = new Provider(new URL((provider_main_url))); - provider_manager.add(selected_provider); + adapter.add(selected_provider); + adapter.saveProviders(); autoSelectProvider(selected_provider); } catch (MalformedURLException e) { e.printStackTrace(); -- cgit v1.2.3