本文整理汇总了Java中android.view.View.hashCode方法的典型用法代码示例。如果您正苦于以下问题:Java View.hashCode方法的具体用法?Java View.hashCode怎么用?Java View.hashCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.View
的用法示例。
在下文中一共展示了View.hashCode方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onChildViewAdded
import android.view.View; //导入方法依赖的package包/类
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);
}
}
示例2: onChildViewAdded
import android.view.View; //导入方法依赖的package包/类
/**
* {@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);
}
}
示例3: cancelExistingAnimation
import android.view.View; //导入方法依赖的package包/类
/**
* 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);
}
}
示例4: onCreateViewHolder
import android.view.View; //导入方法依赖的package包/类
@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;
}
示例5: getId
import android.view.View; //导入方法依赖的package包/类
@Override
public int getId() {
View view = viewRef.get();
return view == null ? super.hashCode() : view.hashCode();
}
示例6: getViewTypeForHeaderOrFooter
import android.view.View; //导入方法依赖的package包/类
public final int getViewTypeForHeaderOrFooter(@NonNull View view) {
return view.hashCode();
}
示例7: hashCode
import android.view.View; //导入方法依赖的package包/类
@Override
public int hashCode() {
final View view = get();
return view != null ? view.hashCode() : 0;
}
示例8: getId
import android.view.View; //导入方法依赖的package包/类
public int getId() {
View view = (View) this.viewRef.get();
return view == null ? super.hashCode() : view.hashCode();
}
示例9: getId
import android.view.View; //导入方法依赖的package包/类
@Override
public int getId() {
View view = viewRef.get();
return view == null ? super.hashCode() : view.hashCode();
}