From 5b1fa2ca831a5fb6be3bb2215b58a95669204925 Mon Sep 17 00:00:00 2001 From: JessYan Date: Sat, 25 Aug 2018 19:35:19 +0800 Subject: [PATCH] Create FragmentHost --- demo/src/main/AndroidManifest.xml | 1 + .../jessyan/autosize/demo/FragmentHost.java | 50 +++++++++++++++++++ demo/src/main/res/layout/activity_host.xml | 24 +++++++++ 3 files changed, 75 insertions(+) create mode 100644 demo/src/main/java/me/jessyan/autosize/demo/FragmentHost.java create mode 100644 demo/src/main/res/layout/activity_host.xml diff --git a/demo/src/main/AndroidManifest.xml b/demo/src/main/AndroidManifest.xml index 2a5f51f..c8e26a3 100644 --- a/demo/src/main/AndroidManifest.xml +++ b/demo/src/main/AndroidManifest.xml @@ -17,6 +17,7 @@ + Contact me + * Follow me + * ================================================ + */ +public class FragmentHost extends AppCompatActivity implements CustomAdapt{ + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_host); + getSupportFragmentManager().beginTransaction().add(R.id.container1, new CustomFragment1()).commit(); + getSupportFragmentManager().beginTransaction().add(R.id.container2, new CustomFragment2()).commit(); + getSupportFragmentManager().beginTransaction().add(R.id.container3, new CustomFragment3()).commit(); + } + + @Override + public boolean isBaseOnWidth() { + return true; + } + + @Override + public float getSizeInDp() { + return 720; + } +} diff --git a/demo/src/main/res/layout/activity_host.xml b/demo/src/main/res/layout/activity_host.xml new file mode 100644 index 0000000..0e4dfb4 --- /dev/null +++ b/demo/src/main/res/layout/activity_host.xml @@ -0,0 +1,24 @@ + + + + + + + + + \ No newline at end of file