当前位置: 首页>>代码示例>>Java>>正文


Java View.equals方法代码示例

本文整理汇总了Java中android.view.View.equals方法的典型用法代码示例。如果您正苦于以下问题:Java View.equals方法的具体用法?Java View.equals怎么用?Java View.equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.view.View的用法示例。


在下文中一共展示了View.equals方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: childAtPosition

import android.view.View; //导入方法依赖的package包/类
private static Matcher<View> childAtPosition(
        final Matcher<View> parentMatcher, final int position) {

    return new TypeSafeMatcher<View>() {
        @Override
        public void describeTo(Description description) {
            description.appendText("Child at position " + position + " in parent ");
            parentMatcher.describeTo(description);
        }

        @Override
        public boolean matchesSafely(View view) {
            ViewParent parent = view.getParent();
            return parent instanceof ViewGroup && parentMatcher.matches(parent)
                    && view.equals(((ViewGroup) parent).getChildAt(position));
        }
    };
}
 
开发者ID:wbrawner,项目名称:SimpleMarkdown,代码行数:19,代码来源:AutosaveTest.java

示例2: ensureTarget

import android.view.View; //导入方法依赖的package包/类
private void ensureTarget() {
    // Don't bother getting the parent height if the parent hasn't been laid
    // out yet.
    if (mTarget == null) {
        for (int i = 0; i < getChildCount(); i++) {
            View child = getChildAt(i);
            if (!child.equals(tCircleView) && !child.equals(bCircleView)) {
                mTarget = child;
                break;
            }
        }
    }
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:14,代码来源:LingjuSwipeRefreshLayout.java

示例3: onClick

import android.view.View; //导入方法依赖的package包/类
public void onClick(View v) {
	if (v.equals(tvCancel)) {
		cancelAndFinish();
	} else if (v.equals(tvShare)) {
		sp.setText(etContent.getText().toString().trim());
		shareAndFinish();
	} else if (v.equals(aivThumb)) {
		showThumb(thumb);
	} else if (v.equals(xvRemove)) {
		maxBodyHeight = 0;
		rlThumb.setVisibility(View.GONE);
		llPage.measure(0, 0);
		onTextChanged(etContent.getText(), 0, 0, 0);
		removeThumb();
	} else if (v.equals(tvAt)) {
		showFriendList();
	}
}
 
开发者ID:GitLqr,项目名称:LQRWeChat,代码行数:19,代码来源:EditPage.java

示例4: onClick

import android.view.View; //导入方法依赖的package包/类
public void onClick(View v) {
	if (v.equals(tvCancel)) {
		finish();
	} else {
		ArrayList<String> selected = new ArrayList<String>();
		for (int i = 0, size = adapter.getCount(); i < size; i++) {
			if (adapter.getItem(i).checked) {
				selected.add(adapter.getItem(i).atName);
			}
		}

		HashMap<String, Object> res = new HashMap<String, Object>();
		res.put("selected", selected);
		res.put("platform", platform);
		setResult(res);
		finish();
	}
}
 
开发者ID:Jusenr,项目名称:androidgithub,代码行数:19,代码来源:FriendListPage.java

示例5: onClick

import android.view.View; //导入方法依赖的package包/类
@Override
public void onClick(View view) {
    if (view.equals(this.floatingActionButton)) {
        MenuItem menuItem = parseMenuItem(this.navigationView);
        switch (menuItem.getItemId()) {
            case R.id.nav_energy_use_day:
                addAlert();
                return;
            case R.id.nav_energy_use_bill:
                addBill();
                return;
        }
    }
}
 
开发者ID:brolam,项目名称:OpenHomeAnalysis,代码行数:15,代码来源:OhaMainActivity.java

示例6: onClick

import android.view.View; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
    if (v.equals(imCart)){
        startFragment(new BasketFragment());
        tvActionBar.setText("SEPETİM");
    }else if (v.equals(imBack)){
        startFragment(new CategoryFragment());
        imBack.setVisibility(View.GONE);
    }
}
 
开发者ID:yusufcakal,项目名称:RestaurantApp,代码行数:11,代码来源:UserActivity.java

示例7: onClick

import android.view.View; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
    if (v.equals(mButtonLeft)) {
        mSwipeStack.swipeTopViewToLeft();
    } else if (v.equals(mButtonRight)) {
        mSwipeStack.swipeTopViewToRight();
    }
}
 
开发者ID:sciage,项目名称:FinalProject,代码行数:9,代码来源:CommunityGroupFragment.java

示例8: ensureTarget

