Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update onLoadMore in RecyclerScrollMoreListener #248

Open
wants to merge 24 commits into
base: v0.3.2
Choose a base branch
from
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
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# built application files
*.apk
*.ap_
*.jar

# files for the dex VM
*.dex
Expand Down Expand Up @@ -38,4 +37,4 @@ android/proguard/
*.iws
.idea/
build/
.gradle
.gradle
34 changes: 22 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ChatKit for Android

[ ![Download](https://api.bintray.com/packages/troy379/maven/ChatKit/images/download.svg) ](https://bintray.com/troy379/maven/ChatKit/_latestVersion)
[![](https://jitpack.io/v/stfalcon-studio/Chatkit.svg)](https://jitpack.io/#stfalcon-studio/Chatkit)

ChatKit is a library designed to simplify the development of UI for such a trivial task as chat. It has flexible possibilities for styling, customizing and data management

Expand Down Expand Up @@ -41,19 +41,29 @@ To implement all of the features above you can use the following components:

### Download

Download via Gradle:
```gradle
compile 'com.github.stfalcon:chatkit:0.3.1'
1. Add jitpack to the root build.gradle file of your project at the end of repositories.
```
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```
2. Add the dependency
[![](https://jitpack.io/v/stfalcon-studio/Chatkit.svg)](https://jitpack.io/#stfalcon-studio/Chatkit)
```
dependencies {
...
implementation 'com.github.stfalcon-studio:Chatkit:[last_version]'
}
```

or Maven:
```xml
<dependency>
<groupId>com.github.stfalcon</groupId>
<artifactId>chatkit</artifactId>
<version>0.3.1</version>
<type>pom</type>
</dependency>
### AndroidX
To use with AndroidX you have to set targetSdkVersion for your project to 28 and add following 2 lines in ```gradle.properties``` file.
```
android.useAndroidX=true
android.enableJetifier=true
```

### Proguard
Expand Down
20 changes: 7 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,22 @@
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.novoda:bintray-release:0.8.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.android.tools.build:gradle:4.1.2'
}
}

plugins {
id 'maven-publish'
}

allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()
maven { url "https://jitpack.io" }
}
}

Expand Down
49 changes: 28 additions & 21 deletions chatkit/build.gradle
Original file line number Diff line number Diff line change
@@ -1,43 +1,50 @@
apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'
apply plugin: 'maven-publish'

android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
compileSdkVersion 29
buildToolsVersion '29.0.2'

defaultConfig {
minSdkVersion 14
versionCode 1
versionName "0.3.2"

versionName '0.4.1'
consumerProguardFiles 'proguard.txt'
}
android {
lintOptions {
abortOnError false
}
}
}

publish {
groupId = 'com.github.stfalcon'
artifactId = 'chatkit'
publishVersion = '0.3.2'
desc = 'ChatKit - is a library designed to simplify the development of UI for such a trivial task as chat. It have flexible possibilities for styling, customizing and data management'
licences = ['Apache-2.0']
uploadName = 'ChatKit'
website = 'https://github.com/stfalcon-studio/ChatKit.git'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

ext {
supportVersion = '27.1.1'
flexboxVersion = '1.0.0'
afterEvaluate {
publishing {
publications {
// Creates a Maven publication called "release".
release(MavenPublication) {
// Applies the component for the release build variant.
from components.release

// You can then customize attributes of the publication as shown below.
groupId = 'com.github.stfalcon'
artifactId = 'chatkit'
version = '0.4.1'
}
}
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation "com.android.support:appcompat-v7:$supportVersion"
implementation "com.android.support:design:$supportVersion"
implementation "com.google.android:flexbox:$flexboxVersion"
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation "com.google.android:flexbox:1.0.0"
implementation 'androidx.recyclerview:recyclerview:1.1.0'
}
3 changes: 1 addition & 2 deletions chatkit/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.stfalcon.chatkit">
<manifest package="com.stfalcon.chatkit">

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@

package com.stfalcon.chatkit.commons;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import androidx.annotation.Nullable;

/**
* Callback for implementing images loading in message list
*/
Expand Down
11 changes: 6 additions & 5 deletions chatkit/src/main/java/com/stfalcon/chatkit/commons/Style.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.support.annotation.AttrRes;
import android.support.annotation.ColorRes;
import android.support.annotation.DimenRes;
import android.support.annotation.DrawableRes;
import android.support.v4.content.ContextCompat;
import android.util.AttributeSet;
import android.util.TypedValue;

import androidx.annotation.AttrRes;
import androidx.annotation.ColorRes;
import androidx.annotation.DimenRes;
import androidx.annotation.DrawableRes;
import androidx.core.content.ContextCompat;

import com.stfalcon.chatkit.R;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@

package com.stfalcon.chatkit.commons;

import android.support.v7.widget.RecyclerView;
import android.view.View;

import androidx.recyclerview.widget.RecyclerView;

/**
* Base ViewHolder
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ public interface IUser {
* Returns the user's id
*
* @return the user's id
* */
*/
String getId();

/**
* Returns the user's name
*
* @return the user's name
* */
*/
String getName();

/**
* Returns the user's avatar image url
*
* @return the user's avatar image url
* */
*/
String getAvatar();
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

package com.stfalcon.chatkit.commons.models;

import android.support.annotation.Nullable;
import androidx.annotation.Nullable;

import com.stfalcon.chatkit.messages.MessageHolders;

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
package com.stfalcon.chatkit.dialogs;

import android.content.Context;
import android.support.annotation.Nullable;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.SimpleItemAnimator;
import android.util.AttributeSet;

import androidx.annotation.Nullable;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.SimpleItemAnimator;

import com.stfalcon.chatkit.commons.models.IDialog;

/**
Expand Down Expand Up @@ -73,7 +74,7 @@ public void setAdapter(Adapter adapter) {
* @param adapter Adapter. Must extend DialogsListAdapter
* @param <DIALOG> Dialog model class
*/
public <DIALOG extends IDialog>
public <DIALOG extends IDialog<?>>
void setAdapter(DialogsListAdapter<DIALOG> adapter) {
setAdapter(adapter, false);
}
Expand All @@ -85,7 +86,7 @@ void setAdapter(DialogsListAdapter<DIALOG> adapter) {
* @param reverseLayout weather to use reverse layout for layout manager.
* @param <DIALOG> Dialog model class
*/
public <DIALOG extends IDialog>
public <DIALOG extends IDialog<?>>
void setAdapter(DialogsListAdapter<DIALOG> adapter, boolean reverseLayout) {
SimpleItemAnimator itemAnimator = new DefaultItemAnimator();
itemAnimator.setSupportsChangeAnimations(false);
Expand Down
Loading