當前位置: 首頁>>代碼示例>>Java>>正文


Java AppCompatImageButton類代碼示例

本文整理匯總了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));
}
 
開發者ID:maddog05,項目名稱:whatanime-android,代碼行數:24,代碼來源:MainActivity.java

示例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);
}
 
開發者ID:AmniX,項目名稱:AdBlockedWebView-Android,代碼行數:21,代碼來源:AdBlocksWebViewActivity.java

示例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);
}
 
開發者ID:fobid,項目名稱:webviewer-android,代碼行數:23,代碼來源:WebViewerActivity.java

示例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());
            }
        }
    });
}
 
開發者ID:atahani,項目名稱:telepathy-android,代碼行數:20,代碼來源:UserMessageAdapter.java

示例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();
        }
    });
}
 
開發者ID:frc2052,項目名稱:FRC-Krawler,代碼行數:17,代碼來源:StopwatchMetricWidget.java

示例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;
    }
 
開發者ID:openforis,項目名稱:collect-mobile,代碼行數:17,代碼來源:TimeAttributeComponent.java

示例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()))));
}
 
開發者ID:jbmlaird,項目名稱:DiscogsBrowser,代碼行數:15,代碼來源:TestUtils.java

示例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);
}
 
開發者ID:Mindjet,項目名稱:LiteReader,代碼行數:15,代碼來源:JToolBar.java

示例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));
}
 
開發者ID:lanyuanxiaoyao,項目名稱:PicKing,代碼行數:36,代碼來源:PicDialog.java

示例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);

}
 
開發者ID:rasoulmiri,項目名稱:Skeleton,代碼行數:15,代碼來源:AdapterSample1.java

示例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);
}
 
開發者ID:InnoFang,項目名稱:FamilyBond,代碼行數:15,代碼來源:MapActivity.java

示例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);
}
 
開發者ID:j2rong,項目名稱:HeadsOff,代碼行數:8,代碼來源:WhiteListAdapter.java

示例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();
}
 
開發者ID:AmniX,項目名稱:AdBlockedWebView-Android,代碼行數:39,代碼來源:AdBlocksWebViewActivity.java

示例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();
}
 
開發者ID:fobid,項目名稱:webviewer-android,代碼行數:38,代碼來源:WebViewerActivity.java

示例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);
}
 
開發者ID:ernestoyaquello,項目名稱:vertical-stepper-form,代碼行數:9,代碼來源:VerticalStepperFormLayout.java


注:本文中的android.support.v7.widget.AppCompatImageButton類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。