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


Java FrameLayout.post方法代码示例

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


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

示例1: init

import android.widget.FrameLayout; //导入方法依赖的package包/类
private void init() {
    sourceImageView = (ImageView) view.findViewById(R.id.sourceImageView);
    scanButton = (Button) view.findViewById(R.id.scanButton);
    scanButton.setOnClickListener(new ScanButtonClickListener());
    sourceFrame = (FrameLayout) view.findViewById(R.id.sourceFrame);
    polygonView = (PolygonView) view.findViewById(R.id.polygonView);
    sourceFrame.post(new Runnable() {
        @Override
        public void run() {
            original = getBitmap();
            if (original != null) {
                setBitmap(original);
            }
        }
    });
}
 
开发者ID:mohammedirfan655,项目名称:document-scanner,代码行数:17,代码来源:ScanFragment.java

示例2: onCreate

import android.widget.FrameLayout; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setAmbientEnabled();

    getWindow().addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);

    byte[] alarmCommandData = getIntent().getByteArrayExtra(EXTRA_ALARM_COMMAND_BYTES);
    if (alarmCommandData == null) {
        Timber.e("No alarm intent!");
        finish();
        return;
    }

    alarmCommand = ParcelPacker.getParcelable(alarmCommandData, AlarmCommand.CREATOR);

    setContentView(R.layout.activity_alarm);

    rootLayout = (FrameLayout) findViewById(R.id.root_layout);
    movableLayout = (FrameLayout) findViewById(R.id.movable_layout);
    centerMovableLayout = (FrameLayout) findViewById(R.id.center_movable_layout);
    leftMovableCircle = (ImageView) findViewById(R.id.left_movable_circle);
    rightMovableCircle = (ImageView) findViewById(R.id.right_movable_circle);

    backgroundImage = (ImageView) findViewById(R.id.background);
    iconImage = (ImageView) findViewById(R.id.icon);
    titleBox = (TextView) findViewById(R.id.title);

    vibrator = (Vibrator) getSystemService(VIBRATOR_SERVICE);
    mainThreadHandler = new Handler();

    rootLayout.post(new Runnable() {
        @Override
        public void run() {
            initAnimationParameters();
        }
    });
    loadAlarmData();
    setupSelfDismiss();
}
 
开发者ID:matejdro,项目名称:WearVibrationCenter,代码行数:41,代码来源:AlarmActivity.java

示例3: onCreateView

import android.widget.FrameLayout; //导入方法依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    rootView = (FrameLayout) inflater.inflate(R.layout.fragment_move_along_path_demo, container, false);
    animatedView = rootView.findViewById(R.id.animated_view);

    rootView.setOnTouchListener(new View.OnTouchListener() {
        @Override
        public boolean onTouch(View v, MotionEvent event) {
            if (event.getAction() == MotionEvent.ACTION_MOVE || event.getAction() == MotionEvent.ACTION_DOWN) {
                if(AdditiveAnimationsShowcaseActivity.ADDITIVE_ANIMATIONS_ENABLED) {
                    AdditiveAnimator.animate(animatedView)
                            .x(event.getX())
                            .y(event.getY())
                            .start();
                }
            }
            return true;
        }
    });

    // wait for rootView to layout itself so we can get its center
    rootView.post(new Runnable() {
        @Override
        public void run() {
            if (AdditiveAnimationsShowcaseActivity.ADDITIVE_ANIMATIONS_ENABLED) {
                // small circle
                final Path path1 = new Path();
                path1.addCircle(rootView.getWidth() / 2, rootView.getHeight() / 2, circleRadius, Path.Direction.CW);
                AdditiveAnimator.animate(animatedView).setInterpolator(new LinearInterpolator())
                        .xyAlongPath(path1)
                        .setRepeatCount(ValueAnimator.INFINITE)
                        .start();

                // another circle which also updates rotation to better show where on the path we are
                final Path path2 = new Path();
                path2.addCircle(rootView.getWidth() / 2, rootView.getHeight() / 2, rootView.getWidth() / 3, Path.Direction.CW);
                AdditiveAnimator.animate(animatedView).setDuration(3200).setInterpolator(new LinearInterpolator())
                        .xyRotationAlongPath(path2)
                        .setRepeatCount(ValueAnimator.INFINITE)
                        .start();
            } else {
                // TODO
            }
        }
    });
    return rootView;
}
 
开发者ID:wirecube,项目名称:android_additive_animations,代码行数:49,代码来源:MoveAlongPathDemoFragment.java


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