本文整理汇总了Java中android.support.v7.view.ActionMode.Callback类的典型用法代码示例。如果您正苦于以下问题:Java Callback类的具体用法?Java Callback怎么用?Java Callback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Callback类属于android.support.v7.view.ActionMode包,在下文中一共展示了Callback类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startActionMode
import android.support.v7.view.ActionMode.Callback; //导入依赖的package包/类
public ActionMode startActionMode(Callback callback) {
if (this.mActionMode != null) {
this.mActionMode.finish();
}
this.mOverlayLayout.setHideOnContentScrollEnabled(false);
this.mContextView.killMode();
ActionModeImpl mode = new ActionModeImpl(this.mContextView.getContext(), callback);
if (!mode.dispatchOnCreate()) {
return null;
}
mode.invalidate();
this.mContextView.initForMode(mode);
animateToMode(true);
this.mContextView.sendAccessibilityEvent(32);
this.mActionMode = mode;
return mode;
}
示例2: startActionMode
import android.support.v7.view.ActionMode.Callback; //导入依赖的package包/类
public final ActionMode startActionMode(ActionMode.Callback paramCallback)
{
if (this.mActionMode != null) {
this.mActionMode.finish();
}
this.mOverlayLayout.setHideOnContentScrollEnabled(false);
this.mContextView.killMode();
ActionModeImpl localActionModeImpl = new ActionModeImpl(this.mContextView.getContext(), paramCallback);
if (localActionModeImpl.dispatchOnCreate())
{
localActionModeImpl.invalidate();
this.mContextView.initForMode(localActionModeImpl);
animateToMode(true);
this.mContextView.sendAccessibilityEvent(32);
this.mActionMode = localActionModeImpl;
return localActionModeImpl;
}
return null;
}
示例3: StandaloneActionMode
import android.support.v7.view.ActionMode.Callback; //导入依赖的package包/类
public StandaloneActionMode(Context paramContext, ActionBarContextView paramActionBarContextView, ActionMode.Callback paramCallback, boolean paramBoolean)
{
this.mContext = paramContext;
this.mContextView = paramActionBarContextView;
this.mCallback = paramCallback;
MenuBuilder localMenuBuilder = new MenuBuilder(paramActionBarContextView.getContext());
localMenuBuilder.mDefaultShowAsAction = 1;
this.mMenu = localMenuBuilder;
this.mMenu.setCallback(this);
this.mFocusable = paramBoolean;
}
示例4: ActionModeImpl
import android.support.v7.view.ActionMode.Callback; //导入依赖的package包/类
public ActionModeImpl(Context paramContext, ActionMode.Callback paramCallback)
{
this.mActionModeContext = paramContext;
this.mCallback = paramCallback;
MenuBuilder localMenuBuilder = new MenuBuilder(paramContext);
localMenuBuilder.mDefaultShowAsAction = 1;
this.mMenu = localMenuBuilder;
this.mMenu.setCallback(this);
}
示例5: handleContentTV
import android.support.v7.view.ActionMode.Callback; //导入依赖的package包/类
@SuppressWarnings("static-access")
public static void handleContentTV(WebView contentTV,
final NonameReadBody row, int position, int bgColor, final Context context, final Callback mActionModeCallback, WebViewClient client) {
contentTV.setBackgroundColor(0);
contentTV.setFocusableInTouchMode(false);
contentTV.setFocusable(false);
contentTV.setLongClickable(false);
if (mActionModeCallback != null) {
contentTV.setOnLongClickListener(new OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
// TODO Auto-generated method stub
((AppCompatActivity) context)
.startSupportActionMode(mActionModeCallback);
return true;
}
});
}
WebSettings setting = contentTV.getSettings();
setting.setUserAgentString(context.getString(R.string.clientua) + ((NgaClientApp) ((Activity) context).getApplication()).version);
setting.setDefaultFontSize(PhoneConfiguration.getInstance()
.getWebSize());
setting.setJavaScriptEnabled(false);
contentTV.setWebViewClient(client);
contentTV.setTag(row.floor);
setting.setDefaultFontSize(PhoneConfiguration.getInstance()
.getWebSize());
setting.setJavaScriptEnabled(false);
contentTV.loadDataWithBaseURL(null, fillFormated_html_data(row, position, context),
"text/html", "utf-8", null);
}
示例6: onCreateView
import android.support.v7.view.ActionMode.Callback; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
listview = new ListView(this.getActivity());
listview.setBackgroundResource(ThemeManager.getInstance()
.getBackgroundColor());
listview.setDivider(null);
activeActionMode();
listview.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
listview.setOnItemLongClickListener(new OnItemLongClickListener() {
@TargetApi(11)
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view,
int position, long id) {
ListView lv = (ListView) parent;
lv.setItemChecked(position, true);
if (mActionModeCallback != null) {
((AppCompatActivity) getActivity())
.startSupportActionMode((Callback) mActionModeCallback);
return true;
}
return false;
}
});
listview.setDescendantFocusability(ListView.FOCUS_AFTER_DESCENDANTS);
return listview;
}
示例7: activeActionMode
import android.support.v7.view.ActionMode.Callback; //导入依赖的package包/类
@TargetApi(11)
private void activeActionMode() {
mActionModeCallback = new ActionMode.Callback() {
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
MenuInflater inflater = mode.getMenuInflater();
inflater.inflate(R.menu.nonamearticlelist_context_menu, menu);
return true;
}
@Override
public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
return false;
}
@Override
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
onContextItemSelected(item);
mode.finish();
return true;
}
@Override
public void onDestroyActionMode(ActionMode mode) {
// int position = listview.getCheckedItemPosition();
// listview.setItemChecked(position, false);
}
};
}
示例8: startActionMode
import android.support.v7.view.ActionMode.Callback; //导入依赖的package包/类
private void startActionMode() {
if (!(adapterView.getContext() instanceof ActionBarActivity)) {
throw new IllegalStateException("Context must be an ActionBarActivity");
}
if (!(baseAdapter instanceof Callback)) {
throw new IllegalStateException("Adapter must implement ActionMode.Callback");
}
ActionBarActivity activity = (ActionBarActivity) adapterView.getContext();
actionMode = activity.startSupportActionMode((ActionMode.Callback) baseAdapter);
}
示例9: CallbackWrapper
import android.support.v7.view.ActionMode.Callback; //导入依赖的package包/类
public CallbackWrapper(Context context, ActionMode.Callback supportCallback) {
this.mContext = context;
this.mWrappedCallback = supportCallback;
}
示例10: startSupportActionMode
import android.support.v7.view.ActionMode.Callback; //导入依赖的package包/类
@Nullable
public abstract ActionMode startSupportActionMode(@NonNull Callback callback);
示例11: ActionModeImpl
import android.support.v7.view.ActionMode.Callback; //导入依赖的package包/类
public ActionModeImpl(Context context, Callback callback) {
this.mActionModeContext = context;
this.mCallback = callback;
this.mMenu = new MenuBuilder(context).setDefaultShowAsAction(1);
this.mMenu.setCallback(this);
}
示例12: startActionMode
import android.support.v7.view.ActionMode.Callback; //导入依赖的package包/类
public ActionMode startActionMode(Callback callback) {
return null;
}
示例13: onWindowStartingSupportActionMode
import android.support.v7.view.ActionMode.Callback; //导入依赖的package包/类
@Nullable
public ActionMode onWindowStartingSupportActionMode(@NonNull Callback callback) {
return null;
}
示例14: startSupportActionMode
import android.support.v7.view.ActionMode.Callback; //导入依赖的package包/类
@Nullable
public ActionMode startSupportActionMode(@NonNull Callback callback) {
return getDelegate().startSupportActionMode(callback);
}
示例15: onWindowStartingSupportActionMode
import android.support.v7.view.ActionMode.Callback; //导入依赖的package包/类
@Nullable
public ActionMode onWindowStartingSupportActionMode(Callback callback) {
return null;
}