本文整理汇总了Java中org.zirco.controllers.Controller类的典型用法代码示例。如果您正苦于以下问题:Java Controller类的具体用法?Java Controller怎么用?Java Controller使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Controller类属于org.zirco.controllers包,在下文中一共展示了Controller类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkInMobileViewUrlList
import org.zirco.controllers.Controller; //导入依赖的package包/类
/**
* Check if there is an item in the mobile view url list that match a given url.
* @param context The current context.
* @param url The url to check.
* @return True if an item in the list match the given url.
*/
public static boolean checkInMobileViewUrlList(Context context, String url) {
if (url != null) {
boolean inList = false;
Iterator<String> iter = Controller.getInstance().getMobileViewUrlList(context).iterator();
while ((iter.hasNext()) &&
(!inList)) {
if (url.contains(iter.next())) {
inList = true;
}
}
return inList;
} else {
return false;
}
}
示例2: checkInAdBlockWhiteList
import org.zirco.controllers.Controller; //导入依赖的package包/类
/**
* Check if the url is in the AdBlock white list.
* @param url The url to check
* @return true if the url is in the white list
*/
private boolean checkInAdBlockWhiteList(String url) {
if (url != null) {
boolean inList = false;
Iterator<String> iter = Controller.getInstance().getAdBlockWhiteList(this).iterator();
while ((iter.hasNext()) &&
(!inList)) {
if (url.contains(iter.next())) {
inList = true;
}
}
return inList;
} else {
return false;
}
}
示例3: doDownloadStart
import org.zirco.controllers.Controller; //导入依赖的package包/类
/**
* Initiate a download. Check the SD card and start the download runnable.
* @param url The url to download.
* @param userAgent The user agent.
* @param contentDisposition The content disposition.
* @param mimetype The mime type.
* @param contentLength The content length.
*/
private void doDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) {
if (ApplicationUtils.checkCardState(this, true)) {
DownloadItem item = new DownloadItem(this, url);
Controller.getInstance().addToDownload(item);
item.startDownload();
Toast.makeText(this, getString(R.string.Main_DownloadStartedMsg), Toast.LENGTH_SHORT).show();
}
}
示例4: showToastOnTabSwitch
import org.zirco.controllers.Controller; //导入依赖的package包/类
/**
* Show a toast alert on tab switch.
*/
private void showToastOnTabSwitch() {
if (Controller.getInstance().getPreferences().getBoolean(Constants.PREFERENCES_SHOW_TOAST_ON_TAB_SWITCH, true)) {
String text;
if (mCurrentWebView.getTitle() != null) {
text = String.format(getString(R.string.Main_ToastTabSwitchFullMessage), mViewFlipper.getDisplayedChild() + 1, mCurrentWebView.getTitle());
} else {
text = String.format(getString(R.string.Main_ToastTabSwitchMessage), mViewFlipper.getDisplayedChild() + 1);
}
Toast.makeText(this, text, Toast.LENGTH_SHORT).show();
}
}
示例5: onPageFinished
import org.zirco.controllers.Controller; //导入依赖的package包/类
public void onPageFinished(String url) {
updateUI();
if ((Controller.getInstance().getPreferences().getBoolean(Constants.PREFERENCES_ADBLOCKER_ENABLE, true)) &&
(!checkInAdBlockWhiteList(mCurrentWebView.getUrl()))) {
mCurrentWebView.loadAdSweep();
}
WebIconDatabase.getInstance().retainIconForPageUrl(mCurrentWebView.getUrl());
if (mUrlBarVisible) {
startToolbarsHideRunnable();
}
}
示例6: onContextItemSelected
import org.zirco.controllers.Controller; //导入依赖的package包/类
@Override
public boolean onContextItemSelected(MenuItem item) {
AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
switch (item.getItemId()) {
case MENU_DELETE:
mDbAdapter.deleteFromWhiteList(info.id);
Controller.getInstance().resetAdBlockWhiteList();
fillData();
return true;
default: return super.onContextItemSelected(item);
}
}
示例7: onMenuItemSelected
import org.zirco.controllers.Controller; //导入依赖的package包/类
@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
switch(item.getItemId()) {
case MENU_CLEAR_DOWNLOADS:
Controller.getInstance().clearCompletedDownloads();
fillData();
return true;
default: return super.onMenuItemSelected(featureId, item);
}
}
示例8: run
import org.zirco.controllers.Controller; //导入依赖的package包/类
@Override
public void run() {
BookmarksProviderWrapper.clearHistoryAndOrBookmarks(getContentResolver(), true, false);
for (CustomWebView webView : Controller.getInstance().getWebViewList()) {
webView.clearHistory();
}
handler.sendEmptyMessage(0);
}
示例9: run
import org.zirco.controllers.Controller; //导入依赖的package包/类
@Override
public void run() {
// Clear DB History
BookmarksProviderWrapper.clearHistoryAndOrBookmarks(getContentResolver(), true, false);
// Clear WebViews history
for (CustomWebView webView : Controller.getInstance().getWebViewList()) {
webView.clearHistory();
}
handler.sendEmptyMessage(0);
}
示例10: onContextItemSelected
import org.zirco.controllers.Controller; //导入依赖的package包/类
@Override
public boolean onContextItemSelected(MenuItem item) {
AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
switch (item.getItemId()) {
case MENU_DELETE:
mDbAdapter.deleteFromMobileViewUrlList(info.id);
Controller.getInstance().resetMobileViewUrlList();
fillData();
return true;
default: return super.onContextItemSelected(item);
}
}
示例11: doAddToMobileViewList
import org.zirco.controllers.Controller; //导入依赖的package包/类
/**
* Add a value to the white list.
* @param value The value to add.
*/
private void doAddToMobileViewList(String value) {
mDbAdapter.insertInMobileViewUrlList(value);
Controller.getInstance().resetMobileViewUrlList();
fillData();
}
示例12: navigateToHome
import org.zirco.controllers.Controller; //导入依赖的package包/类
/**
* Navigate to the user home page.
*/
private void navigateToHome() {
navigateToUrl(Controller.getInstance().getPreferences().getString(Constants.PREFERENCES_GENERAL_HOME_PAGE,
Constants.URL_ABOUT_START));
}
示例13: doAddToWhiteList
import org.zirco.controllers.Controller; //导入依赖的package包/类
/**
* Add a value to the white list.
* @param value The value to add.
*/
private void doAddToWhiteList(String value) {
mDbAdapter.insertInWhiteList(value);
Controller.getInstance().resetAdBlockWhiteList();
fillData();
}
示例14: doClearWhiteList
import org.zirco.controllers.Controller; //导入依赖的package包/类
/**
* Clear the white list.
*/
private void doClearWhiteList() {
mDbAdapter.clearWhiteList();
Controller.getInstance().resetAdBlockWhiteList();
fillData();
}
示例15: fillData
import org.zirco.controllers.Controller; //导入依赖的package包/类
/**
* Fill the download list.
*/
private void fillData() {
mAdapter = new DownloadListAdapter(this, Controller.getInstance().getDownloadList());
setListAdapter(mAdapter);
}