當前位置: 首頁>>代碼示例>>Java>>正文


Java View.setRight方法代碼示例

本文整理匯總了Java中android.view.View.setRight方法的典型用法代碼示例。如果您正苦於以下問題:Java View.setRight方法的具體用法?Java View.setRight怎麽用?Java View.setRight使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.view.View的用法示例。


在下文中一共展示了View.setRight方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: customRequestLayout

import android.view.View; //導入方法依賴的package包/類
public void customRequestLayout() {
    int nLeft = getFirstItemLeft();
    int nRight;
    for (int i = findFirstVisibleItemPosition(); i < findLastVisibleItemPosition() + 1; i++) {
        nRight = nLeft + getCacheWidth(i);

        View columnHeader = findViewByPosition(i);
        columnHeader.setLeft(nLeft);
        columnHeader.setRight(nRight);

        layoutDecoratedWithMargins(columnHeader, columnHeader.getLeft(), columnHeader.getTop
                (), columnHeader.getRight(), columnHeader.getBottom());

        nLeft = nRight + 1;
    }
}
 
開發者ID:evrencoskun,項目名稱:TableView,代碼行數:17,代碼來源:ColumnHeaderLayoutManager.java

示例2: fit2

import android.view.View; //導入方法依賴的package包/類
private void fit2(int p_nXPosition, int p_nYPosition, int p_nColumnCachedWidth, View
        p_jColumn) {
    CellRecyclerView child = (CellRecyclerView) findViewByPosition(p_nYPosition);
    if (child != null) {
        ColumnLayoutManager childLayoutManager = (ColumnLayoutManager) child.getLayoutManager();

        int nCellCacheWidth = childLayoutManager.getCacheWidth(p_nXPosition);
        View cell = childLayoutManager.findViewByPosition(p_nXPosition);

        // Control whether the cell needs to be fitted by column header or not.
        if (cell != null) {

            if (nCellCacheWidth != p_nColumnCachedWidth || m_bNeedSetLeft) {

                // This is just for setting width value
                if (nCellCacheWidth != p_nColumnCachedWidth) {
                    nCellCacheWidth = p_nColumnCachedWidth;
                    TableViewUtils.setWidth(cell, nCellCacheWidth);
                    childLayoutManager.setCacheWidth(p_nXPosition, nCellCacheWidth);
                }

                // The left & right values of Column header can be considered. Because this
                // method will be worked
                // after drawing process of main thread.
                if (p_jColumn.getLeft() != cell.getLeft() || p_jColumn.getRight() != cell
                        .getRight()) {
                    // TODO: + 1 is for decoration item. It should be gotten from a generic
                    // method  of layoutManager
                    // Set right & left values
                    cell.setLeft(p_jColumn.getLeft());
                    cell.setRight(p_jColumn.getRight() + 1);
                    childLayoutManager.layoutDecoratedWithMargins(cell, cell.getLeft(), cell
                            .getTop(), cell.getRight(), cell.getBottom());

                    m_bNeedSetLeft = true;
                }
            }
        }
    }
}
 
開發者ID:evrencoskun,項目名稱:TableView,代碼行數:41,代碼來源:CellLayoutManager.java

示例3: getBoundsAnimator

import android.view.View; //導入方法依賴的package包/類
/**
 * Returns an animator that animates the bounds of a single view.
 */
public static Animator getBoundsAnimator(View view, int fromLeft, int fromTop, int fromRight,
                                         int fromBottom, int toLeft, int toTop, int toRight, int toBottom) {
    view.setLeft(fromLeft);
    view.setTop(fromTop);
    view.setRight(fromRight);
    view.setBottom(fromBottom);

    return ObjectAnimator.ofPropertyValuesHolder(view,
            PropertyValuesHolder.ofInt(VIEW_LEFT, toLeft),
            PropertyValuesHolder.ofInt(VIEW_TOP, toTop),
            PropertyValuesHolder.ofInt(VIEW_RIGHT, toRight),
            PropertyValuesHolder.ofInt(VIEW_BOTTOM, toBottom));
}
 
