Skip to content

Commit

Permalink
解决焦点问题
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfusheng committed Sep 5, 2016
1 parent 4a8c14b commit 43eae9c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class TravelingAdapter extends BaseListAdapter<TravelingEntity> {

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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -34,7 +35,7 @@ protected void getView(List<ChannelEntity> list, ListView listView) {
listView.addHeaderView(view);
}

private void dealWithTheView(List<ChannelEntity> list) {
private void dealWithTheView(final List<ChannelEntity> list) {
int size = list.size();

if (size <= 4) {
Expand All @@ -49,6 +50,12 @@ private void dealWithTheView(List<ChannelEntity> 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) {
}
});
}

}
1 change: 0 additions & 1 deletion app/src/main/res/layout/item_channel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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">

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}

Expand Down

0 comments on commit 43eae9c

Please sign in to comment.