當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。