Projects >> android-arabic-reader >>a86f75332125d0733adcaf5ced1afff696e5ded4

Chunk
Conflicting content
import org.geometerplus.fbreader.book.*;
import org.geometerplus.fbreader.bookmodel.BookModel;
import org.geometerplus.fbreader.fbreader.*;
<<<<<<< HEAD
=======
import org.geometerplus.fbreader.library.Book;
>>>>>>> 3cb970e4cdbae0eaf4017f5c09408702031446a8
import org.geometerplus.fbreader.tips.TipsManager;

import org.geometerplus.android.fbreader.api.*;
Solution content
import org.geometerplus.fbreader.book.*;
import org.geometerplus.fbreader.bookmodel.BookModel;
import org.geometerplus.fbreader.fbreader.*;
import org.geometerplus.fbreader.tips.TipsManager;

import org.geometerplus.android.fbreader.api.*;
File
FBReader.java
Developer's decision
Version 1
Kind of conflict
Import
Chunk
Conflicting content
public final class FBReader extends Activity {
	public static final String ACTION_OPEN_BOOK = "android.fbreader.action.VIEW";
<<<<<<< HEAD
	public static final String BOOK_KEY = "fbreader.book";
=======
	public static final String BOOK_PATH_KEY = "BookPath";
>>>>>>> 3cb970e4cdbae0eaf4017f5c09408702031446a8

	public static final int REQUEST_PREFERENCES = 1;
	public static final int REQUEST_BOOK_INFO = 2;
Solution content
public final class FBReader extends Activity {
	public static final String ACTION_OPEN_BOOK = "android.fbreader.action.VIEW";
	public static final String BOOK_KEY = "fbreader.book";

	public static final int REQUEST_PREFERENCES = 1;
	public static final int REQUEST_BOOK_INFO = 2;
File
FBReader.java
Developer's decision
Version 1
Kind of conflict
Attribute
Chunk
Conflicting content
	}

	private FBReaderApp myFBReaderApp;
<<<<<<< HEAD
	private Book myBook;
=======
>>>>>>> 3cb970e4cdbae0eaf4017f5c09408702031446a8

	private int myFullScreenFlag;
Solution content
	}

	private FBReaderApp myFBReaderApp;
	private Book myBook;

	private int myFullScreenFlag;
File
FBReader.java
Developer's decision
Version 1
Kind of conflict
Attribute
Chunk
Conflicting content
		myFBReaderApp = (FBReaderApp)FBReaderApp.Instance();
		if (myFBReaderApp == null) {
<<<<<<< HEAD
			myFBReaderApp = new FBReaderApp(new BookCollectionShadow());
=======
			if (SQLiteBooksDatabase.Instance() == null) {
				new SQLiteBooksDatabase(this, "READER");
			}
			myFBReaderApp = new FBReaderApp();
>>>>>>> 3cb970e4cdbae0eaf4017f5c09408702031446a8
		}

		final ZLAndroidApplication androidApplication = (ZLAndroidApplication)getApplication();
Solution content
		myFBReaderApp = (FBReaderApp)FBReaderApp.Instance();
		if (myFBReaderApp == null) {
			myFBReaderApp = new FBReaderApp(new BookCollectionShadow());
		}

		final ZLAndroidApplication androidApplication = (ZLAndroidApplication)getApplication();
File
FBReader.java
Developer's decision
Version 1
Kind of conflict
Attribute
If statement
Method invocation
Chunk
Conflicting content
			myFBReaderApp.initWindow();
		}

<<<<<<< HEAD
=======
		new Thread() {
			public void run() {
				myFBReaderApp.openFile(fileFromIntent(getIntent()), getPostponedInitAction());
				myFBReaderApp.getViewWidget().repaint();
			}
		}.start();

		myFBReaderApp.getViewWidget().repaint();

>>>>>>> 3cb970e4cdbae0eaf4017f5c09408702031446a8
		final ZLAndroidLibrary zlibrary = (ZLAndroidLibrary)ZLibrary.Instance();
		myFullScreenFlag =
			zlibrary.ShowStatusBarOption.getValue() ? 0 : WindowManager.LayoutParams.FLAG_FULLSCREEN;
Solution content
			myFBReaderApp.initWindow();
		}

		final ZLAndroidLibrary zlibrary = (ZLAndroidLibrary)ZLibrary.Instance();
		myFullScreenFlag =
			zlibrary.ShowStatusBarOption.getValue() ? 0 : WindowManager.LayoutParams.FLAG_FULLSCREEN;
File
FBReader.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
		if ((intent.getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) != 0) {
			super.onNewIntent(intent);
		} else if (Intent.ACTION_VIEW.equals(action) || ACTION_OPEN_BOOK.equals(action)) {
<<<<<<< HEAD
			openBook(intent, null, true);
=======
			myFBReaderApp.openFile(fileFromIntent(intent), null);
>>>>>>> 3cb970e4cdbae0eaf4017f5c09408702031446a8
		} else if (Intent.ACTION_VIEW.equals(action)
					&& data != null && "fbreader-action".equals(data.getScheme())) {
			myFBReaderApp.runAction(data.getEncodedSchemeSpecificPart(), data.getFragment());
Solution content
		if ((intent.getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) != 0) {
			super.onNewIntent(intent);
		} else if (Intent.ACTION_VIEW.equals(action) || ACTION_OPEN_BOOK.equals(action)) {
			openBook(intent, null, true);
		} else if (Intent.ACTION_VIEW.equals(action)
					&& data != null && "fbreader-action".equals(data.getScheme())) {
			myFBReaderApp.runAction(data.getEncodedSchemeSpecificPart(), data.getFragment());
File
FBReader.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
		registerReceiver(myBatteryInfoReceiver, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));

<<<<<<< HEAD
=======
		try {
			sendBroadcast(new Intent(getApplicationContext(), KillerCallback.class));
		} catch (Throwable t) {
		}
>>>>>>> 3cb970e4cdbae0eaf4017f5c09408702031446a8
		PopupPanel.restoreVisibilities(myFBReaderApp);
		ApiServerImplementation.sendEvent(this, ApiListener.EVENT_READ_MODE_OPENED);
	}
