當前位置: 首頁>>代碼示例>>Java>>正文


Java RepeatListener類代碼示例

本文整理匯總了Java中com.vanniktech.emoji.listeners.RepeatListener的典型用法代碼示例。如果您正苦於以下問題:Java RepeatListener類的具體用法?Java RepeatListener怎麽用?Java RepeatListener使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


RepeatListener類屬於com.vanniktech.emoji.listeners包,在下文中一共展示了RepeatListener類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: handleOnClicks

import com.vanniktech.emoji.listeners.RepeatListener; //導入依賴的package包/類
private void handleOnClicks(final ViewPager emojisPager) {
  for (int i = 0; i < emojiTabs.length - 1; i++) {
    emojiTabs[i].setOnClickListener(new EmojiTabsClickListener(emojisPager, i));
  }

  emojiTabs[emojiTabs.length - 1].setOnTouchListener(new RepeatListener(INITIAL_INTERVAL, NORMAL_INTERVAL, new OnClickListener() {
    @Override public void onClick(final View view) {
      if (onEmojiBackspaceClickListener != null) {
        onEmojiBackspaceClickListener.onEmojiBackspaceClick(view);
      }
    }
  }));
}
 
開發者ID:vanniktech,項目名稱:Emoji,代碼行數:14,代碼來源:EmojiView.java

示例2: EmojiView

import com.vanniktech.emoji.listeners.RepeatListener; //導入依賴的package包/類
EmojiView(final Context context, final OnEmojiClickedListener onEmojiClickedListener, @NonNull final RecentEmoji recentEmoji) {
    super(context);

    View.inflate(context, R.layout.emoji_view, this);

    final ViewPager emojisPager = (ViewPager) findViewById(R.id.emojis_pager);
    emojisPager.addOnPageChangeListener(this);

    final List<FrameLayout> views = getViews(context, onEmojiClickedListener, recentEmoji);
    final EmojiPagerAdapter emojisAdapter = new EmojiPagerAdapter(views);
    emojisPager.setAdapter(emojisAdapter);

    emojiTabs = new ImageView[DUMB_INDEX + 1];
    emojiTabs[RECENT_INDEX] = (ImageView) findViewById(R.id.emojis_tab_0_recent);
    emojiTabs[DEFAULT_INDEX] = (ImageView) findViewById(R.id.emojis_tab_1_default);
    emojiTabs[MONKEY_INDEX] = (ImageView) findViewById(R.id.emojis_tab_2_monkey);
    emojiTabs[DUMB_INDEX] = (ImageView) findViewById(R.id.emojis_tab_3_dumb);

    handleOnClicks(emojisPager);

    findViewById(R.id.emojis_backspace).setOnTouchListener(new RepeatListener(INITIAL_INTERVAL, NORMAL_INTERVAL, new OnClickListener() {
        @Override
        public void onClick(final View view) {
            if (onEmojiBackspaceClickListener != null) {
                onEmojiBackspaceClickListener.onEmojiBackspaceClicked(view);
            }
        }
    }));

    final TypedValue value = new TypedValue();
    context.getTheme().resolveAttribute(R.attr.colorAccent, value, true);
    themeAccentColor = value.data;

    final int startIndex = recentGridView.numberOfRecentEmojis() > 0 ? RECENT_INDEX : DEFAULT_INDEX;
    emojisPager.setCurrentItem(startIndex);
    onPageSelected(startIndex);
}
 
開發者ID:GreenSkinMonster,項目名稱:hipda,代碼行數:38,代碼來源:EmojiView.java

示例3: EmojiView

import com.vanniktech.emoji.listeners.RepeatListener; //導入依賴的package包/類
EmojiView(final Context context, final OnEmojiClickedListener onEmojiClickedListener, @NonNull final RecentEmoji recentEmoji) {
    super(context);

    View.inflate(context, R.layout.emoji_view, this);

    final ViewPager emojisPager = (ViewPager) findViewById(R.id.emojis_pager);
    emojisPager.addOnPageChangeListener(this);

    final List<FrameLayout> views = getViews(context, onEmojiClickedListener, recentEmoji);
    final EmojiPagerAdapter emojisAdapter = new EmojiPagerAdapter(views);
    emojisPager.setAdapter(emojisAdapter);

    emojiTabs = new ImageView[SYMBOLS_INDEX + 1];
    emojiTabs[RECENT_INDEX] = (ImageView) findViewById(R.id.emojis_tab_0_recent);
    emojiTabs[PEOPLE_INDEX] = (ImageView) findViewById(R.id.emojis_tab_1_people);
    emojiTabs[NATURE_INDEX] = (ImageView) findViewById(R.id.emojis_tab_2_nature);
    emojiTabs[FOOD_INDEX] = (ImageView) findViewById(R.id.emojis_tab_3_food);
    emojiTabs[SPORT_INDEX] = (ImageView) findViewById(R.id.emojis_tab_4_sport);
    emojiTabs[CARS_INDEX] = (ImageView) findViewById(R.id.emojis_tab_5_cars);
    emojiTabs[ELECTRONICS_INDEX] = (ImageView) findViewById(R.id.emojis_tab_6_electronics);
    emojiTabs[SYMBOLS_INDEX] = (ImageView) findViewById(R.id.emojis_tab_7_symbols);

    handleOnClicks(emojisPager);

    findViewById(R.id.emojis_backspace).setOnTouchListener(new RepeatListener(INITIAL_INTERVAL, NORMAL_INTERVAL, new OnClickListener() {
        @Override
        public void onClick(final View view) {
            if (onEmojiBackspaceClickListener != null) {
                onEmojiBackspaceClickListener.onEmojiBackspaceClicked(view);
            }
        }
    }));

    final TypedValue value = new TypedValue();
    context.getTheme().resolveAttribute(R.attr.colorAccent, value, true);
    themeAccentColor = value.data;

    final int startIndex = recentGridView.numberOfRecentEmojis() > 0 ? RECENT_INDEX : PEOPLE_INDEX;
    emojisPager.setCurrentItem(startIndex);
    onPageSelected(startIndex);
}
 
開發者ID:congwiny,項目名稱:MyAndroidTest,代碼行數:42,代碼來源:EmojiView.java


注:本文中的com.vanniktech.emoji.listeners.RepeatListener類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。