當前位置: 首頁>>代碼示例>>Java>>正文


Java UIUtil類代碼示例

本文整理匯總了Java中org.geometerplus.android.util.UIUtil的典型用法代碼示例。如果您正苦於以下問題:Java UIUtil類的具體用法?Java UIUtil怎麽用?Java UIUtil使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


UIUtil類屬於org.geometerplus.android.util包,在下文中一共展示了UIUtil類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: openTreeInternal

import org.geometerplus.android.util.UIUtil; //導入依賴的package包/類
private void openTreeInternal(FBTree tree, FBTree treeToSelect, boolean storeInHistory) {
	switch (tree.getOpeningStatus()) {
		case READY_TO_OPEN:
		case ALWAYS_RELOAD_BEFORE_OPENING:
			if (storeInHistory && !myCurrentKey.equals(tree.getUniqueKey())) {
				myHistory.add(myCurrentKey);
			}
			onNewIntent(new Intent(this, getClass())
				.setAction(OPEN_TREE_ACTION)
				.putExtra(TREE_KEY_KEY, tree.getUniqueKey())
				.putExtra(
					SELECTED_TREE_KEY_KEY,
					treeToSelect != null ? treeToSelect.getUniqueKey() : null
				)
				.putExtra(HISTORY_KEY, myHistory)
			);
			break;
		case CANNOT_OPEN:
			UIUtil.showErrorMessage(TreeActivity.this, tree.getOpeningStatusMessage());
			break;
	}
}
 
開發者ID:AlixMing,項目名稱:FBreader,代碼行數:23,代碼來源:TreeActivity.java

示例2: openTree

import org.geometerplus.android.util.UIUtil; //導入依賴的package包/類
private void openTree(final FBTree tree, final FBTree treeToSelect, final boolean storeInHistory) {
	switch (tree.getOpeningStatus()) {
		case WAIT_FOR_OPEN:
		case ALWAYS_RELOAD_BEFORE_OPENING:
			final String messageKey = tree.getOpeningStatusMessage();
			if (messageKey != null) {
				UIUtil.runWithMessage(
					TreeActivity.this, messageKey,
					new Runnable() {
						public void run() {
							tree.waitForOpening();
						}
					},
					new Runnable() {
						public void run() {
							openTreeInternal(tree, treeToSelect, storeInHistory);
						}
					},
					true
				);
			} else {
				tree.waitForOpening();
				openTreeInternal(tree, treeToSelect, storeInHistory);
			}
			break;
		default:
			openTreeInternal(tree, treeToSelect, storeInHistory);
			break;
	}
}
 
開發者ID:AlixMing,項目名稱:FBreader,代碼行數:31,代碼來源:TreeActivity.java

示例3: run

import org.geometerplus.android.util.UIUtil; //導入依賴的package包/類
@Override
protected void run(Object ... params) {
	final String text = Reader.getTextView().getSelectedText();
	Reader.getTextView().clearSelection();

	final ClipboardManager clipboard =
		(ClipboardManager)BaseActivity.getApplication().getSystemService(Application.CLIPBOARD_SERVICE);
	clipboard.setText(text);
	UIUtil.showMessageText(
		BaseActivity,
		ZLResource.resource("selection").getResource("textInBuffer").getValue().replace("%s", clipboard.getText())
	);
}
 
開發者ID:AlixMing,項目名稱:FBreader,代碼行數:14,代碼來源:SelectionCopyAction.java

示例4: runWithMessage

import org.geometerplus.android.util.UIUtil; //導入依賴的package包/類
@Override
public void runWithMessage(String key, Runnable action, Runnable postAction) {
	final Activity activity =
		((ZLAndroidLibrary)ZLAndroidLibrary.Instance()).getActivity();
	if (activity != null) {
		UIUtil.runWithMessage(activity, key, action, postAction, false);
	} else {
		action.run();
	}
}
 
開發者ID:liufeiit,項目名稱:itmarry,代碼行數:11,代碼來源:ZLAndroidApplicationWindow.java

示例5: onNewIntent

import org.geometerplus.android.util.UIUtil; //導入依賴的package包/類
@Override
protected void onNewIntent(Intent intent) {
	Log.i("MAIN", "onNewIntent");
	OrientationUtil.setOrientation(this, intent);

	if (!Intent.ACTION_SEARCH.equals(intent.getAction())) {
		return;
	}
	String pattern = intent.getStringExtra(SearchManager.QUERY);
	Log.i("MAIN", pattern + "");
	myBookmarkSearchPatternOption.setValue(pattern);

	final LinkedList<Bookmark> bookmarks = new LinkedList<Bookmark>();
	pattern = pattern.toLowerCase();
	for (Bookmark b : myAllBooksAdapter.bookmarks()) {
		Log.i("MAIN", b.getText());
		if (MiscUtil.matchesIgnoreCase(b.getText(), pattern)) {
			bookmarks.add(b);
		}
	}
	//
	if (!bookmarks.isEmpty()) {
		showSearchResultsTab(bookmarks);
	} else {
		UIUtil.showErrorMessage(this, "bookmarkNotFound");
	}
}
 
