|
@@ -143,11 +143,11 @@ public final class Utils {
|
|
|
public static SpannableString diffColorString(String bigSizeStr, String centerStr, String lastStr, int firstColor, int centerColor) {
|
|
|
String tmpStr = bigSizeStr + centerStr + lastStr;
|
|
|
SpannableString result = new SpannableString(tmpStr);
|
|
|
- try{
|
|
|
+ try {
|
|
|
result.setSpan(new ForegroundColorSpan(firstColor), 0, bigSizeStr.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
|
|
result.setSpan(new ForegroundColorSpan(centerColor), bigSizeStr.length(), bigSizeStr.length() + centerStr.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
|
|
result.setSpan(new ForegroundColorSpan(firstColor), bigSizeStr.length() + centerStr.length(), tmpStr.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
return result;
|
|
@@ -167,8 +167,13 @@ public final class Utils {
|
|
|
|
|
|
public static void setHeadView(View view, Context context, int height) {
|
|
|
int statusBarHeight = QMUIDisplayHelper.getStatusBarHeight(context);
|
|
|
-// int statusBarHeight = getStatusBarHeight(context);
|
|
|
ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
|
|
|
+ if (statusBarHeight == 0) {
|
|
|
+ statusBarHeight = getStatusBarHeight(context);
|
|
|
+ }
|
|
|
+ if (statusBarHeight == 0) {
|
|
|
+ statusBarHeight = SizeUtils.dp2px(20);
|
|
|
+ }
|
|
|
layoutParams.height = statusBarHeight + SizeUtils.dp2px(height);
|
|
|
view.setLayoutParams(layoutParams);
|
|
|
}
|