Java Code Examples for com.zhy.autolayout.utils.AutoUtils#getPercentHeightSize()
The following examples show how to use
com.zhy.autolayout.utils.AutoUtils#getPercentHeightSize() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AutoTabLayout.java From Aurora with Apache License 2.0 | 6 votes |
private void setUpTabTextSize(Tab tab) { if (mTextSize == NO_VALID || tab.getCustomView() != null) return; ViewGroup tabGroup = (ViewGroup) getChildAt(0); ViewGroup tabContainer = (ViewGroup) tabGroup.getChildAt(tab.getPosition()); TextView textView = (TextView) tabContainer.getChildAt(1); if (AutoUtils.autoed(textView)) { return; } int autoTextSize = 0; if (mTextSizeBaseWidth) { autoTextSize = AutoUtils.getPercentWidthSize(mTextSize); } else { autoTextSize = AutoUtils.getPercentHeightSize(mTextSize); } textView.setTextSize(TypedValue.COMPLEX_UNIT_PX, autoTextSize); }
Example 2
Source File: AutoTabLayout.java From MVPArms with Apache License 2.0 | 6 votes |
private void setUpTabTextSize(Tab tab) { if (mTextSize == NO_VALID || tab.getCustomView() != null) { return; } ViewGroup tabGroup = (ViewGroup) getChildAt(0); ViewGroup tabContainer = (ViewGroup) tabGroup.getChildAt(tab.getPosition()); TextView textView = (TextView) tabContainer.getChildAt(1); if (AutoUtils.autoed(textView)) { return; } int autoTextSize; if (mTextSizeBaseWidth) { autoTextSize = AutoUtils.getPercentWidthSize(mTextSize); } else { autoTextSize = AutoUtils.getPercentHeightSize(mTextSize); } textView.setTextSize(TypedValue.COMPLEX_UNIT_PX, autoTextSize); }
Example 3
Source File: AutoTabLayout.java From AndroidAutoLayout with Apache License 2.0 | 6 votes |
private void setUpTabTextSize(Tab tab) { if (mTextSize == NO_VALID || tab.getCustomView() != null) return; ViewGroup tabGroup = (ViewGroup) getChildAt(0); ViewGroup tabContainer = (ViewGroup) tabGroup.getChildAt(tab.getPosition()); TextView textView = (TextView) tabContainer.getChildAt(1); if (AutoUtils.autoed(textView)) { return; } int autoTextSize = 0 ; if (mTextSizeBaseWidth) { autoTextSize = AutoUtils.getPercentWidthSize(mTextSize); } else { autoTextSize = AutoUtils.getPercentHeightSize(mTextSize); } textView.setTextSize(TypedValue.COMPLEX_UNIT_PX, autoTextSize); }
Example 4
Source File: AutoToolbar.java From LQRWeChat with MIT License | 5 votes |
private void setUpTitleTextSize(String name, int val) { try { //反射 Toolbar 的 TextView Field f = getClass().getSuperclass().getDeclaredField(name); f.setAccessible(true); TextView textView = (TextView) f.get(this); if (textView != null) { int autoTextSize = AutoUtils.getPercentHeightSize(val); textView.setTextSize(TypedValue.COMPLEX_UNIT_PX, autoTextSize); } } catch (Exception e) { e.printStackTrace(); } }
Example 5
Source File: AutoToolbar.java From MVPArms with Apache License 2.0 | 5 votes |
private void setUpTitleTextSize(String name, int val) { try { //反射 Toolbar 的 TextView Field f = getClass().getSuperclass().getDeclaredField(name); f.setAccessible(true); TextView textView = (TextView) f.get(this); if (textView != null) { int autoTextSize = AutoUtils.getPercentHeightSize(val); textView.setTextSize(TypedValue.COMPLEX_UNIT_PX, autoTextSize); } } catch (Exception e) { e.printStackTrace(); } }
Example 6
Source File: AutoToolbar.java From AndroidAutoLayout with Apache License 2.0 | 5 votes |
private void setUpTitleTextSize(String name, int val) { try { //反射 Toolbar 的 TextView Field f = getClass().getSuperclass().getDeclaredField(name); f.setAccessible(true); TextView textView = (TextView) f.get(this); if (textView != null) { int autoTextSize = AutoUtils.getPercentHeightSize(val); textView.setTextSize(TypedValue.COMPLEX_UNIT_PX, autoTextSize); } } catch (Exception e) { e.printStackTrace(); } }
Example 7
Source File: AutoActionMenuItemView.java From AndroidAutoLayout with Apache License 2.0 | 4 votes |
private void setUpTitleTextSize() { if (mMenuTextSize == -1) return; int autoTextSize = AutoUtils.getPercentHeightSize(mMenuTextSize); setTextSize(TypedValue.COMPLEX_UNIT_PX, autoTextSize); }