Skip to content
Snippets Groups Projects
Commit 83ae4e0b authored by Jawnnypoo's avatar Jawnnypoo
Browse files

Use external AdapterFlowLayout

parent 3eb6fd64
No related branches found
No related tags found
No related merge requests found
Pipeline #
Loading
Loading
@@ -17,6 +17,7 @@ import android.widget.FrameLayout;
import android.widget.Spinner;
import android.widget.TextView;
 
import com.commit451.adapterflowlayout.AdapterFlowLayout;
import com.commit451.easycallback.EasyCallback;
import com.commit451.easycallback.NullBodyException;
import com.commit451.gitlab.App;
Loading
Loading
@@ -32,7 +33,6 @@ import com.commit451.gitlab.model.api.Member;
import com.commit451.gitlab.model.api.Milestone;
import com.commit451.gitlab.model.api.Project;
import com.commit451.gitlab.navigation.Navigator;
import com.commit451.gitlab.view.AdapterFlowLayout;
import com.commit451.teleprinter.Teleprinter;
 
import org.parceler.Parcels;
Loading
Loading
package com.commit451.gitlab.view;
import android.content.Context;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.widget.Adapter;
import com.commit451.adapterlayout.AdapterLayoutDelegate;
import com.wefika.flowlayout.FlowLayout;
/**
* {@link com.wefika.flowlayout.FlowLayout} with {@link Adapter} support.
*/
public class AdapterFlowLayout extends FlowLayout {
private AdapterLayoutDelegate mAdapterLayoutDelegate;
public AdapterFlowLayout(Context context) {
super(context);
}
public AdapterFlowLayout(Context context, AttributeSet attrs) {
super(context, attrs);
}
public AdapterFlowLayout(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
public void setAdapter(RecyclerView.Adapter adapter) {
if (mAdapterLayoutDelegate == null) {
mAdapterLayoutDelegate = new AdapterLayoutDelegate(this);
}
mAdapterLayoutDelegate.setAdapter(adapter);
}
@Nullable
public RecyclerView.Adapter getAdapter() {
if (mAdapterLayoutDelegate != null) {
return mAdapterLayoutDelegate.getAdapter();
}
return null;
}
@Nullable
public RecyclerView.ViewHolder getViewHolderAt(int index) {
return mAdapterLayoutDelegate.getViewHolderAt(index);
}
}
\ No newline at end of file
Loading
Loading
@@ -5,9 +5,9 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
 
import com.commit451.adapterflowlayout.AdapterFlowLayout;
import com.commit451.gitlab.R;
import com.commit451.gitlab.adapter.IssueLabelsAdapter;
import com.commit451.gitlab.view.AdapterFlowLayout;
 
import java.util.Collection;
 
Loading
Loading
Loading
Loading
@@ -140,7 +140,7 @@
android:visibility="gone"
android:background="?attr/selectableItemBackground">
 
<com.commit451.gitlab.view.AdapterFlowLayout
<com.commit451.adapterflowlayout.AdapterFlowLayout
android:id="@+id/list_labels"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Loading
Loading
<?xml version="1.0" encoding="utf-8"?>
<com.commit451.gitlab.view.AdapterFlowLayout
<com.commit451.adapterflowlayout.AdapterFlowLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/adapter_layout"
android:layout_width="match_parent"
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment