当前位置: 首页>>代码示例>>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;未经允许,请勿转载。