类android.widget.ImageButton源码实例Demo

下面列出了怎么用android.widget.ImageButton的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: visual-goodies   文件: GridAdapter.java
public View getDetailsView(LayoutInflater inflater, ViewGroup parent,
                           AwesomeViewHolder result) {
    //TODO FORCE DARK MODE
    View view = null;
    switch (mDetailsViewType) {
        case SINGLE_LINE:
            view = inflater.inflate(R.layout.griddetails_single_line, null);
            break;
        case TWO_LINES:
            view = inflater.inflate(R.layout.griddetails_two_lines, null);
            break;
        default:
        case NONE:
            return null;
    }
    view.setTag(DETAILS_VIEW_TAG);
    result.setDetailsView(view);
    result.setText1((TextView) view.findViewById(android.R.id.text1));
    result.setText2((TextView) view.findViewById(android.R.id.text2));
    result.setButton((ImageButton) view.findViewById(R.id.imageButton));
    return view;
}
 
源代码2 项目: myapplication   文件: FindGankAty.java
private void initView() {
    isConnect = SystemUtils.checkNetworkConnection(FindGankAty.this);
    mTitleBackIBtn = (ImageButton) findViewById(R.id.title_gank_back_ibtn);
    mGankClassBtn = (Button) findViewById(R.id.title_gank_class_tv);
    mRecyclerView = (RecyclerView) findViewById(R.id.find_gank_recyclerview);
    mMaterialDialog = new MaterialDialog.Builder(FindGankAty.this)
            .content("Please waiting...")
            .contentGravity(GravityEnum.CENTER)
            .progress(true, 0)
            .progressIndeterminateStyle(true)
            .show();
    mMaterialDialog.setCancelable(false);

    if (isConnect) {
        switchSelectedDatas("all");
    } else {
        mMaterialDialog.dismiss();
        SystemUtils.noNetworkAlert(FindGankAty.this);
    }
}
 
源代码3 项目: QuickerAndroid   文件: MainActivity.java
private void recreateView() {
    // 依据屏幕方向加载
    int orientation = getResources().getConfiguration().orientation;
    if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
        setContentView(R.layout.activity_main);
    } else if (orientation == Configuration.ORIENTATION_PORTRAIT) {
        setContentView(R.layout.activity_main_portrait);
    }

    // 组件引用
    txtProfileName = (TextView) findViewById(R.id.txtProfileName);
    seekbarVolume = (SeekBar) findViewById(R.id.seekbarVolume);
    btnMute = (ImageButton) findViewById(R.id.btnMute);

    // 创建action按钮
    createActionButtons();

    setupUiListeners();
}
 
@Override
protected void onCreate(Bundle savedInstanceState) {
    Log.i(getClass().getName(), "onCreate");
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_number_grapheme);

    getWindow().setStatusBarColor(Color.parseColor("#1C80CF"));

    graphemeImageView = (ImageView) findViewById(R.id.graphemeImageView);

    graphemeNextButton = (ImageButton) findViewById(R.id.loadingNextButton);

    LiteracyApplication literacyApplication = (LiteracyApplication) getApplicationContext();
    numberDao = literacyApplication.getDaoSession().getNumberDao();
    audioDao = literacyApplication.getDaoSession().getAudioDao();
}
 
源代码5 项目: friendly-plans   文件: TaskCreateFragment.java
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    FragmentTaskCreateBinding binding = DataBindingUtil.inflate(
            inflater, R.layout.fragment_task_create, container, false);
    binding.setEvents(this);

    View view = binding.getRoot();
    ImageButton playSoundIcon = (ImageButton) view.findViewById(R.id.id_btn_play_sound);

    AppComponent appComponent = ((App) getActivity().getApplication()).getAppComponent();
    soundComponent = SoundComponent.getSoundComponent(
            soundId, playSoundIcon, getActivity().getApplicationContext(), appComponent);
    appComponent.inject(this);

    binding.setSoundComponent(soundComponent);
    return view;
}
 
