File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
java/me/jessyan/autosize/demo Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 1616package me .jessyan .autosize .demo ;
1717
1818import android .app .Activity ;
19+ import android .content .Intent ;
1920import android .os .Bundle ;
21+ import android .support .v4 .app .Fragment ;
2022import android .support .v7 .app .AppCompatActivity ;
23+ import android .view .View ;
2124
2225import me .jessyan .autosize .internal .CustomAdapt ;
2326
@@ -43,6 +46,14 @@ protected void onCreate(Bundle savedInstanceState) {
4346 setContentView (R .layout .activity_custom_adapt );
4447 }
4548
49+ /**
50+ * 跳转到 {@link FragmentHost}, 展示项目内部的 {@link Fragment} 自定义适配参数的用法
51+ *
52+ * @param view {@link View}
53+ */
54+ public void goCustomAdaptFragment (View view ) {
55+ startActivity (new Intent (getApplicationContext (), FragmentHost .class ));
56+ }
4657 /**
4758 * 是否按照宽度进行等比例适配 (为了保证在高宽比不同的屏幕上也能正常适配, 所以只能在宽度和高度之中选一个作为基准进行适配)
4859 *
Original file line number Diff line number Diff line change 3030 android : background =" #fff"
3131 />
3232
33- <TextView
33+ <Button
3434 android : layout_width =" match_parent"
3535 android : layout_height =" 100dp"
3636 android : background =" #0f3"
37- android : gravity = " center "
38- android : text =" H-100dp "
39- android : textColor =" #fff "
37+ android : onClick = " goCustomAdaptFragment "
38+ android : text =" CustomAdapt(Fragment) "
39+ android : textColor =" #00f "
4040 android : textSize =" 20sp"
4141 />
4242
You can’t perform that action at this time.
0 commit comments