本文整理汇总了Java中android.view.View.findViewWithTag方法的典型用法代码示例。如果您正苦于以下问题:Java View.findViewWithTag方法的具体用法?Java View.findViewWithTag怎么用?Java View.findViewWithTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.View
的用法示例。
在下文中一共展示了View.findViewWithTag方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setRetryListener
import android.view.View; //导入方法依赖的package包/类
/**
* 设置各状态点击重试事件
*
* @param statusView 状态界面
*/
private void setRetryListener(View statusView) {
View retry = statusView.findViewWithTag(StatusLayout.TAG_RETRY);
if (null != retry) {
retry.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
mListener = mLayout.getOnStatusRetryListener();
if (null != mListener) {
if (null != mLayout) {
mLayout.showLoading();
}
mListener.onRetry();
}
}
});
}
}
示例2: onClick
import android.view.View; //导入方法依赖的package包/类
@Override
public void onClick(View view) {
// Extract day selected
ViewGroup dayOfMonthContainer = (ViewGroup) view;
String tagId = (String) dayOfMonthContainer.getTag();
tagId = tagId.substring(mContext.getString(R.string.day_of_month_container).length(), tagId.length());
final TextView dayOfMonthText = (TextView) view.findViewWithTag(mContext.getString(R.string.day_of_month_text) + tagId);
// Fire event
final Calendar calendar = Calendar.getInstance();
calendar.setFirstDayOfWeek(mFirstDayOfWeek);
calendar.setTime(mCalendar.getTime());
calendar.set(Calendar.DAY_OF_MONTH, Integer.valueOf(dayOfMonthText.getText().toString()));
setDateAsSelected(calendar.getTime());
//Set the current day color
setCurrentDay(mCalendar.getTime());
if (mOnDateClickListener != null) {
mOnDateClickListener.onDateClick(calendar.getTime());
}
}
示例3: refreshVisibleItems
import android.view.View; //导入方法依赖的package包/类
private void refreshVisibleItems(int firstPosition, int curPosition, int offset) {
for (int i = curPosition - offset; i <= curPosition + offset; i++) {
View itemView = getChildAt(i - firstPosition);
if (itemView == null) {
continue;
}
TextView textView = (TextView) itemView.findViewWithTag(ITEM_TAG_TEXT);
refreshTextView(i, curPosition, itemView, textView);
}
}
示例4: setRetryListener
import android.view.View; //导入方法依赖的package包/类
/**
* 设置各状态点击重试事件
*
* @param statusView 状态界面
*/
private void setRetryListener(View statusView) {
View retry = statusView.findViewWithTag(TAG_RETRY);
if (null != retry) {
retry.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
if (null != mListener) {
showLoading();
mListener.onRetry();
}
}
});
}
}
示例5: onCreate
import android.view.View; //导入方法依赖的package包/类
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
application = getWalletApplication();
config = application.getConfiguration();
wallet = application.getWallet();
setContentView(R.layout.wallet_content);
final View exchangeRatesFragment = findViewById(R.id.wallet_main_twopanes_exchange_rates);
if (exchangeRatesFragment != null)
exchangeRatesFragment.setVisibility(Constants.ENABLE_EXCHANGE_RATES ? View.VISIBLE : View.GONE);
if (savedInstanceState == null) {
final View contentView = findViewById(android.R.id.content);
final View slideInLeftView = contentView.findViewWithTag("slide_in_left");
if (slideInLeftView != null)
slideInLeftView.startAnimation(AnimationUtils.loadAnimation(this, R.anim.slide_in_left));
final View slideInRightView = contentView.findViewWithTag("slide_in_right");
if (slideInRightView != null)
slideInRightView.startAnimation(AnimationUtils.loadAnimation(this, R.anim.slide_in_right));
final View slideInTopView = contentView.findViewWithTag("slide_in_top");
if (slideInTopView != null)
slideInTopView.startAnimation(AnimationUtils.loadAnimation(this, R.anim.slide_in_top));
final View slideInBottomView = contentView.findViewWithTag("slide_in_bottom");
if (slideInBottomView != null)
slideInBottomView.startAnimation(AnimationUtils.loadAnimation(this, R.anim.slide_in_bottom));
checkSavedCrashTrace();
}
config.touchLastUsed();
handleIntent(getIntent());
final FragmentManager fragmentManager = getFragmentManager();
MaybeMaintenanceFragment.add(fragmentManager);
AlertDialogsFragment.add(fragmentManager);
}
示例6: onSelectorModeExit
import android.view.View; //导入方法依赖的package包/类
@Override
public void onSelectorModeExit() {
final View rootView = ((Activity) nestedRecyclerView.getContext())
.findViewById(R.id.root_view);
//find selector-toolbar
final Toolbar selectorToolbar = rootView
.findViewWithTag(SelectorModeUtil.SELECTOR_TOOLBAR_TAG);
//animate selector-toolbar
selectorToolbar.animate()
.translationY(-selectorToolbar.getHeight())
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
if (theme.darkStatusBarIcons()) {
Util.setDarkStatusBarIcons(rootView);
} else {
Util.setLightStatusBarIcons(rootView);
}
//remove selector-toolbar
((ViewGroup) rootView).removeView(selectorToolbar);
}
});
}
示例7: IconHolder
import android.view.View; //导入方法依赖的package包/类
IconHolder(View itemView) {
super(itemView);
ivIcon = (ImageView) itemView.findViewWithTag("iv");
}
示例8: CateHolder
import android.view.View; //导入方法依赖的package包/类
CateHolder(View itemView) {
super(itemView);
tvCate = (TextView) itemView.findViewWithTag("cate");
tvCount = (TextView) itemView.findViewWithTag("count");
}