Coder Social home page Coder Social logo

Comments (5)

w446108264 avatar w446108264 commented on August 26, 2024

这部分是demo中的示例代码,不是lib的代码。开发可以根据自己的需求,从配置,或数据库选择相应加载方式。

原示例代码完整如下,为了演示方便,PageSetAdapter是static的,事实上只添加了一次,不会增加内存占用。

public static PageSetAdapter sCommonPageSetAdapter;

public static PageSetAdapter getCommonAdapter(Context context, EmoticonClickListener emoticonClickListener) {

        if(sCommonPageSetAdapter != null){
            return sCommonPageSetAdapter;
        }

        PageSetAdapter pageSetAdapter = new PageSetAdapter();

        addEmojiPageSetEntity(pageSetAdapter, context, emoticonClickListener);

        addXhsPageSetEntity(pageSetAdapter, context, emoticonClickListener);

        addWechatPageSetEntity(pageSetAdapter, context, emoticonClickListener);

        addGoodGoodStudyPageSetEntity(pageSetAdapter, context, emoticonClickListener);

        addKaomojiPageSetEntity(pageSetAdapter, context, emoticonClickListener);

        addTestPageSetEntity(pageSetAdapter, context);

        return pageSetAdapter;
 }

from xhsemoticonskeyboard.

275873859 avatar 275873859 commented on August 26, 2024

正因为是static,所以,应该退出当前界面的时候,不会销毁,但我试了下,每次都要取执行后面的添加的操作

from xhsemoticonskeyboard.

w446108264 avatar w446108264 commented on August 26, 2024

demo中有很多的示例,不同的activity都有键盘,但他们的数据源大多是相同的,所以为了演示的方便,这里直接使用了static的Adapter。实际的开发中不推荐这样使用的。

from xhsemoticonskeyboard.

275873859 avatar 275873859 commented on August 26, 2024

好吧,只能说我拿来主义习惯了 ^O^

from xhsemoticonskeyboard.

275873859 avatar 275873859 commented on August 26, 2024

谢谢啦

from xhsemoticonskeyboard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.