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


Java RelativeLayout.setOnTouchListener方法代码示例

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


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

示例1: init

import android.widget.RelativeLayout; //导入方法依赖的package包/类
public void init(Context context) {
    View.inflate(context, getLayoutId(), this);
    startButton = (ImageView) findViewById(R.id.start);
    fullscreenButton = (ImageView) findViewById(R.id.fullscreen);
    progressBar = (SeekBar) findViewById(R.id.progress);
    currentTimeTextView = (TextView) findViewById(R.id.current);
    totalTimeTextView = (TextView) findViewById(R.id.total);
    bottomContainer = (ViewGroup) findViewById(R.id.layout_bottom);
    textureViewContainer = (RelativeLayout) findViewById(R.id.surface_container);
    topContainer = (ViewGroup) findViewById(R.id.layout_top);

    startButton.setOnClickListener(this);
    fullscreenButton.setOnClickListener(this);
    progressBar.setOnSeekBarChangeListener(this);
    bottomContainer.setOnClickListener(this);
    textureViewContainer.setOnClickListener(this);

    textureViewContainer.setOnTouchListener(this);
    mScreenWidth = getContext().getResources().getDisplayMetrics().widthPixels;
    mScreenHeight = getContext().getResources().getDisplayMetrics().heightPixels;
    mAudioManager = (AudioManager) getContext().getSystemService(Context.AUDIO_SERVICE);
    mHandler = new Handler();
}
 
开发者ID:wp521,项目名称:MyFire,代码行数:24,代码来源:JCVideoPlayer.java

示例2: initView

import android.widget.RelativeLayout; //导入方法依赖的package包/类
private void initView(final Context context) {
    final View root = LayoutInflater.from(context).inflate(R.layout.view_status_detail, this, true);

    ViewPager pager = (ViewPager) root.findViewById(R.id.photo_collection);
    PhotoDetailViewPagerAdapter adapter = new PhotoDetailViewPagerAdapter(getContext(), getPhotos());
    pager.setAdapter(adapter);

    adapter.setItemClickListener(this);

    ViewPagerIndicator indicator = (ViewPagerIndicator) findViewById(R.id.view_pager_indicator);
    indicator.setGravity(3);

    ImageView more_btn = (ImageView) findViewById(R.id.for_detail_btn);

    RelativeLayout detail_container = (RelativeLayout) findViewById(R.id.detail_container);
    detail_container.setOnTouchListener(new OnTouchListener() {
        @Override
        public boolean onTouch(View v, MotionEvent event) {
            return true;
        }
    });
}
 
开发者ID:sherlockchou86,项目名称:yphoto,代码行数:23,代码来源:StatusDetailView.java

示例3: onCreate

import android.widget.RelativeLayout; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    tvPulsa = (TextView) findViewById(R.id.tvPulsa);
    rl = (RelativeLayout) findViewById(R.id.activity_main);
    animation = AnimationUtils.loadAnimation(this, R.anim.fadeinout);

    tvPulsa.startAnimation(animation);

    rl.setOnTouchListener(new View.OnTouchListener() {
        @Override
        public boolean onTouch(View v, MotionEvent event) {

            Intent intent = new Intent(MainActivity.this, MenuActivity.class);
            startActivity(intent);

            return true;
        }
    });
}
 
开发者ID:svnacho,项目名称:ElAhorcado,代码行数:23,代码来源:MainActivity.java

示例4: initView

import android.widget.RelativeLayout; //导入方法依赖的package包/类
private void initView() {
    mRelativeLayout = (RelativeLayout) findViewById(R.id.rl_main);
    push_state_ll = (LinearLayout) findViewById(R.id.push_state_ll);
    settings = (ImageView) findViewById(R.id.iv_settings);
    settings.setOnClickListener(this);
    wx_user_name = (TextView) findViewById(R.id.wx_user_name_tv);
    wx_user_icon = (CircleImageView) findViewById(R.id.wx_user_icon_iv);
    mCountTimeView = (CountTimeView) findViewById(R.id.count_time_view);
    mRecorderButton = (ImageView) findViewById(R.id.iv_push);
    mRecorderButton.setOnClickListener(this);
    btn_pop_pro = (ImageView) findViewById(R.id.btn_pro);
    btn_pop_pro.setOnClickListener(this);
    btn_pop_talk = (ImageView) findViewById(R.id.btn_talk);
    btn_pop_talk.setOnClickListener(this);
    mTv_watch_person = (TextView) findViewById(R.id.tv_watch_person);
    mRelativeLayout.setOnTouchListener(this);
}
 
开发者ID:JunGeges,项目名称:AliZhiBoHao,代码行数:18,代码来源:LiveCameraActivity.java

示例5: handleOnClicks

