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

The following are Jave code examples for showing how to use hashCode() 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: Navigation-bar   File: FlowRadioGroup.java   Source Code and License Vote up 7 votes
public void onChildViewAdded(View parent, View child) {
    if (parent == FlowRadioGroup.this && child instanceof RadioButton) {
        int id = child.getId();
        // generates an id if it's missing
        if (id == View.NO_ID) {
            id = child.hashCode();
            child.setId(id);
        }
        ((RadioButton) child)
                .setOnCheckedChangeListener(mChildOnCheckedChangeListener);
    } else if (parent == FlowRadioGroup.this
            && child instanceof ViewGroup) {// 如果是复合控件
        // 查找并设置id
        setCheckedId((ViewGroup) child);
    }

    if (mOnHierarchyChangeListener != null) {
        mOnHierarchyChangeListener.onChildViewAdded(parent, child);
    }
}
 
Example 2
Project: ToggleButtons   File: ToggleGroup.java   Source Code and License Vote up 7 votes
/**
 * {@inheritDoc}
 */
public void onChildViewAdded(View parent, View child) {
    if (parent == ToggleGroup.this && child instanceof CompoundButton) {
        int id = child.getId();
        // generates an id if it's missing
        if (id == View.NO_ID) {
         if (Build.VERSION.SDK_INT < 17)
          id = child.hashCode();
         else
             id = View.generateViewId();
            child.setId(id);
        }
        ((CompoundButton) child).setOnCheckedChangeListener(mChildOnCheckedChangeListener);
    }

    if (mOnHierarchyChangeListener != null) {
        mOnHierarchyChangeListener.onChildViewAdded(parent, child);
    }
}
 
Example 3
Project: GitHub   File: ViewAnimator.java   Source Code and License Vote up 6 votes
/**
 * Cancels any existing animations for given View.
 */
public void cancelExistingAnimation(@NonNull final View view) {
    int hashCode = view.hashCode();
    Animator animator = mAnimators.get(hashCode);
    if (animator != null) {
        animator.end();
        mAnimators.remove(hashCode);
    }
}
 
Example 4
Project: MyCalendar   File: ViewAnimator.java   Source Code and License Vote up 6 votes
/**
 * Cancels any existing animations for given View.
 */
public void cancelExistingAnimation(@NonNull final View view) {
    int hashCode = view.hashCode();
    Animator animator = mAnimators.get(hashCode);
    if (animator != null) {
        animator.end();
        mAnimators.remove(hashCode);
    }
}
 
Example 5
Project: Bigbang   File: CardListAdapter.java   Source Code and License Vote up 6 votes
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    for (View view:cardViews){
        if(view.hashCode()%TYPE_STEP==viewType){
            AbsCard cardView= (AbsCard) view;
            return new ViewHolder(cardView);
        }
    }
    return null;
}
 
Example 6
Project: GitHub   File: ViewAware.java   Source Code and License Vote up 5 votes
@Override
public int getId() {
	View view = viewRef.get();
	return view == null ? super.hashCode() : view.hashCode();
}
 
Example 7
Project: HeaderRecyclerViewAdapter-Android   File: HeaderRecyclerViewAdapter.java   Source Code and License Vote up 5 votes
public final int getViewTypeForHeaderOrFooter(@NonNull View view) {
    return view.hashCode();
}
 
Example 8
Project: PaoMovie   File: MultiCallback.java   Source Code and License Vote up 5 votes
@Override
public int hashCode() {
	final View view = get();
	return view != null ? view.hashCode() : 0;
}
 
Example 9
Project: PaoMovie   File: MultiCallback.java   Source Code and License Vote up 5 votes
@Override
public int hashCode() {
	final View view = get();
	return view != null ? view.hashCode() : 0;
}
 
Example 10
Project: letv   File: ViewAware.java   Source Code and License Vote up 5 votes
public int getId() {
    View view = (View) this.viewRef.get();
    return view == null ? super.hashCode() : view.hashCode();
}
 
Example 11
Project: GifImageLoader   File: ViewAware.java   Source Code and License Vote up 5 votes
@Override
public int getId() {
	View view = viewRef.get();
	return view == null ? super.hashCode() : view.hashCode();
}
 
Example 12
Project: boohee_v5.6   File: ViewAware.java   Source Code and License Vote up 5 votes
public int getId() {
    View view = (View) this.viewRef.get();
    return view == null ? super.hashCode() : view.hashCode();
}
 
Example 13
Project: ImageLoaderSupportGif   File: ViewAware.java   Source Code and License Vote up 5 votes
@Override
public int getId() {
    View view = viewRef.get();
    return view == null ? super.hashCode() : view.hashCode();
}