List of usage examples for android.widget TextView getPaddingBottom
public int getPaddingBottom()
From source file:com.github.irshulx.Components.InputExtensions.java
public void UpdateTextStyle(EditorTextStyle style, TextView editText) { /// String type = getControlType(getActiveView()); try {/*from www .j a v a 2 s .co m*/ if (editText == null) { editText = (EditText) editorCore.getActiveView(); } EditorControl tag = editorCore.getControlTag(editText); int pBottom = editText.getPaddingBottom(); int pRight = editText.getPaddingRight(); int pTop = editText.getPaddingTop(); if (isEditorTextStyleHeaders(style)) { updateTextStyle(editText, style); return; } if (isEditorTextStyleContentStyles(style)) { boolean containsHeadertextStyle = containsHeaderTextStyle(tag); if (style == EditorTextStyle.BOLD) { boldifyText(tag, editText, containsHeadertextStyle ? HEADING : CONTENT); } else if (style == EditorTextStyle.ITALIC) { italicizeText(tag, editText, containsHeadertextStyle ? HEADING : CONTENT); } return; } if (style == EditorTextStyle.INDENT) { if (editorCore.containsStyle(tag.editorTextStyles, EditorTextStyle.INDENT)) { tag = editorCore.updateTagStyle(tag, EditorTextStyle.INDENT, Op.Delete); editText.setPadding(0, pTop, pRight, pBottom); editText.setTag(tag); } else { tag = editorCore.updateTagStyle(tag, EditorTextStyle.INDENT, Op.Insert); editText.setPadding(30, pTop, pRight, pBottom); editText.setTag(tag); } } else if (style == EditorTextStyle.OUTDENT) { if (editorCore.containsStyle(tag.editorTextStyles, EditorTextStyle.INDENT)) { tag = editorCore.updateTagStyle(tag, EditorTextStyle.INDENT, Op.Delete); editText.setPadding(0, pTop, pRight, pBottom); editText.setTag(tag); } } else if (style == EditorTextStyle.BLOCKQUOTE) { LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) editText.getLayoutParams(); if (editorCore.containsStyle(tag.editorTextStyles, EditorTextStyle.BLOCKQUOTE)) { tag = editorCore.updateTagStyle(tag, EditorTextStyle.BLOCKQUOTE, Op.Delete); editText.setPadding(0, pTop, pRight, pBottom); editText.setBackgroundDrawable(ContextCompat.getDrawable(this.editorCore.getContext(), R.drawable.invisible_edit_text)); params.setMargins(0, 0, 0, (int) editorCore.getContext().getResources() .getDimension(R.dimen.edittext_margin_bottom)); } else { float marginExtra = editorCore.getContext().getResources() .getDimension(R.dimen.edittext_margin_bottom) * 1.5f; tag = editorCore.updateTagStyle(tag, EditorTextStyle.BLOCKQUOTE, Op.Insert); editText.setPadding(30, pTop, 30, pBottom); editText.setBackgroundDrawable( editText.getContext().getResources().getDrawable(R.drawable.block_quote_background)); params.setMargins(0, (int) marginExtra, 0, (int) marginExtra); } editText.setTag(tag); } } catch (Exception e) { } }
From source file:com.community.yuequ.bottombar.BottomBar.java
private void updateTitleBottomPadding() { if (tabContainer == null) { return;//from w ww . j a v a 2s . c om } int childCount = getTabCount(); for (int i = 0; i < childCount; i++) { View tab = tabContainer.getChildAt(i); TextView title = (TextView) tab.findViewById(R.id.bb_bottom_bar_title); if (title == null) { continue; } int baseline = title.getBaseline(); int height = title.getHeight(); int paddingInsideTitle = height - baseline; int missingPadding = tenDp - paddingInsideTitle; if (missingPadding > 0) { title.setPadding(title.getPaddingLeft(), title.getPaddingTop(), title.getPaddingRight(), missingPadding + title.getPaddingBottom()); } } }
From source file:bottombar.BottomBar.java
private void updateTitleBottomPadding() { int tabCount = getTabCount(); if (tabContainer == null || tabCount == 0 || !isShiftingMode()) { return;/* w ww . jav a2s.c o m*/ } for (int i = 0; i < tabCount; i++) { BottomBarTab tab = getTabAtPosition(i); TextView title = tab.getTitleView(); if (title == null) { continue; } int baseline = title.getBaseline(); int height = title.getHeight(); int paddingInsideTitle = height - baseline; int missingPadding = tenDp - paddingInsideTitle; if (missingPadding > 0) { title.setPadding(title.getPaddingLeft(), title.getPaddingTop(), title.getPaddingRight(), missingPadding + title.getPaddingBottom()); } } }
From source file:com.pitchedapps.primenumbercalculator.Calculator.java
License:asdf
@Override public void onTextSizeChanged(final TextView textView, float oldSize) { if (mCurrentState != CalculatorState.INPUT) { // Only animate text changes that occur from user input. return;//from w w w . jav a2 s. co m } // Calculate the values needed to perform the scale and translation animations, // maintaining the same apparent baseline for the displayed text. final float textScale = oldSize / textView.getTextSize(); final float translationX = (1.0f - textScale) * (textView.getWidth() / 2.0f - textView.getPaddingEnd()); final float translationY = (1.0f - textScale) * (textView.getHeight() / 2.0f - textView.getPaddingBottom()); final AnimatorSet animatorSet = new AnimatorSet(); animatorSet.playTogether(ObjectAnimator.ofFloat(textView, View.SCALE_X, textScale, 1.0f), ObjectAnimator.ofFloat(textView, View.SCALE_Y, textScale, 1.0f), ObjectAnimator.ofFloat(textView, View.TRANSLATION_X, translationX, 0.0f), ObjectAnimator.ofFloat(textView, View.TRANSLATION_Y, translationY, 0.0f)); animatorSet.setDuration(getResources().getInteger(android.R.integer.config_mediumAnimTime)); animatorSet.setInterpolator(new AccelerateDecelerateInterpolator()); animatorSet.start(); }
From source file:com.roughike.bottombar.BottomBar.java
private void updateTitleBottomPadding() { if (isIconsOnlyMode()) { return;// w w w.j a v a 2 s . c o m } int tabCount = getTabCount(); if (tabContainer == null || tabCount == 0 || !isShiftingMode()) { return; } for (int i = 0; i < tabCount; i++) { BottomBarTab tab = getTabAtPosition(i); TextView title = tab.getTitleView(); if (title == null) { continue; } int baseline = title.getBaseline(); int height = title.getHeight(); int paddingInsideTitle = height - baseline; int missingPadding = tenDp - paddingInsideTitle; if (missingPadding > 0) { title.setPadding(title.getPaddingLeft(), title.getPaddingTop(), title.getPaddingRight(), missingPadding + title.getPaddingBottom()); } } }