源代码6 项目: Popeens-DSub   文件: AlbumView.java
public AlbumView(Context context, boolean cell) {
	super(context);

	if(cell) {
		LayoutInflater.from(context).inflate(R.layout.album_cell_item, this, true);
	} else {
		LayoutInflater.from(context).inflate(R.layout.album_list_item, this, true);
	}

	coverArtView = findViewById(R.id.album_coverart);
	listenedView = (ImageView) findViewById(R.id.album_listened);
	titleView = (TextView) findViewById(R.id.album_title);
	artistView = (TextView) findViewById(R.id.album_artist);

	ratingBar = (RatingBar) findViewById(R.id.album_rating);
	ratingBar.setFocusable(false);
	starButton = (ImageButton) findViewById(R.id.album_star);
	starButton.setFocusable(false);
	moreButton = (ImageView) findViewById(R.id.item_more);

	sqlh  = new SQLiteHandler(context);

	checkable = true;
}
 
源代码7 项目: FimiX8-RE   文件: CustomVideoView.java
private void initView() {
    this.mPlayerView = (RelativeLayout) LayoutInflater.from(getContext()).inflate(R.layout.album_custom_video_view, this);
    this.mPlayerView.setOnClickListener(this);
    this.mLoadingBar = (ProgressBar) this.mPlayerView.findViewById(R.id.load_iv);
    this.mVideoView = (TextureView) this.mPlayerView.findViewById(R.id.play_video_textureview);
    this.mVideoView.setOnClickListener(this);
    this.mVideoView.setKeepScreenOn(true);
    this.mVideoView.setSurfaceTextureListener(this);
    this.mTopBarLl = (LinearLayout) this.mPlayerView.findViewById(R.id.shoto_top_tab_ll);
    this.mBottomPlayRl = (RelativeLayout) this.mPlayerView.findViewById(R.id.bottom_play_rl);
    this.mMiniPlayBtn = (ImageButton) this.mBottomPlayRl.findViewById(R.id.play_btn);
    this.mPlaySb = (SeekBar) this.mBottomPlayRl.findViewById(R.id.play_sb);
    this.mPlaySb.setOnSeekBarChangeListener(this);
    this.mMiniPlayBtn.setOnClickListener(this);
    this.mCurrentTimeTv = (TextView) this.mBottomPlayRl.findViewById(R.id.time_current_tv);
    this.mTotalTimeTv = (TextView) this.mBottomPlayRl.findViewById(R.id.total_time_tv);
    showBar(false);
    this.nameTv = (TextView) findViewById(R.id.photo_name_tv);
    this.mPlayBackIBtn = (ImageButton) findViewById(R.id.media_back_btn);
    this.mPlayBackIBtn.setOnClickListener(this);
    this.mPlayerView.setOnClickListener(this);
    LayoutParams params = new LayoutParams(this.mScreenWidth, this.mDestationHeight);
    params.addRule(13);
    this.mPlayerView.setLayoutParams(params);
}
 
private void addIconTab(final int position, int resId) {

        ImageButton tab = new ImageButton(getContext());
        tab.setFocusable(true);
        tab.setImageResource(resId);

        tab.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                pager.setCurrentItem(position);
            }
        });

        tabsContainer.addView(tab);
        tab.setSelected(position == currentPosition);
    }
 
源代码9 项目: FreezeYou   文件: ScheduledTasksAddActivity.java
private void prepareSaveButton(final int id) {
    final ImageButton saveButton = findViewById(R.id.staa_saveButton);
    saveButton.setBackgroundResource(Build.VERSION.SDK_INT < 21 ? getThemeFabDotBackground(ScheduledTasksAddActivity.this) : R.drawable.oval_ripple);
    saveButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            SharedPreferences defaultSharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
            if (isTimeTask) {
                if (saveTimeTaskData(defaultSharedPreferences, id)) {
                    finish();
                }
            } else {
                if (saveTriggerTaskData(defaultSharedPreferences, id)) {
                    finish();
                }
            }
        }
    });
}
 
