Bladeren bron

1.修改Android Apex Drivers Detail按钮大小。

Pen Li 7 jaren geleden
bovenliggende
commit
7fc2cd105b

+ 3 - 1
ApexDrivers/app/src/main/java/com/usai/redant/apexdrivers/Detail/DetailAdapter.java

@@ -1,6 +1,7 @@
 package com.usai.redant.apexdrivers.Detail;
 
 import android.content.Context;
+import android.util.TypedValue;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -303,7 +304,7 @@ public class DetailAdapter extends BaseExpandableListAdapter {
                     ll.addView(container,layoutParams);
 
                     Button btn = new Button(mCtx);
-                    RelativeLayout.LayoutParams btnLayoutParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+                    RelativeLayout.LayoutParams btnLayoutParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, RAUtil.dp2px(mCtx,70));
                     btnLayoutParams.addRule(RelativeLayout.CENTER_IN_PARENT);
 
                     int marginH = RAUtil.dp2px(mCtx,5);
@@ -320,6 +321,7 @@ public class DetailAdapter extends BaseExpandableListAdapter {
 
                     final DetailSubActionModel subActionModel = model.actionModelForIndex(index);
                     btn.setText(subActionModel.actionTitle);
+                    btn.setTextSize(TypedValue.COMPLEX_UNIT_SP,20);
                     btn.setAllCaps(false);
 
                     btn.setOnClickListener(new View.OnClickListener() {