final int topUpperEdit = mUpperEditText.getTop(); final int middleUpperEdit = (mUpperEditText.getBottom() - mUpperEditText .getTop()) / 2; canvas.drawLine(lastRight, topFirst + middleFirst, leftUpperEdit, topUpperEdit + middleUpperEdit, mPaint); final int topLowerEdit = mLowerEditText.getTop(); final int middleLowerEdit = (mLowerEditText.getBottom() - mLowerEditText .getTop()) / 2; canvas.drawLine(lastRight, topFirst + middleFirst, leftLowerEdit, topLowerEdit + middleLowerEdit, mPaint);
if(etUserName.hasFocus()) { left = etUserName.getLeft(); bottom = etUserName.getTop(); if (bottom > sh / 3) { System.out.println("Umn Left :: " + left); scrlv.scrollTo(left, (sh/3)); left = etUserName.getLeft(); bottom = etUserName.getTop(); System.out.println("Umn Left :: " + left); System.out.println("Unm Bottom :: " + bottom); if(etPhoneNo.hasFocus()) { left = etPhoneNo.getLeft(); bottom = etPhoneNo.getTop(); if (bottom > sh / 3) { System.out.println("Phno Left :: " + left); scrlv.scrollTo(0, (sh/3)); left = etPhoneNo.getLeft(); bottom = etPhoneNo.getTop(); System.out.println("Phno Left :: " + left); System.out.println("Phno Bottom :: " + bottom);
private void initializeSelectorWheel() { initializeSelectorWheelIndices(); int[] selectorIndices = mSelectorIndices; int totalTextHeight = selectorIndices.length * mTextSize; float totalTextGapHeight = (getBottom() - getTop()) - totalTextHeight; float textGapCount = selectorIndices.length; mSelectorTextGapHeight = (int) (totalTextGapHeight / textGapCount + 0.5f); mSelectorElementHeight = mTextSize + mSelectorTextGapHeight; // Ensure that the middle item is positioned the same as the text in // mInputText int editTextTextPosition = mInputText.getBaseline() + mInputText.getTop(); mInitialScrollOffset = editTextTextPosition - (mSelectorElementHeight * SELECTOR_MIDDLE_ITEM_INDEX); mCurrentScrollOffset = mInitialScrollOffset; updateInputTextView(); }
private void initializeSelectorWheel() { initializeSelectorWheelIndices(); int[] selectorIndices = mSelectorIndices; int totalTextHeight = selectorIndices.length * mTextSize; float totalTextGapHeight = (getBottom() - getTop()) - totalTextHeight; float textGapCount = selectorIndices.length; mSelectorTextGapHeight = (int) (totalTextGapHeight / textGapCount + 0.5f); mSelectorElementHeight = mTextSize + mSelectorTextGapHeight; // Ensure that the middle item is positioned the same as the text in // mInputText int editTextTextPosition = mInputText.getBaseline() + mInputText.getTop(); mInitialScrollOffset = editTextTextPosition - (mSelectorElementHeight * SELECTOR_MIDDLE_ITEM_INDEX); mCurrentScrollOffset = mInitialScrollOffset; updateInputTextView(); }
if (isHorizontalMode()) { x = mCurrentScrollOffset; y = mSelectedText.getBaseline() + mSelectedText.getTop(); if (mRealWheelItemCount < DEFAULT_WHEEL_ITEM_COUNT) { canvas.clipRect(mLeftDividerLeft, 0, mRightDividerRight, getBottom());
button2.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { EditText button3; EditText button4; button3 = (EditText) findViewById(R.id.button3); button4 = (EditText) findViewById(R.id.button4); int top3 = button3.getTop(); int bot3 = button3.getBottom(); int left3 = button3.getLeft(); int right3 = button3.getRight(); int top4 = button4.getTop(); int bot4 = button4.getBottom(); int left4 = button4.getLeft(); int right4 = button4.getRight(); button4.setTop(top3); button4.setBottom(bot3); button4.setLeft(left3); button4.setRight(right3); button3.setTop(top4); button3.setBottom(bot4); button3.setLeft(left4); button3.setRight(right4); } });
button2.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { EditText button3; EditText button4; button3 = (EditText) findViewById(R.id.button3); button4 = (EditText) findViewById(R.id.button4); int top3 = button3.getTop(); int bot3 = button3.getBottom(); int left3 = button3.getLeft(); int right3 = button3.getRight(); int top4 = button4.getTop(); int bot4 = button4.getBottom(); int left4 = button4.getLeft(); int right4 = button4.getRight(); button4.setTop(top3); button4.setBottom(bot3); button4.setLeft(left3); button4.setRight(right3); button3.setTop(top4); button3.setBottom(bot4); button3.setLeft(left4); button3.setRight(right4); } });