From b61c632cb90b87cc7b069f42f2b08928ee15a5d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Mon, 14 Oct 2013 17:05:06 +0200 Subject: ProviderAPI broadcasts progress to CW. Setting up a provider makes the progressbar move according to the number of files downloaded (1/3, 2/3, 3/3). Next step: recover from download errors individually. That means that if a download fails but the others went OK, the user will be prompted to retry that individual failing download. --- src/se/leap/bitmaskclient/Dashboard.java | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'src/se/leap/bitmaskclient/Dashboard.java') diff --git a/src/se/leap/bitmaskclient/Dashboard.java b/src/se/leap/bitmaskclient/Dashboard.java index 0ae7085a..8c7c495d 100644 --- a/src/se/leap/bitmaskclient/Dashboard.java +++ b/src/se/leap/bitmaskclient/Dashboard.java @@ -16,8 +16,6 @@ */ package se.leap.bitmaskclient; -import org.apache.http.cookie.Cookie; -import org.apache.http.impl.cookie.BasicClientCookie; import org.json.JSONException; import org.json.JSONObject; @@ -30,12 +28,9 @@ import android.app.DialogFragment; import android.app.Fragment; import android.app.FragmentManager; import android.app.FragmentTransaction; -import android.app.ProgressDialog; -import android.content.BroadcastReceiver; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; -import android.content.IntentFilter; import android.content.SharedPreferences; import android.os.Bundle; import android.os.Handler; @@ -45,11 +40,7 @@ import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; -import android.view.ViewStub; -import android.widget.CompoundButton; import android.widget.ProgressBar; -import android.widget.RelativeLayout; -import android.widget.Switch; import android.widget.TextView; import android.widget.Toast; @@ -76,7 +67,6 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf private ProgressBar mProgressBar; private TextView eipStatus; - private ProviderAPIBroadcastReceiver_Update providerAPI_broadcast_receiver_update; private static Context app; private static SharedPreferences preferences; private static Provider provider; @@ -98,10 +88,7 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf // mProgressBar = (ProgressBar) findViewById(R.id.eipProgress); // eipStatus = (TextView) findViewById(R.id.eipStatus); - providerAPI_broadcast_receiver_update = new ProviderAPIBroadcastReceiver_Update(); - IntentFilter update_intent_filter = new IntentFilter(ProviderAPI.UPDATE_ACTION); - update_intent_filter.addCategory(Intent.CATEGORY_DEFAULT); - registerReceiver(providerAPI_broadcast_receiver_update, update_intent_filter); + mProgressBar = (ProgressBar) findViewById(R.id.eipProgress); ConfigHelper.setSharedPreferences(getSharedPreferences(SHARED_PREFERENCES, MODE_PRIVATE)); preferences = ConfigHelper.shared_preferences; @@ -116,7 +103,6 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf @Override protected void onDestroy() { super.onDestroy(); - unregisterReceiver(providerAPI_broadcast_receiver_update); } @Override @@ -176,11 +162,6 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf provider.init( this ); setContentView(R.layout.client_dashboard); - - providerAPI_broadcast_receiver_update = new ProviderAPIBroadcastReceiver_Update(); - IntentFilter update_intent_filter = new IntentFilter(ProviderAPI.UPDATE_ACTION); - update_intent_filter.addCategory(Intent.CATEGORY_DEFAULT); - registerReceiver(providerAPI_broadcast_receiver_update, update_intent_filter); providerNameTV = (TextView) findViewById(R.id.providerName); providerNameTV.setText(provider.getDomain()); -- cgit v1.2.3