Skip to content

Commit

Permalink
Android UI Kit v2.3.5-2
Browse files Browse the repository at this point in the history
  • Loading branch information
darshanbhanushali committed Jun 30, 2021
1 parent ecd6f1e commit 1e0d8da
Show file tree
Hide file tree
Showing 232 changed files with 2,900 additions and 803 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The UI Kit is developed to keep developers in mind and aims to reduce developmen
[![Platform](https://img.shields.io/badge/Language-Java-yellowgreen.svg)](#)
<img src="https://img.shields.io/badge/Repo%20Size-9.26%20MB-blue" />
![GitHub contributors](https://img.shields.io/github/contributors/cometchat-pro/android-java-chat-ui-kit)
![Version](https://shields.io/badge/version-v2.3.5--1-orange)
![Version](https://shields.io/badge/version-v2.3.5--2-orange)
![GitHub stars](https://img.shields.io/github/stars/cometchat-pro/android-java-chat-ui-kit?style=social)
![Twitter Follow](https://img.shields.io/twitter/follow/cometchat?style=social)

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ buildscript {

}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
classpath 'com.android.tools.build:gradle:4.0.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
6 changes: 3 additions & 3 deletions uikit/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
apply plugin: 'com.android.library'
android {
compileSdkVersion 29
compileSdkVersion 30

defaultConfig {
minSdkVersion 21
targetSdkVersion 29
targetSdkVersion 30
versionCode 1
versionName "1.0"
multiDexEnabled true
Expand Down Expand Up @@ -90,6 +90,6 @@ dependencies {
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
//cometchat
compileOnly 'com.cometchat:pro-android-chat-sdk:2.3.5'
compileOnly'com.cometchat:pro-android-chat-sdk:2.3.5'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.0'
}
52 changes: 38 additions & 14 deletions uikit/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,49 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

<queries>

<!-- Gallery -->
<intent>
<action android:name="android.intent.action.GET_CONTENT" />

<data android:mimeType="image/* video/*" />
</intent>
<intent>
<action android:name="android.intent.action.PICK" />

<data android:mimeType="image/* video/*" />
</intent>
<intent>
<action android:name="android.intent.action.CHOOSER" />
</intent>
</queries>

<application
android:extractNativeLibs="false"
android:hardwareAccelerated="true"
android:requestLegacyExternalStorage="true"
android:usesCleartextTraffic="true"
tools:node="merge"
tools:targetApi="m">
<activity android:name=".ui_components.messages.extensions.Collaborative.CometChatWebViewActivity"/>
<activity
android:name=".ui_components.messages.extensions.Reactions.CometChatReactionInfoActivity"/>
<activity android:name=".ui_components.chats.CometChatStartConversation"/>
<activity android:name=".ui_components.messages.extensions.Collaborative.CometChatWebViewActivity" />
<activity android:name=".ui_components.messages.extensions.Reactions.CometChatReactionInfoActivity" />
<activity android:name=".ui_components.messages.media_view.CometChatMediaViewActivity" />
<activity android:name=".ui_components.messages.message_information.CometChatMessageInfoScreenActivity" />
<activity android:name=".ui_components.calls.call_manager.CometChatStartCallActivity"
android:screenOrientation="portrait"
android:launchMode="singleTask" />
<activity
android:name=".ui_components.calls.call_manager.CometChatStartCallActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait" />
<activity
android:name=".ui_components.messages.thread_message_list.CometChatThreadMessageListActivity"
android:windowSoftInputMode="adjustResize" />
Expand All @@ -47,7 +68,7 @@

<category android:name="android.intent.category.DEFAULT" />

<data android:mimeType="image/*"/>
<data android:mimeType="image/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
Expand All @@ -57,6 +78,7 @@
<data android:mimeType="text/plain" />
</intent-filter>
</activity>

<meta-data
android:name="com.cometchat.pro.uikit"
android:value="${file_provider}" />
Expand Down Expand Up @@ -95,6 +117,7 @@
android:name=".ui_components.messages.message_list.CometChatMessageListActivity"
android:parentActivityName=".ui_components.cometchat_ui.CometChatUI"
android:screenOrientation="portrait" />

<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${file_provider}.provider"
Expand All @@ -105,17 +128,18 @@
android:resource="@xml/provider_path" />
</provider>

<receiver android:name=".ui_components.calls.call_manager.ongoing_call.OngoingCallBroadcast"
<receiver
android:name=".ui_components.calls.call_manager.ongoing_call.OngoingCallBroadcast"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="restartService"/>
<action android:name="restartService" />
</intent-filter>
</receiver>

<service android:name=".ui_components.calls.call_manager.ongoing_call.OngoingCallService"
android:enabled="true"/>

<service
android:name=".ui_components.calls.call_manager.ongoing_call.OngoingCallService"
android:enabled="true" />
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,17 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
// Inflate the layout for this fragment
view = inflater.inflate(R.layout.fragment_cometchat_calls, container, false);
tvTitle = view.findViewById(R.id.tv_title);
fetchSettings();
CometChatError.init(getContext());
phoneAddIv = view.findViewById(R.id.add_phone_iv);
if (oneOnoneCallEnabled || oneOnoneVideoCallEnabled)
phoneAddIv.setVisibility(View.VISIBLE);
else
phoneAddIv.setVisibility(View.GONE);

phoneAddIv.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
openUserListScreen();
}
});

fetchSettings();

viewPager = view.findViewById(R.id.viewPager);
tabLayout = view.findViewById(R.id.tabLayout);
if (getActivity() != null) {
Expand Down Expand Up @@ -149,13 +146,15 @@ private void fetchSettings() {
FeatureRestriction.isOneOnOneAudioCallEnabled(new FeatureRestriction.OnSuccessListener() {
@Override
public void onSuccess(Boolean booleanVal) {
oneOnoneCallEnabled = booleanVal;
if (booleanVal)
phoneAddIv.setVisibility(View.VISIBLE);
}
});
FeatureRestriction.isOneOnOneVideoCallEnabled(new FeatureRestriction.OnSuccessListener() {
@Override
public void onSuccess(Boolean booleanVal) {
oneOnoneVideoCallEnabled = booleanVal;
if (booleanVal)
phoneAddIv.setVisibility(View.VISIBLE);
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,11 @@ public CometChatNewCallList() {
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.fragment_cometchat_userlist);
fetchSettings();
title = findViewById(R.id.tv_title);
CometChatError.init(this);
ImageView imageView = new ImageView(this);
imageView.setImageDrawable(getResources().getDrawable(R.drawable.ic_close_24dp));
imageView.setImageDrawable(getResources().getDrawable(R.drawable.ic_back_arrow_selected));
if (FeatureRestriction.getColor()!=null) {
getWindow().setStatusBarColor(Color.parseColor(FeatureRestriction.getColor()));
imageView.setImageTintList(ColorStateList.valueOf(
Expand All @@ -113,7 +114,6 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
imageView.setImageTintList(
ColorStateList.valueOf(getResources().getColor(R.color.colorPrimary)));

fetchSettings();
imageView.setClickable(true);
imageView.setPadding(8,8,8,8);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
Expand All @@ -128,11 +128,11 @@ public void onClick(View v) {
onBackPressed();
}
});
title.setTypeface(FontUtils.getInstance(this).getTypeFace(FontUtils.robotoMedium));
RelativeLayout.LayoutParams titleLayoutParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
titleLayoutParams.setMargins(16,32,16,48);
titleLayoutParams.addRule(RelativeLayout.CENTER_HORIZONTAL);
title.setLayoutParams(titleLayoutParams);
title.setTextAppearance(R.style.TextAppearance_AppCompat_Large);
title.setText(getResources().getString(R.string.new_call));
rvUserList = findViewById(R.id.rv_user_list);
etSearch = findViewById(R.id.search_bar);
Expand Down Expand Up @@ -201,9 +201,7 @@ public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newStat
}
});

if (audioCallEnabled || videoCallEnabled) {
// Used to trigger event on click of user item in rvUserList (RecyclerView)
rvUserList.setItemClickListener(new OnItemClickListener<User>() {
rvUserList.setItemClickListener(new OnItemClickListener<User>() {
@Override
public void OnItemClick(User var, int position) {
User user = var;
Expand All @@ -229,7 +227,7 @@ public void onClick(DialogInterface dialogInterface, int i) {
alertDialog.show();
}
});
}

fetchUsers();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,10 @@ public void setCallType(boolean isVideoCall, boolean isIncoming) {
outgoingCallView.setVisibility(View.GONE);
if (isVideoCall) {
callMessage.setText(getResources().getString(R.string.incoming_video_call));
callMessage.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(R.drawable.ic_videocam_white_24dp),null,null,null);
callMessage.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(R.drawable.ic_incoming_video_call),null,null,null);
} else {
callMessage.setText(getResources().getString(R.string.incoming_audio_call));
callMessage.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(R.drawable.ic_call_incoming_24dp),null,null,null);
callMessage.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(R.drawable.ic_incoming_call),null,null,null);
}
} else {
callTv.setText(getString(R.string.calling));
Expand All @@ -248,7 +248,7 @@ public void setCallType(boolean isVideoCall, boolean isIncoming) {
if (isVideoCall) {
cameraPreview = new CameraPreview(this);
cameraFrame.addView(cameraPreview);
hangUp.setImageDrawable(getResources().getDrawable(R.drawable.ic_videocam_white_24dp));
hangUp.setImageDrawable(getResources().getDrawable(R.drawable.ic_videocall));

} else {
hangUp.setImageDrawable(getResources().getDrawable(R.drawable.ic_call_end_white_24dp));
Expand Down
Loading

0 comments on commit 1e0d8da

Please sign in to comment.