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


Java View.isSelected方法代码示例

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


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

示例1: onDisableCameraBtnClick

import android.view.View; //导入方法依赖的package包/类
public void onDisableCameraBtnClick(View view) {
    TextView text = (TextView) bottomButtonContainer.findViewById(R.id.rc_voip_disable_camera_text);
    String currentUserId = RongIMClient.getInstance().getCurrentUserId();

    RongCallClient.getInstance().setEnableLocalVideo(view.isSelected());
    if (view.isSelected()) {
        text.setText(R.string.rc_voip_disable_camera);
        if (localViewUserId.equals(currentUserId)) {
            localView.setVisibility(View.VISIBLE);
        } else {
            remoteViewContainer.findViewWithTag(currentUserId).setVisibility(View.VISIBLE);
        }
    } else {
        text.setText(R.string.rc_voip_enable_camera);
        if (localViewUserId.equals(currentUserId)) {
            localView.setVisibility(View.GONE);
        } else {
            remoteViewContainer.findViewWithTag(currentUserId).setVisibility(View.GONE);
        }
    }
    view.setSelected(!view.isSelected());
}
 
开发者ID:hushengjun,项目名称:FastAndroid,代码行数:23,代码来源:MultiVideoCallActivity.java

示例2: selectChange

import android.view.View; //导入方法依赖的package包/类
public void selectChange(View view) {
    if (view.isSelected()) {
        view.setSelected(false);
    } else {
        view.setSelected(true);
    }

    if (view.getId() == R.id.saveButton) {
        int save;
        if (view.isSelected()) {
            ((TextView) view).setText("Saved");
            save = 1;
        } else {
            ((TextView) view).setText("Save");
            save = 0;
        }

        saveCollection(save);

        iconAnim(view);
    }

}
 
开发者ID:PacktPublishing,项目名称:Expert-Android-Programming,代码行数:24,代码来源:CollectionDetailActivity.java

示例3: onFabClick

import android.view.View; //导入方法依赖的package包/类
private void onFabClick(View v) {
  int x = (v.getLeft() + v.getRight()) / 2;
  int y = (v.getTop() + v.getBottom()) / 2;
  float radiusOfFab = 1f * v.getWidth() / 2f;
  float radiusFromFabToRoot = (float) Math.hypot(
      Math.max(x, rootLayout.getWidth() - x),
      Math.max(y, rootLayout.getHeight() - y));

  if (v.isSelected()) {
    hideMenu(x, y, radiusFromFabToRoot, radiusOfFab);
  } else {
    showMenu(x, y, radiusOfFab, radiusFromFabToRoot);
  }
  v.setSelected(!v.isSelected());
}
 
开发者ID:xzg8023,项目名称:ArcLayout-master,代码行数:16,代码来源:DemoLikeTumblrActivity.java

示例4: onClick

import android.view.View; //导入方法依赖的package包/类
@OnClick({R.id.iv_video_share, R.id.iv_video_download, R.id.sb_send})
public void onClick(View view) {
    switch (view.getId()) {
        case R.id.iv_video_share:
            new ShareBottomDialog(this).show();
            break;
        case R.id.iv_video_download:
            if (view.isSelected()) {
                DialogHelper.checkDialog(this, mVideoData);
            } else {
                DialogHelper.downloadDialog(this, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        DownloaderWrapper.start(mVideoData);
                        mIvVideoDownload.setSelected(true);
                        SnackbarUtils.showDownloadSnackbar(VideoPlayerActivity.this, "任务正在下载", true);
                    }
                });
            }
            break;
        case R.id.sb_send:
            mPlayerView.sendDanmaku(mEtContent.getText().toString(), false);
            mEtContent.setText("");
            _closeSoftInput();
            break;
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:28,代码来源:VideoPlayerActivity.java

示例5: selectedThemeView

import android.view.View; //导入方法依赖的package包/类
private void selectedThemeView(@NonNull View selectedView) {
    selectedView.setSelected(true);

    for (View view : themeViews) {
        if (view != selectedView && view.isSelected()) {
            view.setSelected(false);
        }
    }

}
 
开发者ID:z-chu,项目名称:FriendBook,代码行数:11,代码来源:ReaderSettingDialog.java

示例6: setPageMode

import android.view.View; //导入方法依赖的package包/类
private void setPageMode(int pageMode) {
    View selectedView = null;
    switch (pageMode) {
        case PageView.PAGE_MODE_COVER:
            readTvFlipOverCover.setSelected(true);
            selectedView = readTvFlipOverCover;
            break;
        case PageView.PAGE_MODE_SIMULATION:
            readTvFlipOverSimulation.setSelected(true);
            selectedView = readTvFlipOverSimulation;
            break;
        case PageView.PAGE_MODE_SLIDE:
            readTvFlipOverSlide.setSelected(true);
            selectedView = readTvFlipOverSlide;
            break;
        case PageView.PAGE_MODE_NONE:
            readTvFlipOverNone.setSelected(true);
            selectedView = readTvFlipOverNone;
            break;
    }
    for (View view : flipOverViews) {
        if (view != selectedView && view.isSelected()) {
            view.setSelected(false);
        }
    }
    if (pageMode != mPageView.getPageMode()) {
        mPageView.setPageAnimMode(pageMode);
        ReaderSettingManager
                .getInstance()
                .setPageMode(pageMode);
    }

}
 
开发者ID:z-chu,项目名称:FriendBook,代码行数:34,代码来源:ReaderSettingDialog.java

示例7: onFabClick