源代码10 项目: Conversations   文件: AudioPlayer.java
private void startStop(ImageButton playPause) {
    if (ContextCompat.checkSelfPermission(messageAdapter.getActivity(), Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
        pendingOnClickView.push(new WeakReference<>(playPause));
        ActivityCompat.requestPermissions(messageAdapter.getActivity(), new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, ConversationsActivity.REQUEST_PLAY_PAUSE);
        return;
    }
    initializeProximityWakeLock(playPause.getContext());
    final RelativeLayout audioPlayer = (RelativeLayout) playPause.getParent();
    final ViewHolder viewHolder = ViewHolder.get(audioPlayer);
    final Message message = (Message) audioPlayer.getTag();
    if (startStop(viewHolder, message)) {
        this.audioPlayerLayouts.clear();
        this.audioPlayerLayouts.addWeakReferenceTo(audioPlayer);
        stopRefresher(true);
    }
}
 
源代码11 项目: 365browser   文件: AccessibilityTabModelListItem.java
@Override
public void onFinishInflate() {
    super.onFinishInflate();
    mTabContents = (LinearLayout) findViewById(R.id.tab_contents);
    mTitleView = (TextView) findViewById(R.id.tab_title);
    mFaviconView = (ImageView) findViewById(R.id.tab_favicon);
    mCloseButton = (ImageButton) findViewById(R.id.close_btn);

    mUndoContents = (LinearLayout) findViewById(R.id.undo_contents);
    mUndoButton = (Button) findViewById(R.id.undo_button);

    setClickable(true);
    setFocusable(true);

    mCloseButton.setOnClickListener(this);
    mUndoButton.setOnClickListener(this);
    setOnClickListener(this);
}
 
源代码12 项目: FaceT   文件: PostActivity.java
private View createView2() {
    LayoutInflater inflater2 = LayoutInflater.from(getBaseContext());
    LinearLayout view2 =
            (LinearLayout) inflater2.inflate(R.layout.activity_post_image, null, false);

    Typeface fontType = FontManager.getTypeface(getApplicationContext(), FontManager.APP_FONT);
    FontManager.markAsIconContainer(findViewById(R.id.activity_post_layout), fontType);

    mSelectImage = (ImageButton) view2.findViewById(R.id.imageButton);
    mSelectImage.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Intent intent = new Intent(
                    Intent.ACTION_PICK,
                    android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
            startActivityForResult(intent, GALLERY_REQUEST);
        }
    });
    return view2;
}
 
源代码13 项目: FoodOrdering   文件: CaptureActivity.java
/**
 * OnCreate中初始化一些辅助类,如InactivityTimer(休眠)、Beep(声音)以及AmbientLight(闪光灯)
 */
@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    // 保持Activity处于唤醒状态
    Window window = getWindow();
    window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    setContentView(R.layout.capture);

    hasSurface = false;

    inactivityTimer = new InactivityTimer(this);
    beepManager = new BeepManager(this);

    imageButton_back = (ImageButton) findViewById(R.id.capture_imageview_back);
    imageButton_back.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            finish();
        }
    });
}
 
