From 1050159bde469c18ef59721cf1b13043eaa25fdb Mon Sep 17 00:00:00 2001 From: Maxime Jallu Date: Fri, 29 Sep 2017 14:18:22 +0200 Subject: [PATCH] feat(adapter): add kotlin adapter --- .../jmaxime/adapters/CheckableAdapter.java | 4 +- .../adapters/DividerItemDecoration.java | 201 ++++++++++++++++++ .../jmaxime/adapters/EasyPagerAdapter.java | 10 +- .../jmaxime/adapters/RecyclerAdapter.java | 18 +- .../jmaxime/interfaces/IAdapterChanged.java | 12 ++ .../interfaces/IBaseCommunication.java | 13 ++ .../android/jmaxime/interfaces/IViewType.java | 12 ++ .../interfaces/ViewCheckableCallback.java | 19 ++ .../viewholder/JRecyclerViewHolder.java | 138 ------------ .../jmaxime/adapters/DividerItemDecoration.kt | 89 -------- .../jmaxime/interfaces/IAdapterChanged.kt | 12 -- .../jmaxime/interfaces/IBaseCommunication.kt | 18 -- .../android/jmaxime/interfaces/IViewType.kt | 12 -- .../interfaces/ViewCheckableCallback.kt | 19 -- 14 files changed, 273 insertions(+), 304 deletions(-) create mode 100644 adapter/src/main/java/com/android/jmaxime/adapters/DividerItemDecoration.java create mode 100644 adapter/src/main/java/com/android/jmaxime/interfaces/IAdapterChanged.java create mode 100644 adapter/src/main/java/com/android/jmaxime/interfaces/IBaseCommunication.java create mode 100644 adapter/src/main/java/com/android/jmaxime/interfaces/IViewType.java create mode 100644 adapter/src/main/java/com/android/jmaxime/interfaces/ViewCheckableCallback.java delete mode 100644 adapter/src/main/java/com/android/jmaxime/viewholder/JRecyclerViewHolder.java delete mode 100644 adapter/src/main/kotlin/com/android/jmaxime/adapters/DividerItemDecoration.kt delete mode 100644 adapter/src/main/kotlin/com/android/jmaxime/interfaces/IAdapterChanged.kt delete mode 100644 adapter/src/main/kotlin/com/android/jmaxime/interfaces/IBaseCommunication.kt delete mode 100644 adapter/src/main/kotlin/com/android/jmaxime/interfaces/IViewType.kt delete mode 100644 adapter/src/main/kotlin/com/android/jmaxime/interfaces/ViewCheckableCallback.kt diff --git a/adapter/src/main/java/com/android/jmaxime/adapters/CheckableAdapter.java b/adapter/src/main/java/com/android/jmaxime/adapters/CheckableAdapter.java index d043e60..7745f9c 100644 --- a/adapter/src/main/java/com/android/jmaxime/adapters/CheckableAdapter.java +++ b/adapter/src/main/java/com/android/jmaxime/adapters/CheckableAdapter.java @@ -2,7 +2,7 @@ import com.android.jmaxime.factory.ViewHolderFactory; import com.android.jmaxime.interfaces.ViewCheckableCallback; -import com.android.jmaxime.viewholder.JRecyclerViewHolder; +import com.android.jmaxime.viewholder.RecyclerViewHolder; import java.util.HashMap; import java.util.List; @@ -18,7 +18,7 @@ public class CheckableAdapter extends RecyclerAdapter implements ViewCheck private HashMap mCheckedMap = new HashMap<>(); - public CheckableAdapter(Class> viewHolderType) { + public CheckableAdapter(Class> viewHolderType) { super(viewHolderType); setCommunication(this); } diff --git a/adapter/src/main/java/com/android/jmaxime/adapters/DividerItemDecoration.java b/adapter/src/main/java/com/android/jmaxime/adapters/DividerItemDecoration.java new file mode 100644 index 0000000..be5698b --- /dev/null +++ b/adapter/src/main/java/com/android/jmaxime/adapters/DividerItemDecoration.java @@ -0,0 +1,201 @@ +package com.android.jmaxime.adapters; + + +import android.content.Context; +import android.content.res.TypedArray; +import android.graphics.Canvas; +import android.graphics.Rect; +import android.graphics.drawable.Drawable; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; +import android.view.View; + +@SuppressWarnings("WeakerAccess") +public class DividerItemDecoration extends RecyclerView.ItemDecoration { + + private static final String INVALID = "invalid orientation"; + private static final int[] ATTRS = new int[]{ + android.R.attr.listDivider + }; + + public static final int LIST_HORIZONTAL = LinearLayoutManager.HORIZONTAL; + public static final int LIST_VERTICAL = LinearLayoutManager.VERTICAL; + public static final int GRID_STROKE = 3; + public static final int GRID_FILL = 4; + private static Drawable mDivider; + private int mOrientation; + + /** + * Custom constructor + * + * @param context + * @param orientation + */ + public DividerItemDecoration(final Context context, final int orientation) { + final TypedArray a = context.obtainStyledAttributes(ATTRS); + if (mDivider == null){ + mDivider = a.getDrawable(0); + } + a.recycle(); + setOrientation(orientation); + } + + /** + * Set the orientation of the underlying grid / list + * + * @param orientation must be + * {@link com.android.jmaxime.adapters.DividerItemDecoration#LIST_HORIZONTAL} + * {@link com.android.jmaxime.adapters.DividerItemDecoration#LIST_VERTICAL} + * {@link com.android.jmaxime.adapters.DividerItemDecoration#GRID_STROKE} + * {@link com.android.jmaxime.adapters.DividerItemDecoration#GRID_FILL} + */ + public void setOrientation(final int orientation) { + if (orientation != LIST_HORIZONTAL && + orientation != LIST_VERTICAL && + orientation != GRID_STROKE && + orientation != GRID_FILL) { + throw new IllegalArgumentException(INVALID); + } + mOrientation = orientation; + } + + @Override + public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) { + super.onDraw(c, parent, state); + if (mDivider != null) { + switch (mOrientation) { + case LIST_VERTICAL: + drawVertical(c, parent); + break; + case LIST_HORIZONTAL: + drawHorizontal(c, parent); + break; + case GRID_FILL: + drawGridFill(c, parent); + break; + case GRID_STROKE: + drawGridStroke(c, parent); + break; + default: + throw new IllegalArgumentException(INVALID); + } + } + } + + /** + * Draw vertical divider in parent + * + * @param c canvas + * @param parent recycler view + */ + public void drawVertical(final Canvas c, final RecyclerView parent) { + final int left = parent.getPaddingLeft(); + final int right = parent.getWidth() - parent.getPaddingRight(); + + final int childCount = parent.getChildCount(); + for (int i = 0; i < childCount; i++) { + final View child = parent.getChildAt(i); + final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child + .getLayoutParams(); + final int top = child.getBottom() + params.bottomMargin; + final int bottom = top + mDivider.getIntrinsicHeight(); + mDivider.setBounds(left, top, right, bottom); + mDivider.draw(c); + } + } + + /** + * Draw horizontal divider in parent + * + * @param c Canvas + * @param parent Recycler view + */ + public void drawHorizontal(final Canvas c, final RecyclerView parent) { + final int top = parent.getPaddingTop(); + final int bottom = parent.getHeight() - parent.getPaddingBottom(); + + final int childCount = parent.getChildCount(); + for (int i = 0; i < childCount; i++) { + final View child = parent.getChildAt(i); + final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child + .getLayoutParams(); + final int left = child.getRight() + params.rightMargin; + final int right = left + mDivider.getIntrinsicHeight(); + mDivider.setBounds(left, top, right, bottom); + mDivider.draw(c); + } + } + + /** + * Remove both horizontal and vertical divider in parent + * + * @param c Canvas + * @param parent Recycler view + */ + public void drawGridStroke(final Canvas c, final RecyclerView parent) { + final int childCount = parent.getChildCount(); + for (int i = 0; i < childCount; i++) { + final View child = parent.getChildAt(i); + final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child + .getLayoutParams(); + final int left = child.getLeft() - params.leftMargin; + final int right = child.getRight() + params.rightMargin; + final int top = child.getTop() - params.topMargin; + final int bottom = child.getBottom() + params.bottomMargin; + mDivider.setBounds(left, top, left + mDivider.getIntrinsicHeight(), bottom); + mDivider.draw(c); + mDivider.setBounds(right - mDivider.getIntrinsicHeight(), top, right, bottom); + mDivider.draw(c); + mDivider.setBounds(left, top, right, top + mDivider.getIntrinsicHeight()); + mDivider.draw(c); + mDivider.setBounds(left, bottom - mDivider.getIntrinsicHeight(), right, bottom); + mDivider.draw(c); + mDivider.draw(c); + } + } + + /** + * Draw both horizontal and vertical divider in parent + * + * @param c Canvas + * @param parent Recler view + */ + public void drawGridFill(final Canvas c, final RecyclerView parent) { + final int childCount = parent.getChildCount(); + for (int i = 0; i < childCount; i++) { + final View child = parent.getChildAt(i); + final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child + .getLayoutParams(); + final int left = child.getLeft() - params.leftMargin; + final int right = child.getRight() + params.rightMargin; + final int top = child.getTop() - params.topMargin; + final int bottom = child.getBottom() + params.bottomMargin; + mDivider.setBounds(left, top, right, bottom); + mDivider.draw(c); + } + } + + @Override + public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) { + super.getItemOffsets(outRect, view, parent, state); + if (mDivider != null) { + switch (mOrientation) { + case LIST_VERTICAL: + outRect.set(0, 0, 0, mDivider.getIntrinsicHeight()); + break; + case LIST_HORIZONTAL: + outRect.set(0, 0, mDivider.getIntrinsicWidth(), 0); + break; + case GRID_FILL: + outRect.set(mDivider.getIntrinsicWidth(), mDivider.getIntrinsicWidth(), mDivider.getIntrinsicWidth(), mDivider.getIntrinsicWidth()); + break; + case GRID_STROKE: + outRect.set(0, 0, 0, 0); + break; + default: + throw new IllegalArgumentException(INVALID); + } + } + } +} + diff --git a/adapter/src/main/java/com/android/jmaxime/adapters/EasyPagerAdapter.java b/adapter/src/main/java/com/android/jmaxime/adapters/EasyPagerAdapter.java index 99bbe01..9601b58 100644 --- a/adapter/src/main/java/com/android/jmaxime/adapters/EasyPagerAdapter.java +++ b/adapter/src/main/java/com/android/jmaxime/adapters/EasyPagerAdapter.java @@ -6,7 +6,7 @@ import com.android.jmaxime.factory.ViewHolderFactory; import com.android.jmaxime.interfaces.IBaseCommunication; -import com.android.jmaxime.viewholder.JRecyclerViewHolder; +import com.android.jmaxime.viewholder.RecyclerViewHolder; import java.util.ArrayList; import java.util.List; @@ -23,21 +23,21 @@ public class EasyPagerAdapter extends PagerAdapter { private final List mItems; private final ViewHolderFactory mFactory; - public EasyPagerAdapter(Class> viewHolder) { + public EasyPagerAdapter(Class> viewHolder) { this(new ArrayList<>(), viewHolder); } - public EasyPagerAdapter(List items, Class> viewHolder) { + public EasyPagerAdapter(List items, Class> viewHolder) { this(items, viewHolder, null); } - public EasyPagerAdapter(List items, Class> viewHolder, IBaseCommunication callback) { + public EasyPagerAdapter(List items, Class> viewHolder, IBaseCommunication callback) { mItems = items; mFactory = new ViewHolderFactory<>(viewHolder, callback); } @Override public Object instantiateItem(ViewGroup container, int position) { - JRecyclerViewHolder vh = mFactory.createVH(container, 0); + RecyclerViewHolder vh = mFactory.createVH(container, 0); vh.bind(mItems.get(position)); container.addView(vh.itemView); return vh.itemView; diff --git a/adapter/src/main/java/com/android/jmaxime/adapters/RecyclerAdapter.java b/adapter/src/main/java/com/android/jmaxime/adapters/RecyclerAdapter.java index 6544a11..ce2f240 100644 --- a/adapter/src/main/java/com/android/jmaxime/adapters/RecyclerAdapter.java +++ b/adapter/src/main/java/com/android/jmaxime/adapters/RecyclerAdapter.java @@ -9,7 +9,7 @@ import com.android.jmaxime.interfaces.IAdapterChanged; import com.android.jmaxime.interfaces.IBaseCommunication; import com.android.jmaxime.interfaces.IViewType; -import com.android.jmaxime.viewholder.JRecyclerViewHolder; +import com.android.jmaxime.viewholder.RecyclerViewHolder; import java.security.AccessControlException; import java.util.ArrayList; @@ -24,7 +24,7 @@ * Use this Class for :
* ... {DOCUMENTATION} */ -public class RecyclerAdapter extends RecyclerView.Adapter> { +public class RecyclerAdapter extends RecyclerView.Adapter> { private List mTList; private ViewHolderFactory mFactory; @@ -38,19 +38,19 @@ public RecyclerAdapter(ViewHolderFactory factory) { this(new ArrayList<>(), factory); } - public RecyclerAdapter(Class> viewHolderType) { + public RecyclerAdapter(Class> viewHolderType) { this(new ArrayList<>(), viewHolderType, null); } - public RecyclerAdapter(Class> viewHolderType, @Nullable IBaseCommunication callback) { + public RecyclerAdapter(Class> viewHolderType, @Nullable IBaseCommunication callback) { this(new ArrayList<>(), viewHolderType, callback); } - public RecyclerAdapter(List TList, Class> viewHolderType) { + public RecyclerAdapter(List TList, Class> viewHolderType) { this(TList, viewHolderType, null); } - public RecyclerAdapter(List TList, Class> viewHolderType, @Nullable IBaseCommunication callback) { + public RecyclerAdapter(List TList, Class> viewHolderType, @Nullable IBaseCommunication callback) { this(TList, new ViewHolderFactory<>(viewHolderType, callback)); } @@ -65,7 +65,7 @@ public void setFactory(ViewHolderFactory factory) { } @Override - public JRecyclerViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { + public RecyclerViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { if (mFactory == null) { throw new AccessControlException("mFactory is not instancied. thanks use setFactory() method."); } @@ -75,7 +75,7 @@ public JRecyclerViewHolder onCreateViewHolder(ViewGroup parent, int viewType) @Override - public void onBindViewHolder(JRecyclerViewHolder holder, int position) { + public void onBindViewHolder(RecyclerViewHolder holder, int position) { holder.setItem(getItem(position)); holder.setBound(false); holder.bind(holder.getItem()); @@ -105,7 +105,7 @@ public int getItemViewType(int position) { return super.getItemViewType(position); } - public void putViewType(int viewType, Class> viewHolder){ + public void putViewType(int viewType, Class> viewHolder){ mFactory.putViewType(viewType, viewHolder); } diff --git a/adapter/src/main/java/com/android/jmaxime/interfaces/IAdapterChanged.java b/adapter/src/main/java/com/android/jmaxime/interfaces/IAdapterChanged.java new file mode 100644 index 0000000..2957ebc --- /dev/null +++ b/adapter/src/main/java/com/android/jmaxime/interfaces/IAdapterChanged.java @@ -0,0 +1,12 @@ +package com.android.jmaxime.interfaces; + +/** + * @author Maxime Jallu + * @since 29/09/2017 + *

+ * Use this Class for :
+ * {DOCUMENTATION} + */ +public interface IAdapterChanged { + void onItemCountChange(int count); +} diff --git a/adapter/src/main/java/com/android/jmaxime/interfaces/IBaseCommunication.java b/adapter/src/main/java/com/android/jmaxime/interfaces/IBaseCommunication.java new file mode 100644 index 0000000..f15f7ec --- /dev/null +++ b/adapter/src/main/java/com/android/jmaxime/interfaces/IBaseCommunication.java @@ -0,0 +1,13 @@ +package com.android.jmaxime.interfaces; + + +public interface IBaseCommunication { + + default void onDeleteClicked(int position, T item) { + /*nothing*/ + } + + default void onEditClicked(int position, T item) { + /*nothing*/ + } +} diff --git a/adapter/src/main/java/com/android/jmaxime/interfaces/IViewType.java b/adapter/src/main/java/com/android/jmaxime/interfaces/IViewType.java new file mode 100644 index 0000000..b20fba8 --- /dev/null +++ b/adapter/src/main/java/com/android/jmaxime/interfaces/IViewType.java @@ -0,0 +1,12 @@ +package com.android.jmaxime.interfaces; + +/** + * @author Maxime Jallu + * @since 29/09/2017 + *

+ * Use this Class for :
+ * {DOCUMENTATION} + */ +public interface IViewType { + int getItemViewType(); +} diff --git a/adapter/src/main/java/com/android/jmaxime/interfaces/ViewCheckableCallback.java b/adapter/src/main/java/com/android/jmaxime/interfaces/ViewCheckableCallback.java new file mode 100644 index 0000000..d182bfc --- /dev/null +++ b/adapter/src/main/java/com/android/jmaxime/interfaces/ViewCheckableCallback.java @@ -0,0 +1,19 @@ +package com.android.jmaxime.interfaces; + +import android.annotation.SuppressLint; + +/** + * @author Maxime Jallu + * @since 29/09/2017 + *

+ * Use this Class for :
+ * {DOCUMENTATION} + */ +@SuppressLint("NewApi") +public interface ViewCheckableCallback extends IBaseCommunication { + boolean isChecked(T item); + default boolean isCheckable(T item) { + return true; + } + void put(String key, boolean value); +} diff --git a/adapter/src/main/java/com/android/jmaxime/viewholder/JRecyclerViewHolder.java b/adapter/src/main/java/com/android/jmaxime/viewholder/JRecyclerViewHolder.java deleted file mode 100644 index cff531d..0000000 --- a/adapter/src/main/java/com/android/jmaxime/viewholder/JRecyclerViewHolder.java +++ /dev/null @@ -1,138 +0,0 @@ -package com.android.jmaxime.viewholder; - - -import android.annotation.SuppressLint; -import android.content.Context; -import android.graphics.drawable.Drawable; -import android.support.annotation.ColorRes; -import android.support.annotation.DrawableRes; -import android.support.annotation.PluralsRes; -import android.support.annotation.StringRes; -import android.support.v4.content.ContextCompat; -import android.support.v7.widget.RecyclerView; -import android.util.Log; -import android.view.View; -import android.widget.ImageView; - -import com.android.jmaxime.adapter.R; -import com.android.jmaxime.interfaces.IBaseCommunication; -import com.squareup.picasso.Picasso; - -import butterknife.ButterKnife; - -/** - * @author Maxime Jallu - * @link ArrayRecyclerAdapter - *

- * Tools this class:
- *

- * getContext() - * getColor(@ColorRes res) - * getDrawable(@DrawableRes res) - * @since 30/06/2016 - *

- * Create for CubeInStore - Android (Decathlon) - *

- * Use this Class for :
- * make it easier ViewHolder com.android.jmaxime.adapter recyclerView, define T type of item - * Must to use in ArrayRecyclerAdapter - */ -public abstract class JRecyclerViewHolder extends RecyclerView.ViewHolder { - - private T mItem; - private boolean isBound; - private IBaseCommunication mCommunication; - - /** - * This super() auto BindViews with ButterKnife
- * - * ButterKnife.bind(this, itemView); - * - * - * @param itemView the Views holder - */ - @SuppressLint("NewApi") - public JRecyclerViewHolder(View itemView) { - super(itemView); - ButterKnife.bind(this, itemView); - } - - public abstract void bind(final T item); - - protected Context getContext() { - return itemView.getContext(); - } - - protected final String getString(@StringRes int stringRes) { - return getContext().getString(stringRes); - } - - protected final String getString(@StringRes int stringRes, String string) { - return getContext().getResources().getString(stringRes, string); - } - - protected final String getQuantityString(@PluralsRes int pluralRes, int quantity) { - return getContext().getResources().getQuantityString(pluralRes, quantity, quantity); - } - - protected final String getQuantityStringFormat(@PluralsRes int pluralRes, int quantity) { - return getContext().getResources().getQuantityString(pluralRes, quantity, quantity); - } - - protected final int getColor(@ColorRes int colorResId) { - return ContextCompat.getColor(getContext(), colorResId); - } - - protected final Drawable getDrawable(@DrawableRes int drawableResId) { - return ContextCompat.getDrawable(getContext(), drawableResId); - } - - protected final void showPicture(ImageView picture, String url) { - Picasso.with(picture.getContext()) - .load(url) - .placeholder(R.drawable.no_image) - .error(R.drawable.no_image) - .fit() - .centerInside() - .into(picture); - } - - protected boolean isBound() { - return isBound; - } - - public void setBound(boolean bound) { - isBound = bound; - } - - public T getItem() { - return mItem; - } - - public void setItem(T item) { - mItem = item; - } - - protected final void onClickRemoveItem() { - getDispatcher().onDeleteClicked(getAdapterPosition(), getItem()); - } - - protected final void onClickEditItem() { - getDispatcher().onEditClicked(getAdapterPosition(), getItem()); - } - - protected > I getDispatcher() { - I i = null; - try { - //noinspection unchecked - i = (I) mCommunication; - } catch (ClassCastException e) { - Log.e("ViewHolderFactory", "getInterfaceCallback: ", e); - } - return i; - } - - public void setCommunication(IBaseCommunication interfaceCallback) { - mCommunication = interfaceCallback; - } -} diff --git a/adapter/src/main/kotlin/com/android/jmaxime/adapters/DividerItemDecoration.kt b/adapter/src/main/kotlin/com/android/jmaxime/adapters/DividerItemDecoration.kt deleted file mode 100644 index 3fa5dbe..0000000 --- a/adapter/src/main/kotlin/com/android/jmaxime/adapters/DividerItemDecoration.kt +++ /dev/null @@ -1,89 +0,0 @@ -package com.android.jmaxime.adapter - -import android.content.Context -import android.content.res.TypedArray -import android.graphics.Canvas -import android.graphics.Rect -import android.graphics.drawable.Drawable -import android.support.v7.widget.LinearLayoutManager -import android.support.v7.widget.RecyclerView -import android.view.View - - -class DividerItemDecoration(context: Context, orientation: Int) : RecyclerView.ItemDecoration() { - - private val mDivider: Drawable? - - private var mOrientation: Int = 0 - - init { - val a = context.obtainStyledAttributes(ATTRS) - mDivider = a.getDrawable(0) - a.recycle() - setOrientation(orientation) - } - - fun setOrientation(orientation: Int) { - if (orientation != HORIZONTAL_LIST && orientation != VERTICAL_LIST) { - throw IllegalArgumentException("invalid orientation") - } - mOrientation = orientation - } - - override fun onDraw(c: Canvas?, parent: RecyclerView?) { - if (mOrientation == VERTICAL_LIST) { - drawVertical(c, parent) - } else { - drawHorizontal(c, parent) - } - } - - fun drawVertical(c: Canvas?, parent: RecyclerView?) { - val left = parent!!.paddingLeft - val right = parent.width - parent.paddingRight - - val childCount = parent.childCount - for (i in 0..childCount - 1) { - val child = parent.getChildAt(i) - val params = child - .layoutParams as RecyclerView.LayoutParams - val top = child.bottom + params.bottomMargin - val bottom = top + mDivider!!.intrinsicHeight - mDivider.setBounds(left, top, right, bottom) - mDivider.draw(c!!) - } - } - - fun drawHorizontal(c: Canvas?, parent: RecyclerView?) { - val top = parent!!.paddingTop - val bottom = parent.height - parent.paddingBottom - - val childCount = parent.childCount - for (i in 0..childCount - 1) { - val child = parent.getChildAt(i) - val params = child - .layoutParams as RecyclerView.LayoutParams - val left = child.right + params.rightMargin - val right = left + mDivider!!.intrinsicHeight - mDivider.setBounds(left, top, right, bottom) - mDivider.draw(c!!) - } - } - - override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State?) { - if (mOrientation == VERTICAL_LIST) { - outRect.set(0, 0, 0, mDivider!!.intrinsicHeight) - } else { - outRect.set(0, 0, mDivider!!.intrinsicWidth, 0) - } - } - - companion object { - - private val ATTRS = intArrayOf(android.R.attr.listDivider) - - val HORIZONTAL_LIST = LinearLayoutManager.HORIZONTAL - - val VERTICAL_LIST = LinearLayoutManager.VERTICAL - } -} diff --git a/adapter/src/main/kotlin/com/android/jmaxime/interfaces/IAdapterChanged.kt b/adapter/src/main/kotlin/com/android/jmaxime/interfaces/IAdapterChanged.kt deleted file mode 100644 index fd447d7..0000000 --- a/adapter/src/main/kotlin/com/android/jmaxime/interfaces/IAdapterChanged.kt +++ /dev/null @@ -1,12 +0,0 @@ -package com.android.jmaxime.interfaces - -/** - * @author Maxime Jallu - * @since 13/09/2017 - * - * Use this Class for :
- * {DOCUMENTATION} - */ -interface IAdapterChanged { - fun onItemCountChange(count: Int) -} \ No newline at end of file diff --git a/adapter/src/main/kotlin/com/android/jmaxime/interfaces/IBaseCommunication.kt b/adapter/src/main/kotlin/com/android/jmaxime/interfaces/IBaseCommunication.kt deleted file mode 100644 index fa70d10..0000000 --- a/adapter/src/main/kotlin/com/android/jmaxime/interfaces/IBaseCommunication.kt +++ /dev/null @@ -1,18 +0,0 @@ -package com.android.jmaxime.interfaces - -/** - * @author Maxime Jallu - * @since 10/05/2017 - * Use this Class for :

- * ... {DOCUMENTATION} - */ -interface IBaseCommunication { - - fun onDeleteClicked(position: Int, item : T) { - /*nothing*/ - } - - fun onEditClicked(position: Int, item: T) { - /*nothing*/ - } -} diff --git a/adapter/src/main/kotlin/com/android/jmaxime/interfaces/IViewType.kt b/adapter/src/main/kotlin/com/android/jmaxime/interfaces/IViewType.kt deleted file mode 100644 index 6847bc0..0000000 --- a/adapter/src/main/kotlin/com/android/jmaxime/interfaces/IViewType.kt +++ /dev/null @@ -1,12 +0,0 @@ -package com.android.jmaxime.interfaces - -/** - * @author Maxime Jallu - * @since 13/09/2017 - * - * Use this Class for :
- * {DOCUMENTATION} - */ -interface IViewType { - fun getItemViewType(): Int -} \ No newline at end of file diff --git a/adapter/src/main/kotlin/com/android/jmaxime/interfaces/ViewCheckableCallback.kt b/adapter/src/main/kotlin/com/android/jmaxime/interfaces/ViewCheckableCallback.kt deleted file mode 100644 index 2c699bd..0000000 --- a/adapter/src/main/kotlin/com/android/jmaxime/interfaces/ViewCheckableCallback.kt +++ /dev/null @@ -1,19 +0,0 @@ -package com.android.jmaxime.interfaces - -import android.annotation.SuppressLint - -/** - * @author Maxime Jallu - * @since 26/09/2017 - * - * Use this Class for :
- * {DOCUMENTATION} - */ -interface ViewCheckableCallback : IBaseCommunication { - abstract fun isChecked(item: T): Boolean - @SuppressLint("NewApi") - fun isCheckable(item: T): Boolean { - return true - } - fun put(key: String, value: Boolean) -} \ No newline at end of file