Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
compileSdkVersion 29

defaultConfig {
applicationId "co.intentservice.chatui.sample"
minSdkVersion 16
targetSdkVersion 23
targetSdkVersion 29
versionCode 1
versionName "1.0"
}
Expand All @@ -20,9 +19,9 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'

compile 'com.android.support:appcompat-v7:23.4.0'
compile project(':chat-ui')
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation project(':chat-ui')
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package co.intentservice.chatui.sample;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import androidx.appcompat.app.AppCompatActivity;

import co.intentservice.chatui.ChatView;
import co.intentservice.chatui.models.ChatMessage;
Expand Down
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.android.tools.build:gradle:4.0.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
// NOTE: Do not place your application dependencies here; they belong
Expand All @@ -16,6 +17,7 @@ buildscript {
allprojects {
repositories {
jcenter()
google()
}
}

Expand Down
31 changes: 14 additions & 17 deletions chat-ui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ext {
siteUrl = 'https://github.com/IntentService/android-chat-ui'
gitUrl = 'https://github.com/IntentService/android-chat-ui'

libraryVersion = '0.1.3'
libraryVersion = '0.1.4'

developerId = 'timigod'
developerName = 'Timi Ajiboye'
Expand All @@ -25,12 +25,11 @@ ext {
}

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
compileSdkVersion 29

defaultConfig {
minSdkVersion 16
targetSdkVersion 23
targetSdkVersion 29
versionCode 1
versionName "1.0"
}
Expand All @@ -42,21 +41,19 @@ android {
}
}

ext {
supportLibVer = '23.4.0'
}


dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile 'junit:junit:4.12'
compile 'com.android.support:support-v4:23.0.0'
compile "com.android.support:appcompat-v7:${supportLibVer}"
compile "com.android.support:cardview-v7:${supportLibVer}"
compile "com.android.support:design:${supportLibVer}"

compile 'pl.tajchert:waitingdots:0.2.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation 'junit:junit:4.12'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.google.android.material:material:1.1.0'

implementation 'pl.tajchert:waitingdots:0.2.0'
}


apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle'
apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle'
//apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle'
//apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle'
13 changes: 0 additions & 13 deletions chat-ui/src/main/java/co/intentservice/chatui/ApplicationTest.java

This file was deleted.

5 changes: 3 additions & 2 deletions chat-ui/src/main/java/co/intentservice/chatui/ChatView.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import android.content.res.TypedArray;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.CardView;
import android.text.Editable;
import android.text.InputType;
import android.text.TextUtils;
Expand All @@ -22,6 +20,9 @@
import android.widget.RelativeLayout;
import android.widget.TextView;

import androidx.cardview.widget.CardView;
import androidx.core.content.ContextCompat;

import java.util.ArrayList;

import co.intentservice.chatui.fab.FloatingActionsMenu;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import android.widget.BaseAdapter;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;

