当前位置: 首页>>代码示例>>Java>>正文


Java InputConnectionCompat.createWrapper方法代码示例

本文整理汇总了Java中android.support.v13.view.inputmethod.InputConnectionCompat.createWrapper方法的典型用法代码示例。如果您正苦于以下问题:Java InputConnectionCompat.createWrapper方法的具体用法?Java InputConnectionCompat.createWrapper怎么用?Java InputConnectionCompat.createWrapper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v13.view.inputmethod.InputConnectionCompat的用法示例。


在下文中一共展示了InputConnectionCompat.createWrapper方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreateInputConnection

import android.support.v13.view.inputmethod.InputConnectionCompat; //导入方法依赖的package包/类
@Override
public InputConnection onCreateInputConnection(EditorInfo editorInfo) {
	final InputConnection ic = super.onCreateInputConnection(editorInfo);

	if (mimeTypes != null && mCommitContentListener != null) {
		EditorInfoCompat.setContentMimeTypes(editorInfo, mimeTypes);
		return InputConnectionCompat.createWrapper(ic, editorInfo, new InputConnectionCompat.OnCommitContentListener() {
			@Override
			public boolean onCommitContent(InputContentInfoCompat inputContentInfo, int flags, Bundle opts) {
				return EditMessage.this.mCommitContentListener.onCommitContent(inputContentInfo, flags, opts, mimeTypes);
			}
		});
	}
	else {
		return ic;
	}
}
 
开发者ID:syntafin,项目名称:TenguChat,代码行数:18,代码来源:EditMessage.java

示例2: onCreateInputConnection

import android.support.v13.view.inputmethod.InputConnectionCompat; //导入方法依赖的package包/类
@Override
public InputConnection onCreateInputConnection(final EditorInfo info) {
    final InputConnection ic = super.onCreateInputConnection(info);
    EditorInfoCompat.setContentMimeTypes(info, new String[]{"image/gif"});
    final InputConnectionCompat.OnCommitContentListener callback = (info1, flags, opts) -> {
        if (BuildVersionUtil.isAtLeastNMR1() && (flags & InputConnectionCompat.INPUT_CONTENT_GRANT_READ_URI_PERMISSION) != 0) {
            try {
                info1.requestPermission();
            } catch (Exception e) {
                return false;
            }
        }
        if (commitListener != null) {
            commitListener.onCommitContent(info1);
        }
        return true;
    };
    return InputConnectionCompat.createWrapper(ic, info, callback);
}
 
开发者ID:qiscus,项目名称:qiscus-sdk-android,代码行数:20,代码来源:QiscusEditText.java

示例3: onCreateInputConnection

import android.support.v13.view.inputmethod.InputConnectionCompat; //导入方法依赖的package包/类
@Override
@Nullable
public InputConnection onCreateInputConnection(EditorInfo editorInfo) {
    final InputConnection ic = super.onCreateInputConnection(editorInfo);

    if (mimeTypes != null && mCommitContentListener != null) {
        EditorInfoCompat.setContentMimeTypes(editorInfo, mimeTypes);
        return InputConnectionCompat.createWrapper(ic, editorInfo, new InputConnectionCompat.OnCommitContentListener() {

            @Override
            public boolean onCommitContent(InputContentInfoCompat inputContentInfo, int flags, Bundle opts) {
                return EditMessage.this.mCommitContentListener.onCommitContent(inputContentInfo, flags, opts, mimeTypes);
            }
        });
    } else {
        return ic;
    }
}
 
开发者ID:kriztan,项目名称:Pix-Art-Messenger,代码行数:19,代码来源:EditMessage.java

示例4: onCreateInputConnection

import android.support.v13.view.inputmethod.InputConnectionCompat; //导入方法依赖的package包/类
@Override
public InputConnection onCreateInputConnection(EditorInfo editorInfo) {
	final InputConnection ic = super.onCreateInputConnection(editorInfo);

	if (mimeTypes != null && mCommitContentListener != null) {
		EditorInfoCompat.setContentMimeTypes(editorInfo, mimeTypes);
		return InputConnectionCompat.createWrapper(ic, editorInfo, new InputConnectionCompat.OnCommitContentListener() {
			@Override
			public boolean onCommitContent(InputContentInfoCompat inputContentInfo, int flags, Bundle opts) {
				return EditMessage.this.mCommitContentListener.onCommitContent(inputContentInfo, flags, opts, mimeTypes);
			}
		});
	} else {
		return ic;
	}
}
 
