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

Migrate to AndroidX #249

Open
wants to merge 2 commits into
base: master
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
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.android.tools.build:gradle:3.3.1'
classpath 'com.novoda:bintray-release:0.8.0'

// NOTE: Do not place your application dependencies here; they belong
Expand Down
18 changes: 9 additions & 9 deletions chatkit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'

android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
compileSdkVersion 28
buildToolsVersion '28.0.3'

defaultConfig {
minSdkVersion 14
versionCode 1
versionName "0.3.3"
versionName "1.0.0"
consumerProguardFiles 'proguard.txt'
}
android {
Expand All @@ -21,22 +21,22 @@ android {
publish {
groupId = 'com.github.stfalcon'
artifactId = 'chatkit'
publishVersion = '0.3.3'
publishVersion = '1.0.0'
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'
}

ext {
supportVersion = '27.1.1'
flexboxVersion = '1.0.0'
androidxVersion = '1.0.2'
materialVersion = '1.1.0-alpha03'
flexboxVersion = '1.1.0'
}

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

implementation "com.android.support:appcompat-v7:$supportVersion"
implementation "com.android.support:design:$supportVersion"
implementation "androidx.appcompat:appcompat:$androidxVersion"
implementation "com.google.android.material:material:$materialVersion"
implementation "com.google.android:flexbox:$flexboxVersion"
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

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,16 +20,17 @@
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 com.stfalcon.chatkit.R;

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

/**
* Base class for chat component styles
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

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 @@ -16,8 +16,8 @@

package com.stfalcon.chatkit.commons.models;

import android.support.annotation.Nullable;
import com.stfalcon.chatkit.messages.MessageHolders;
import androidx.annotation.Nullable;

/*
* Created by troy379 on 28.03.17.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@
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 com.stfalcon.chatkit.commons.models.IDialog;

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

/**
* Component for displaying list of dialogs
*/
Expand All @@ -51,7 +52,7 @@ public DialogsList(Context context, @Nullable AttributeSet attrs, int defStyle)
protected void onAttachedToWindow() {
super.onAttachedToWindow();

LinearLayoutManager layout = new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false);
LinearLayoutManager layout = new LinearLayoutManager(getContext(), RecyclerView.VERTICAL, false);
SimpleItemAnimator animator = new DefaultItemAnimator();

setLayoutManager(layout);
Expand Down Expand Up @@ -90,8 +91,7 @@ void setAdapter(DialogsListAdapter<DIALOG> adapter, boolean reverseLayout) {
SimpleItemAnimator itemAnimator = new DefaultItemAnimator();
itemAnimator.setSupportsChangeAnimations(false);

LinearLayoutManager layoutManager = new LinearLayoutManager(getContext(),
LinearLayoutManager.VERTICAL, reverseLayout);
LinearLayoutManager layoutManager = new LinearLayoutManager(getContext(), RecyclerView.VERTICAL, reverseLayout);

setItemAnimator(itemAnimator);
setLayoutManager(layoutManager);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@

import android.graphics.Typeface;
import android.graphics.drawable.GradientDrawable;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
Expand All @@ -42,6 +39,10 @@
import java.util.Date;
import java.util.List;

import androidx.annotation.LayoutRes;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;

import static android.view.View.GONE;
import static android.view.View.VISIBLE;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package com.stfalcon.chatkit.messages;

import android.support.annotation.LayoutRes;
import android.support.annotation.NonNull;
import android.support.v4.view.ViewCompat;
import android.text.Spannable;
import android.text.method.LinkMovementMethod;
import android.util.SparseArray;
Expand All @@ -27,6 +24,10 @@
import java.util.Date;
import java.util.List;

import androidx.annotation.LayoutRes;
import androidx.annotation.NonNull;
import androidx.core.view.ViewCompat;

/*
* Created by troy379 on 31.03.17.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.support.v4.view.ViewCompat;
import android.support.v4.widget.Space;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.AttributeSet;
Expand All @@ -29,11 +27,11 @@
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.RelativeLayout;
import android.widget.Space;
import android.widget.TextView;

import com.stfalcon.chatkit.R;

import java.lang.reflect.Field;
import androidx.core.view.ViewCompat;

/**
* Component for input outcoming messages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.support.annotation.ColorInt;
import android.support.annotation.DrawableRes;
import android.support.v4.graphics.drawable.DrawableCompat;
import android.util.AttributeSet;

import com.stfalcon.chatkit.R;
import com.stfalcon.chatkit.commons.Style;

import androidx.annotation.ColorInt;
import androidx.annotation.DrawableRes;
import androidx.core.graphics.drawable.DrawableCompat;

/**
* Style for MessageInputStyle customization by xml attributes
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@
package com.stfalcon.chatkit.messages;

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 com.stfalcon.chatkit.commons.models.IMessage;

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

/**
* Component for displaying list of messages
*/
Expand Down Expand Up @@ -79,7 +80,7 @@ void setAdapter(MessagesListAdapter<MESSAGE> adapter, boolean reverseLayout) {
itemAnimator.setSupportsChangeAnimations(false);

LinearLayoutManager layoutManager = new LinearLayoutManager(getContext(),
LinearLayoutManager.VERTICAL, reverseLayout);
RecyclerView.VERTICAL, reverseLayout);

setItemAnimator(itemAnimator);
setLayoutManager(layoutManager);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.support.annotation.LayoutRes;
import android.support.v7.widget.RecyclerView;
import android.text.Spannable;
import android.text.method.LinkMovementMethod;
import android.util.SparseArray;
Expand All @@ -41,6 +39,9 @@
import java.util.Date;
import java.util.List;

import androidx.annotation.LayoutRes;
import androidx.recyclerview.widget.RecyclerView;

/**
* Adapter for {@link MessagesList}.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@
import android.graphics.Color;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.support.annotation.ColorInt;
import android.support.annotation.DrawableRes;
import android.support.v4.graphics.drawable.DrawableCompat;
import android.util.AttributeSet;

import com.stfalcon.chatkit.R;
import com.stfalcon.chatkit.commons.Style;

import androidx.annotation.ColorInt;
import androidx.annotation.DrawableRes;
import androidx.core.graphics.drawable.DrawableCompat;

/**
* Style for MessagesListStyle customization by xml attributes
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package com.stfalcon.chatkit.messages;

import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.StaggeredGridLayoutManager;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.StaggeredGridLayoutManager;

class RecyclerScrollMoreListener
extends RecyclerView.OnScrollListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
import android.graphics.drawable.Drawable;
import android.graphics.drawable.LayerDrawable;
import android.net.Uri;
import android.support.annotation.DimenRes;
import android.support.annotation.NonNull;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.AppCompatImageView;
import android.util.AttributeSet;
import android.widget.ImageView;

import androidx.annotation.DimenRes;
import androidx.annotation.NonNull;
import androidx.appcompat.widget.AppCompatImageView;
import androidx.core.content.ContextCompat;

/**
* Thanks to Joonho Kim (https://github.com/pungrue26) for his lightweight SelectableRoundedImageView,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@
import android.util.AttributeSet;
import android.view.View;

import androidx.appcompat.widget.AppCompatImageView;

/**
* ImageView with mask what described with Bézier Curves
*/

public class ShapeImageView extends android.support.v7.widget.AppCompatImageView {
public class ShapeImageView extends AppCompatImageView {

private Path path;

public ShapeImageView(Context context) {
Expand Down
4 changes: 2 additions & 2 deletions chatkit/src/main/res/layout/view_message_input.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
android:layout_height="wrap_content"
android:layout_centerVertical="true"/>

<android.support.v4.widget.Space
<Space
android:id="@id/attachmentButtonSpace"
android:layout_width="0dp"
android:layout_height="0dp"
Expand All @@ -28,7 +28,7 @@
android:layout_toStartOf="@id/sendButtonSpace"
android:inputType="textAutoCorrect|textAutoComplete|textMultiLine|textCapSentences"/>

<android.support.v4.widget.Space
<Space
android:id="@id/sendButtonSpace"
android:layout_width="0dp"
android:layout_height="0dp"
Expand Down
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Tue Jul 03 14:43:10 EEST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-bin.zip
Loading