|
|
@ -26,6 +26,7 @@ import com.kanglai.push.constant.CommonConstant; |
|
|
|
import com.kanglai.push.databinding.ActivityInstantBinding; |
|
|
|
import com.kanglai.push.databinding.ActivityInstantBinding; |
|
|
|
import com.kanglai.push.entity.LocalPushChatMsg; |
|
|
|
import com.kanglai.push.entity.LocalPushChatMsg; |
|
|
|
import com.kanglai.push.entity.PushChatMessage; |
|
|
|
import com.kanglai.push.entity.PushChatMessage; |
|
|
|
|
|
|
|
import com.kanglai.push.ui.adapter.ScrollBoundaryDeciderAdapter; |
|
|
|
import com.kanglai.push.ui.adapter.SoloChatRoomAdapter; |
|
|
|
import com.kanglai.push.ui.adapter.SoloChatRoomAdapter; |
|
|
|
import com.kanglai.push.ui.vm.InstantViewModel; |
|
|
|
import com.kanglai.push.ui.vm.InstantViewModel; |
|
|
|
import com.kanglai.push.util.ViewFilterUtil; |
|
|
|
import com.kanglai.push.util.ViewFilterUtil; |
|
|
@ -76,9 +77,15 @@ public class InstantActivity extends BaseActivity<ActivityInstantBinding, Instan |
|
|
|
mRecyclerView.setAdapter(mAdapter); |
|
|
|
mRecyclerView.setAdapter(mAdapter); |
|
|
|
refreshLayout = findViewById(R.id.instant_smart_refresh); |
|
|
|
refreshLayout = findViewById(R.id.instant_smart_refresh); |
|
|
|
refreshLayout.setEnableRefresh(false); |
|
|
|
refreshLayout.setEnableRefresh(false); |
|
|
|
refreshLayout.setEnableAutoLoadMore(true); |
|
|
|
refreshLayout.setEnableAutoLoadMore(false); |
|
|
|
refreshLayout.setEnableNestedScroll(false); |
|
|
|
refreshLayout.setEnableNestedScroll(false); |
|
|
|
refreshLayout.setEnableScrollContentWhenLoaded(true); |
|
|
|
refreshLayout.setEnableScrollContentWhenLoaded(true); |
|
|
|
|
|
|
|
refreshLayout.setScrollBoundaryDecider(new ScrollBoundaryDeciderAdapter() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public boolean canLoadMore(View content) { |
|
|
|
|
|
|
|
return super.canRefresh(content); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
refreshLayout.setOnLoadMoreListener(mViewModel::loadMore); |
|
|
|
refreshLayout.setOnLoadMoreListener(mViewModel::loadMore); |
|
|
|
input_box = findViewById(R.id.instant_input_box); |
|
|
|
input_box = findViewById(R.id.instant_input_box); |
|
|
|
input_box.setFilters(new InputFilter[]{ViewFilterUtil.getNoSpecialCharactersFilter()}); |
|
|
|
input_box.setFilters(new InputFilter[]{ViewFilterUtil.getNoSpecialCharactersFilter()}); |
|
|
|