源代码14 项目: Silence   文件: PassphrasePromptActivity.java
private void initializeResources() {
  getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
  getSupportActionBar().setCustomView(R.layout.centered_app_title);

  ImageButton okButton = (ImageButton) findViewById(R.id.ok_button);
  passphraseText       = (EditText)    findViewById(R.id.passphrase_edit);
  SpannableString hint = new SpannableString("  " + getString(R.string.PassphrasePromptActivity_enter_passphrase));
  hint.setSpan(new RelativeSizeSpan(0.9f), 0, hint.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
  hint.setSpan(new TypefaceSpan("sans-serif"), 0, hint.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);

  passphraseText.setHint(hint);
  okButton.setOnClickListener(new OkButtonClickListener());
  passphraseText.setOnEditorActionListener(new PassphraseActionListener());
  passphraseText.setImeActionLabel(getString(R.string.prompt_passphrase_activity__unlock),
                                   EditorInfo.IME_ACTION_DONE);
}
 
源代码15 项目: Maps   文件: OfflineMapActivity.java
protected void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     /*
      * 设置离线地图存储目录,在下载离线地图或初始化地图设置; 使用过程中可自行设置, 若自行设置了离线地图存储的路径,
* 则需要在离线地图下载和使用地图页面都进行路径设置
*/
     // Demo中为了其他界面可以使用下载的离线地图,使用默认位置存储,屏蔽了自定义设置
     MapsInitializer.sdcardDir = OffLineMapUtils.getSdCacheDir(this);
     setContentView(R.layout.offlinemap_activity);
     init();

     ImageButton mOffLineMapsBack = (ImageButton) findViewById(R.id.offline_back);

     mOffLineMapsBack.setOnClickListener(new View.OnClickListener() {
         @Override
         public void onClick(View view) {
             finish();
         }
     });
 }
 
源代码16 项目: MalwareBuster   文件: MainActivity.java
private void refreshGlobalHookControls() {
    boolean currentStatus = prefs.getBoolean(Common.GLOBALHOOK, false);

    ImageButton glbHookbtn = (ImageButton)findViewById(R.id.btnGlobalHook);
    ListView list = (ListView) findViewById(R.id.lstApps);
    TextView globalWarningTextView = (TextView) findViewById(R.id.globalWarningTextView);
    SearchView searchApp = (SearchView) findViewById(R.id.searchApp);

    if (currentStatus) {
        glbHookbtn.setBackgroundColor(0xff34bcf1);
        list.setVisibility(View.GONE);
        globalWarningTextView.setVisibility(View.VISIBLE);
        searchApp.setEnabled(false);
    }
    else {
        glbHookbtn.setBackgroundColor(Color.DKGRAY);
        list.setVisibility(View.VISIBLE);
        globalWarningTextView.setVisibility(View.GONE);
        searchApp.setEnabled(true);
    }
}
 
源代码17 项目: cast-videos-android   文件: LocalPlayerActivity.java
private void loadViews() {
    mVideoView = (VideoView) findViewById(R.id.videoView1);
    mTitleView = (TextView) findViewById(R.id.textView1);
    mDescriptionView = (TextView) findViewById(R.id.textView2);
    mDescriptionView.setMovementMethod(new ScrollingMovementMethod());
    mAuthorView = (TextView) findViewById(R.id.textView3);
    mStartText = (TextView) findViewById(R.id.startText);
    mStartText.setText(Utils.formatMillis(0));
    mEndText = (TextView) findViewById(R.id.endText);
    mSeekbar = (SeekBar) findViewById(R.id.seekBar1);
    mPlayPause = (ImageView) findViewById(R.id.imageView2);
    mLoading = (ProgressBar) findViewById(R.id.progressBar1);
    mControllers = findViewById(R.id.controllers);
    mContainer = findViewById(R.id.container);
    mCoverArt = (ImageView) findViewById(R.id.coverArtView);
    ViewCompat.setTransitionName(mCoverArt, getString(R.string.transition_image));
    mPlayCircle = (ImageButton) findViewById(R.id.play_circle);
    mPlayCircle.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            togglePlayback();
        }
    });
}
 