开发者ID:siacs,项目名称:Conversations,代码行数:17,代码来源:EditMessage.java

示例5: onCreateInputConnection

import android.support.v13.view.inputmethod.InputConnectionCompat; //导入方法依赖的package包/类
@Override
public InputConnection onCreateInputConnection(EditorInfo editorInfo) {
  InputConnection inputConnection = super.onCreateInputConnection(editorInfo);

  if(TextSecurePreferences.isEnterSendsEnabled(getContext())) {
    editorInfo.imeOptions &= ~EditorInfo.IME_FLAG_NO_ENTER_ACTION;
  }

  if (Build.VERSION.SDK_INT < 21) return inputConnection;
  if (mediaListener == null)      return inputConnection;
  if (inputConnection == null)    return null;

  EditorInfoCompat.setContentMimeTypes(editorInfo, new String[] {"image/jpeg", "image/png", "image/gif"});
  return InputConnectionCompat.createWrapper(inputConnection, editorInfo, new CommitContentListener(mediaListener));
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:16,代码来源:ComposeText.java

示例6: onCreateInputConnection

import android.support.v13.view.inputmethod.InputConnectionCompat; //导入方法依赖的package包/类
@Override
public InputConnection onCreateInputConnection(EditorInfo editorInfo) {
    InputConnection connection = super.onCreateInputConnection(editorInfo);
    if (onCommitContentListener != null) {
        Assert.expect(mimeTypes != null);
        EditorInfoCompat.setContentMimeTypes(editorInfo, mimeTypes);
        return InputConnectionCompat.createWrapper(connection, editorInfo,
                onCommitContentListener);
    } else {
        return connection;
    }
}
 
开发者ID:Vavassor,项目名称:Tusky,代码行数:13,代码来源:EditTextTyped.java

示例7: onCreateInputConnection

import android.support.v13.view.inputmethod.InputConnectionCompat; //导入方法依赖的package包/类
@Override
public InputConnection onCreateInputConnection(EditorInfo editorInfo) {
  InputConnection inputConnection = super.onCreateInputConnection(editorInfo);

  if (SilencePreferences.getEnterKeyType(getContext()).equals("send")) {
    editorInfo.imeOptions &= ~EditorInfo.IME_FLAG_NO_ENTER_ACTION;
  }

  if (Build.VERSION.SDK_INT <= 13) return inputConnection;
  if (mediaListener == null)       return inputConnection;

  EditorInfoCompat.setContentMimeTypes(editorInfo, new String[] {"image/jpeg", "image/png", "image/gif"});
  return InputConnectionCompat.createWrapper(inputConnection, editorInfo, new CommitContentListener(mediaListener));
}
 
开发者ID:SilenceIM,项目名称:Silence,代码行数:15,代码来源:ComposeText.java

示例8: onCreateInputConnection

import android.support.v13.view.inputmethod.InputConnectionCompat; //导入方法依赖的package包/类
@Override
public InputConnection onCreateInputConnection(EditorInfo attrs) {
    InputConnection con = super.onCreateInputConnection(attrs);
    EditorInfoCompat.setContentMimeTypes(attrs, new String[] { "image/gif", "image/png" });

    return InputConnectionCompat.createWrapper(con, attrs, new InputConnectionCompat.OnCommitContentListener() {
        @Override
        public boolean onCommitContent(InputContentInfoCompat inputContentInfo, int flags, Bundle opts) {
            if (callback != null) {
                if (BuildCompat.isAtLeastNMR1() &&
                        (flags & InputConnectionCompat.INPUT_CONTENT_GRANT_READ_URI_PERMISSION) != 0) {
                    try {
                        inputContentInfo.requestPermission();
                    } catch (Exception e) {
                        return false;
                    }
                }

                callback.onImageSelected(
                        inputContentInfo.getContentUri(),
                        inputContentInfo.getDescription().getMimeType(0)
                );

                return true;
            } else {
                return false;
            }
        }
    });
}
 
开发者ID:ccrama,项目名称:Slide,代码行数:31,代码来源:ImageInsertEditText.java


注:本文中的android.support.v13.view.inputmethod.InputConnectionCompat.createWrapper方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。