|
| 1 | +/* |
| 2 | + * Copyright 2018 JessYan |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | +package me.jessyan.autosize.demo; |
| 17 | + |
| 18 | +import android.os.Bundle; |
| 19 | +import android.support.annotation.Nullable; |
| 20 | +import android.support.v7.app.AppCompatActivity; |
| 21 | + |
| 22 | +import me.jessyan.autosize.internal.CustomAdapt; |
| 23 | + |
| 24 | +/** |
| 25 | + * ================================================ |
| 26 | + * Created by JessYan on 2018/8/25 14:39 |
| 27 | + * <a href="mailto:[email protected]">Contact me</a> |
| 28 | + * <a href="https://github.com/JessYanCoding">Follow me</a> |
| 29 | + * ================================================ |
| 30 | + */ |
| 31 | +public class FragmentHost extends AppCompatActivity implements CustomAdapt{ |
| 32 | + @Override |
| 33 | + protected void onCreate(@Nullable Bundle savedInstanceState) { |
| 34 | + super.onCreate(savedInstanceState); |
| 35 | + setContentView(R.layout.activity_host); |
| 36 | + getSupportFragmentManager().beginTransaction().add(R.id.container1, new CustomFragment1()).commit(); |
| 37 | + getSupportFragmentManager().beginTransaction().add(R.id.container2, new CustomFragment2()).commit(); |
| 38 | + getSupportFragmentManager().beginTransaction().add(R.id.container3, new CustomFragment3()).commit(); |
| 39 | + } |
| 40 | + |
| 41 | + @Override |
| 42 | + public boolean isBaseOnWidth() { |
| 43 | + return true; |
| 44 | + } |
| 45 | + |
| 46 | + @Override |
| 47 | + public float getSizeInDp() { |
| 48 | + return 720; |
| 49 | + } |
| 50 | +} |
0 commit comments