import android.view.View; //导入方法依赖的package包/类
private void onFabClick(View v) {
  if (v.isSelected()) {
    hideMenu();
  } else {
    showMenu();
  }
  v.setSelected(!v.isSelected());
}
 
开发者ID:xzg8023,项目名称:ArcLayout-master,代码行数:9,代码来源:DemoLikePathActivity.java

示例8: onFavoritesButton

import android.view.View; //导入方法依赖的package包/类
@OnClick(R.id.grid_favorite_button)
public void onFavoritesButton(View view) {
    if (view.isSelected()) {
        favoritesRepository.removeFromFavorites(movieEntity);
        view.setSelected(false);
    } else {
        favoritesRepository.addToFavorites(movieEntity);
        view.setSelected(true);
    }
}
 
开发者ID:oantajames,项目名称:mdb-android-application,代码行数:11,代码来源:MoviesGridAdapter.java

示例9: onFabClick

import android.view.View; //导入方法依赖的package包/类
private void onFabClick(View v) {
    if (v.isSelected()) {
        hideMenu();
    } else {
        showMenu();
    }
    v.setSelected(!v.isSelected());
}
 
开发者ID:xzg8023,项目名称:ArcLayout-master,代码行数:9,代码来源:MainActivity.java

示例10: onOptionClick

import android.view.View; //导入方法依赖的package包/类
public void onOptionClick(View view) {
    if (view.isSelected()) {
        view.setSelected(false);
    } else {
        view.setSelected(true);
    }
}
 
开发者ID:PacktPublishing,项目名称:Expert-Android-Programming,代码行数:8,代码来源:NotificationPreferenceActivity.java

示例11: onEnableAllClick

import android.view.View; //导入方法依赖的package包/类
public void onEnableAllClick(View view) {

        if (view.isSelected()) {
            enableAllChildren(parent, false);
        } else {
            enableAllChildren(parent, true);
        }

    }
 
开发者ID:PacktPublishing,项目名称:Expert-Android-Programming,代码行数:10,代码来源:NotificationPreferenceActivity.java

示例12: isSelected

import android.view.View; //导入方法依赖的package包/类
public boolean isSelected(int viewId) {
    View view = getView(viewId);
    return view.isSelected();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:BaseViewHolder.java

示例13: moveChildres

import android.view.View; //导入方法依赖的package包/类
/**
 * 移动 元素的值
 *
 * @param steps
 */
protected void moveChildres(int steps) {

    if (steps == 0 || loopViewAdapter == null) {
        return;
    }
    int start;
    int end;
    int incr;
    if (steps < 0) {
        start = 0;
        end = getChildCount();
        incr = 1;
    } else {
        start = getChildCount() - 1;
        end = -1;
        incr = -1;
    }
    for (int i = start; i != end; i += incr) {
        //获取View
        View childAtView = getChildAt(i);
        //获取tag中的数据
        int mNowIndex = (int) childAtView.getTag(INDEX_TAG);
        //向右滑动
        if (steps > 0) {
            //当前为0了,赋值为最后一个
            if (mNowIndex == 0 /*&& isLoop*/) {
                //赋值
                mNowIndex = loopViewAdapter.getItemCount();
            }
            mNowIndex--;
            //显示视图 循环 并且 当前下标 大于等于0  显示
           /* if (isLoop && mNowIndex >= 0) {
                childAtView.setVisibility(VISIBLE);
            }
            if (!isLoop && mNowIndex < 0) {
                childAtView.setVisibility(INVISIBLE);
            }*/
        } else {
            //向左滑动 已经是最后一个 赋值为第一个
            if (mNowIndex == loopViewAdapter.getItemCount() - 1/* && isLoop*/) {
                mNowIndex = -1;
            }
            mNowIndex++;
            //显示视图  循环 并且 下标小于等于总条数
           /* if (isLoop && mNowIndex <= loopViewAdapter.getItemCount() - 1) {
                childAtView.setVisibility(VISIBLE);
            }
            if (!isLoop && mNowIndex > loopViewAdapter.getItemCount() - 1) {
                childAtView.setVisibility(INVISIBLE);
            }*/
        }

        //保存选中的View
        if (childAtView.isSelected()) {
            mCenterView = childAtView;
        }
        //保存当前的下标
        childAtView.setTag(INDEX_TAG, mNowIndex);

        //适配器不为空  回调数据
        if (loopViewAdapter != null && childAtView.getVisibility() == VISIBLE) {
            loopViewAdapter.setData(childAtView, mNowIndex);
        }

    }
}
 
开发者ID:aohanyao,项目名称:HorizontalLoopView,代码行数:72,代码来源:HorizontalLoopView.java

示例14: onHandFreeButtonClick

import android.view.View; //导入方法依赖的package包/类
public void onHandFreeButtonClick(View view) {
    RongCallClient.getInstance().setEnableSpeakerphone(!view.isSelected());
    view.setSelected(!view.isSelected());
    handFree = view.isSelected();
}
 
开发者ID:hushengjun,项目名称:FastAndroid,代码行数:6,代码来源:SingleCallActivity.java

示例15: onMuteButtonClick

import android.view.View; //导入方法依赖的package包/类
public void onMuteButtonClick(View view) {
    RongCallClient.getInstance().setEnableLocalAudio(view.isSelected());
    view.setSelected(!view.isSelected());
    muted = view.isSelected();
}
 
开发者ID:hushengjun,项目名称:FastAndroid,代码行数:6,代码来源:SingleCallActivity.java


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