開發者ID:liufeiit,項目名稱:itmarry,代碼行數:28,代碼來源:BookmarksActivity.java

示例6: gotoBookmark

import org.geometerplus.android.util.UIUtil; //導入依賴的package包/類
private void gotoBookmark(Bookmark bookmark) {
	bookmark.markAsAccessed();
	myCollection.saveBookmark(bookmark);
	final Book book = myCollection.getBookById(bookmark.getBookId());
	if (book != null) {
		CoreReadActivity.openBookActivity(this, book, bookmark);
	} else {
		UIUtil.showErrorMessage(this, "cannotOpenBook");
	}
}
 
開發者ID:liufeiit,項目名稱:itmarry,代碼行數:11,代碼來源:BookmarksActivity.java

示例7: onSearchEvent

import org.geometerplus.android.util.UIUtil; //導入依賴的package包/類
private void onSearchEvent(final boolean found) {
	runOnUiThread(new Runnable() {
		public void run() {
			if (found) {
				openSearchResults();
			} else {
				UIUtil.showErrorMessage(LibraryActivity.this, "bookNotFound");
			}
		}
	});
}
 
開發者ID:liufeiit,項目名稱:itmarry,代碼行數:12,代碼來源:LibraryActivity.java

示例8: runWithMessage

import org.geometerplus.android.util.UIUtil; //導入依賴的package包/類
@Override
public void runWithMessage(String key, Runnable action, Runnable postAction)
{
	UIUtil.runWithMessage(this, key, action, postAction, false);
}
 
開發者ID:AlixMing,項目名稱:FBreader,代碼行數:6,代碼來源:FBReader.java

示例9: installDictionary

import org.geometerplus.android.util.UIUtil; //導入依賴的package包/類
private static void installDictionary(Activity activity, PackageInfo dictionaryInfo) {
	if (!PackageUtil.installFromMarket(activity, dictionaryInfo.PackageName)) {
		UIUtil.showErrorMessage(activity, "cannotRunAndroidMarket", dictionaryInfo.Title);
	}
}
 
開發者ID:AlixMing,項目名稱:FBreader,代碼行數:6,代碼來源:DictionaryUtil.java

示例10: onNewIntent

import org.geometerplus.android.util.UIUtil; //導入依賴的package包/類
@Override
protected void onNewIntent(final Intent intent) {
	Log.i("TAG", "onNewIntent()");
	final String action = intent.getAction();
	final Uri data = intent.getData();

	if ((intent.getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) != 0) {
		super.onNewIntent(intent);
	} else if (Intent.ACTION_VIEW.equals(action) && data != null
			&& "fbreader-action".equals(data.getScheme())) {
		myFBReaderApp.runAction(data.getEncodedSchemeSpecificPart(),
				data.getFragment());
	} else if (ACTION_OPEN_BOOK.equals(action)) {

		getCollection().bindToService(this, new Runnable() {
			public void run() {
				Log.i("TAG", "openBook()");
				openBook(intent, null, true);
			}
		});
	} else if (Intent.ACTION_SEARCH.equals(action)) {
		final String pattern = intent.getStringExtra(SearchManager.QUERY);
		final Runnable runnable = new Runnable() {
			public void run() {
				final TextSearchPopup popup = (TextSearchPopup) myFBReaderApp
						.getPopupById(TextSearchPopup.ID);
				popup.initPosition();
				myFBReaderApp.TextSearchPatternOption.setValue(pattern);
				if (myFBReaderApp.getTextView().search(pattern, true,
						false, false, false) != 0) {
					runOnUiThread(new Runnable() {
						public void run() {
							myFBReaderApp.showPopup(popup.getId());
						}
					});
				} else {
					runOnUiThread(new Runnable() {
						public void run() {
							UIUtil.showErrorMessage(CoreReadActivity.this,
									"textNotFound");
							popup.StartPosition = null;
						}
					});
				}
			}
		};
		UIUtil.wait("search", runnable, this);
	} else {
		super.onNewIntent(intent);
	}
}
 
開發者ID:liufeiit,項目名稱:itmarry,代碼行數:52,代碼來源:CoreReadActivity.java


注:本文中的org.geometerplus.android.util.UIUtil類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。