edit: I asked this question again.. Because I can not take true answer on this question so you can look for full answer
And I try to this icon clickable but I can not do . How can I makte this icons clickevent do you know any way.
and these icons are not in xml. They are on draw able folder. this is gives methods can we use it methods about gama wheel library
And this is my trying
package com.myproject.gama;
import java.util.Arrays;
import com.digitalaria.gama.wheel.Wheel;
import com.digitalaria.gama.wheel.WheelAdapter;
import android.app.Activity;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.*;
import android.view.View.*;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.util.Log;
public class SampleWheelActivity extends Activity {
private static final String TAG = SampleWheelActivity.class.getSimpleName();
private Wheel wheel;
public WheelAdapter<Adapter> adapter;
private Resources res;
public int[] icons = {
R.drawable.icon1, R.drawable.icon0 , R.drawable.icon2};
ImageView t;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
init();
}
private void init() {
res = getApplicationContext().getResources();
wheel = (Wheel) findViewById(R.id.wheel);
wheel.setItems(getDrawableFromData(icons));
wheel.setWheelDiameter(400);
}
/*I am delete it
@Override
public void onResume(){
//first try
ImageView iconsa[] = new ImageView[icons[0]];
ImageView iconsa1[] = new ImageView[icons[1]];
ImageView iconsa2[] = new ImageView[icons[1]];
//second try
String arrayStr = Arrays.toString (icons);
String[] aa = arrayStr.split(",");
String[] strArray = new String[] {arrayStr};
for(int i=0;i<strArray.length;i++)
{
iconsa[i] = new ImageView(wheel.getContext());
iconsa[i].setOnClickListener(onClick());
}
}
*/
// I am delete it too
/* private OnClickListener onClick() {
Toast.makeText(SampleWheelActivity.this, "test", Toast.LENGTH_SHORT).show();
// how can ı Reach id on drawable folder icons
return null;
} */
private Drawable[] getDrawableFromData(int[] data) {
Drawable[] ret = new Drawable[data.length];
for (int i = 0; i < data.length; i++) {
ret[i] = res.getDrawable(data[i]);
}
return ret;
}
//I try it but how can I give clickevent icon1.. when click icon1 it should go other page
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
ImageView iv = new ImageView(this);
iv.setImageResource(R.drawable.icon1);
}
}