Java Code Examples for android.widget.ImageView.setEnabled()

The following are Jave code examples for showing how to use setEnabled() of the android.widget.ImageView class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: boohee_v5.6   File: MQEmotionKeyboardLayout.java   View Source Code Vote up 7 votes
protected void processLogic() {
    this.mIndicatorIvList = new ArrayList();
    this.mGridViewList = new ArrayList();
    int emotionPageCount = ((MQEmotionUtil.sEmotionKeyArr.length - 1) / 27) + 1;
    LayoutParams indicatorIvLp = new LayoutParams(-2, -2);
    int margin = MQUtils.dip2px(getContext(), 5.0f);
    indicatorIvLp.setMargins(margin, margin, margin, margin);
    for (int i = 0; i < emotionPageCount; i++) {
        ImageView indicatorIv = new ImageView(getContext());
        indicatorIv.setLayoutParams(indicatorIvLp);
        indicatorIv.setImageResource(R.drawable.mq_selector_emotion_indicator);
        indicatorIv.setEnabled(false);
        this.mIndicatorIvList.add(indicatorIv);
        this.mIndicatorLl.addView(indicatorIv);
        this.mGridViewList.add(getGridView(i));
    }
    ((ImageView) this.mIndicatorIvList.get(0)).setEnabled(true);
    this.mContentVp.setAdapter(new EmotionPagerAdapter());
}
 
Example 2
Project: boohee_v5.6   File: HomePopView.java   View Source Code Vote up 7 votes
private void refreshWallPaper() {
    boolean z = false;
    if (this.index >= 0 && this.index <= this.wallpagers.size() - 1) {
        this.btnWallLeft.setEnabled(this.index != 0);
        ImageView imageView = this.btnWallRight;
        if (this.index != this.wallpagers.size() - 1) {
            z = true;
        }
        imageView.setEnabled(z);
        this.handler.removeCallbacks(this.runnable);
        this.imageUrl = ((HomeWallpager) this.wallpagers.get(this.index)).getPicUrl();
        this.date = ((HomeWallpager) this.wallpagers.get(this.index)).date;
        this.tvWallDate.setText(this.date);
        this.handler.postDelayed(this.runnable, 3000);
    }
}
 
Example 3
Project: boohee_v5.6   File: HomeImageFragment.java   View Source Code Vote up 7 votes
public void initUI() {
    if (getView() != null) {
        ImageView mImageView = (ImageView) getView().findViewById(R.id.image);
        if (this.data != null) {
            this.imageLoader.displayImage(this.data.getPicUrl(), mImageView,
                    ImageLoaderOptions.global(this.data.getDefaultImage()));
            if (TextUtils.isEmpty(this.data.getLink())) {
                mImageView.setEnabled(false);
                return;
            }
            mImageView.setEnabled(true);
            mImageView.setOnClickListener(new OnClickListener() {
                public void onClick(View v) {
                    if (TextUtils.isEmpty(HomeImageFragment.this.data.getMobEvent())) {
                        MobclickAgent.onEvent(HomeImageFragment.this.getActivity(),
                                HomeImageFragment.this.data.getMobEvent());
                    }
                    BooheeScheme.handleUrl(HomeImageFragment.this.getActivity(),
                            HomeImageFragment.this.data.getLink(), HomeImageFragment.this
                                    .data.getTitle());
                }
            });
        }
    }
}
 
Example 4
Project: OpenEyesReading-android   File: BannerView.java   View Source Code Vote up 7 votes
/**
 * 增加banner dots 指示器
 *
 * @param size
 */
private void addIndicatorImageViews(int size) {
    llIndexContainer.removeAllViews();
    for (int i = 0; i < size; i++) {
        ImageView iv = new ImageView(mContext);
        LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(MeasureUtils.dp2px(mContext, 5), MeasureUtils.dp2px(mContext, 5));
        if (i != 0) {
            lp.leftMargin = MeasureUtils.dp2px(mContext, 7);
        }
        iv.setLayoutParams(lp);
        iv.setBackgroundResource(R.drawable.banner_dot_bg);
        iv.setEnabled(false);
        if (i == 0) {
            iv.setEnabled(true);
        }
        llIndexContainer.addView(iv);
    }
}
 
