Java Code Examples for android.view.View.findViewWithTag()

The following are Jave code examples for showing how to use findViewWithTag() of the android.view.View class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: Widgets   File: StaLayoutHelper.java   Source Code and License Vote up 6 votes
/**
 * 设置各状态点击重试事件
 *
 * @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();
                }
            }
        });
    }
}
 
Example 2
Project: DMS   File: CalendarView.java   Source Code and License Vote up 6 votes
@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());
    }
}
 
Example 3
Project: GitHub   File: WheelListView.java   Source Code and License Vote up 5 votes
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);
    }
}
 
Example 4
Project: Widgets   File: StatusLayout.java   Source Code and License Vote up 5 votes
/**
 * 设置各状态点击重试事件
 *
 * @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();
                }
            }
        });
    }
}
 
Example 5
Project: okwallet   File: WalletActivity.java   Source Code and License Vote up 5 votes
@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);
}
 
Example 6
Project: Camera-Roll-Android-App   File: NestedRecyclerViewAlbumHolder.java   Source Code and License Vote up 5 votes
@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);
                }
            });
}
 
Example 7
Project: NanoIconPackLite   File: LiteIconActivityV1.java   Source Code and License Vote up 4 votes
IconHolder(View itemView) {
    super(itemView);

    ivIcon = (ImageView) itemView.findViewWithTag("iv");
}
 
Example 8
Project: NanoIconPackLite   File: LiteIconActivityV2.java   Source Code and License Vote up 4 votes
IconHolder(View itemView) {
    super(itemView);

    ivIcon = (ImageView) itemView.findViewWithTag("iv");
}
 
Example 9
Project: NanoIconPackLite   File: LiteIconActivity.java   Source Code and License Vote up 4 votes
CateHolder(View itemView) {
    super(itemView);

    tvCate = (TextView) itemView.findViewWithTag("cate");
    tvCount = (TextView) itemView.findViewWithTag("count");
}
 
Example 10
Project: NanoIconPackLite   File: LiteIconActivity.java   Source Code and License Vote up 4 votes
IconHolder(View itemView) {
    super(itemView);

    ivIcon = (ImageView) itemView.findViewWithTag("iv");
}