Projects >> android-arabic-reader >>49eb62d6d1c335aecbe9f833e805e98753f61784

Chunk
Conflicting content
import org.geometerplus.zlibrary.ui.android.R;
import org.geometerplus.zlibrary.ui.android.library.*;
<<<<<<< HEAD
=======
import org.geometerplus.zlibrary.ui.android.view.AndroidFontUtil;
>>>>>>> 2eedebf82058fc562914e8e082cf10c376b1c961

import org.geometerplus.fbreader.fbreader.ActionCode;
import org.geometerplus.fbreader.fbreader.FBReaderApp;
Solution content
import org.geometerplus.zlibrary.ui.android.R;
import org.geometerplus.zlibrary.ui.android.library.*;
import org.geometerplus.zlibrary.ui.android.view.AndroidFontUtil;

import org.geometerplus.fbreader.fbreader.ActionCode;
import org.geometerplus.fbreader.fbreader.FBReaderApp;
File
FBReader.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
import org.geometerplus.fbreader.Paths;

public final class AndroidFontUtil {
<<<<<<< HEAD
=======
	private static Method ourFontCreationMethod;
	static {
		try {
			ourFontCreationMethod = Typeface.class.getMethod("createFromFile", File.class);
		} catch (NoSuchMethodException e) {
			ourFontCreationMethod = null;
		}
	}

	public static boolean areExternalFontsSupported() {
		return ourFontCreationMethod != null;
	}

	private static Typeface createFontFromFile(File file) {
		if (ourFontCreationMethod == null) {
			return null;
		}
		try {
			return (Typeface)ourFontCreationMethod.invoke(null, file);
		} catch (IllegalAccessException e) {
			return null;
		} catch (InvocationTargetException e) {
			return null;
		}
	}

>>>>>>> 2eedebf82058fc562914e8e082cf10c376b1c961
	private static Map ourFontMap;
	private static Set ourFileSet;
	private static long ourTimeStamp;
Solution content
import org.geometerplus.fbreader.Paths;

public final class AndroidFontUtil {
	private static Map ourFontMap;
	private static Set ourFileSet;
	private static long ourTimeStamp;
File
AndroidFontUtil.java
Developer's decision
Version 1
Kind of conflict
Attribute
Method declaration
Static initializer
Chunk
Conflicting content
	private static Set ourFileSet;
	private static long ourTimeStamp;

<<<<<<< HEAD
	public static Map getFontMap(boolean forceReload) {
=======
	private static Map getFontMap(boolean forceReload) {
		if (ourFontCreationMethod == null) {
			return Collections.emptyMap();
		}

>>>>>>> 2eedebf82058fc562914e8e082cf10c376b1c961
		final long timeStamp = System.currentTimeMillis();
		if (forceReload && timeStamp < ourTimeStamp + 1000) {
			forceReload = false;
Solution content
	private static Set ourFileSet;
	private static long ourTimeStamp;

	public static Map getFontMap(boolean forceReload) {
		final long timeStamp = System.currentTimeMillis();
		if (forceReload && timeStamp < ourTimeStamp + 1000) {
			forceReload = false;
File
AndroidFontUtil.java
Developer's decision
Version 1
Kind of conflict
If statement
Method signature
Chunk
Conflicting content
	@Override
	protected void setFontInternal(String family, int size, boolean bold, boolean italic, boolean underline, boolean strikeThrought) {
<<<<<<< HEAD
		family = realFontFamilyName(family);
		final int style = (bold ? Typeface.BOLD : 0) | (italic ? Typeface.ITALIC : 0);
		Typeface[] typefaces = myTypefaces.get(family);
		if (typefaces == null) {
			typefaces = new Typeface[4];
			myTypefaces.put(family, typefaces);
		}
		Typeface tf = typefaces[style];
		if (tf == null) {
			File[] files = AndroidFontUtil.getFontMap(false).get(family);
			if (files != null) {
				try {
					if (files[style] != null) {
						tf = Typeface.createFromFile(files[style]);
					} else {
						for (int i = 0; i < 4; ++i) {
							if (files[i] != null) {
								tf = (typefaces[i] != null) ?
									typefaces[i] : Typeface.createFromFile(files[i]);
								typefaces[i] = tf;
								break;
							}
						}
					}
				} catch (Throwable e) {
				}
			}
			if (tf == null) {
				tf = Typeface.create(family, style);
			}
			typefaces[style] = tf;
		}
		myTextPaint.setTypeface(tf);
=======
		myTextPaint.setTypeface(AndroidFontUtil.typeface(family, bold, italic));
>>>>>>> 2eedebf82058fc562914e8e082cf10c376b1c961
		myTextPaint.setTextSize(size);
		myTextPaint.setUnderlineText(underline);
		myTextPaint.setStrikeThruText(strikeThrought);
Solution content
	@Override
	protected void setFontInternal(String family, int size, boolean bold, boolean italic, boolean underline, boolean strikeThrought) {
		myTextPaint.setTypeface(AndroidFontUtil.typeface(family, bold, italic));
		myTextPaint.setTextSize(size);
		myTextPaint.setUnderlineText(underline);
		myTextPaint.setStrikeThruText(strikeThrought);
File
ZLAndroidPaintContext.java
Developer's decision
Version 2
Kind of conflict
Array access
If statement
Method invocation
Variable