import android.widget.RelativeLayout; //导入方法依赖的package包/类
private void handleOnClicks(final ViewPager emojisPager) {
    for (int i = 0; i < emojiTabs.length - 1; i++) {
        final RelativeLayout categoryLayout = (RelativeLayout) emojiTabs[i].findViewById(R.id.category_layout);
        categoryLayout.setOnClickListener(new EmojiTabsClickListener(emojisPager, i));
    }

    final RelativeLayout backspaceLayout = (RelativeLayout) emojiTabs[emojiTabs.length - 1].findViewById(R.id.category_layout);
    backspaceLayout.setOnTouchListener(
            new RepeatListener(INITIAL_INTERVAL, NORMAL_INTERVAL, new OnClickListener() {
                @Override
                public void onClick(final View view) {
                    if (onEmojiBackspaceClickListener != null) {
                        onEmojiBackspaceClickListener.onEmojiBackspaceClicked(view);
                    }
                }
            }));
}
 
开发者ID:apradanas,项目名称:prismoji-android,代码行数:18,代码来源:PrismojiView.java

示例6: initView

import android.widget.RelativeLayout; //导入方法依赖的package包/类
private void initView() {
    showBigBang = SPHelper.getBoolean(ConstantUtil.TOTAL_SWITCH, true);
    isStick=SPHelper.getBoolean(ConstantUtil.FLOATVIEW_IS_STICK,false);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {
        Point point = new Point();
        mWindowManager.getDefaultDisplay().getSize(point);
        mScreenWidth = point.x;
        mScreenHeight = point.y;
    } else {
        mScreenWidth = mWindowManager.getDefaultDisplay().getWidth();
        mScreenHeight = mWindowManager.getDefaultDisplay().getHeight();
    }
    if (showBigBang) {
        mCurrentIconAlpha =  SPHelper.getInt(ConstantUtil.FLOATVIEW_ALPHA, 70) / 100f;
    } else {
        mCurrentIconAlpha = 0.6f * SPHelper.getInt(ConstantUtil.FLOATVIEW_ALPHA, 70) / 100f;
    }

    iconFloatView = (LinearLayout) View.inflate(mContext, R.layout.arc_float_icon, null);
    floatImageView = ((ImageView) iconFloatView.findViewById(R.id.float_image));
    acrFloatView = (RelativeLayout) View.inflate(mContext, R.layout.arc_view_float, null);
    archMenu = (ArcMenu) acrFloatView.findViewById(R.id.arc_menu);
    initIcon();
    archMenu.setOnModeSeletedListener(new ArcMenu.OnModeSeletedListener() {
        @Override
        public void onModeSelected() {
            showFloatImageView();
        }

        @Override
        public void onNothing() {

        }
    });
    // event listeners
    acrFloatView.setOnTouchListener(this);
    iconFloatView.setOnTouchListener(this);
}
 
开发者ID:l465659833,项目名称:Bigbang,代码行数:40,代码来源:ArcTipViewController.java

示例7: initView

import android.widget.RelativeLayout; //导入方法依赖的package包/类
@Override
        public void initView() {
//                toolbar = (Toolbar) findViewById(R.id.tb_toolbar);
//                collapsingToolbarLayout = (CollapsingToolbarLayout) findViewById(R.id.ctl_layout);
//                floatingActionButton = (FloatingActionButton) findViewById(R.id.fab_avatar);
                floatingActionButton = (FloatingActionButton) findViewById(R.id.fab_activity_user_detail_button);
                floatingActionButton.setImageResource(R.drawable.ic_mode_edit_blue_grey_900_24dp);
//                display = (RecyclerView) findViewById(R.id.rcl_content);
                display = (RecyclerView) findViewById(R.id.rcv_activity_user_detail_display);
                refresh = (SwipeRefreshLayout) findViewById(R.id.refresh_activity_user_detail_refresh);
//                bgCover = (ImageView) findViewById(R.id.iv_background_cover);
//                appBarLayout = (AppBarLayout) findViewById(R.id.al_appbar_layout);
                bottomInput = (LinearLayout) findViewById(R.id.ll_user_detail_bottom);
                input = (EditText) findViewById(R.id.et_user_detail_input);
                send = (ImageView) findViewById(R.id.iv_user_detail_send);
                rootContainer = (RelativeLayout) findViewById(R.id.rl_activity_user_detail_container);
                rootContainer.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
                        @Override
                        public void onGlobalLayout() {
                                Rect rect = new Rect();
                                rootContainer.getWindowVisibleDisplayFrame(rect);
                                screenHeight = rootContainer.getRootView().getHeight();
                                int keyBoardHeight = screenHeight - rect.bottom;
                                int status = getStatusHeight();
                                if (keyBoardHeight != mKeyBoardHeight) {
                                        if (keyBoardHeight > mKeyBoardHeight) {
                                                bottomInput.setVisibility(View.VISIBLE);
                                                RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) bottomInput.getLayoutParams();
                                                int realHeight = screenHeight - status - bottomInput.getHeight() - keyBoardHeight;
                                                layoutParams.setMargins(0, realHeight, 0, 0);
                                                bottomInput.setLayoutParams(layoutParams);
                                                mKeyBoardHeight = keyBoardHeight;
                                                floatingActionButton.setVisibility(View.GONE);
                                                mLinearLayoutManager.scrollToPositionWithOffset(currentPosition, getListOffset());
                                        } else {
                                                floatingActionButton.setVisibility(View.VISIBLE);
                                                mKeyBoardHeight = keyBoardHeight;
                                                bottomInput.setVisibility(View.GONE);
                                        }
                                }
                        }
                });
