mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-03 09:49:19 +02:00
code simplification (sync with premium version)
This commit is contained in:
parent
0af41eb011
commit
b6e40c7a84
2 changed files with 8 additions and 24 deletions
|
@ -214,7 +214,12 @@
|
||||||
<action android:name="android.fbreader.action.sync.QUICK_SYNC"/>
|
<action android:name="android.fbreader.action.sync.QUICK_SYNC"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</service>
|
</service>
|
||||||
<activity android:name="org.geometerplus.android.fbreader.library.BookInfoActivity" android:theme="@style/FBReader.Activity" android:process=":library" android:configChanges="orientation|keyboardHidden|screenSize">
|
<activity
|
||||||
|
android:name="org.geometerplus.android.fbreader.library.BookInfoActivity"
|
||||||
|
android:theme="@style/FBReader.Activity"
|
||||||
|
android:process=":library"
|
||||||
|
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||||
|
>
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.fbreader.action.BOOK_INFO"/>
|
<action android:name="android.fbreader.action.BOOK_INFO"/>
|
||||||
<category android:name="android.intent.category.DEFAULT"/>
|
<category android:name="android.intent.category.DEFAULT"/>
|
||||||
|
|
|
@ -241,16 +241,7 @@ public class BookInfoActivity extends Activity implements IBookCollection.Listen
|
||||||
((TextView)findViewById(R.id.book_info_title)).setText(myResource.getResource("bookInfo").getValue());
|
((TextView)findViewById(R.id.book_info_title)).setText(myResource.getResource("bookInfo").getValue());
|
||||||
|
|
||||||
setupInfoPair(R.id.book_title, "title", book.getTitle());
|
setupInfoPair(R.id.book_title, "title", book.getTitle());
|
||||||
|
setupInfoPair(R.id.book_authors, "authors", book.authorsString(", "), book.authors().size());
|
||||||
final StringBuilder buffer = new StringBuilder();
|
|
||||||
final List<Author> authors = book.authors();
|
|
||||||
for (Author a : authors) {
|
|
||||||
if (buffer.length() > 0) {
|
|
||||||
buffer.append(", ");
|
|
||||||
}
|
|
||||||
buffer.append(a.DisplayName);
|
|
||||||
}
|
|
||||||
setupInfoPair(R.id.book_authors, "authors", buffer, authors.size());
|
|
||||||
|
|
||||||
final SeriesInfo series = book.getSeriesInfo();
|
final SeriesInfo series = book.getSeriesInfo();
|
||||||
setupInfoPair(R.id.book_series, "series", series == null ? null : series.Series.getTitle());
|
setupInfoPair(R.id.book_series, "series", series == null ? null : series.Series.getTitle());
|
||||||
|
@ -259,19 +250,7 @@ public class BookInfoActivity extends Activity implements IBookCollection.Listen
|
||||||
seriesIndexString = series.Index.toPlainString();
|
seriesIndexString = series.Index.toPlainString();
|
||||||
}
|
}
|
||||||
setupInfoPair(R.id.book_series_index, "indexInSeries", seriesIndexString);
|
setupInfoPair(R.id.book_series_index, "indexInSeries", seriesIndexString);
|
||||||
|
setupInfoPair(R.id.book_tags, "tags", book.tagsString(", "), book.tags().size());
|
||||||
buffer.delete(0, buffer.length());
|
|
||||||
final HashSet<String> tagNames = new HashSet<String>();
|
|
||||||
for (Tag tag : book.tags()) {
|
|
||||||
if (!tagNames.contains(tag.Name)) {
|
|
||||||
if (buffer.length() > 0) {
|
|
||||||
buffer.append(", ");
|
|
||||||
}
|
|
||||||
buffer.append(tag.Name);
|
|
||||||
tagNames.add(tag.Name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
setupInfoPair(R.id.book_tags, "tags", buffer, tagNames.size());
|
|
||||||
String language = book.getLanguage();
|
String language = book.getLanguage();
|
||||||
if (!ZLLanguageUtil.languageCodes().contains(language)) {
|
if (!ZLLanguageUtil.languageCodes().contains(language)) {
|
||||||
language = Language.OTHER_CODE;
|
language = Language.OTHER_CODE;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue