qiscus / qiscus-sdk-android

Qiscus provide everything you need to power up your app with chats. And it's now made simple.
https://www.qiscus.com
Apache License 2.0
201 stars 84 forks source link

room sender color interceptor #41

Closed andhikayuana closed 6 years ago

andhikayuana commented 6 years ago

to intercept sender color name example

Qiscus.getChatConfig().setRoomSenderNameColorInterceptor(qiscusComment -> R.color.accent);

//or you can set the logic inside

Qiscus.getChatConfig().setRoomSenderNameColorInterceptor(qiscusComment -> {
            if (anu) {
                return R.color.colorAnu;
            } else if (anu2) {
                return R.color.colorAnu2;
            } else {
                return R.color.colorAnu3;
            }
        });

//replybar color
Qiscus.getChatConfig()
                .setRoomReplybarColorInterceptor(qiscusComment -> R.color.qiscus_contact_background);

//clear chats
ArrayList<String> strings = new ArrayList<>();
        strings.add("uniqueid");

        QiscusApi.getInstance()
                .clearChatRoomMessages(strings)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(aVoid -> Toast.makeText(MainActivity.this, "Berhasil", Toast.LENGTH_SHORT).show(), Throwable::printStackTrace);
zetbaitsu commented 6 years ago

bro @andhikayuana please fix the checkstyle issues first

andhikayuana commented 6 years ago

ok wait

codecov[bot] commented 6 years ago

Codecov Report

Merging #41 into master will not change coverage. The diff coverage is 0%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master     #41   +/-   ##
======================================
  Coverage       0%      0%           
======================================
  Files         127     127           
  Lines       10091   10128   +37     
  Branches     1043    1044    +1     
======================================
- Misses      10091   10128   +37
Impacted Files Coverage Δ
...r/viewholder/QiscusBaseReplyMessageViewHolder.java 0% <0%> (ø) :arrow_up:
...dapter/viewholder/QiscusBaseMessageViewHolder.java 0% <0%> (ø) :arrow_up:
...va/com/qiscus/sdk/data/model/QiscusChatConfig.java 0% <0%> (ø) :arrow_up:
...com/qiscus/sdk/ui/view/QiscusReplyPreviewView.java 0% <0%> (ø) :arrow_up:
...ain/java/com/qiscus/sdk/data/remote/QiscusApi.java 0% <0%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 61490ca...7b66c20. Read the comment docs.