Yorumlar
nasıl bir komut hedef telefonda bi eylem mi gerçekleştirilmesini istiyorsun
Ahmet Burak Demirkoparan
Ahmet Burak Demirkoparan
Ahmet Burak Demirkoparan
10 yıl 2 ay önce
Teşekkürler. Layout kısmını seçince properties kısmında seçilebiliyormuş.
Ahmet Burak Demirkoparan
10 yıl 2 ay önce
Teşekkür ederim. Benim aklıma da tek o geldi ama keyleri neye gönderebiliriz? Textview' a falan mı?
Ahmet Burak Demirkoparan
10 yıl 2 ay önce
<?xml version="1.0" encoding="utf-8"?>
imageList.length-1) {
curIndex = 0;
}
imageSwitcher.setInAnimation(AnimationUtils
.loadAnimation(Main.this,
android.R.anim.fade_in));
imageSwitcher.setOutAnimation(AnimationUtils
.loadAnimation(Main.this,
android.R.anim.fade_out));
imageSwitcher.setImageResource(imageList[curIndex]);
}
});
imageSwitcher = (ImageSwitcher) findViewById(R.id.imageSwitcher);
imageSwitcher.setFactory(this);
imageSwitcher.setInAnimation(AnimationUtils.loadAnimation(this,
android.R.anim.fade_in));
imageSwitcher.setOutAnimation(AnimationUtils.loadAnimation(this,
android.R.anim.fade_out));
imageSwitcher.setImageResource(imageList[curIndex]);
imageSwitcher.setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
downX = (int) event.getX();
Log.i("event.getX()", " downX " + downX);
return true;
}
else if (event.getAction() == MotionEvent.ACTION_UP) {
upX = (int) event.getX();
Log.i("event.getX()", " upX " + downX);
if (upX - downX > 100) {
curIndex--;
if (curIndex < 0) {
curIndex = imageList.length - 1;
}
imageSwitcher.setInAnimation(AnimationUtils
.loadAnimation(Main.this,
android.R.anim.fade_in));
imageSwitcher.setOutAnimation(AnimationUtils
.loadAnimation(Main.this,
android.R.anim.fade_out));
imageSwitcher.setImageResource(imageList[curIndex]);
}
else if (downX - upX > -100) {
curIndex++;
if (curIndex > imageList.length-1) {
curIndex = 0;
}
imageSwitcher.setInAnimation(AnimationUtils
.loadAnimation(Main.this,
android.R.anim.fade_in));
imageSwitcher.setOutAnimation(AnimationUtils
.loadAnimation(Main.this,
android.R.anim.fade_out));
imageSwitcher.setImageResource(imageList[curIndex]);
}
return true;
}
return false;
}
});
}
@Override
public View makeView() {
ImageView i = new ImageView(this);
i.setScaleType(ImageView.ScaleType.FIT_CENTER);
return i;
}
}
Ahmet Burak Demirkoparan
Ahmet Burak Demirkoparan
10 yıl 3 ay önce
Demek istediğinizi anladım. Peki buna benzer bir örnek var mı acaba? Teşekkürler..
Ahmet Burak Demirkoparan
10 yıl 3 ay önce
Teşekkürler Ahmet.