Skip to content
Merged
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
4 changes: 4 additions & 0 deletions AndroidCustomGridView/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.source=1.6
2 changes: 1 addition & 1 deletion AndroidCustomGridView/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

# Project target.
target=android-14
target=android-21
4 changes: 2 additions & 2 deletions AndroidCustomGridView/res/layout/row_grid.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
android:layout_marginTop="5dp"
android:orientation="vertical"
android:padding="5dp"
android:clickable="true"
android:clickable="false"
android:background="@drawable/grid_color_selector"
android:focusable="true">
android:focusable="false">

<ImageView
android:id="@+id/image"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
package com.javatechig.gridview;

import java.util.ArrayList;
import android.os.Bundle;

import android.app.Activity;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.GridView;
import android.widget.Toast;



/**
*
* @author javatechig {@link http://javatechig.com}
Expand All @@ -33,6 +37,7 @@ protected void onCreate(Bundle savedInstanceState) {
gridView.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View v,
int position, long id) {
Log.e("item", "clicked");
Toast.makeText(MainActivity.this, position + "#Selected",
Toast.LENGTH_SHORT).show();
}
Expand Down