源代码18 项目: 4pdaClient-plus   文件: CuratorFragment.java
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    view = inflater.inflate(R.layout.curator_fragment, container, false);
    webView = (AdvWebView) findViewById(R.id.wvBody);
    FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
    if (App.getInstance().getPreferences().getBoolean("pancilInActionBar", false)) {
        fab.hide();
    } else {
        setHideFab(fab);
        setFabColors(fab);
        fab.setOnClickListener(view -> webView.evalJs("getIds();"));
    }
    ImageButton up = (ImageButton) findViewById(R.id.btnUp);
    ImageButton down = (ImageButton) findViewById(R.id.btnDown);
    up.setOnClickListener(v -> webView.pageUp(true));
    down.setOnClickListener(v -> webView.pageDown(true));
    initSwipeRefreshLayout();
    webView.addJavascriptInterface(this, "HTMLOUT");
    topicId = getArguments().getString("TOPIC_ID");
    url = getArguments().getString("URL");
    load(url, topicId);
    return view;
}
 
源代码19 项目: myapplication   文件: FindGankDetailAty.java
private void initView() {
    titlBackIbtn = (ImageButton) findViewById(R.id.title_gank_detail_back_ibtn);
    mMarqueeTextView = (MarqueeTextView) findViewById(R.id.title_detail_gank_class_tv);
    mMarqueeTextView.setEllipsize(TextUtils.TruncateAt.MARQUEE);
    mMarqueeTextView.setSingleLine(true);
    mShareIbtn = (ImageButton) findViewById(R.id.title_detail_gank_share_ibtn);
    mNumberProgressBar = (NumberProgressBar) findViewById(R.id.find_gank_detail_numpbar);
    mWebView = (WebView) findViewById(R.id.find_gank_detail_wv);
}
 
