當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。