1
0
Fork 0
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:
Nikolay Pultsin 2015-10-01 02:00:35 +01:00
parent 0af41eb011
commit b6e40c7a84
2 changed files with 8 additions and 24 deletions

View file

@ -214,7 +214,12 @@
<action android:name="android.fbreader.action.sync.QUICK_SYNC"/>
</intent-filter>
</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>
<action android:name="android.fbreader.action.BOOK_INFO"/>
<category android:name="android.intent.category.DEFAULT"/>

View file

@ -241,16 +241,7 @@ public class BookInfoActivity extends Activity implements IBookCollection.Listen
((TextView)findViewById(R.id.book_info_title)).setText(myResource.getResource("bookInfo").getValue());
setupInfoPair(R.id.book_title, "title", book.getTitle());
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());
setupInfoPair(R.id.book_authors, "authors", book.authorsString(", "), book.authors().size());
final SeriesInfo series = book.getSeriesInfo();
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();
}
setupInfoPair(R.id.book_series_index, "indexInSeries", seriesIndexString);
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());
setupInfoPair(R.id.book_tags, "tags", book.tagsString(", "), book.tags().size());
String language = book.getLanguage();
if (!ZLLanguageUtil.languageCodes().contains(language)) {
language = Language.OTHER_CODE;