本文整理汇总了Java中android.support.v13.view.inputmethod.InputConnectionCompat类的典型用法代码示例。如果您正苦于以下问题:Java InputConnectionCompat类的具体用法?Java InputConnectionCompat怎么用?Java InputConnectionCompat使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InputConnectionCompat类属于android.support.v13.view.inputmethod包,在下文中一共展示了InputConnectionCompat类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onCommitContent
import android.support.v13.view.inputmethod.InputConnectionCompat; //导入依赖的package包/类
@Override
public boolean onCommitContent(InputContentInfoCompat inputContentInfo, int flags, Bundle opts) {
if (BuildCompat.isAtLeastNMR1() && (flags & InputConnectionCompat.INPUT_CONTENT_GRANT_READ_URI_PERMISSION) != 0) {
try {
inputContentInfo.requestPermission();
} catch (Exception e) {
Log.w(TAG, e);
return false;
}
}
if (inputContentInfo.getDescription().getMimeTypeCount() > 0) {
mediaListener.onMediaSelected(inputContentInfo.getContentUri(),
inputContentInfo.getDescription().getMimeType(0));
return true;
}
return false;
}
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:21,代码来源:ComposeText.java
示例2: 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
示例3: 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
示例4: 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
示例5: 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
示例6: 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
示例7: 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
示例8: 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
示例9: 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
示例10: setMimeTypes
import android.support.v13.view.inputmethod.InputConnectionCompat; //导入依赖的package包/类
public void setMimeTypes(String[] types,
InputConnectionCompat.OnCommitContentListener listener) {
mimeTypes = types;
onCommitContentListener = listener;
}
开发者ID:Vavassor,项目名称:Tusky,代码行数:6,代码来源:EditTextTyped.java
注:本文中的android.support.v13.view.inputmethod.InputConnectionCompat类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论