@Override public void onClick(View v) { if (password == null) { password = ""; } switch (v.getId()) { case R.id.fbv_0: password += ((TextView) mPasswordView.findViewById(R.id.tv_0)).getText().toString(); break; case R.id.fbv_1: password += ((TextView) mPasswordView.findViewById(R.id.tv_1)).getText().toString(); break; case R.id.fbv_2: password += ((TextView) mPasswordView.findViewById(R.id.tv_2)).getText().toString(); break; case R.id.fbv_3: password += ((TextView) mPasswordView.findViewById(R.id.tv_3)).getText().toString(); break; case R.id.fbv_4: password += ((TextView) mPasswordView.findViewById(R.id.tv_4)).getText().toString(); break; case R.id.fbv_5: password += ((TextView) mPasswordView.findViewById(R.id.tv_5)).getText().toString(); break; case R.id.fbv_6: password += ((TextView) mPasswordView.findViewById(R.id.tv_6)).getText().toString(); break; case R.id.fbv_7: password += ((TextView) mPasswordView.findViewById(R.id.tv_7)).getText().toString(); break; case R.id.fbv_8: password += ((TextView) mPasswordView.findViewById(R.id.tv_8)).getText().toString(); break; case R.id.fbv_9: password += ((TextView) mPasswordView.findViewById(R.id.tv_9)).getText().toString(); break; case R.id.fbv_del: if (password.length() > 0) { password = password.substring(0, password.length() - 1); } break; default: break; } indicator.passwordChanged(password); mHandler.postDelayed(r, 200); }
private void initUI() { ImageView ivBackground = (ImageView) mRootLayout.findViewById(R.id.iv_background); WallpaperUtils.showWallpaper(getActivity(), ivBackground, mDao.getCurrent()); mPasswordView = (DigitalPasswordView) mRootLayout.findViewById(R.id.dpv_password_view); mPasswordView.setOnClickListener(this); indicator = (EnterDigitalIndicator) mRootLayout.findViewById(R.id.edi_indicator); }