changed orbot notification icons

This commit is contained in:
Adithya Abraham Philip
2015-08-16 19:47:38 +05:30
parent 6af24527da
commit 93d66d39f7
17 changed files with 12 additions and 7 deletions

View File

@@ -63,8 +63,6 @@ public class KeyserverSyncAdapterService extends Service {
public int onStartCommand(final Intent intent, int flags, final int startId) { public int onStartCommand(final Intent intent, int flags, final int startId) {
Log.e("PHILIP", "Sync adapter service starting" + intent.getAction()); Log.e("PHILIP", "Sync adapter service starting" + intent.getAction());
NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
manager.cancel(Constants.Notification.KEYSERVER_SYNC_FAIL_ORBOT);
switch (intent.getAction()) { switch (intent.getAction()) {
case ACTION_CANCEL: { case ACTION_CANCEL: {
mCancelled.set(true); mCancelled.set(true);
@@ -88,10 +86,14 @@ public class KeyserverSyncAdapterService extends Service {
break; break;
} }
case ACTION_IGNORE_TOR: { case ACTION_IGNORE_TOR: {
NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
manager.cancel(Constants.Notification.KEYSERVER_SYNC_FAIL_ORBOT);
asyncKeyUpdate(this, new CryptoInputParcel(ParcelableProxy.getForNoProxy())); asyncKeyUpdate(this, new CryptoInputParcel(ParcelableProxy.getForNoProxy()));
break; break;
} }
case ACTION_START_ORBOT: { case ACTION_START_ORBOT: {
NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
manager.cancel(Constants.Notification.KEYSERVER_SYNC_FAIL_ORBOT);
Intent startOrbot = new Intent(this, OrbotRequiredDialogActivity.class); Intent startOrbot = new Intent(this, OrbotRequiredDialogActivity.class);
startOrbot.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startOrbot.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startOrbot.putExtra(OrbotRequiredDialogActivity.EXTRA_START_ORBOT, true); startOrbot.putExtra(OrbotRequiredDialogActivity.EXTRA_START_ORBOT, true);
@@ -126,7 +128,8 @@ public class KeyserverSyncAdapterService extends Service {
break; break;
} }
case ACTION_DISMISS_NOTIFICATION: { case ACTION_DISMISS_NOTIFICATION: {
// notification is dismissed at the beginning NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
manager.cancel(Constants.Notification.KEYSERVER_SYNC_FAIL_ORBOT);
stopSelf(startId); stopSelf(startId);
break; break;
} }
@@ -417,7 +420,6 @@ public class KeyserverSyncAdapterService extends Service {
} }
private Notification getOrbotNoification(Context context) { private Notification getOrbotNoification(Context context) {
// TODO: PHILIP work in progress
NotificationCompat.Builder builder = new NotificationCompat.Builder(context); NotificationCompat.Builder builder = new NotificationCompat.Builder(context);
builder.setSmallIcon(R.drawable.ic_stat_notify_24dp) builder.setSmallIcon(R.drawable.ic_stat_notify_24dp)
.setLargeIcon(getBitmap(R.drawable.ic_launcher, context)) .setLargeIcon(getBitmap(R.drawable.ic_launcher, context))
@@ -435,7 +437,7 @@ public class KeyserverSyncAdapterService extends Service {
PendingIntent.FLAG_CANCEL_CURRENT PendingIntent.FLAG_CANCEL_CURRENT
); );
builder.addAction(R.drawable.abc_ic_clear_mtrl_alpha, builder.addAction(R.drawable.ic_stat_tor_off,
context.getString(R.string.keyserver_sync_orbot_notif_ignore), context.getString(R.string.keyserver_sync_orbot_notif_ignore),
ignoreTorPi); ignoreTorPi);
@@ -448,7 +450,7 @@ public class KeyserverSyncAdapterService extends Service {
PendingIntent.FLAG_CANCEL_CURRENT PendingIntent.FLAG_CANCEL_CURRENT
); );
builder.addAction(R.drawable.abc_ic_commit_search_api_mtrl_alpha, builder.addAction(R.drawable.ic_stat_tor,
context.getString(R.string.keyserver_sync_orbot_notif_start), context.getString(R.string.keyserver_sync_orbot_notif_start),
startOrbotPi startOrbotPi
); );

View File

@@ -26,11 +26,13 @@ import android.os.Message;
import android.os.Messenger; import android.os.Messenger;
import android.os.RemoteException; import android.os.RemoteException;
import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentActivity;
import android.view.ContextThemeWrapper;
import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.compatibility.DialogFragmentWorkaround; import org.sufficientlysecure.keychain.compatibility.DialogFragmentWorkaround;
import org.sufficientlysecure.keychain.service.input.CryptoInputParcel; import org.sufficientlysecure.keychain.service.input.CryptoInputParcel;
import org.sufficientlysecure.keychain.ui.util.ThemeChanger;
import org.sufficientlysecure.keychain.util.Log; import org.sufficientlysecure.keychain.util.Log;
import org.sufficientlysecure.keychain.util.ParcelableProxy; import org.sufficientlysecure.keychain.util.ParcelableProxy;
import org.sufficientlysecure.keychain.util.orbot.OrbotHelper; import org.sufficientlysecure.keychain.util.orbot.OrbotHelper;
@@ -75,7 +77,8 @@ public class OrbotRequiredDialogActivity extends FragmentActivity
boolean startOrbotDirect = getIntent().getBooleanExtra(EXTRA_START_ORBOT, false); boolean startOrbotDirect = getIntent().getBooleanExtra(EXTRA_START_ORBOT, false);
if (startOrbotDirect) { if (startOrbotDirect) {
mShowOrbotProgressDialog = new ProgressDialog(this); ContextThemeWrapper theme = ThemeChanger.getDialogThemeWrapper(this);
mShowOrbotProgressDialog = new ProgressDialog(theme);
mShowOrbotProgressDialog.setTitle(R.string.progress_starting_orbot); mShowOrbotProgressDialog.setTitle(R.string.progress_starting_orbot);
mShowOrbotProgressDialog.setCancelable(false); mShowOrbotProgressDialog.setCancelable(false);
mShowOrbotProgressDialog.show(); mShowOrbotProgressDialog.show();

Binary file not shown.

After

Width:  |  Height:  |  Size: 920 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 920 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 540 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 540 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 727 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB