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


Java Emojicon类代码示例

本文整理汇总了Java中com.rockerhieu.emojicon.emoji.Emojicon的典型用法代码示例。如果您正苦于以下问题:Java Emojicon类的具体用法?Java Emojicon怎么用?Java Emojicon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: add

import com.rockerhieu.emojicon.emoji.Emojicon; //导入依赖的package包/类
@Override
public void add(int index, Emojicon object) {
    super.add(index, object);

    if (index == 0) {
        while (this.size() > EmojiconRecentsManager.maximumSize) {
            super.remove(EmojiconRecentsManager.maximumSize);
        }
    } else {
        while (this.size() > EmojiconRecentsManager.maximumSize) {
            super.remove(0);
        }
    }

    saveRecents();
}
 
开发者ID:jianliaoim,项目名称:talk-android,代码行数:17,代码来源:EmojiconRecentsManager.java

示例2: onViewCreated

import com.rockerhieu.emojicon.emoji.Emojicon; //导入依赖的package包/类
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    GridView gridView = (GridView) view.findViewById(R.id.Emoji_GridView);
    Bundle bundle = getArguments();
    if (bundle == null) {
        mData = People.DATA;
        mUseSystemDefault = false;
    } else {
        Parcelable[] parcels = bundle.getParcelableArray(EMOJICONS_KEY);
        mData = new Emojicon[parcels.length];
        for (int i = 0; i < parcels.length; i++) {
            mData[i] = (Emojicon) parcels[i];
        }
        mUseSystemDefault = bundle.getBoolean(USE_SYSTEM_DEFAULT_KEY);
    }
    gridView.setAdapter(new EmojiAdapter(view.getContext(), mData, mUseSystemDefault));
    gridView.setOnItemClickListener(this);
}
 
开发者ID:mobilemaster128,项目名称:emoticon-keyboard,代码行数:19,代码来源:EmojiconGridFragment.java

示例3: addRecentEmoji

import com.rockerhieu.emojicon.emoji.Emojicon; //导入依赖的package包/类
@Override
public void addRecentEmoji(Context context, Emojicon emojicon) {
    EmojiconRecentsManager recents = EmojiconRecentsManager
        .getInstance(context);
    recents.push(emojicon);

    // notify dataset changed
    if (mAdapter != null)
        mAdapter.notifyDataSetChanged();
}
 
开发者ID:jianliaoim,项目名称:talk-android,代码行数:11,代码来源:EmojiconRecentsGridFragment.java

示例4: push

import com.rockerhieu.emojicon.emoji.Emojicon; //导入依赖的package包/类
public void push(Emojicon object) {
    // FIXME totally inefficient way of adding the emoji to the adapter
    // TODO this should be probably replaced by a deque
    if (contains(object)) {
        super.remove(object);
    }
    add(0, object);
}
 
开发者ID:jianliaoim,项目名称:talk-android,代码行数:9,代码来源:EmojiconRecentsManager.java

示例5: loadRecents

import com.rockerhieu.emojicon.emoji.Emojicon; //导入依赖的package包/类
private void loadRecents() {
    SharedPreferences prefs = getPreferences();
    String str = prefs.getString(PREF_RECENTS, "");
    StringTokenizer tokenizer = new StringTokenizer(str, EmojiconRecentsManager.DELIMITER);
    while (tokenizer.hasMoreTokens()) {
        add(Emojicon.fromChars(tokenizer.nextToken()));
    }
}
 
开发者ID:jianliaoim,项目名称:talk-android,代码行数:9,代码来源:EmojiconRecentsManager.java

示例6: saveRecents

import com.rockerhieu.emojicon.emoji.Emojicon; //导入依赖的package包/类
private void saveRecents() {
    StringBuilder str = new StringBuilder();
    int c = size();
    for (int i = 0; i < c; i++) {
        Emojicon e = get(i);
        str.append(e.getEmoji());
        if (i < (c - 1)) {
            str.append(EmojiconRecentsManager.DELIMITER);
        }
    }
    SharedPreferences prefs = getPreferences();
    prefs.edit().putString(PREF_RECENTS, str.toString()).commit();
}
 
开发者ID:jianliaoim,项目名称:talk-android,代码行数:14,代码来源:EmojiconRecentsManager.java

示例7: newInstance

import com.rockerhieu.emojicon.emoji.Emojicon; //导入依赖的package包/类
protected static EmojiconGridFragment newInstance(Emojicon[] emojicons, EmojiconRecents recents, boolean useSystemDefault) {
    EmojiconGridFragment emojiGridFragment = new EmojiconGridFragment();
    Bundle args = new Bundle();
    args.putSerializable("emojicons", emojicons);
    args.putBoolean(USE_SYSTEM_DEFAULT_KEY, useSystemDefault);
    emojiGridFragment.setArguments(args);
    emojiGridFragment.setRecents(recents);
    return emojiGridFragment;
}
 
开发者ID:jianliaoim,项目名称:talk-android,代码行数:10,代码来源:EmojiconGridFragment.java

示例8: onViewCreated

import com.rockerhieu.emojicon.emoji.Emojicon; //导入依赖的package包/类
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    GridView gridView = (GridView) view.findViewById(R.id.Emoji_GridView);
    Bundle bundle = getArguments();
    if (bundle == null) {
        mData = People.DATA;
        mUseSystemDefault = false;
    } else {
        Object[] o = (Object[]) getArguments().getSerializable("emojicons");
        mData = Arrays.asList(o).toArray(new Emojicon[o.length]);
        mUseSystemDefault = bundle.getBoolean(USE_SYSTEM_DEFAULT_KEY);
    }
    gridView.setAdapter(new EmojiAdapter(view.getContext(), mData, mUseSystemDefault));
    gridView.setOnItemClickListener(this);
}
 
开发者ID:jianliaoim,项目名称:talk-android,代码行数:16,代码来源:EmojiconGridFragment.java

示例9: onItemClick

import com.rockerhieu.emojicon.emoji.Emojicon; //导入依赖的package包/类
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
    if (mOnEmojiconClickedListener != null) {
        mOnEmojiconClickedListener.onEmojiconClicked((Emojicon) parent.getItemAtPosition(position));
    }
    if (mRecents != null) {
        mRecents.addRecentEmoji(view.getContext(), ((Emojicon) parent
            .getItemAtPosition(position)));
    }
}
 
开发者ID:jianliaoim,项目名称:talk-android,代码行数:11,代码来源:EmojiconGridFragment.java

示例10: addRecentEmoji

import com.rockerhieu.emojicon.emoji.Emojicon; //导入依赖的package包/类
@Override
public void addRecentEmoji(Context context, Emojicon emojicon) {
    EmojiconRecentsManager recents = EmojiconRecentsManager
            .getInstance(context);
    recents.push(emojicon);

    // notify dataset changed
    if (mAdapter != null)
        mAdapter.notifyDataSetChanged();
}
 
开发者ID:mobilemaster128,项目名称:emoticon-keyboard,代码行数:11,代码来源:EmojiconRecentsGridFragment.java

示例11: newInstance

import com.rockerhieu.emojicon.emoji.Emojicon; //导入依赖的package包/类
protected static EmojiconGridFragment newInstance(Emojicon[] emojicons, EmojiconRecents recents, boolean useSystemDefault) {
    EmojiconGridFragment emojiGridFragment = new EmojiconGridFragment();
    Bundle args = new Bundle();
    args.putParcelableArray(EMOJICONS_KEY, emojicons);
    args.putBoolean(USE_SYSTEM_DEFAULT_KEY, useSystemDefault);
    emojiGridFragment.setArguments(args);
    emojiGridFragment.setRecents(recents);
    return emojiGridFragment;
}
 
开发者ID:mobilemaster128,项目名称:emoticon-keyboard,代码行数:10,代码来源:EmojiconGridFragment.java

示例12: onItemClick

import com.rockerhieu.emojicon.emoji.Emojicon; //导入依赖的package包/类
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
    if (mOnEmojiconClickedListener != null) {
        mOnEmojiconClickedListener.onEmojiconClicked((Emojicon) parent.getItemAtPosition(position));
    }
    if (mRecents != null) {
        mRecents.addRecentEmoji(view.getContext(), ((Emojicon) parent
                .getItemAtPosition(position)));
    }
}
 
开发者ID:mobilemaster128,项目名称:emoticon-keyboard,代码行数:11,代码来源:EmojiconGridFragment.java

示例13: input

import com.rockerhieu.emojicon.emoji.Emojicon; //导入依赖的package包/类
public static void input(EditText editText, Emojicon emojicon) {
    if (editText == null || emojicon == null) {
        return;
    }

    int start = editText.getSelectionStart();
    int end = editText.getSelectionEnd();
    if (start < 0) {
        editText.append(emojicon.getEmoji());
    } else {
        editText.getText().replace(Math.min(start, end), Math.max(start, end), emojicon.getEmoji(), 0, emojicon.getEmoji().length());
    }
}
 
开发者ID:mobilemaster128,项目名称:emoticon-keyboard,代码行数:14,代码来源:EmojiconsFragment.java

示例14: onEmojiconClicked

import com.rockerhieu.emojicon.emoji.Emojicon; //导入依赖的package包/类
@Override
public void onEmojiconClicked(Emojicon emojicon)
{
	int currentPos = mTabLayout.getSelectedTabPosition();
	if (currentPos == POS_CONDITION) return;
	WriteMessageFragment fragment = (WriteMessageFragment) mFragments.get(currentPos);
	fragment.setContent(emojicon.getEmoji());
}
 
开发者ID:ChenAt,项目名称:PlayTogether,代码行数:9,代码来源:PostInvitationActivity.java

示例15: onEmojiconClicked

import com.rockerhieu.emojicon.emoji.Emojicon; //导入依赖的package包/类
@Override
public void onEmojiconClicked(Emojicon emojicon)
{
	String currContent = mEtContent.getText().toString();
	mEtContent.setText(currContent + emojicon.getEmoji());
	mEtContent.setSelection(mEtContent.getText().toString().length());
}
 
开发者ID:ChenAt,项目名称:PlayTogether,代码行数:8,代码来源:ChatActivity.java


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