本文整理汇总了Java中android.support.v7.widget.CardView.setPreventCornerOverlap方法的典型用法代码示例。如果您正苦于以下问题:Java CardView.setPreventCornerOverlap方法的具体用法?Java CardView.setPreventCornerOverlap怎么用?Java CardView.setPreventCornerOverlap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v7.widget.CardView
的用法示例。
在下文中一共展示了CardView.setPreventCornerOverlap方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateView
import android.support.v7.widget.CardView; //导入方法依赖的package包/类
@Override
public View onCreateView(final LayoutInflater inflater, final ViewGroup container,
final Bundle savedInstanceState) {
final View view = inflater.inflate(R.layout.wallet_address_fragment, container, false);
currentAddressQrView = (ImageView) view.findViewById(R.id.bitcoin_address_qr);
final CardView currentAddressQrCardView = (CardView) view.findViewById(R.id.bitcoin_address_qr_card);
currentAddressQrCardView.setCardBackgroundColor(Color.WHITE);
currentAddressQrCardView.setPreventCornerOverlap(false);
currentAddressQrCardView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(final View v) {
handleShowQRCode();
}
});
return view;
}
示例2: onCreateViewHolder
import android.support.v7.widget.CardView; //导入方法依赖的package包/类
@Override
public RecyclerView.ViewHolder onCreateViewHolder(final ViewGroup parent, final int viewType) {
if (viewType == VIEW_TYPE_TRANSACTION) {
if (useCards) {
final CardView cardView = (CardView) inflater.inflate(R.layout.transaction_row_card, parent, false);
cardView.setPreventCornerOverlap(false);
cardView.setUseCompatPadding(true);
return new TransactionViewHolder(cardView);
} else {
return new TransactionViewHolder(inflater.inflate(R.layout.transaction_row, parent, false));
}
} else if (viewType == VIEW_TYPE_WARNING) {
return new WarningViewHolder(inflater.inflate(R.layout.transaction_row_warning, parent, false));
} else {
throw new IllegalStateException("unknown type: " + viewType);
}
}
示例3: onCreateViewHolder
import android.support.v7.widget.CardView; //导入方法依赖的package包/类
@Override
public AttackHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.layout_history_attack, parent, false);
AttackHolder attackHolder = new AttackHolder(itemView);
itemView.setOnClickListener(mOnClickListener);
attackHolder.delete.setOnClickListener(mOnClickListener);
attackHolder.delete.setOnLongClickListener(mOnLongClickListener);
CardView cardView = (CardView) attackHolder.itemView.findViewById(R.id.card);
cardView.setPreventCornerOverlap(false);
return attackHolder;
}
示例4: initZoomRegionView
import android.support.v7.widget.CardView; //导入方法依赖的package包/类
/**
* Init the ZoomRegionView for navigate into image when user zoom in
*/
private void initZoomRegionView() {
if (mZoomRegionView == null) {
Bitmap init = Bitmap.createBitmap(getWidth(), getHeight(), Bitmap.Config.ARGB_8888);
mContentBitmap = init.copy(Bitmap.Config.ARGB_8888, true);
init.recycle();
mContentCanvas = new Canvas(mContentBitmap);
FrameLayout.LayoutParams layoutParams = new LayoutParams(getWidth() / 4, getHeight() / 4,
Gravity.TOP | Gravity.END);
layoutParams.setMargins(12, 12, 12, 12);
mZoomRegionCardView = new CardView(getContext());
mZoomRegionCardView.setLayoutParams(layoutParams);
mZoomRegionCardView.setPreventCornerOverlap(true);
mZoomRegionCardView.setRadius(0f);
mZoomRegionCardView.setUseCompatPadding(true);
mZoomRegionCardView.setVisibility(View.INVISIBLE);
CardView.LayoutParams childLayoutParams = new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT);
mZoomRegionView = new ZoomRegionView(getContext());
mZoomRegionView.setLayoutParams(childLayoutParams);
mZoomRegionView.setScaleType(ImageView.ScaleType.CENTER_CROP);
mZoomRegionView.setOnZoomRegionListener(new ZoomRegionView.OnZoomRegionListener() {
@Override
public void onZoomRegionMoved(Rect newRect) {
mFromZoomRegion = true;
mZoomCenterX = newRect.centerX() * 4;
mZoomCenterY = newRect.centerY() * 4;
invalidate();
}
});
mZoomRegionCardView.addView(mZoomRegionView);
addView(mZoomRegionCardView);
}
}
示例5: onCreateView
import android.support.v7.widget.CardView; //导入方法依赖的package包/类
@Override
public View onCreateView(final LayoutInflater inflater, final ViewGroup container,
final Bundle savedInstanceState) {
final View view = inflater.inflate(R.layout.request_coins_fragment, container, false);
qrView = (ImageView) view.findViewById(R.id.request_coins_qr);
final CardView qrCardView = (CardView) view.findViewById(R.id.request_coins_qr_card);
qrCardView.setCardBackgroundColor(Color.WHITE);
qrCardView.setPreventCornerOverlap(false);
qrCardView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(final View v) {
BitmapFragment.show(getFragmentManager(), qrCodeBitmap.getBitmap());
}
});
final CurrencyAmountView btcAmountView = (CurrencyAmountView) view.findViewById(R.id.request_coins_amount_btc);
btcAmountView.setCurrencySymbol(config.getFormat().code());
btcAmountView.setInputFormat(config.getMaxPrecisionFormat());
btcAmountView.setHintFormat(config.getFormat());
final CurrencyAmountView localAmountView = (CurrencyAmountView) view
.findViewById(R.id.request_coins_amount_local);
localAmountView.setInputFormat(Constants.LOCAL_FORMAT);
localAmountView.setHintFormat(Constants.LOCAL_FORMAT);
amountCalculatorLink = new CurrencyCalculatorLink(btcAmountView, localAmountView);
acceptBluetoothPaymentView = (CheckBox) view.findViewById(R.id.request_coins_accept_bluetooth_payment);
acceptBluetoothPaymentView.setVisibility(Bluetooth.canListen(bluetoothAdapter) ? View.VISIBLE : View.GONE);
acceptBluetoothPaymentView.setChecked(Bluetooth.canListen(bluetoothAdapter) && bluetoothAdapter.isEnabled());
acceptBluetoothPaymentView.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(final CompoundButton buttonView, final boolean isChecked) {
if (Bluetooth.canListen(bluetoothAdapter) && isChecked) {
if (bluetoothAdapter.isEnabled()) {
maybeStartBluetoothListening();
} else {
// ask for permission to enable bluetooth
startActivityForResult(new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE),
REQUEST_CODE_ENABLE_BLUETOOTH);
}
} else {
stopBluetoothListening();
}
updateView();
}
});
initiateRequestView = (TextView) view.findViewById(R.id.request_coins_fragment_initiate_request);
return view;
}