本文整理了Java中android.widget.ImageView.getLocationInWindow()
方法的一些代码示例,展示了ImageView.getLocationInWindow()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ImageView.getLocationInWindow()
方法的具体详情如下:
包路径:android.widget.ImageView
类名称:ImageView
方法名:getLocationInWindow
暂无
代码示例来源:origin: ZieIony/Carbon
public Point getLocationInWindow() {
int[] outLocation = new int[2];
super.getLocationInWindow(outLocation);
return new Point(outLocation[0], outLocation[1]);
}
代码示例来源:origin: Demidong/ClockView
@Override
public void onClick(View v) {
int[] start_location = new int[2];
iv1.getLocationInWindow(start_location);//获取点击商品图片的位置
shopCarLayout.doAnim(iv1.getDrawable(),start_location,tv_myDr);
}
});
代码示例来源:origin: Demidong/ClockView
@Override
public void onClick(View v) {
int[] start_location = new int[2];
iv2.getLocationInWindow(start_location);//获取点击商品图片的位置
shopCarLayout.doAnim(iv2.getDrawable(),start_location,tv_myDr);
}
});
代码示例来源:origin: Demidong/ClockView
@Override
public void onClick(View v) {
int[] start_location = new int[2];
iv3.getLocationInWindow(start_location);//获取点击商品图片的位置
shopCarLayout.doAnim(iv3.getDrawable(),start_location,tv_myDr);
}
});
代码示例来源:origin: Demidong/ClockView
@Override
public void onClick(View v) {
int[] start_location = new int[2];
iv4.getLocationInWindow(start_location);//获取点击商品图片的位置
shopCarLayout.doAnim(iv4.getDrawable(),start_location,tv_myDr);
}
});
代码示例来源:origin: githubliruiyuan/Animation
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (isPause){
isPause = false;
} else {
if (0 == preIndex){
if (0 == rocketX){
int[] location = new int[2];
page_one_rocket.getLocationInWindow(location);
rocketX = location[0];
rocketY = location[1];
center.getLocationOnScreen(location);
centerX = location[0];
centerY = location[1];
pageOneStart();
}
}
}
}
代码示例来源:origin: stackoverflow.com
thumbImageView.getLocationInWindow(thumbViewLocation);
代码示例来源:origin: Lichenwei-Dev/BezierView
@Override
public void onClick(View v) {
//获取商品坐标
int[] goodsPoint = new int[2];
iv_shop_add.getLocationInWindow(goodsPoint);
//获取购物车坐标
int[] shoppingCartPoint = new int[2];
iv_shop_cart.getLocationInWindow(shoppingCartPoint);
//生成商品View
GoodsView goodsView = new GoodsView(ShoppingCartActivity.this);
goodsView.setCircleStartPoint(goodsPoint[0], goodsPoint[1]);
goodsView.setCircleEndPoint(shoppingCartPoint[0] + mShoppingCartWidth / 2, shoppingCartPoint[1]);
//添加View并执行动画
mViewGroup.addView(goodsView);
goodsView.startAnimation();
}
});
代码示例来源:origin: songguoping/AndroidDemoSummary
goodsImg.getLocationInWindow(startLoc);
mTvShopCart.getLocationInWindow(endLoc);
代码示例来源:origin: fengyongge/shopcar
@Override
public void onClick(View v) {
int count = ((MainActivity)context).getSelectedItemCountById(list.get(position).getProduct_id());
Log.i("fyg","iv_add"+String.valueOf(count));
if (count < 1) {
viewholder.iv_remove.setAnimation(getShowAnimation());
viewholder.iv_remove.setVisibility(View.VISIBLE);
viewholder.tv_acount.setVisibility(View.VISIBLE);
}
((MainActivity)context).handlerCarNum(1,list.get(position),true);
catograyAdapter.notifyDataSetChanged();
int[] loc = new int[2];
viewholder.iv_add.getLocationInWindow(loc);
for (int i=0;i<loc.length;i++)
{
Log.i("fyg",String.valueOf(loc[i]));
}
int[] startLocation = new int[2];// 一个整型数组,用来存储按钮的在屏幕的X、Y坐标
v.getLocationInWindow(startLocation);// 这是获取购买按钮的在屏幕的X、Y坐标(这也是动画开始的坐标)
ImageView ball = new ImageView(context);
ball.setImageResource(R.drawable.number);
((MainActivity)context).setAnim(ball, startLocation);// 开始执行动画
}
});
代码示例来源:origin: leibing8912/BezierCurveShoppingCart
goodsImg.getLocationInWindow(startLoc);
mShoppingCartIv.getLocationInWindow(endLoc);
代码示例来源:origin: stackoverflow.com
imgView.getLocationInWindow(location);
代码示例来源:origin: wudifamo/Neleme
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top, right, bottom);
if (iv_shop_car == null) {
iv_shop_car = findViewById(R.id.iv_shop_car);
car_badge = findViewById(R.id.car_badge);
car_limit = findViewById(R.id.car_limit);
tv_amount = findViewById(R.id.tv_amount);
shoprl = findViewById(R.id.car_rl);
shoprl.setOnClickListener(new toggleCar());
carLoc = new int[2];
iv_shop_car.getLocationInWindow(carLoc);
carLoc[0] = carLoc[0] + iv_shop_car.getWidth() / 2 - ViewUtils.dip2px(getContext(), 10);
}
}
代码示例来源:origin: rocky0116/orderDishes
int[] endLocation = new int[2];// 存储动画结束位置的X、Y坐标
shopCart.getLocationInWindow(endLocation);// shopCart是那个购物车
内容来源于网络,如有侵权,请联系作者删除!