import android.view.View; //导入方法依赖的package包/类
private void ensureTarget() {
    if (this.mTarget == null) {
        int i = 0;
        while (i < getChildCount()) {
            View child = getChildAt(i);
            if (child.equals(this.mCircleView)) {
                i++;
            } else {
                this.mTarget = child;
                return;
            }
        }
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:15,代码来源:SwipeRefreshLayout.java

示例9: isViewFromObject

import android.view.View; //导入方法依赖的package包/类
@Override
public boolean isViewFromObject(View view, Object object) {
    return view.equals(object);
}
 
开发者ID:appteam-nith,项目名称:Nimbus,代码行数:5,代码来源:SlidingImageAdapter.java

示例10: onViewPositionChanged

import android.view.View; //导入方法依赖的package包/类
/**
                 * 子view拖拽过程中位置改变的回调
                 *
                 * @param changedView 被拖拽的子view
                 * @param left        距离父布局左边的距离
                 * @param top         距离父布局上面的距离
                 * @param dx          x方向的偏移量
                 * @param dy          y方向的偏移量
                 */
                @Override
                public void onViewPositionChanged(View changedView, int left, int top, int dx, int dy) {
                        if (dx == 0) {
                                return;
                        }
                        if (changedView.equals(menu)) {
//                                如果拖拽的是menu,布局不变
                                menu.layout(0, 0, width, height);
//                                content.layout(marginLeft, 0, marginLeft + width, height);
//                                这里如果在屏幕上手指按定,就会出现dx=0,dy=1的情况
                                content.layout(left, 0, left + width, height);
                        }
//                                如果是内容布局,就随拖拽位移而变化,因为在smoothSlideViewTo中会进行控件边缘和内容边缘之间的移动,所以这里content要随时改变布局
//                                content.layout(marginLeft, 0, marginLeft + width, height);
//                        0~~1之间
                        float percent = left / (float) range;
                        float desWidth = (float) (width / 4.0 * (percent - 1));
//                        进行内容移动,本身控件位置不变
                        ViewHelper.setTranslationX(menu, desWidth);
                        if (SHADOW) {
//                                ivShadow.layout(marginLeft, 0, marginLeft + width, height);
                                ivShadow.layout(left, 0, left + width, height);
//                                ivShadow.setAlpha(percent * 225);
//                                ViewHelper.setAlpha(ivShadow, percent * 255);
//                                阴影效果
                                float f1 = 1 - percent * 0.5f;
                                ViewHelper.setScaleX(ivShadow, f1 * 1.2f * (1 - percent * 0.10f));
                                ViewHelper.setScaleY(ivShadow, f1 * 1.85f * (1 - percent * 0.10f));
                        }
                        int dragState = getCurrentState();
                        if (dragState == DRAG_STATE_OPEN) {
                                if (mListener != null) {
                                        mListener.onOpenMenu();
                                }
                        } else if (dragState == DRAG_STATE_CLOSE) {
                                if (mListener != null) {
                                        mListener.onCloseMenu();
                                }
                        } else {
                                if (mListener != null) {
                                        mListener.onDrag(changedView, percent);
                                }
                        }
                }
 
开发者ID:HelloChenJinJun,项目名称:TestChat,代码行数:54,代码来源:DragLayout.java

示例11: isViewFromObject

import android.view.View; //导入方法依赖的package包/类
@Override
public boolean isViewFromObject(View view, Object object) {
    return object instanceof ViewHolder
            && view.equals(((ViewHolder) object).itemView);
}
 
开发者ID:Nulltilus,项目名称:Appmatic-Android,代码行数:6,代码来源:ImagePreviewAdapter.java

示例12: doExpansion

import android.view.View; //导入方法依赖的package包/类
private void doExpansion() {
    int childnum = mDragPos - getFirstVisiblePosition();
    if (mDragPos > mSrcDragPos) {
        childnum++;
    }
    int numheaders = getHeaderViewsCount();

    View first = getChildAt(mSrcDragPos - getFirstVisiblePosition());
    for (int i = 0; ; i++) {
        View vv = getChildAt(i);
        if (vv == null) {
            break;
        }

        int height = mItemHeightNormal;
        int visibility = View.VISIBLE;
        if (mDragPos < numheaders && i == numheaders) {
            // dragging on top of the header item, so adjust the item below
            // instead
            if (vv.equals(first)) {
                visibility = View.INVISIBLE;
            } else {
                height = mItemHeightExpanded;
            }
        } else if (vv.equals(first)) {
            // processing the item that is being dragged
            if (mDragPos == mSrcDragPos
                    || getPositionForView(vv) == getCount() - 1) {
                // hovering over the original location
                visibility = View.INVISIBLE;
            } else {
                // not hovering over it
                // Ideally the item would be completely gone, but neither
                // setting its size to 0 nor settings visibility to GONE
                // has the desired effect.
                height = 1;
            }
        } else if (i == childnum) {
            if (mDragPos >= numheaders && mDragPos < getCount() - 1) {
                height = mItemHeightExpanded;
            }
        }
        ViewGroup.LayoutParams params = vv.getLayoutParams();
        params.height = height;
        vv.setLayoutParams(params);
        vv.setVisibility(visibility);
    }
}
 
开发者ID:89luca89,项目名称:ThunderMusic,代码行数:49,代码来源:TouchInterceptor.java

示例13: clampViewPositionHorizontal

import android.view.View; //导入方法依赖的package包/类
@Override
public int clampViewPositionHorizontal(View child, int left) {

    if (mDragView != null && child.equals(mDragView)) {


        if (left > 0 && !mDragView.isBouncePossible()) {
            return 0;
        }

        return left;
    }

    return 0;
}
 
开发者ID:Kaufland,项目名称:andswipeframework,代码行数:16,代码来源:LeftDragViewEngine.java


注:本文中的android.view.View.equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。