Solution content
		registerReceiver(myBatteryInfoReceiver, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));

		PopupPanel.restoreVisibilities(myFBReaderApp);
		ApiServerImplementation.sendEvent(this, ApiListener.EVENT_READ_MODE_OPENED);
	}
File
FBReader.java
Developer's decision
Version 1
Kind of conflict
Try statement
Chunk
Conflicting content
	protected void onStop() {
		ApiServerImplementation.sendEvent(this, ApiListener.EVENT_READ_MODE_CLOSED);
		PopupPanel.removeAllWindows(myFBReaderApp, this);
<<<<<<< HEAD
		((BookCollectionShadow)myFBReaderApp.Collection).unbind();
=======
>>>>>>> 3cb970e4cdbae0eaf4017f5c09408702031446a8
		super.onStop();
	}
Solution content
	protected void onStop() {
		ApiServerImplementation.sendEvent(this, ApiListener.EVENT_READ_MODE_CLOSED);
		PopupPanel.removeAllWindows(myFBReaderApp, this);
		((BookCollectionShadow)myFBReaderApp.Collection).unbind();
		super.onStop();
	}
File
FBReader.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
		switch (resultCode) {
		}
	}

<<<<<<< HEAD
	private void onPreferencesUpdate(int resultCode, Book book) {
		if (book != null) {
			myFBReaderApp.Collection.saveBook(book, true);
		}
=======
	private void onPreferencesUpdate(int resultCode) {
>>>>>>> 3cb970e4cdbae0eaf4017f5c09408702031446a8
			case RESULT_DO_NOTHING:
				break;
Solution content
		}
	}

	private void onPreferencesUpdate(int resultCode, Book book) {
		if (book != null) {
			myFBReaderApp.Collection.saveBook(book, true);
		}
		switch (resultCode) {
			case RESULT_DO_NOTHING:
				break;
File
FBReader.java
Developer's decision
Version 1
Kind of conflict
If statement
Method signature
Chunk
Conflicting content
			{
				AndroidFontUtil.clearFontCache();
				final BookModel model = myFBReaderApp.Model;
<<<<<<< HEAD
				if (model != null && book != null) {
					if (model.Book != null) {
						model.Book = book;
						ZLTextHyphenator.Instance().load(model.Book.getLanguage());
=======
				if (model != null) {
					final Book book = model.Book;
					if (book != null) {
						book.reloadInfoFromDatabase();
						ZLTextHyphenator.Instance().load(book.getLanguage());
>>>>>>> 3cb970e4cdbae0eaf4017f5c09408702031446a8
					}
				}
				myFBReaderApp.clearTextCaches();
Solution content
			{
				AndroidFontUtil.clearFontCache();
				final BookModel model = myFBReaderApp.Model;
				if (model != null && book != null) {
					if (model.Book != null) {
						model.Book = book;
						ZLTextHyphenator.Instance().load(model.Book.getLanguage());
					}
				}
				myFBReaderApp.clearTextCaches();
File
FBReader.java
Developer's decision
Version 1
Kind of conflict
If statement
Method invocation
Variable
Chunk
Conflicting content
				break;
			}
			case RESULT_RELOAD_BOOK:
<<<<<<< HEAD
				myFBReaderApp.reloadBook(book);
=======
				myFBReaderApp.reloadBook();
>>>>>>> 3cb970e4cdbae0eaf4017f5c09408702031446a8
				break;
		}
	}
Solution content
				break;
			}
			case RESULT_RELOAD_BOOK:
				myFBReaderApp.reloadBook(book);
				break;
		}
	}
File
FBReader.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
>>>>>>> 3cb970e4cdbae0eaf4017f5c09408702031446a8
					startActivity(
						new Intent(getApplicationContext(), FBReader.class)
							.setAction(FBReader.ACTION_OPEN_BOOK)
<<<<<<< HEAD
							.putExtra(FBReader.BOOK_KEY, SerializerUtil.serialize(myBook))
=======
							.putExtra(FBReader.BOOK_PATH_KEY, myFile.getPath())
							.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
					);
				}
Solution content
					startActivity(
						new Intent(getApplicationContext(), FBReader.class)
							.setAction(FBReader.ACTION_OPEN_BOOK)
							.putExtra(FBReader.BOOK_KEY, SerializerUtil.serialize(myBook))
							.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
					);
				}
File
BookInfoActivity.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
		startActivity(
			new Intent(getApplicationContext(), FBReader.class)
				.setAction(FBReader.ACTION_OPEN_BOOK)
<<<<<<< HEAD
				.putExtra(FBReader.BOOK_KEY, SerializerUtil.serialize(book))
=======
				.putExtra(FBReader.BOOK_PATH_KEY, book.File.getPath())
>>>>>>> 3cb970e4cdbae0eaf4017f5c09408702031446a8
				.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
		);
	}
Solution content
		startActivity(
			new Intent(getApplicationContext(), FBReader.class)
				.setAction(FBReader.ACTION_OPEN_BOOK)
				.putExtra(FBReader.BOOK_KEY, SerializerUtil.serialize(book))
				.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
		);
	}
File
LibraryActivity.java
Developer's decision
Version 1
Kind of conflict
Method invocation