本文整理汇总了Java中org.holoeverywhere.HoloEverywhere类的典型用法代码示例。如果您正苦于以下问题:Java HoloEverywhere类的具体用法?Java HoloEverywhere怎么用?Java HoloEverywhere使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HoloEverywhere类属于org.holoeverywhere包,在下文中一共展示了HoloEverywhere类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import org.holoeverywhere.HoloEverywhere; //导入依赖的package包/类
@Override
public void run() {
final MenuBuilder menu;
if (HoloEverywhere.SAVE_MENU_INSTANCE_OVER_INVALIDATE && mMenu != null) {
mMenu.clearAll();
menu = mMenu;
} else {
menu = createMenu();
}
if (mActivity.superOnCreatePanelMenu(Window.FEATURE_OPTIONS_PANEL, menu) &&
mActivity.superOnPreparePanel(Window.FEATURE_OPTIONS_PANEL, null, menu)) {
setMenu(menu);
} else {
setMenu(null);
}
mInvalidateMenuPosted = false;
}
示例2: showContextMenuForChild
import org.holoeverywhere.HoloEverywhere; //导入依赖的package包/类
@Override
public boolean showContextMenuForChild(View originalView) {
if (HoloEverywhere.WRAP_TO_NATIVE_CONTEXT_MENU) {
return super.showContextMenuForChild(originalView);
}
mListener = mProvider.getContextMenuListener(originalView);
if (mListener == null) {
return false;
}
if (mContextMenu == null) {
mContextMenu = new ContextMenuBuilder(getContext(), mListener);
mContextMenu.setCallback(this);
} else {
mContextMenu.clearAll();
mContextMenu.setContextMenuListener(mListener);
}
mMenuDialogHelper = mContextMenu.show(originalView, originalView.getWindowToken());
if (mMenuDialogHelper != null) {
mMenuDialogHelper.setPresenterCallback(this);
return true;
} else {
return false;
}
}
示例3: makeNameById
import org.holoeverywhere.HoloEverywhere; //导入依赖的package包/类
public static String makeNameById(int id) {
if (id > 0) {
if (HoloEverywhere.NAMED_PREFERENCES) {
return Application.getLastInstance().getResources().getResourceEntryName(id);
} else {
return "preference_0x" + Integer.toHexString(id);
}
} else {
return null;
}
}
示例4: makeAddonClass
import org.holoeverywhere.HoloEverywhere; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static <T extends IAddon> Class<T> makeAddonClass(String classname) {
if (classname.contains(".")) {
try {
return (Class<T>) Class.forName(classname);
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
} else {
return makeAddonClass(HoloEverywhere.PACKAGE + ".addon.Addon" + classname);
}
}
示例5: startActivity
import org.holoeverywhere.HoloEverywhere; //导入依赖的package包/类
@Override
public void startActivity(Intent intent, Bundle options) {
if (HoloEverywhere.ALWAYS_USE_PARENT_THEME) {
ThemeManager.startActivity(this, intent, options);
} else {
superStartActivity(intent, -1, options);
}
}
示例6: startActivityForResult
import org.holoeverywhere.HoloEverywhere; //导入依赖的package包/类
@Override
public void startActivityForResult(Intent intent, int requestCode,
Bundle options) {
if (HoloEverywhere.ALWAYS_USE_PARENT_THEME) {
ThemeManager.startActivity(this, intent, requestCode, options);
} else {
superStartActivity(intent, requestCode, options);
}
}
示例7: registerForContextMenu
import org.holoeverywhere.HoloEverywhere; //导入依赖的package包/类
@Override
public void registerForContextMenu(View view) {
if (HoloEverywhere.WRAP_TO_NATIVE_CONTEXT_MENU) {
super.registerForContextMenu(view);
} else {
registerForContextMenu(view, this);
}
}
示例8: unregisterForContextMenu
import org.holoeverywhere.HoloEverywhere; //导入依赖的package包/类
@Override
public void unregisterForContextMenu(View view) {
if (HoloEverywhere.WRAP_TO_NATIVE_CONTEXT_MENU) {
super.unregisterForContextMenu(view);
} else {
if (mContextMenuListeners != null) {
mContextMenuListeners.remove(view);
}
}
}
示例9: GridView
import org.holoeverywhere.HoloEverywhere; //导入依赖的package包/类
@SuppressLint("NewApi")
public GridView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
if (context instanceof Activity) {
setActivity((Activity) context);
}
if (HoloEverywhere.DISABLE_OVERSCROLL_EFFECT && VERSION.SDK_INT >= 9) {
setOverScrollMode(OVER_SCROLL_NEVER);
}
mOnItemLongClickListenerWrapper = new OnItemLongClickListenerWrapper();
super.setOnItemLongClickListener(mOnItemLongClickListenerWrapper);
setLongClickable(false);
if (VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB) {
super.setFastScrollAlwaysVisible(false);
super.setChoiceMode(CHOICE_MODE_NONE);
}
super.setFastScrollEnabled(false);
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.AbsListView,
defStyle, R.style.Holo_ListView);
setFastScrollEnabled(a.getBoolean(R.styleable.AbsListView_android_fastScrollEnabled, false));
setFastScrollAlwaysVisible(a.getBoolean(
R.styleable.AbsListView_android_fastScrollAlwaysVisible, false));
setChoiceMode(a.getInt(R.styleable.AbsListView_android_choiceMode, CHOICE_MODE_NONE));
a.recycle();
}
示例10: ListView
import org.holoeverywhere.HoloEverywhere; //导入依赖的package包/类
@SuppressLint("NewApi")
public ListView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
if (context instanceof Activity) {
setActivity((Activity) context);
}
if (HoloEverywhere.DISABLE_OVERSCROLL_EFFECT && VERSION.SDK_INT >= 9) {
setOverScrollMode(OVER_SCROLL_NEVER);
}
mOnItemLongClickListenerWrapper = new OnItemLongClickListenerWrapper();
super.setOnItemLongClickListener(mOnItemLongClickListenerWrapper);
setLongClickable(false);
if (VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB) {
super.setFastScrollAlwaysVisible(false);
}
super.setFastScrollEnabled(false);
super.setChoiceMode(CHOICE_MODE_NONE);
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.AbsListView,
defStyle, R.style.Holo_ListView);
setFastScrollEnabled(a.getBoolean(R.styleable.AbsListView_android_fastScrollEnabled, false));
setFastScrollAlwaysVisible(a.getBoolean(
R.styleable.AbsListView_android_fastScrollAlwaysVisible, false));
setChoiceMode(a.getInt(R.styleable.AbsListView_android_choiceMode, CHOICE_MODE_NONE));
a.recycle();
}
示例11: registerForContextMenu
import org.holoeverywhere.HoloEverywhere; //导入依赖的package包/类
@Override
public void registerForContextMenu(View view) {
if (HoloEverywhere.WRAP_TO_NATIVE_CONTEXT_MENU) {
super.registerForContextMenu(view);
} else {
mActivity.registerForContextMenu(view, this);
}
}
示例12: unregisterForContextMenu
import org.holoeverywhere.HoloEverywhere; //导入依赖的package包/类
@Override
public void unregisterForContextMenu(View view) {
if (HoloEverywhere.WRAP_TO_NATIVE_CONTEXT_MENU) {
super.unregisterForContextMenu(view);
} else {
mActivity.unregisterForContextMenu(view);
}
}
示例13: startActivityForResult
import org.holoeverywhere.HoloEverywhere; //导入依赖的package包/类
@Override
public void startActivityForResult(Intent intent, int requestCode,
Bundle options) {
if (HoloEverywhere.ALWAYS_USE_PARENT_THEME) {
ThemeManager.startActivity(this, intent, requestCode, options);
} else {
superStartActivity(intent, requestCode, options);
}
}
示例14: GridView
import org.holoeverywhere.HoloEverywhere; //导入依赖的package包/类
@SuppressLint("NewApi")
public GridView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
if (context instanceof Activity) {
setActivity((Activity) context);
}
if (HoloEverywhere.DISABLE_OVERSCROLL_EFFECT && VERSION.SDK_INT >= 9) {
setOverScrollMode(OVER_SCROLL_NEVER);
}
mOnItemLongClickListenerWrapper = new OnItemLongClickListenerWrapper();
super.setOnItemLongClickListener(mOnItemLongClickListenerWrapper);
setLongClickable(false);
}
示例15: ListView
import org.holoeverywhere.HoloEverywhere; //导入依赖的package包/类
@SuppressLint("NewApi")
public ListView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
if (context instanceof Activity) {
setActivity((Activity) context);
}
if (HoloEverywhere.DISABLE_OVERSCROLL_EFFECT && VERSION.SDK_INT >= 9) {
setOverScrollMode(OVER_SCROLL_NEVER);
}
mOnItemLongClickListenerWrapper = new OnItemLongClickListenerWrapper();
super.setOnItemLongClickListener(mOnItemLongClickListenerWrapper);
setLongClickable(false);
if (VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB) {
super.setFastScrollAlwaysVisible(false);
}
super.setFastScrollEnabled(false);
super.setChoiceMode(CHOICE_MODE_NONE);
TypedArray a = context.obtainStyledAttributes(attrs, new int[] {
android.R.attr.fastScrollEnabled,
android.R.attr.fastScrollAlwaysVisible,
android.R.attr.choiceMode,
android.R.attr.overScrollFooter,
android.R.attr.overScrollHeader
}, defStyle, R.style.Holo_ListView);
setFastScrollEnabled(a.getBoolean(0, false));
setFastScrollAlwaysVisible(a.getBoolean(1, false));
setChoiceMode(a.getInt(2, CHOICE_MODE_NONE));
if (!a.hasValue(3) && VERSION.SDK_INT >= VERSION_CODES.GINGERBREAD) {
super.setOverscrollFooter(null);
}
if (!a.hasValue(4) && VERSION.SDK_INT >= VERSION_CODES.GINGERBREAD) {
super.setOverscrollHeader(null);
}
a.recycle();
}