[2.8.0-f] 屏幕适配
This commit is contained in:
@@ -41,6 +41,9 @@ import androidx.core.app.NotificationManagerCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.view.ViewCompat;
|
||||
|
||||
import me.jessyan.autosize.AutoSizeCompat;
|
||||
import me.jessyan.autosize.AutoSizeConfig;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* author: Blankj
|
||||
|
||||
@@ -14,6 +14,8 @@ import java.util.Locale;
|
||||
import androidx.annotation.LayoutRes;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import me.jessyan.autosize.AutoSizeCompat;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* author: Blankj
|
||||
@@ -117,6 +119,7 @@ public class ViewUtils {
|
||||
public static View layoutId2View(@LayoutRes final int layoutId) {
|
||||
LayoutInflater inflate =
|
||||
(LayoutInflater) Utils.getApp().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
AutoSizeCompat.autoConvertDensity(inflate.getContext().getResources(), 2560, true);//如果有自定义需求就用这个方法
|
||||
return inflate.inflate(layoutId, null);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user