Skip to content

Commit

Permalink
UI with SDK v1.7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
yadavmangesh committed Jun 25, 2019
1 parent 9fc0dab commit 110a26b
Show file tree
Hide file tree
Showing 35 changed files with 908 additions and 175 deletions.
3 changes: 1 addition & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,10 @@ dependencies {
implementation 'com.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
//cometchat sdk
implementation 'com.cometchat:pro-android-chat-sdk:1.5.+'
implementation 'com.cometchat:pro-android-chat-sdk:1.7.2'

implementation'com.facebook.shimmer:shimmer:0.3.0'


}

repositories {
Expand Down
9 changes: 8 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,17 @@


<activity android:name=".Activity.BlockedUserListActivity"></activity>

<activity
android:name=".Activity.CometChatActivity"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
android:screenOrientation="portrait" >

<intent-filter>
<action android:name="android.intent.action.SEARCH"/>
</intent-filter>

</activity>
<activity
android:name=".Activity.OneToOneChatActivity"
android:screenOrientation="portrait"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

public class CallActivity extends AppCompatActivity implements CallActivityContract.CallActivityView {


private RelativeLayout callView;

private String sessionId;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.inscripts.cometchatpulse.demo.Activity;

import android.app.SearchManager;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.Drawable;
Expand All @@ -11,6 +12,7 @@
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.SearchView;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.Menu;
Expand All @@ -27,9 +29,11 @@
import com.inscripts.cometchatpulse.demo.Presenters.CometChatActivityPresenter;
import com.inscripts.cometchatpulse.demo.R;
import com.inscripts.cometchatpulse.demo.Utils.FontUtils;
import java.util.HashMap;


public class CometChatActivity extends AppCompatActivity implements
ScrollHelper, CometChatActivityContract.CometChatActivityView {
ScrollHelper, CometChatActivityContract.CometChatActivityView,test {

private ViewPager mViewPager; //view pager

Expand All @@ -53,6 +57,15 @@ public class CometChatActivity extends AppCompatActivity implements

private static final String TAG = "CometChatActivity";


public static HashMap<String ,Integer> countMap;

private MenuItem searchItem;

private SearchView searchView;

private int pageNumber=0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand Down Expand Up @@ -105,6 +118,7 @@ public void onPageScrolled(int i, float v, int i1) {
@Override
public void onPageSelected(int i) {
adapter.notifyDataSetChanged();
pageNumber=i;
}

@Override
Expand Down Expand Up @@ -169,9 +183,62 @@ private void setViewPager() {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main_menu, menu);

searchItem=menu.findItem(R.id.app_bar_search);

SearchManager searchManager=((SearchManager)getSystemService(Context.SEARCH_SERVICE));

if (searchItem!=null){

searchView=((SearchView)searchItem.getActionView());

searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String s) {
return false;
}

@Override
public boolean onQueryTextChange(String s) {
searchUser(s);
return false;
}
});

searchView.setOnCloseListener(new SearchView.OnCloseListener() {
@Override
public boolean onClose() {
searchUser(null);
return false;
}
});
}

if (searchView!=null){
searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
}

return true;
}

private void searchUser(String s) {

switch (pageNumber){

case 0:
ContactsFragment contactsFragment = (ContactsFragment) adapter.getItem(0);
contactsFragment.search(s);
break;

case 1:
GroupListFragment groupListFragment= (GroupListFragment) adapter.getItem(1);
groupListFragment.search(s);
break;

}
}


@Override
public boolean onOptionsItemSelected(MenuItem item) {

Expand Down Expand Up @@ -204,4 +271,20 @@ public void setFab(boolean isExtended) {
fabIconAnimator.setExtended(isExtended);
}



@Override
public void x(String string) {

}
}

interface test{
/**
*
* This methods take no parameter
* @param string
*/
void x(String string);
}

Loading

0 comments on commit 110a26b

Please sign in to comment.