開發者ID:SysdataSpA,項目名稱:FancyAccordionView,代碼行數:17,代碼來源:AnimatorUtils.java

示例4: fit

import android.view.View; //導入方法依賴的package包/類
private int fit(int p_nXPosition, int p_nYPosition, int p_nLeft, int p_nRight, int
        p_nColumnCachedWidth) {
    CellRecyclerView child = (CellRecyclerView) findViewByPosition(p_nYPosition);

    if (child != null) {
        ColumnLayoutManager childLayoutManager = (ColumnLayoutManager) child.getLayoutManager();

        int nCellCacheWidth = childLayoutManager.getCacheWidth(p_nXPosition);
        View cell = childLayoutManager.findViewByPosition(p_nXPosition);

        // Control whether the cell needs to be fitted by column header or not.
        if (cell != null) {

            if (nCellCacheWidth != p_nColumnCachedWidth || m_bNeedSetLeft) {

                // This is just for setting width value
                if (nCellCacheWidth != p_nColumnCachedWidth) {
                    nCellCacheWidth = p_nColumnCachedWidth;
                    TableViewUtils.setWidth(cell, nCellCacheWidth);
                    childLayoutManager.setCacheWidth(p_nXPosition, nCellCacheWidth);
                }

                // Even if the cached values are same, the left & right value wouldn't change.
                // m_bNeedSetLeftValue & the below lines for it.
                if (p_nLeft != IGNORE_LEFT && cell.getLeft() != p_nLeft) {

                    // Calculate scroll distance
                    int nScrollX = Math.max(cell.getLeft(), p_nLeft) - Math.min(cell.getLeft
                            (), p_nLeft);

                    cell.setLeft(p_nLeft);

                    // It shouldn't be scroll horizontally and the problem is gotten just for
                    // first visible item.
                    if (m_iHorizontalListener.getScrollPositionOffset() > 0 && p_nXPosition
                            == childLayoutManager.findFirstVisibleItemPosition() &&
                            m_iCellRecyclerView.getScrollState() != RecyclerView
                                    .SCROLL_STATE_IDLE) { //


                        m_iHorizontalListener.setScrollPositionOffset(m_iHorizontalListener
                                .getScrollPositionOffset() + nScrollX);
                        childLayoutManager.scrollToPositionWithOffset(m_iHorizontalListener
                                .getScrollPosition(), m_iHorizontalListener
                                .getScrollPositionOffset());
                    }
                }

                if (cell.getWidth() != nCellCacheWidth) {
                    if (p_nLeft != IGNORE_LEFT) {
                        // TODO: + 1 is for decoration item. It should be gotten from a
                        // generic method  of layoutManager
                        // Set right
                        p_nRight = cell.getLeft() + nCellCacheWidth + 1;
                        cell.setRight(p_nRight);

                        childLayoutManager.layoutDecoratedWithMargins(cell, cell.getLeft(),
                                cell.getTop(), cell.getRight(), cell.getBottom());
                    }

                    m_bNeedSetLeft = true;
                }
            }
        }
    } else {
        Log.e(LOG_TAG, " x: " + p_nXPosition + " y: " + p_nYPosition + " child is null. " +
                "Because first visible item position is  " + findFirstVisibleItemPosition());
    }
    return p_nRight;
}
 
開發者ID:evrencoskun,項目名稱:TableView,代碼行數:71,代碼來源:CellLayoutManager.java

示例5: set

import android.view.View; //導入方法依賴的package包/類
@Override
public void set(View view, Integer right) {
    view.setRight(right);
}
 
開發者ID:SysdataSpA,項目名稱:FancyAccordionView,代碼行數:5,代碼來源:AnimatorUtils.java


注:本文中的android.view.View.setRight方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。