本文整理匯總了Java中android.support.v7.widget.AppCompatImageButton類的典型用法代碼示例。如果您正苦於以下問題:Java AppCompatImageButton類的具體用法?Java AppCompatImageButton怎麽用?Java AppCompatImageButton使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
AppCompatImageButton類屬於android.support.v7.widget包,在下文中一共展示了AppCompatImageButton類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setupViews
import android.support.v7.widget.AppCompatImageButton; //導入依賴的package包/類
private void setupViews() {
drawer = (DrawerLayout) findViewById(R.id.drawerlayout);
navview = (NavigationView) findViewById(R.id.navview);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, R.string.main_drawer_open, R.string.main_drawer_close);
//drawer.addDrawerListener(this);
toggle.syncState();
navview.setNavigationItemSelectedListener(this);
View _view = findViewById(R.id.bottom_search_results);
resultsBottom = BottomSheetBehavior.from(_view);
resultsBottom.setHideable(true);
resultsBottom.setState(BottomSheetBehavior.STATE_HIDDEN);
resultsRv = (RecyclerView) findViewById(R.id.rv_results);
resultsRv.setLayoutManager(new LinearLayoutManager(MainActivity.this,
LinearLayoutManager.VERTICAL, false));
photoIv = (SquareImageView) findViewById(R.id.iv_photo);
searchFab = (FloatingActionButton) findViewById(R.id.fab_search);
closeBottomBtn = (AppCompatImageButton) findViewById(R.id.btn_close_bottom);
indicatorLoadingLayout = (LinearLayout) findViewById(R.id.layout_main_loading);
indicatorStatusTv = (AppCompatTextView) findViewById(R.id.tv_progress_status);
AppCompatTextView versionAppTv = navview.getHeaderView(0).findViewById(R.id.tv_header_app_version);
versionAppTv.setText(C.getAppVersion(MainActivity.this));
}
示例2: initPopupMenu
import android.support.v7.widget.AppCompatImageButton; //導入依賴的package包/類
private void initPopupMenu() {
@SuppressLint("InflateParams")
View view = LayoutInflater.from(this).inflate(R.layout.popup_menu, null);
mPopupMenu = new PopupWindow(this);
mPopupMenu.setBackgroundDrawable(new BitmapDrawable());
mPopupMenu.setContentView(view);
mPopupMenu.setOutsideTouchable(true);
mPopupMenu.setFocusable(true);
mLlControlButtons = (RelativeLayout) view.findViewById(R.id.popup_menu_rl_arrows);
mBtnBack = (AppCompatImageButton) view.findViewById(R.id.popup_menu_btn_back);
mBtnFoward = (AppCompatImageButton) view.findViewById(R.id.popup_menu_btn_forward);
mBtnBack.setOnClickListener(this);
mBtnFoward.setOnClickListener(this);
view.findViewById(R.id.popup_menu_btn_refresh).setOnClickListener(this);
view.findViewById(R.id.popup_menu_btn_copy_link).setOnClickListener(this);
view.findViewById(R.id.popup_menu_btn_open_with_other_browser).setOnClickListener(this);
view.findViewById(R.id.popup_menu_btn_share).setOnClickListener(this);
}
示例3: initPopupMenu
import android.support.v7.widget.AppCompatImageButton; //導入依賴的package包/類
private void initPopupMenu() {
@SuppressLint("InflateParams")
View view = LayoutInflater.from(this).inflate(R.layout.popup_menu, null);
mPopupMenu = new PopupWindow(this);
mPopupMenu.setContentView(view);
mPopupMenu.setOutsideTouchable(true);
mPopupMenu.setBackgroundDrawable(new ColorDrawable(0));
mPopupMenu.setFocusable(true);
mLlControlButtons = (RelativeLayout) view.findViewById(R.id.popup_menu_rl_arrows);
mBtnBack = (AppCompatImageButton) view.findViewById(R.id.popup_menu_btn_back);
mBtnFoward = (AppCompatImageButton) view.findViewById(R.id.popup_menu_btn_forward);
mBtnBack.setOnClickListener(this);
mBtnFoward.setOnClickListener(this);
view.findViewById(R.id.popup_menu_btn_refresh).setOnClickListener(this);
view.findViewById(R.id.popup_menu_btn_copy_link).setOnClickListener(this);
view.findViewById(R.id.popup_menu_btn_open_with_other_browser).setOnClickListener(this);
view.findViewById(R.id.popup_menu_btn_share).setOnClickListener(this);
}
示例4: UserMessageViewHolder
import android.support.v7.widget.AppCompatImageButton; //導入依賴的package包/類
public UserMessageViewHolder(View itemView) {
super(itemView);
mTxFirstMessageBody = (DetectLTextView) itemView.findViewById(R.id.tx_first_message_body);
mTxSecondMessageBody = (DetectLTextView) itemView.findViewById(R.id.tx_second_message_body);
mTxMatchedStatus = (AppCompatTextView) itemView.findViewById(R.id.tx_matched_status);
mBtnDeleteMessage = (AppCompatImageButton) itemView.findViewById(R.id.btn_delete);
mTxMessageStatus = (AppCompatTextView) itemView.findViewById(R.id.tx_message_status);
mTxCrossIn = (AppCompatTextView) itemView.findViewById(R.id.tx_cross_in);
mVSeparator = itemView.findViewById(R.id.v_separator);
//handle delete action
mBtnDeleteMessage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mUserMessageListener != null) {
mUserMessageListener.onDeleteMessage(mData.get(getAdapterPosition()).getMessageId(), getAdapterPosition());
}
}
});
}
示例5: initViews
import android.support.v7.widget.AppCompatImageButton; //導入依賴的package包/類
@Override
public void initViews() {
inflater.inflate(R.layout.widget_metric_stopwatch, this);
startResumeButton = (AppCompatImageButton) findViewById(R.id.start_resume);
findViewById(R.id.reset).setOnClickListener(v -> reset());
findViewById(R.id.reset).setVisibility(View.GONE);
startResumeButton.setOnClickListener(v -> {
if (!running) {
startResumeButton.setImageResource(R.drawable.ic_pause_black_48dp);
start();
} else {
startResumeButton.setImageResource(R.drawable.ic_play_arrow_black_48dp);
stop();
}
});
}
示例6: createButton
import android.support.v7.widget.AppCompatImageButton; //導入依賴的package包/類
private View createButton() {
ImageButton button = new AppCompatImageButton(context);
view.setLayoutParams(new LinearLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT));
button.setImageResource(new Attrs(context).resourceId(R.attr.timeIcon));
//
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
saveNode();
TimePickerFragment newFragment = new TimePickerFragment();
newFragment.setComponent(TimeAttributeComponent.this);
newFragment.show(context.getSupportFragmentManager(), "timePicker");
}
});
return button;
}
示例7: getHamburgerButton
import android.support.v7.widget.AppCompatImageButton; //導入依賴的package包/類
/**
* A matcher to get the ActionBar home/hamburger button.
* <p>
* Taken from: http://stackoverflow.com/a/34658817/4624156
*
* @return Matcher.
*/
public static Matcher<View> getHamburgerButton()
{
return allOf(
withParent(withClassName(is(Toolbar.class.getName()))),
withClassName(anyOf(is(ImageButton.class.getName()),
is(AppCompatImageButton.class.getName()))));
}
示例8: setNavIcon
import android.support.v7.widget.AppCompatImageButton; //導入依賴的package包/類
/**
* Note that to use this method rather than {@link Toolbar#setNavigationIcon(int)}, as this method will expand the click area.
*
* @param icon the navigation icon.
*/
public void setNavIcon(@DrawableRes int icon) {
setNavigationIcon(icon);
AppCompatImageButton navIcon = (AppCompatImageButton) getChildAt(1);
Toolbar.LayoutParams lp = (LayoutParams) navIcon.getLayoutParams();
lp.width = ViewGroup.LayoutParams.WRAP_CONTENT;
lp.height = ViewGroup.LayoutParams.MATCH_PARENT;
navIcon.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
navIcon.setLayoutParams(lp);
}
示例9: PicDialog
import android.support.v7.widget.AppCompatImageButton; //導入依賴的package包/類
public PicDialog(Context context) {
super(context, R.style.AppNoActionBarTheme);
setOwnerActivity((Activity) context);
setContentView(R.layout.dialog_pic);
StatusBarUtil.MIUISetStatusBarLightMode(getOwnerActivity(), true);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
View decorView = getWindow().getDecorView();
int option = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
decorView.setSystemUiVisibility(option);
getWindow().setStatusBarColor(Color.TRANSPARENT);
}
ButterKnife.bind(this);
if ((boolean) SPUtils.get(getContext(), AppConfig.click_to_back, false))
photoDraweeView.setOnViewTapListener(new OnViewTapListener() {
@Override
public void onViewTap(View view, float x, float y) {
dismiss();
}
});
photoDraweeView.setAllowParentInterceptOnEdge(false);
photoDraweeView.setEnableDraweeMatrix(false);
for (AppCompatImageButton imageButton : imageButtons)
imageButton.setOnClickListener(this);
getWindow().setWindowAnimations(R.style.dialogStyle);
behavior = BottomSheetBehavior.from(findViewById(R.id.bottom_view));
}
示例10: ViewHolder
import android.support.v7.widget.AppCompatImageButton; //導入依賴的package包/類
ViewHolder(View itemView) {
super(itemView);
cardView = (CardView) itemView.findViewById(R.id.cardView);
skeletonGroup = (SkeletonGroup) itemView.findViewById(R.id.skeletonGroup);
photoACImgV = (AppCompatImageView) itemView.findViewById(R.id.photoACImgV);
newFlagTv = (TextView) itemView.findViewById(R.id.newFlagTv);
titleTv = (TextView) itemView.findViewById(R.id.titleTv);
descriptionTv = (TextView) itemView.findViewById(R.id.descriptionTv);
addToParkingImgBtn = (AppCompatImageButton) itemView.findViewById(R.id.addToParkingImgBtn);
compareImgBtn = (AppCompatImageButton) itemView.findViewById(R.id.compareImgBtn);
priceTv = (TextView) itemView.findViewById(R.id.priceTv);
}
示例11: initView
import android.support.v7.widget.AppCompatImageButton; //導入依賴的package包/類
void initView() {
mMapView = (MapView) findViewById(R.id.map);
mLocbtn = (AppCompatImageButton) findViewById(R.id.locbtn);
mActionLocate = (FloatingActionButton) findViewById(R.id.action_locate);
mActionSettings = (FloatingActionButton) findViewById(R.id.action_settings);
mActionReminder = (FloatingActionButton) findViewById(R.id.action_reminder);
mFloatingActionsMenu = (FloatingActionsMenu) findViewById(R.id.floating_actions_menu);
mInfoTextView = (TextView) findViewById(R.id.info_text_view);
mActionLocate.setOnClickListener(this);
mActionSettings.setOnClickListener(this);
mActionReminder.setOnClickListener(this);
mLocbtn.setOnClickListener(this);
}
示例12: ViewHolder
import android.support.v7.widget.AppCompatImageButton; //導入依賴的package包/類
public ViewHolder(View itemView) {
super(itemView);
txtRule = (TextView) itemView.findViewById(R.id.txt_rule);
btnDelete = (AppCompatImageButton) itemView.findViewById(R.id.btn_delete);
btnDelete.setOnClickListener(this);
}
示例13: bindView
import android.support.v7.widget.AppCompatImageButton; //導入依賴的package包/類
@SuppressLint("SetJavaScriptEnabled")
private void bindView() {
// Toolbar
mTvTitle = (TextView) findViewById(R.id.toolbar_tv_title);
mTvUrl = (TextView) findViewById(R.id.toolbar_tv_url);
findViewById(R.id.toolbar_root).setBackgroundColor(getIntent().getIntExtra(EXTRA_COLOR, Color.BLACK));
mCoordinatorLayout = (CoordinatorLayout) findViewById(R.id.a_web_viewer_coordinatorlayout);
mProgressBar = (ProgressBar) findViewById(R.id.a_web_viewer_pb);
mSwipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.a_web_viewer_srl);
mWebView = (WebView) findViewById(R.id.a_web_viewer_wv);
mSwipeRefreshLayout.setOnRefreshListener(this);
WebSettings webSettings = mWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
webSettings.setDisplayZoomControls(false);
}
webSettings.setBuiltInZoomControls(true);
webSettings.setSupportZoom(true);
webSettings.setDomStorageEnabled(true);
mWebView.setWebChromeClient(new MyWebChromeClient());
mWebView.setWebViewClient(new MyWebViewClient());
mWebView.setDownloadListener(this);
mWebView.setOnCreateContextMenuListener(this);
mBtnMore = (AppCompatImageButton) findViewById(R.id.toolbar_btn_more);
//noinspection ConstantConditions
findViewById(R.id.toolbar_btn_close).setOnClickListener(this);
//noinspection ConstantConditions
mBtnMore.setOnClickListener(this);
// PopupWindow
initPopupMenu();
}
示例14: bindView
import android.support.v7.widget.AppCompatImageButton; //導入依賴的package包/類
@SuppressLint("SetJavaScriptEnabled")
private void bindView() {
// Toolbar
mTvTitle = (TextView) findViewById(R.id.toolbar_tv_title);
mTvUrl = (TextView) findViewById(R.id.toolbar_tv_url);
mCoordinatorLayout = (CoordinatorLayout) findViewById(R.id.a_web_viewer_coordinatorlayout);
mProgressBar = (ProgressBar) findViewById(R.id.a_web_viewer_pb);
mSwipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.a_web_viewer_srl);
mWebView = (WebView) findViewById(R.id.a_web_viewer_wv);
mSwipeRefreshLayout.setOnRefreshListener(this);
WebSettings webSettings = mWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
webSettings.setDisplayZoomControls(false);
}
webSettings.setBuiltInZoomControls(true);
webSettings.setSupportZoom(true);
webSettings.setDomStorageEnabled(true);
mWebView.setWebChromeClient(new MyWebChromeClient());
mWebView.setWebViewClient(new MyWebViewClient());
mWebView.setDownloadListener(this);
mWebView.setOnCreateContextMenuListener(this);
mBtnMore = (AppCompatImageButton) findViewById(R.id.toolbar_btn_more);
//noinspection ConstantConditions
findViewById(R.id.toolbar_btn_close).setOnClickListener(this);
//noinspection ConstantConditions
mBtnMore.setOnClickListener(this);
// PopupWindow
initPopupMenu();
}
示例15: findViews
import android.support.v7.widget.AppCompatImageButton; //導入依賴的package包/類
protected void findViews() {
content = (LinearLayout) findViewById(R.id.content);
stepsScrollView = (ScrollView) findViewById(R.id.steps_scroll);
progressBar = (ProgressBar) findViewById(R.id.progress_bar);
previousStepButton = (AppCompatImageButton) findViewById(R.id.down_previous);
nextStepButton = (AppCompatImageButton) findViewById(R.id.down_next);
bottomNavigation = (RelativeLayout) findViewById(R.id.bottom_navigation);
}