|
| 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.NonNull; |
| 20 | +import android.support.annotation.Nullable; |
| 21 | +import android.support.v4.app.Fragment; |
| 22 | +import android.view.LayoutInflater; |
| 23 | +import android.view.View; |
| 24 | +import android.view.ViewGroup; |
| 25 | + |
| 26 | +import me.jessyan.autosize.internal.CustomAdapt; |
| 27 | + |
| 28 | +/** |
| 29 | + * ================================================ |
| 30 | + * Created by JessYan on 2018/8/25 14:06 |
| 31 | + * <a href="mailto:[email protected]">Contact me</a> |
| 32 | + * <a href="https://github.com/JessYanCoding">Follow me</a> |
| 33 | + * ================================================ |
| 34 | + */ |
| 35 | +public class CustomFragment3 extends Fragment implements CustomAdapt{ |
| 36 | + |
| 37 | + @Nullable |
| 38 | + @Override |
| 39 | + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { |
| 40 | + return CustomFragment1.createTextView(inflater, "Fragment-3\nView width = 360dp\nTotal width = 360dp", 0xff0000ff); |
| 41 | + } |
| 42 | + |
| 43 | + @Override |
| 44 | + public boolean isBaseOnWidth() { |
| 45 | + return true; |
| 46 | + } |
| 47 | + |
| 48 | + @Override |
| 49 | + public float getSizeInDp() { |
| 50 | + return 360; |
| 51 | + } |
| 52 | +} |
0 commit comments