//                appBarLayout.addOnOffsetChangedListener(this);
                send.setOnClickListener(this);
                refresh.setOnRefreshListener(this);
                floatingActionButton.setOnClickListener(this);
                rootContainer.setOnTouchListener(new View.OnTouchListener() {
                        @Override
                        public boolean onTouch(View v, MotionEvent event) {
                                if (mCommentPopupWindow != null && mCommentPopupWindow.isShowing()) {
                                        mCommentPopupWindow.dismiss();
                                }

//                                这里进行点击关闭编辑框
                                if (bottomInput.getVisibility() == View.VISIBLE) {
                                        LogUtil.e("触摸界面点击关闭输入法");
                                        dealBottomView(false);
                                        return true;
                                }
                                return false;
                        }
                });
        }
 
开发者ID:HelloChenJinJun,项目名称:TestChat,代码行数:64,代码来源:UserDetailActivity.java

示例8: initUI

import android.widget.RelativeLayout; //导入方法依赖的package包/类
public void initUI() {
        db = new DatabaseHelper(this);
        rlHome = (RelativeLayout) findViewById(R.id.layout_home);
        rlHome.setOnClickListener(this);
        menu = findViewById(R.id.my_fragment);
        centralView = findViewById(R.id.center_view);
        menu.setVisibility(View.GONE);
        //search
        searchText = (EditText) findViewById(R.id.search_bar_text);
        flSearch = (FrameLayout) findViewById(R.id.frame_search);
        rvSearch = (RecyclerView) findViewById(R.id.rl_search);
        btnCancelSearch = (ImageButton) findViewById(R.id.btn_cancel_search);
        btnCancelSearch.setOnClickListener(this);
        btnDecSearch = (ImageButton) findViewById(R.id.btn_dec_search);
        btnSearch = (ImageButton) findViewById(R.id.btn_search);
        btnSearch.setOnClickListener(this);

        searchBar = (LinearLayout) findViewById(R.id.search_bar_home);
        rvRight = (RecyclerView) findViewById(R.id.list_view_right);
        rvLeft = (RecyclerView) findViewById(R.id.list_view_left);
        frameRight = (FrameLayout) findViewById(R.id.frame_right);
        frameLeft = (FrameLayout) findViewById(R.id.frame_left);
        btnTheme = (ImageButton) findViewById(R.id.btn_theme);
        btnTheme.setOnClickListener(this);
        btnSettings = (ImageButton) findViewById(R.id.btn_settings);
        btnSettings.setOnClickListener(this);
        btnAddLeft = (ImageButton) findViewById(R.id.btn_add_left);
        btnAddLeft.setOnClickListener(this);
        btnAddRight = (ImageButton) findViewById(R.id.btn_add_right);
        btnAddRight.setOnClickListener(this);
        btnLeftElem = (ImageButton) findViewById(R.id.left);
        btnLeftElem.setOnClickListener(this);
        btnRightElem = (ImageButton) findViewById(R.id.right);
        btnRightElem.setOnClickListener(this);
        LinearLayoutManager managerRight =
                new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
        LinearLayoutManager managerLeft =
                new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
        managerSearch =
                new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
        rvRight.setLayoutManager(managerRight);
        rvLeft.setLayoutManager(managerLeft);
        rvSearch.setLayoutManager(managerSearch);

        settingsHelper = new SettingsHelper(this);
        settingsHelperSearch = new SettingsHelper(this);

        //handling swipe action
        new RecyclerItemSwiper(0, LEFT | RIGHT, this,
                adapterLeft, arrayListLeft, db, "left", rvLeft);

        new RecyclerItemSwiper(0, LEFT | RIGHT, this,
                adapterRight, arrayListRight, db, "right", rvRight);

        setupSharedPreferences();
//        setupSharedPreferencesNew();
//        rlHome.setOnTouchListener(new RelativeLayoutTouchListener(this));
        mainElemsTouchListener = new MainElemsTouchListener(this, centralMenu, menu, rlHome);
        rlHome.setOnTouchListener(mainElemsTouchListener);
    }
 
开发者ID:Existentio,项目名称:OddLauncher,代码行数:61,代码来源:HomeActivity.java


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