File tree Expand file tree Collapse file tree 3 files changed +9
-11
lines changed
src/main/java/com/zhy/autolayout/widget
widgetsample/src/main/java/com/zhy/autolayout/test/widgets Expand file tree Collapse file tree 3 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ dependencies {
2323 compile ' com.android.support:appcompat-v7:23.1.0'
2424 compile project(' :autolayout' )
2525 compile ' com.android.support:support-v4:23.1.0'
26- compile ' com.android.support:design:23.1.0 '
26+ compile ' com.android.support:design:23.0.1 '
2727 compile ' com.android.support:gridlayout-v7:23.1.0'
2828 compile ' com.android.support:cardview-v7:23.1.0'
2929}
Original file line number Diff line number Diff line change @@ -90,18 +90,22 @@ private void setUpTabTextSize(Tab tab)
9090 ViewGroup tabContainer = (ViewGroup ) tabGroup .getChildAt (tab .getPosition ());
9191 TextView textView = (TextView ) tabContainer .getChildAt (1 );
9292
93+
9394 if (AutoUtils .autoed (textView ))
9495 {
9596 return ;
9697 }
98+ int autoTextSize = 0 ;
9799 if (mTextSizeBaseWidth )
98100 {
99- mTextSize = AutoUtils .getPercentWidthSize (mTextSize );
101+ autoTextSize = AutoUtils .getPercentWidthSize (mTextSize );
100102 } else
101103 {
102- mTextSize = AutoUtils .getPercentHeightSize (mTextSize );
104+ autoTextSize = AutoUtils .getPercentHeightSize (mTextSize );
103105 }
104- textView .setTextSize (TypedValue .COMPLEX_UNIT_PX , mTextSize );
106+
107+
108+ textView .setTextSize (TypedValue .COMPLEX_UNIT_PX , autoTextSize );
105109 }
106110
107111
Original file line number Diff line number Diff line change 55import android .support .v4 .app .Fragment ;
66import android .support .v4 .app .FragmentPagerAdapter ;
77import android .support .v4 .view .ViewPager ;
8- import android .support .v7 .app .AppCompatActivity ;
9- import android .util .Log ;
108import android .view .Menu ;
119import android .view .MenuItem ;
12- import android .view .View ;
13- import android .view .ViewGroup ;
1410
1511import com .zhy .autolayout .AutoLayoutActivity ;
1612import com .zhy .autolayout .test .widgets .fragments .SimpleFragment ;
1713
18- import java .util .List ;
19-
2014public class MainActivity extends AutoLayoutActivity
2115{
2216 private TabLayout mTabLayout ;
@@ -42,7 +36,7 @@ public Fragment getItem(int position)
4236 @ Override
4337 public int getCount ()
4438 {
45- return 3 ;
39+ return 2 ;
4640 }
4741
4842 @ Override
You can’t perform that action at this time.
0 commit comments