Skip to content

Commit

Permalink
launcher and notification icons
Browse files Browse the repository at this point in the history
  • Loading branch information
naman14 committed May 14, 2016
1 parent 811f79d commit 080ffc2
Show file tree
Hide file tree
Showing 18 changed files with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/src/main/java/com/naman14/arcade/ModelDownloader.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@ public final class ModelDownloader {
private static final String MODEL_URL = "https://dl.dropbox.com/s/b9mmzkke7rst94y/nin_imagenet_conv.caffemodel?dl=1";
private static final String PROTO_URL = "https://drive.google.com/uc?export=download&id=0ByTrPZ8aLNaddklKTUozZFBKTlE";

private Notificationhelper notificationhelper;

public void run(final Context context) throws Exception {

Utils.deleteModels();
final Notificationhelper notificationhelper = new Notificationhelper(context);
this.notificationhelper = notificationhelper;

final ProgressListener progressListener = new ProgressListener() {
@Override
Expand Down Expand Up @@ -108,8 +110,10 @@ private void writeToFile(File file, InputStream inputStream) {
if (stream != null)
stream.close();
} catch (FileNotFoundException e) {
notificationhelper.errorNotification();
e.printStackTrace();
} catch (IOException e) {
notificationhelper.errorNotification();
e.printStackTrace();
}
}
Expand Down Expand Up @@ -201,7 +205,7 @@ public void createNotification(int newtask, String title) {

builder.setAutoCancel(false);
builder.setContentTitle(title);
builder.setSmallIcon(R.mipmap.ic_launcher);
builder.setSmallIcon(R.drawable.ic_stat_download);
builder.setOngoing(false);
builder.setWhen(Calendar.getInstance().getTimeInMillis());
builder.build();
Expand All @@ -226,6 +230,11 @@ public void completed() {
mNotificationManager.notify(NOTIFICATION_ID, builder.build());
}

public void errorNotification() {
builder.setContentTitle("Error downloading models");
mNotificationManager.notify(NOTIFICATION_ID, builder.build());
}

public void clearNotification() {
mNotificationManager.cancel(NOTIFICATION_ID);
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-hdpi/ic_stat_download.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-mdpi/ic_stat_download.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-xhdpi/ic_stat_download.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 080ffc2

Please sign in to comment.