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


Java ViewGroup.getRight方法代码示例

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


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

示例1: filterViewGroup

import android.view.ViewGroup; //导入方法依赖的package包/类
void filterViewGroup(MotionEvent ev) {
    int downX = Math.round(ev.getX());
    int downY = Math.round(ev.getY());
    int size = mChildViewGroups.size();
    mInAreaViewGroups.clear();
    for (int i = 0; i < size; i++) {
        ViewGroup child = mChildViewGroups.get(i);
        if (child == null || child.getVisibility() == View.GONE)
            continue;
        if (downX > child.getLeft() && downX < child.getRight() && downY > child.getTop() && downY < child.getBottom())
            mInAreaViewGroups.add(child);
    }
}
 
开发者ID:Sunzxyong,项目名称:PullToLoad,代码行数:14,代码来源:PullToRefreshLayout.java

示例2: drawCurrentTimeIndicator

import android.view.ViewGroup; //导入方法依赖的package包/类
private void drawCurrentTimeIndicator() {
    if (todayColumnIndex != Constant.INT_NONE_VALUE) {
        mView_NowMarkerLine.setColorFilter(mSetting.getCustomColor(), PorterDuff.Mode.SRC_IN);
        mView_NowMarkerLine.setVisibility(View.VISIBLE);

        mView_NowMarkerCycle.setColorFilter(mSetting.getCustomColor(), PorterDuff.Mode.SRC_IN);
        mView_NowMarkerCycle.setVisibility(View.VISIBLE);

        final long time = 2 * 60 * 1000;    //2 minutes in millisecond

        final Handler handler = new Handler();

        final Runnable updateTask = new Runnable() {
            @Override
            public void run() {
                if (mActivity == null || !isFragmentVisible || wasDestroyed) return;
                int nowTS = DateTimeHelper.convertMillisToTimeStamp(System.currentTimeMillis());
                int nowInMinutes = DateTimeHelper.getDateTimeNum(nowTS, HOUR_OF_DAY_AND_MINUTE_IN_MINUTES);

                ViewGroup todayColumn = mView_Column.get(todayColumnIndex);
                if (todayColumn == null) return;
                int markerHeight = mResources.getDimensionPixelSize(R.dimen.weekly_view_now_height);

                //marker line
                RelativeLayout.LayoutParams paramsLine = (RelativeLayout.LayoutParams) mView_NowMarkerLine.getLayoutParams();
                paramsLine.width = todayColumn.getWidth() - mTinyMargin;
                paramsLine.height = markerHeight / 3;
                if (todayColumnIndex != (mWeekInfoList.size() - 1)) {
                    paramsLine.setMargins(mTinyMargin, 0, 0, 0);
                } else {
                    paramsLine.setMargins(0, 0, mTinyMargin, 0);
                }
                mView_NowMarkerLine.setLayoutParams(paramsLine);
                mView_NowMarkerLine.setX(todayColumn.getX());
                mView_NowMarkerLine.setY(getYByMinute(nowInMinutes) - paramsLine.height / 2);

                //marker cycle
                RelativeLayout.LayoutParams paramsCycle = (RelativeLayout.LayoutParams) mView_NowMarkerCycle.getLayoutParams();
                //noinspection SuspiciousNameCombination
                paramsCycle.width = markerHeight;
                paramsCycle.height = markerHeight;
                mView_NowMarkerCycle.setLayoutParams(paramsCycle);
                float x;
                if (todayColumnIndex != 0) {
                    x = todayColumn.getX() - markerHeight / 2;
                } else {
                    x = todayColumn.getRight() - markerHeight / 2;
                }
                mView_NowMarkerCycle.setX(x);
                mView_NowMarkerCycle.setY(getYByMinute(nowInMinutes) - paramsCycle.height / 2);


                handler.postDelayed(this, time);
            }
        };

        handler.postDelayed(updateTask, 1);
    }
}
 
开发者ID:nhocga1995s,项目名称:MyCalendar,代码行数:60,代码来源:WeekViewFragment.java

示例3: animateRevealColor

import android.view.ViewGroup; //导入方法依赖的package包/类
private void animateRevealColor(ViewGroup viewRoot, @ColorRes int color) {
    int cx = (viewRoot.getLeft() + viewRoot.getRight()) / 2;
    int cy = (viewRoot.getTop() + viewRoot.getBottom()) / 2;
    animateRevealColorFromCoordinates(viewRoot, color, cx, cy);
}
 
开发者ID:shenhuanet,项目名称:AndroidOpen,代码行数:6,代码来源:RevealActivity.java


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