Example 5
Project: SunmiUI   File: BannerLayout.java   View Source Code Vote up 6 votes
@Override
public void setEnabled(boolean enabled) {
    super.setEnabled(enabled);
    for(int i=0;i<getChildCount();i++){
        ImageView child = (ImageView) getChildAt(i);
        child.setEnabled(enabled);
    }
}
 
Example 6
Project: cordova-plugin-image-picker   File: ImageFetcher.java   View Source Code Vote up 6 votes
private void setInvisible() {
    // Log.d("COLLAGE", "Setting something invisible...");
    if (imageViewReference != null) {
        final ImageView imageView = imageViewReference.get();
        BitmapFetcherTask bitmapDownloaderTask = getBitmapDownloaderTask(imageView);
        if (this == bitmapDownloaderTask) {
            imageView.setVisibility(View.GONE);
            imageView.setClickable(false);
            imageView.setEnabled(false);
        }
    }
}
 
Example 7
Project: letv   File: AlbumCommentDetailActivity.java   View Source Code Vote up 6 votes
@SuppressLint({"ResourceAsColor"})
private void setStatueView(int level, ImageView statue) {
    if (level == 1) {
        statue.setVisibility(0);
        statue.setEnabled(true);
    } else if (level == 2) {
        statue.setVisibility(0);
        statue.setEnabled(false);
    } else {
        statue.setVisibility(8);
    }
}
 
Example 8
Project: letv   File: AlbumCommentDetailActivity.java   View Source Code Vote up 6 votes
private void setSupportView(String voteFlag, ImageView supportView) {
    if (TextUtils.isEmpty(voteFlag) || voteFlag.equals("0")) {
        supportView.setVisibility(8);
    } else if (voteFlag.equals("1")) {
        supportView.setVisibility(0);
        supportView.setEnabled(true);
    } else if (voteFlag.equals("2")) {
        supportView.setVisibility(0);
        supportView.setEnabled(false);
    }
}
 
Example 9
Project: Huochexing12306   File: ReminderSetupAty.java   View Source Code Vote up 6 votes
private void initViews() {
	
	//提醒设置
	ivStart = (ImageView)findViewById(R.id.from);
	ivStart.setOnClickListener(this);
	ivEnd = (ImageView)findViewById(R.id.to);
	ivEnd.setOnClickListener(this);
	btnPreReminderTime = (Button)findViewById(R.id.time);
	btnPreReminderTime.setOnClickListener(this);
	ivRing = (ImageView)findViewById(R.id.ring);
	ivRing.setOnClickListener(this);
	ivVibrate = (ImageView)findViewById(R.id.vibrate);
	ivVibrate.setOnClickListener(this);
	tvMIUIRepair = (TextView)findViewById(R.id.repair);
	tvMIUIRepair.setOnClickListener(this);
	Button btnReminderDemo = (Button)findViewById(R.id.demo);
	btnReminderDemo.setOnClickListener(this);
	
	btnPreReminderTime.setText(setSP.getPreReminderTimeString());
	ivVibrate.setImageResource(setSP.isVibrate()==true ? R.drawable.chat_on:R.drawable.chat_off);
	ivRing.setImageResource(setSP.isRing()==true ? R.drawable.chat_on:R.drawable.chat_off);
	ivStart.setImageResource(setSP.isStartReminder()==true ? R.drawable.chat_on:R.drawable.chat_off);
	ivEnd.setImageResource(setSP.isEndReminder()==true ? R.drawable.chat_on:R.drawable.chat_off);
	
	if (!setSP.isReminderSet()){
		btnPreReminderTime.setEnabled(false);
		ivRing.setEnabled(false);
		ivVibrate.setEnabled(false);
		tvMIUIRepair.setEnabled(false);
	}else{
		btnPreReminderTime.setEnabled(true);
		ivRing.setEnabled(true);
		ivVibrate.setEnabled(true);
		tvMIUIRepair.setEnabled(true);
	}
}
 
