1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-05 19:42:17 +02:00

"Shared from FBReader" text + message subject when sharing a book

This commit is contained in:
Nikolay Pultsin 2012-05-03 13:44:58 +01:00
parent 564fcf8438
commit a907bd4ac1
3 changed files with 13 additions and 2 deletions

View file

@ -6,8 +6,10 @@ litres: top/hot lists (what's happen?)
litres: author photos
* Screen orientation by default: not selected?
* Old style seekbar for navigation
* "Shared by FBReader" in message with shared book
DONE Old style seekbar for navigation
* Start position mark in navigation widget
DONE "Shared from FBReader" in message with shared book
* Better file name for shared file
* Link sharing
* fb2 native: footnote id depth
* check new condition syntax

View file

@ -226,6 +226,9 @@
<node name="bookmarkCreated" value="Bookmark created:&#10;%s"/>
<node name="clearSelection" value="Clear"/>
</node>
<node name="sharing">
<node name="sharedFrom" value="Shared from &lt;a href=&quot;http://www.fbreader.org/&quot;&gt;FBReader&lt;/a&gt;"/>
</node>
<node name="menu">
<node name="preferences" value="Settings"/>
<node name="bookInfo" value="Book info"/>

View file

@ -23,8 +23,10 @@ import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.net.Uri;
import android.text.Html;
import org.geometerplus.zlibrary.core.filesystem.ZLPhysicalFile;
import org.geometerplus.zlibrary.core.resources.ZLResource;
import org.geometerplus.fbreader.library.Book;
import org.geometerplus.fbreader.filetype.FileTypeCollection;
@ -37,9 +39,13 @@ public abstract class FBUtil {
// That should be impossible
return;
}
final CharSequence sharedFrom =
Html.fromHtml(ZLResource.resource("sharing").getResource("sharedFrom").getValue());
activity.startActivity(
new Intent(Intent.ACTION_SEND)
.setType(FileTypeCollection.Instance.simplifiedMimeType(file).Name)
.putExtra(Intent.EXTRA_SUBJECT, book.getTitle())
.putExtra(Intent.EXTRA_TEXT, sharedFrom)
.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file.javaFile()))
);
} catch (ActivityNotFoundException e) {