源代码20 项目: LoyalNativeSlider   文件: ZoomableView.java
private void cover_on(LinearLayout cover, final ImageButton cornerButton) {
    if (bottomFadeDescription && Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1)
        cover.animate().alpha(1f);

    if (animateCloseButton && cornerButton.getVisibility() != View.GONE && Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
        cornerButton.animate().alpha(1f).withEndAction(new Runnable() {
            @Override
            public void run() {
                cornerButton.setEnabled(true);
            }
        });

}
 
源代码21 项目: FilterMenu   文件: FilterMenu.java
public Builder addItem(Drawable icon) {
            ImageButton view = (ImageButton) inflater.inflate(R.layout.menu_item, null, false);
            view.setImageDrawable(icon);
//            TypedValue value = new TypedValue();
//            ctx.getTheme().resolveAttribute(R.attr.selectableItemBackgroundBorderless, value, true);
//            view.setBackgroundResource(value.resourceId);
            addItem(view);
            return this;
        }
 
源代码22 项目: wakao-app   文件: ActivitySetting.java
private void initView() {
	TextView tView = (TextView) findViewById(R.id.top_bar_title);
	ImageButton iButton = (ImageButton) findViewById(R.id.m_toggle);
	checkUpdate = (TextView) findViewById(R.id.checkUpdate);
	agent = new FeedbackAgent(this);
	agent.sync();

	ac_desc = (TextView) findViewById(R.id.account_settings_desc);
	ac = (TextView) findViewById(R.id.account_name);
	cacheSize = (TextView) findViewById(R.id.cache_size);
	logout = (TextView) findViewById(R.id.logout);

	tView.setText("设置");
	iButton.setVisibility(View.GONE);
	cacheSize.setText(AppTool.getCacheSize(this));
	
	checkUpdate.setOnClickListener(new View.OnClickListener() {
		public void onClick(View v) {
			// 如果想程序启动时自动检查是否需要更新, 把下面两行代码加在Activity 的onCreate()函数里。
			com.umeng.common.Log.LOG = true;
			
			UmengUpdateAgent.setUpdateOnlyWifi(false); // 目前我们默认在Wi-Fi接入情况下才进行自动提醒。如需要在其他网络环境下进行更新自动提醒,则请添加该行代码
			UmengUpdateAgent.setUpdateAutoPopup(false);
			UmengUpdateAgent.setUpdateListener(new MyUpdateListener(mContext));
			UmengUpdateAgent.setDownloadListener(new UpdateDownloadListener(mContext));
			UmengUpdateAgent.forceUpdate(mContext);
		}
	});
}
 
源代码23 项目: Conquer   文件: SettingActivity.java
private void init() {
	block_0 = (ImageButton) findViewById(R.id.block_0);
	block_1 = (ImageButton) findViewById(R.id.block_1);
	block_2 = (ImageButton) findViewById(R.id.block_2);
	block_3 = (ImageButton) findViewById(R.id.block_3);

	block_0.setOnClickListener(this);
	block_1.setOnClickListener(this);
	block_2.setOnClickListener(this);
	block_3.setOnClickListener(this);

	tv_alert_audio = (TextView) findViewById(R.id.tv_alert_audio);
	tv_alert_time = (TextView) findViewById(R.id.tv_alert_time);
	tv_version = (TextView) findViewById(R.id.tv_version);
	findViewById(R.id.ll_alert_audio).setOnClickListener(this);
	findViewById(R.id.ll_alarm).setOnClickListener(this);
	findViewById(R.id.ll_black).setOnClickListener(this);
	findViewById(R.id.ll_version).setOnClickListener(this);
	findViewById(R.id.ll_about).setOnClickListener(this);
	findViewById(R.id.ll_use).setOnClickListener(this);
	findViewById(R.id.ll_help).setOnClickListener(this);
	setBlack((Integer) SP.get(context, "theme", 0));
	String defaultUri = (String) SP.get(context, "alert_audio", "");
	tv_alert_audio.setText(RingtoneManager.getRingtone(context, Uri.parse(defaultUri)).getTitle(context));
	tv_alert_time.setText(s[(Integer) SP.get(context, "alert_time", 0)]);
	tv_version.setText(CommonUtils.getVersionName(context));
}
 
源代码24 项目: arcusandroid   文件: IrrigationFragment.java
@Override
public void doStatusSection() {
    startStopButton = (ImageButton) statusView.findViewById(R.id.open_close_button);
    delayButton = (ImageButton) statusView.findViewById(R.id.delay_button);

    powerStatusView = statusView.findViewById(R.id.irrigation_status);
    TextView batteryTopText = (TextView) powerStatusView.findViewById(R.id.top_status_text);
    TextView batteryBottomText = (TextView) powerStatusView.findViewById(R.id.bottom_status_text);
    updatePowerSourceAndBattery(batteryTopText, batteryBottomText);

    startStopButton.setOnClickListener(this);
    delayButton.setOnClickListener(this);

    setImageGlowMode(GlowableImageView.GlowMode.OPEN_CLOSE);
}
 
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.fragment_vector_layer_cache, container, false);
    if (mVectorLayer == null)
        return v;

    final ProgressBar rebuildCacheProgress = v.findViewById(R.id.rebuildCacheProgressBar);
    final Button buildCacheButton = v.findViewById(R.id.rebuild_cache);
    buildCacheButton.setOnClickListener((View.OnClickListener) getActivity());
    final ImageButton cancelBuildCacheButton = v.findViewById(R.id.cancelBuildCacheButton);
    cancelBuildCacheButton.setOnClickListener((View.OnClickListener) getActivity());
    final View progressView = v.findViewById(R.id.rebuild_progress);

    mRebuildCacheReceiver = new BroadcastReceiver() {
        public void onReceive(Context context, Intent intent) {
            int max = intent.getIntExtra(RebuildCacheService.KEY_MAX, 0);
            int progress = intent.getIntExtra(RebuildCacheService.KEY_PROGRESS, 0);
            int layer = intent.getIntExtra(ConstantsUI.KEY_LAYER_ID, NOT_FOUND);

            if (layer == mVectorLayer.getId()) {
                rebuildCacheProgress.setMax(max);
                rebuildCacheProgress.setProgress(progress);
            }

            if (progress == 0) {
                buildCacheButton.setEnabled(true);
                progressView.setVisibility(View.GONE);
            } else {
                buildCacheButton.setEnabled(false);
                progressView.setVisibility(View.VISIBLE);
            }

            mActivity.onFeaturesCountChanged();
        }
    };

    return v;
}
 