Example 10
Project: siiMobilityAppKit   File: ImageFetcher.java   View Source Code Vote up 6 votes
private void setInvisible() {
    // Log.d("COLLAGE", "Setting something invisible...");
    if (imageViewReference != null) {
        final ImageView imageView = imageViewReference.get();
        BitmapFetcherTask bitmapDownloaderTask = getBitmapDownloaderTask(imageView);
        if (this == bitmapDownloaderTask) {
            imageView.setVisibility(View.GONE);
            imageView.setClickable(false);
            imageView.setEnabled(false);
        }
    }
}
 
Example 11
Project: decoy   File: AVChatVideo.java   View Source Code Vote up 6 votes
private void findViews() {
    if (init || root == null)
        return;
    topRoot = root.findViewById(R.id.avchat_video_top_control);
    switchAudio = topRoot.findViewById(R.id.avchat_video_switch_audio);
    switchAudio.setOnClickListener(this);
    time = (Chronometer) topRoot.findViewById(R.id.avchat_video_time);
    netUnstableTV = (TextView) topRoot.findViewById(R.id.avchat_video_netunstable);

    middleRoot = root.findViewById(R.id.avchat_video_middle_control);
    headImg = (HeadImageView) middleRoot.findViewById(R.id.avchat_video_head);
    nickNameTV = (TextView) middleRoot.findViewById(R.id.avchat_video_nickname);
    notifyTV = (TextView) middleRoot.findViewById(R.id.avchat_video_notify);

    refuse_receive = middleRoot.findViewById(R.id.avchat_video_refuse_receive);
    refuseTV = (TextView) refuse_receive.findViewById(R.id.refuse);
    receiveTV = (TextView) refuse_receive.findViewById(R.id.receive);
    refuseTV.setOnClickListener(this);
    receiveTV.setOnClickListener(this);

    recordView = root.findViewById(R.id.avchat_record_layout);
    recordTip = recordView.findViewById(R.id.avchat_record_tip);
    recordWarning = recordView.findViewById(R.id.avchat_record_warning);

    bottomRoot = root.findViewById(R.id.avchat_video_bottom_control);
    faceUnityRoot = root.findViewById(R.id.avchat_video_face_unity);

    switchCameraToggle = new ToggleView(bottomRoot.findViewById(R.id.avchat_switch_camera), ToggleState.DISABLE, this);
    closeCameraToggle = new ToggleView(bottomRoot.findViewById(R.id.avchat_close_camera), ToggleState.DISABLE, this);
    muteToggle = new ToggleView(bottomRoot.findViewById(R.id.avchat_video_mute), ToggleState.DISABLE, this);
    recordToggle = (ImageView) bottomRoot.findViewById(R.id.avchat_video_record);
    recordToggle.setEnabled(false);
    recordToggle.setOnClickListener(this);
    hangUpImg = (ImageView) bottomRoot.findViewById(R.id.avchat_video_logout);
    hangUpImg.setOnClickListener(this);

    permissionRoot = root.findViewById(R.id.avchat_video_permission_control);
    init = true;
}
 
