1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-04 02:09:35 +02:00

sync with intro branch

This commit is contained in:
Nikolay Pultsin 2014-12-23 17:57:46 +00:00
parent 9e002e2576
commit 825fdd6e22
2 changed files with 24 additions and 1 deletions

View file

@ -19,11 +19,16 @@
package org.geometerplus.android.fbreader;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.View;
import android.widget.PopupWindow;
import android.widget.*;
import org.geometerplus.zlibrary.core.resources.ZLResource;
import org.geometerplus.zlibrary.text.view.*;
import org.geometerplus.zlibrary.ui.android.R;
import org.geometerplus.zlibrary.ui.android.image.ZLAndroidImageData;
import org.geometerplus.fbreader.fbreader.FBReaderApp;
@ -59,7 +64,15 @@ class DisplayBookPopupAction extends FBAndroidAction {
popup.setFocusable(true);
popup.setOutsideTouchable(true);
final ZLResource buttonResource = ZLResource.resource("dialog").getResource("button")
final ImageView coverView = (ImageView)bookView.findViewById(R.id.book_popup_cover);
if (coverView != null) {
final ZLAndroidImageData imageData = (ZLAndroidImageData)element.getImageData();
if (imageData != null) {
coverView.setImageBitmap(imageData.getFullSizeBitmap());
}
}
final ZLResource buttonResource = ZLResource.resource("dialog").getResource("button");
final View buttonsView = bookView.findViewById(R.id.book_popup_buttons);
final Button downloadButton = (Button)buttonsView.findViewById(R.id.ok_button);

View file

@ -946,6 +946,16 @@ public abstract class ZLTextView extends ZLTextViewBase {
final int hMargin = ZLibrary.Instance().getDisplayDPI() / 10;
final ZLImageData imageData = ((BookElement)element).getImageData();
if (imageData != null) {
context.drawImage(
area.XStart + hMargin, area.YEnd - vMargin,
imageData,
new ZLPaintContext.Size(
area.XEnd - area.XStart - 2 * hMargin + 1,
area.YEnd - area.YStart - 2 * vMargin + 1
),
ZLPaintContext.ScalingType.FitMaximum,
ZLPaintContext.ColorAdjustingMode.NONE
);
} else {
}
} else if (element == ZLTextElement.HSpace) {