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


Java View.getId方法代碼示例

本文整理匯總了Java中android.view.View.getId方法的典型用法代碼示例。如果您正苦於以下問題:Java View.getId方法的具體用法?Java View.getId怎麽用?Java View.getId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.view.View的用法示例。


在下文中一共展示了View.getId方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onClick

import android.view.View; //導入方法依賴的package包/類
@OnClick({R.id.btnEmail, R.id.btnFacebook, R.id.btnTwitter, R.id.btnGoogle})
void onClick(View view) {
    switch (view.getId()) {
        case R.id.btnEmail: {
            router.toEmailLogin();
            break;
        }
        case R.id.btnFacebook: {
            // TODO fb login
            break;
        }
        case R.id.btnGoogle: {
            final Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(apiClient);
            startActivityForResult(signInIntent, RC_GOOGLE_SIGNIN);

            break;
        }
        case R.id.btnTwitter: {
            // TODO twitter login
            break;
        }
        default: {
            break;
        }
    }
}
 
開發者ID:sztomek,項目名稱:cleanarchitecture-unidirectional,代碼行數:27,代碼來源:LoginActivity.java

示例2: onRestoreInstanceState

import android.view.View; //導入方法依賴的package包/類
@Override
protected void onRestoreInstanceState(Parcelable state) {
  if (!(state instanceof SavedState)) {
    super.onRestoreInstanceState(state);
    return;
  }

  final SavedState ss = (SavedState) state;
  super.onRestoreInstanceState(ss.getSuperState());

  final SparseArray<Parcelable> behaviorStates = ss.behaviorStates;

  for (int i = 0, count = getChildCount(); i < count; i++) {
    final View child = getChildAt(i);
    final int childId = child.getId();
    final LayoutParams lp = getResolvedLayoutParams(child);
    final Behavior b = lp.getBehavior();

    if (childId != NO_ID && b != null) {
      Parcelable savedState = behaviorStates.get(childId);
      if (savedState != null) {
        b.onRestoreInstanceState(this, child, savedState);
      }
    }
  }
}
 
開發者ID:commonsguy,項目名稱:cwac-crossport,代碼行數:27,代碼來源:CoordinatorLayout.java

示例3: onClick

import android.view.View; //導入方法依賴的package包/類
@Override
public void onClick(View view) {
    switch (view.getId()) {
        case R.id.buttonTransfer:
            if (isValidTransferCash())
                new AccountService(this).isExist(editTextToWallet.getText().toString(), REQUEST_IS_EXIST);
            break;

        case R.id.buttonScanQR:
            openQRScanner();
            break;

        case R.id.buttonClear:
            clearInputWallet(view);
            break;

        default:
            break;
    }
}
 
開發者ID:humaniq,項目名稱:humaniq-android,代碼行數:21,代碼來源:TransferCoinsFragment.java

示例4: onClick

import android.view.View; //導入方法依賴的package包/類
@Override
public void onClick(View view) {
    switch (view.getId()) {
        case R.id.sign_in_button:
            Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);
            startActivityForResult(signInIntent, 1);
            break;
        case R.id.sign_out_button:
            Auth.GoogleSignInApi.signOut(mGoogleApiClient).setResultCallback(
                    new ResultCallback<Status>() {
                        @Override
                        public void onResult(Status status) {
                            Log.w("credentials","Status: "+ status.getStatus());
                            Log.w("credentials","StatusMessage: "+ status.getStatusMessage());
                        }
                    });
            break;
    }
}
 
開發者ID:karlotoy,項目名稱:perfectTune,代碼行數:20,代碼來源:SignInActivity.java

示例5: onClick

import android.view.View; //導入方法依賴的package包/類
@Override
public void onClick(View v) {

    //        dialogOnclickInterface = (IDialogOnclickInterface) context;
    switch (v.getId()) {
        //            case R.id.confirm:
        ////                dialogOnclickInterface.confirmOnclick();
        ////                turnGPSOn(getContext());
        //                Intent intent = new Intent(
        //                        Settings.ACTION_LOCATION_SOURCE_SETTINGS);
        //                context.startActivity(intent);
        //              cancel();
        //                break;

        default:
            break;
    }
}
 
開發者ID:yiwent,項目名稱:Mobike,代碼行數:19,代碼來源:SelectDialog.java

示例6: onClick

import android.view.View; //導入方法依賴的package包/類
@OnClick({R.id.btn_sign_up, R.id.btn_cancel})
@Override
public void onClick(View v) {
    switch (v.getId()) {
        case R.id.btn_sign_up:
            switch (mType) {
                case 1:
                    InvitationActivity.show(mContext, mInvitationImg);
                    break;
                case 2:
                    mPresenter.signUp(mDetail.getId());
                    break;
            }
            break;
        case R.id.btn_cancel:
            DialogHelper.getConfirmDialog(mContext, "", "是否確認取消?", "是", "否", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    mPresenter.cancelApply(mDetail.getId());
                }
            }).show();
            break;
    }
}
 
開發者ID:hsj-xiaokang,項目名稱:OSchina_resources_android,代碼行數:25,代碼來源:SignUpFragment.java

示例7: save

import android.view.View; //導入方法依賴的package包/類
public void save(View view) {
    vibrator.vibrate(60);
    switch (view.getId()) {
        case R.id.jpg:
            Viewshot.of(frameLayout.getRootView()).setOnSaveResultListener(this).toJPG().save();
            break;
        case R.id.png:
            Viewshot.of(frameLayout).setOnSaveResultListener(this).toPNG().save();
            break;
        case R.id.nomedia:
            Viewshot.of(frameLayout).setOnSaveResultListener(this).toNomedia().save();
            break;
    }

}
 
開發者ID:Muddz,項目名稱:Viewshot,代碼行數:16,代碼來源:MainActivity.java

示例8: onClick

import android.view.View; //導入方法依賴的package包/類
@Override
public void onClick(View v) {
    if (v.getId() == R.id.fullscreen && currentState == CURRENT_STATE_NORMAL) {
        Toast.makeText(getContext(), "Play video first", Toast.LENGTH_SHORT).show();
        return;
    }
    super.onClick(v);
}
 
開發者ID:wp521,項目名稱:MyFire,代碼行數:9,代碼來源:JCVideoPlayerSimple.java

示例9: onClick

import android.view.View; //導入方法依賴的package包/類
@Override
public void onClick(View v) {
    if (v.getId() == R.id.delete) {
        int position = -1;
        AttackData attackData = (AttackData) v.getTag();
        position = mAttacks.indexOf(attackData);

        if (position != -1) {
            mOnItemDeleteClickListener.onItemDeleteClick(attackData, position);
        }
    } else {
        mOnItemClickListener.onItemClick((AttackData) v.getTag());
    }
}
 
開發者ID:monthlypub,項目名稱:SmingZZick_App,代碼行數:15,代碼來源:AttackAdaptor.java

示例10: onClick

import android.view.View; //導入方法依賴的package包/類
@Override
public void onClick(View view) {
    if (ivLoading.isShown()) return;
    if (view.getId() == R.id.ivCancel) {
        back();
    } else if (view.getId() == R.id.ivCheck) {
        saveImage();
    }
}
 
開發者ID:hoanganhtuan95ptit,項目名稱:EditPhoto,代碼行數:10,代碼來源:CropFragment.java

示例11: onClick

import android.view.View; //導入方法依賴的package包/類
@Override
public void onClick(View v) 
{
	switch (v.getId()) {
	case R.id.sync_now_button:
		LDLN.initiateSync(mActivity, mActivity);
		break;
	}
}
 
開發者ID:LDLN,項目名稱:Responder-Android,代碼行數:10,代碼來源:SyncOptionsFragment.java

示例12: onWidgetClick

import android.view.View; //導入方法依賴的package包/類
@Override
public void onWidgetClick(View view) {
    switch (view.getId()) {
        case R.id.btn_set_transparent:
            sbChangeAlpha.setProgress(0);
            break;
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:9,代碼來源:BarStatusAlphaActivity.java

示例13: onClick

import android.view.View; //導入方法依賴的package包/類
@Override
public void onClick(View v) {
    switch (v.getId()) {
        case R.id.v1:
            openKeyboard(v, resetLicense(0));
            break;
        case R.id.v2:
            openKeyboard(v, resetLicense(1));
            break;
        case R.id.v3:
            openKeyboard(v, resetLicense(2));
            break;
        case R.id.v4:
            openKeyboard(v, resetLicense(3));
            break;
        case R.id.v5:
            openKeyboard(v, resetLicense(4));
            break;
        case R.id.v6:
            openKeyboard(v, resetLicense(5));
            break;
        case R.id.v7:
            openKeyboard(v, resetLicense(6));
            break;
        case R.id.v8:
            toggleElectricalTag();
            openKeyboard(v, resetLicense(7));
            break;
    }
}
 
開發者ID:fengdongfei,項目名稱:CXJPadProject,代碼行數:31,代碼來源:LicenseBar.java

示例14: onClick

import android.view.View; //導入方法依賴的package包/類
@Override
public void onClick(View v) {
    if (onFlowBarActionListener == null) {
        return;
    }
    switch (v.getId()) {
        case R.id.addFriendBt:
                onFlowBarActionListener.onAddFriend();
            break;
        case R.id.cancelBt:
                onFlowBarActionListener.onCancel();
            break;
    }
}
 
開發者ID:zuoweitan,項目名稱:Hitalk,代碼行數:15,代碼來源:ChatRoomLayout.java

示例15: onClick

import android.view.View; //導入方法依賴的package包/類
@Override
public void onClick(View v) {
    switch (v.getId()){
        case R.id.tv_start:
            Intent intent = new Intent(mActivity, VersionUpdateService.class);
            intent.putExtra(VersionUpdateService.UPDATE_URL, mVersionResult.getUrl());
            mActivity.startService(intent);
            break;
        case R.id.tv_cancel:
            break;
    }
    dismiss();
}
 
開發者ID:junchenChow,項目名稱:exciting-app,代碼行數:14,代碼來源:AutoUpdateDialog.java


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