diff --git a/app/src/main/java/com/sunfusheng/StickyHeaderListView/adapter/TravelingAdapter.java b/app/src/main/java/com/sunfusheng/StickyHeaderListView/adapter/TravelingAdapter.java index 56b156c..3577a0c 100644 --- a/app/src/main/java/com/sunfusheng/StickyHeaderListView/adapter/TravelingAdapter.java +++ b/app/src/main/java/com/sunfusheng/StickyHeaderListView/adapter/TravelingAdapter.java @@ -26,7 +26,7 @@ public class TravelingAdapter extends BaseListAdapter { private boolean isNoData; private int mHeight; - public static final int ONE_SCREEN_COUNT = 7; // 一屏能显示的个数,这个根据屏幕高度和各自的需求定 + public static final int ONE_SCREEN_COUNT = 8; // 一屏能显示的个数,这个根据屏幕高度和各自的需求定 public static final int ONE_REQUEST_COUNT = 10; // 一次请求的个数 public TravelingAdapter(Context context) { diff --git a/app/src/main/java/com/sunfusheng/StickyHeaderListView/view/HeaderChannelViewView.java b/app/src/main/java/com/sunfusheng/StickyHeaderListView/view/HeaderChannelViewView.java index 831c215..8d79930 100644 --- a/app/src/main/java/com/sunfusheng/StickyHeaderListView/view/HeaderChannelViewView.java +++ b/app/src/main/java/com/sunfusheng/StickyHeaderListView/view/HeaderChannelViewView.java @@ -2,6 +2,7 @@ import android.app.Activity; import android.view.View; +import android.widget.AdapterView; import android.widget.ListView; import com.sunfusheng.StickyHeaderListView.R; @@ -34,7 +35,7 @@ protected void getView(List list, ListView listView) { listView.addHeaderView(view); } - private void dealWithTheView(List list) { + private void dealWithTheView(final List list) { int size = list.size(); if (size <= 4) { @@ -49,6 +50,12 @@ private void dealWithTheView(List list) { HeaderChannelAdapter adapter = new HeaderChannelAdapter(mContext, list); gvChannel.setAdapter(adapter); + + gvChannel.setOnItemClickListener(new AdapterView.OnItemClickListener() { + @Override + public void onItemClick(AdapterView parent, View view, int position, long id) { + } + }); } } diff --git a/app/src/main/res/layout/item_channel.xml b/app/src/main/res/layout/item_channel.xml index 1a6b483..d3f78c4 100644 --- a/app/src/main/res/layout/item_channel.xml +++ b/app/src/main/res/layout/item_channel.xml @@ -4,7 +4,6 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/ripple_item_clicked_with_mask" - android:clickable="true" android:gravity="center_vertical" android:minHeight="90dp"> diff --git a/build.gradle b/build.gradle index 6d7ef37..a980a43 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.1.2' + classpath 'com.android.tools.build:gradle:2.1.3' } }