当前位置: 首页>>代码示例>>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;未经允许,请勿转载。