import co.intentservice.chatui.models.ChatMessage;
import co.intentservice.chatui.viewholders.MessageViewHolder;
Expand Down Expand Up @@ -106,6 +108,12 @@ public View getView(int position, View convertView, ViewGroup parent) {

public void addMessage(ChatMessage message) {
chatMessages.add(message);
Collections.sort(chatMessages, new Comparator<ChatMessage>() {
@Override
public int compare(ChatMessage chatMessage, ChatMessage t1) {
return (int) (chatMessage.getTimestamp()-t1.getTimestamp());
}
});
notifyDataSetChanged();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@
import android.graphics.drawable.shapes.OvalShape;
import android.os.Build;
import android.os.Build.VERSION_CODES;
import android.support.annotation.ColorRes;
import android.support.annotation.DimenRes;
import android.support.annotation.DrawableRes;
import android.support.annotation.IntDef;
import android.support.annotation.NonNull;
import android.util.AttributeSet;
import android.widget.ImageButton;
import android.widget.TextView;

import androidx.annotation.ColorRes;
import androidx.annotation.DimenRes;
import androidx.annotation.DrawableRes;
import androidx.annotation.IntDef;
import androidx.annotation.NonNull;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
import android.graphics.drawable.LayerDrawable;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.ColorRes;
import android.support.annotation.NonNull;
import android.support.v4.content.ContextCompat;
import android.util.AttributeSet;
import android.view.ContextThemeWrapper;
import android.view.TouchDelegate;
Expand All @@ -27,6 +24,10 @@
import android.view.animation.OvershootInterpolator;
import android.widget.TextView;

import androidx.annotation.ColorRes;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;

import co.intentservice.chatui.R;

public class FloatingActionsMenu extends ViewGroup {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

import android.content.Context;
import android.content.res.TypedArray;
import android.support.annotation.ColorRes;
import android.support.annotation.DrawableRes;
import android.util.AttributeSet;

import androidx.annotation.ColorRes;
import androidx.annotation.DrawableRes;

import co.intentservice.chatui.R;

public class SendFloatingActionButton extends FloatingActionButton {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package co.intentservice.chatui.fab;

import android.graphics.Rect;
import android.support.annotation.NonNull;
import android.view.MotionEvent;
import android.view.TouchDelegate;
import android.view.View;

import androidx.annotation.NonNull;

import java.util.ArrayList;

public class TouchDelegateGroup extends TouchDelegate {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package co.intentservice.chatui.viewholders;

import android.content.Context;
import android.support.v4.content.ContextCompat;
import android.view.View;

import androidx.core.content.ContextCompat;

import co.intentservice.chatui.R;
import co.intentservice.chatui.views.MessageView;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package co.intentservice.chatui.views;

import android.content.Context;
import android.support.annotation.ColorInt;
import android.support.v7.widget.CardView;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.FrameLayout;
import android.widget.TextView;

import androidx.annotation.ColorInt;
import androidx.cardview.widget.CardView;

import co.intentservice.chatui.R;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

import android.app.Service;
import android.content.Context;
import android.support.annotation.ColorInt;
import android.support.v7.widget.CardView;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;

import androidx.annotation.ColorInt;
import androidx.cardview.widget.CardView;

import co.intentservice.chatui.R;

/**
Expand Down
4 changes: 2 additions & 2 deletions chat-ui/src/main/res/layout/chat_item_dots.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
android:paddingStart="16dp"
android:paddingLeft="16dp">

<android.support.v7.widget.CardView
<androidx.cardview.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
Expand All @@ -25,7 +25,7 @@
dots:autoplay="true"
dots:period="1000" />

</android.support.v7.widget.CardView>
</androidx.cardview.widget.CardView>


</FrameLayout>
6 changes: 3 additions & 3 deletions chat-ui/src/main/res/layout/chat_item_rcv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
android:paddingEnd="72dp"
android:paddingRight="72dp">

<android.support.v7.widget.CardView
<androidx.cardview.widget.CardView
android:id="@+id/bubble"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand Down Expand Up @@ -49,7 +49,7 @@
android:textSize="@dimen/default_message_text_size"
tools:text="My name is Timi and I am..." />

<android.support.v4.widget.Space
<Space
android:layout_width="match_parent"
android:layout_height="4dp" />

Expand All @@ -65,6 +65,6 @@

</LinearLayout>

</android.support.v7.widget.CardView>
</androidx.cardview.widget.CardView>

</FrameLayout>
6 changes: 3 additions & 3 deletions chat-ui/src/main/res/layout/chat_item_sent.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
android:paddingEnd="16dp"
android:paddingRight="16dp">

<android.support.v7.widget.CardView
<androidx.cardview.widget.CardView
android:id="@+id/bubble"
app:cardCornerRadius="8dp"
app:cardElevation="4dp"
Expand Down Expand Up @@ -51,7 +51,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

<android.support.v4.widget.Space
<Space
android:layout_width="match_parent"
android:layout_height="4dp" />

Expand All @@ -66,6 +66,6 @@

</LinearLayout>

</android.support.v7.widget.CardView>
</androidx.cardview.widget.CardView>

</FrameLayout>
4 changes: 2 additions & 2 deletions chat-ui/src/main/res/layout/chat_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</co.intentservice.chatui.fab.FloatingActionsMenu>


<android.support.v7.widget.CardView
<androidx.cardview.widget.CardView
android:id="@+id/input_frame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down Expand Up @@ -69,6 +69,6 @@
android:textColorHint="@color/main_color_gray"
android:textSize="@dimen/default_input_text_size" />

</android.support.v7.widget.CardView>
</androidx.cardview.widget.CardView>

</merge>
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# org.gradle.parallel=true
android.enableJetifier=true
android.useAndroidX=true
Loading