Example 12
Project: Linphone4Android   File: HistoryListFragment.java   View Source Code Vote up 5 votes
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
						 Bundle savedInstanceState) {
	mInflater = inflater;
	View view = inflater.inflate(R.layout.history, container, false);

	noCallHistory = (TextView) view.findViewById(R.id.no_call_history);
	noMissedCallHistory = (TextView) view.findViewById(R.id.no_missed_call_history);

	historyList = (ListView) view.findViewById(R.id.history_list);
	historyList.setOnItemClickListener(this);

	delete = (ImageView) view.findViewById(R.id.delete);
	delete.setOnClickListener(this);

	editList = (LinearLayout) view.findViewById(R.id.edit_list);
	topBar = (LinearLayout) view.findViewById(R.id.top_bar);

	cancel = (ImageView) view.findViewById(R.id.cancel);
	cancel.setOnClickListener(this);

	allCalls = (ImageView) view.findViewById(R.id.all_calls);
	allCalls.setOnClickListener(this);

	allCallsSelected = view.findViewById(R.id.all_calls_select);

	missedCalls = (ImageView) view.findViewById(R.id.missed_calls);
	missedCalls.setOnClickListener(this);

	missedCallsSelected = view.findViewById(R.id.missed_calls_select);

	selectAll = (ImageView) view.findViewById(R.id.select_all);
	selectAll.setOnClickListener(this);

	deselectAll = (ImageView) view.findViewById(R.id.deselect_all);
	deselectAll.setOnClickListener(this);

	allCalls.setEnabled(false);
	onlyDisplayMissedCalls = false;

	edit = (ImageView) view.findViewById(R.id.edit);
	edit.setOnClickListener(this);

	return view;
}
 
Example 13
Project: DaiGo   File: ToolBarView.java   View Source Code Vote up 5 votes
public ToolBarView(Context context, AttributeSet attr) {

        super(context, attr);

        /**
         * 加载ToolBar布局文件
         */
        LayoutInflater.from(context).inflate(R.layout.tool_bar, this);

        titleText = (TextView) findViewById(R.id.title_bar_text);

        backButton = (Button) findViewById(R.id.title_bar_back);

        rightButton = (ImageView) findViewById(R.id.title_bar_right_button);

        titleCampus = (TextView) findViewById(R.id.title_bar_campus);

        setBackButtonVisible(false);

        setTitleCampusVisible(false);

        rightButton.setEnabled(false);

    }
 
Example 14
Project: CXJPadProject   File: WebViewActivity.java   View Source Code Vote up 5 votes
@SuppressWarnings("deprecation")
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(ResourceUtils.getIdByName(this, "layout",
            "sobot_activity_webview"));
    String bg_color = SharedPreferencesUtil.getStringData(this, "robot_current_themeColor", "");
    if (bg_color != null && bg_color.trim().length() != 0) {
        relative.setBackgroundColor(Color.parseColor(bg_color));
    }

    int robot_current_themeImg = SharedPreferencesUtil.getIntData(this, "robot_current_themeImg", 0);
    if (robot_current_themeImg != 0) {
        relative.setBackgroundResource(robot_current_themeImg);
    }
    Drawable drawable = getResources().getDrawable(ResourceUtils.getIdByName(this, "drawable", "sobot_btn_back_selector"));
    drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
    sobot_tv_left.setCompoundDrawables(drawable, null, null, null);
    sobot_tv_left.setText(getResString("sobot_back"));
    mWebView = (WebView) findViewById(getResId("sobot_mWebView"));
    mProgressBar = (ProgressBar) findViewById(getResId("sobot_loadProgress"));
    sobot_rl_net_error = (RelativeLayout) findViewById(getResId("sobot_rl_net_error"));
    sobot_webview_toolsbar = (LinearLayout) findViewById(getResId("sobot_webview_toolsbar"));
    sobot_btn_reconnect = (Button) findViewById(getResId("sobot_btn_reconnect"));
    sobot_btn_reconnect.setOnClickListener(this);
    sobot_txt_loading = (TextView) findViewById(getResId("sobot_txt_loading"));
    sobot_webview_goback = (ImageView) findViewById(getResId("sobot_webview_goback"));
    sobot_webview_forward = (ImageView) findViewById(getResId("sobot_webview_forward"));
    sobot_webview_reload = (ImageView) findViewById(getResId("sobot_webview_reload"));
    sobot_webview_copy = (ImageView) findViewById(getResId("sobot_webview_copy"));
    sobot_webview_goback.setOnClickListener(this);
    sobot_webview_forward.setOnClickListener(this);
    sobot_webview_reload.setOnClickListener(this);
    sobot_webview_copy.setOnClickListener(this);
    sobot_webview_goback.setEnabled(false);
    sobot_webview_forward.setEnabled(false);
    sobot_tv_left.setOnClickListener(this);
    setTitle("");
    setShowNetRemind(false);
    resetViewDisplay();
    initWebView();
    initBundleData(savedInstanceState);
    mWebView.loadUrl(mUrl);
    LogUtils.i("webViewActivity---" + mUrl);
}
 
