Browse Source

Receiver and other fixes

pull/24/head
Apostolos Fanakis 8 years ago
parent
commit
f6452789b6
  1. 2
      VERSION
  2. 4
      app/build.gradle
  3. 2
      app/src/main/java/gr/thmmy/mthmmy/activities/downloads/DownloadsActivity.java
  4. 20
      app/src/main/java/gr/thmmy/mthmmy/receiver/Receiver.java
  5. BIN
      app/src/main/res/drawable-hdpi/ic_remove_circle.png
  6. BIN
      app/src/main/res/drawable-mdpi/ic_remove_circle.png
  7. BIN
      app/src/main/res/drawable-xhdpi/ic_remove_circle.png
  8. BIN
      app/src/main/res/drawable-xxhdpi/ic_remove_circle.png
  9. BIN
      app/src/main/res/drawable-xxxhdpi/ic_remove_circle.png
  10. 7
      app/src/main/res/layout/activity_bookmark_row.xml

2
VERSION

@ -1 +1 @@
1.0.1 1.1.0

4
app/build.gradle

@ -9,8 +9,8 @@ android {
applicationId "gr.thmmy.mthmmy" applicationId "gr.thmmy.mthmmy"
minSdkVersion 19 minSdkVersion 19
targetSdkVersion 25 targetSdkVersion 25
versionCode 2 versionCode 3
versionName "1.0.1" versionName "1.1.0"
archivesBaseName = "mTHMMY-v$versionName" archivesBaseName = "mTHMMY-v$versionName"
} }

2
app/src/main/java/gr/thmmy/mthmmy/activities/downloads/DownloadsActivity.java

@ -272,7 +272,7 @@ public class DownloadsActivity extends BaseActivity implements DownloadsAdapter.
rows.select("div.smalltext:not(:has(a))").text(), rows.select("div.smalltext:not(:has(a))").text(),
rows.select("span:not(:has(a))").first().text(), rows.select("span:not(:has(a))").first().text(),
false, false,
rows.select("span:has(a)").first().html())); rows.select("span:has(a)").first().text()));
} }
} }
} }

20
app/src/main/java/gr/thmmy/mthmmy/receiver/Receiver.java

@ -16,6 +16,7 @@ import java.io.File;
import gr.thmmy.mthmmy.R; import gr.thmmy.mthmmy.R;
import mthmmy.utils.Report; import mthmmy.utils.Report;
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
import static gr.thmmy.mthmmy.services.DownloadService.ACTION_DOWNLOAD; import static gr.thmmy.mthmmy.services.DownloadService.ACTION_DOWNLOAD;
import static gr.thmmy.mthmmy.services.DownloadService.COMPLETED; import static gr.thmmy.mthmmy.services.DownloadService.COMPLETED;
import static gr.thmmy.mthmmy.services.DownloadService.EXTRA_DOWNLOAD_ID; import static gr.thmmy.mthmmy.services.DownloadService.EXTRA_DOWNLOAD_ID;
@ -61,22 +62,19 @@ public class Receiver extends BroadcastReceiver {
File file = new File(SAVE_DIR, fileName); File file = new File(SAVE_DIR, fileName);
if (file.exists()) { if (file.exists()) {
// String type = "application/" + extension; String type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(
String type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension); MimeTypeMap.getFileExtensionFromUrl(file.getAbsolutePath()));
Uri pathUri = Uri.fromFile(file); Intent chooser = new Intent();
Intent chooserIntent = new Intent(Intent.ACTION_VIEW); chooser.setAction(android.content.Intent.ACTION_VIEW);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); chooser.setDataAndType(Uri.fromFile(file), type);
Intent chooser = Intent.createChooser(chooserIntent, "Open With..."); chooser.setFlags(FLAG_ACTIVITY_NEW_TASK);
intent.setDataAndType(pathUri, type); chooser.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, chooser, PendingIntent.FLAG_CANCEL_CURRENT); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, chooser, PendingIntent.FLAG_CANCEL_CURRENT);
builder.setContentIntent(pendingIntent); builder.setContentIntent(pendingIntent);
} } else
else
Report.w(TAG, "File doesn't exist."); Report.w(TAG, "File doesn't exist.");
} }
Notification notification = builder.build(); Notification notification = builder.build();
notificationManager.notify(id, notification); notificationManager.notify(id, notification);

BIN
app/src/main/res/drawable-hdpi/ic_remove_circle.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 584 B

After

Width:  |  Height:  |  Size: 392 B

BIN
app/src/main/res/drawable-mdpi/ic_remove_circle.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 392 B

After

Width:  |  Height:  |  Size: 270 B

BIN
app/src/main/res/drawable-xhdpi/ic_remove_circle.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 746 B

After

Width:  |  Height:  |  Size: 509 B

BIN
app/src/main/res/drawable-xxhdpi/ic_remove_circle.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 746 B

BIN
app/src/main/res/drawable-xxxhdpi/ic_remove_circle.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

7
app/src/main/res/layout/activity_bookmark_row.xml

@ -4,14 +4,15 @@
android:id="@+id/bookmark_row" android:id="@+id/bookmark_row"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:layout_marginTop="4dp"
android:background="?attr/selectableItemBackground" android:background="?attr/selectableItemBackground"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingBottom="6dp"
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:paddingStart="16dp"> android:paddingStart="16dp"
android:paddingTop="6dp">
<TextView <TextView
android:id="@+id/bookmark_title" android:id="@+id/bookmark_title"

Loading…
Cancel
Save