源代码26 项目: arcusandroid   文件: SomfyBlindsFragment.java
@Override
public void doStatusSection() {
    leftButton = (ImageButton) statusView.findViewById(R.id.left_button);
    leftButton.setOnClickListener(this);
    middleButton = (ImageButton) statusView.findViewById(R.id.middle_button);
    middleButton.setOnClickListener(this);
    rightButton = (ImageButton) statusView.findViewById(R.id.right_button);
    rightButton.setOnClickListener(this);

    setImageGlowMode(GlowableImageView.GlowMode.OFF);
}
 
源代码27 项目: arcusandroid   文件: SomfyBlindsFragment.java
private void updateButton(final ImageButton button, final boolean enabled, final int image, final int visibility) {
    button.setVisibility(visibility);
    button.setEnabled(enabled);
    button.setAlpha(enabled ? BUTTON_ENABLED_ALPHA : BUTTON_DISABLED_ALPHA);
    Activity a = getActivity();
    if(a != null){
        button.setBackground(ContextCompat.getDrawable(a, image));
    }
}
 
源代码28 项目: test-samples   文件: NA_Native.java
private void tileClick(int x, int y) {
    ImageButton tile = tiles[x][y];

    if (tile.getTag() == STATE_HIGHLIGHTED) {
        swap(swapTile[0], swapTile[1], x, y);
        swapTile = new int[]{-1, -1};
        incrementRound();
    } else {
        swapTile = new int[]{x, y};
        tile.setTag(STATE_PRESSED);
        tile.setEnabled(false);
        tile.setBackgroundResource(R.drawable.button_game_pressed);
        highlightNeighbours(x, y);
    }
}
 
源代码29 项目: WayHoo   文件: QueryCityActivity.java
private void initViews() {
	mInflater = LayoutInflater.from(this);
	mRootView = (RelativeLayout) findViewById(R.id.city_add_bg);
	mBackBtn = (ImageView) findViewById(R.id.back_image);
	mLocationTV = (TextView) findViewById(R.id.location_text);
	mQueryCityET = (EditText) findViewById(R.id.queryCityText);
	mQueryCityExitBtn = (ImageButton) findViewById(R.id.queryCityExit);

	mQueryCityListView = (ListView) findViewById(R.id.cityList);
	mQueryCityListView.setOnItemClickListener(this);
	mSearchCityAdapter = new QueryCityAdapter(QueryCityActivity.this,
			mCities);
	mQueryCityListView.setAdapter(mSearchCityAdapter);
	mQueryCityListView.setTextFilterEnabled(true);
	mFilter = mSearchCityAdapter.getFilter();

	// mEmptyCityView = (TextView) findViewById(R.id.noCityText);

	mHotCityGridView = (GridView) findViewById(R.id.hotCityGrid);
	mHotCityGridView.setOnItemClickListener(this);
	mHotCityGridView.setAdapter(new HotCityAdapter());

	mBackBtn.setOnClickListener(this);
	mLocationTV.setOnClickListener(this);
	mQueryCityExitBtn.setOnClickListener(this);
	mQueryCityET.addTextChangedListener(this);

	String cityName = getCityName();
	if (TextUtils.isEmpty(cityName)) {
		startLocation(mCityNameStatus);
	} else {
		mLocationTV.setText(formatBigMessage(cityName));
	}
}
 
源代码30 项目: SimplePomodoro-android   文件: CommonAsyncTask.java
CommonAsyncTask(TaskListFragment fragment) {
mFragment = fragment;
   client = fragment.service;
   listView = (ListView) fragment.rootView.findViewById(R.id.list_task);
   refreshBtn = (ImageButton) fragment.rootView.findViewById(R.id.btn_add_task);
   progressBar = (ProgressBar) fragment.rootView.findViewById(R.id.progressBar1);
 }
 
 类所在包
 同包方法