Example 15
Project: iosched-reader   File: SessionDetailFragment.java   View Source Code Vote up 5 votes
private void displaySpeakersData(SessionDetailModel data) {
    final ViewGroup speakersGroup = (ViewGroup) getActivity()
            .findViewById(R.id.session_speakers_block);

    // Remove all existing speakers (everything but first child, which is the header)
    for (int i = speakersGroup.getChildCount() - 1; i >= 1; i--) {
        speakersGroup.removeViewAt(i);
    }

    final LayoutInflater inflater = getActivity().getLayoutInflater();

    boolean hasSpeakers = false;

    List<SessionDetailModel.Speaker> speakers = data.getSpeakers();

    for (final SessionDetailModel.Speaker speaker : speakers) {

        String speakerHeader = speaker.getName();
        if (!TextUtils.isEmpty(speaker.getCompany())) {
            speakerHeader += ", " + speaker.getCompany();
        }

        final View speakerView = inflater
                .inflate(R.layout.speaker_detail, speakersGroup, false);
        final TextView speakerHeaderView = (TextView) speakerView
                .findViewById(R.id.speaker_header);
        final ImageView speakerImageView = (ImageView) speakerView
                .findViewById(R.id.speaker_image);
        final TextView speakerAbstractView = (TextView) speakerView
                .findViewById(R.id.speaker_abstract);
        final ImageView plusOneIcon = (ImageView) speakerView.findViewById(R.id.gplus_icon_box);
        final ImageView twitterIcon = (ImageView) speakerView.findViewById(
                R.id.twitter_icon_box);

        setUpSpeakerSocialIcon(speaker, twitterIcon, speaker.getTwitterUrl(),
                UIUtils.TWITTER_COMMON_NAME, UIUtils.TWITTER_PACKAGE_NAME);

        setUpSpeakerSocialIcon(speaker, plusOneIcon, speaker.getPlusoneUrl(),
                UIUtils.GOOGLE_PLUS_COMMON_NAME, UIUtils.GOOGLE_PLUS_PACKAGE_NAME);

        // A speaker may have both a Twitter and GPlus page, only a Twitter page or only a
        // GPlus page, or neither. By default, align the Twitter icon to the right and the GPlus
        // icon to its left. If only a single icon is displayed, align it to the right.
        determineSocialIconPlacement(plusOneIcon, twitterIcon);

        if (!TextUtils.isEmpty(speaker.getImageUrl()) && mSpeakersImageLoader != null) {
            mSpeakersImageLoader.loadImage(speaker.getImageUrl(), speakerImageView);
        }

        speakerHeaderView.setText(speakerHeader);
        speakerImageView.setContentDescription(
                getString(R.string.speaker_googleplus_profile, speakerHeader));
        UIUtils.setTextMaybeHtml(speakerAbstractView, speaker.getAbstract());

        if (!TextUtils.isEmpty(speaker.getUrl())) {
            speakerImageView.setEnabled(true);
            speakerImageView.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Intent speakerProfileIntent = new Intent(Intent.ACTION_VIEW,
                            Uri.parse(speaker.getUrl()));
                    speakerProfileIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
                    UIUtils.preferPackageForIntent(getActivity(),
                            speakerProfileIntent,
                            UIUtils.GOOGLE_PLUS_PACKAGE_NAME);
                    startActivity(speakerProfileIntent);
                }
            });
        } else {
            speakerImageView.setEnabled(false);
            speakerImageView.setOnClickListener(null);
        }

        speakersGroup.addView(speakerView);
        hasSpeakers = true;
    }

    speakersGroup.setVisibility(hasSpeakers ? View.VISIBLE : View.GONE);
    updateEmptyView(data);
}