Browse Source

定位工具类修改,自定义CommonUserItemView修改

niusongtao@dl-cg.com 5 years ago
parent
commit
9e064421f7

+ 8 - 0
base_library/src/main/java/com/mgtech/base_library/custom/CommonUserItemView.java

@@ -73,6 +73,14 @@ public class CommonUserItemView extends ConstraintLayout {
                 ,typedArray.getDimension(R.styleable.CommonUserItemView_item_title_text_size, titleText.getTextSize()));
         detailText.setTextSize(TypedValue.COMPLEX_UNIT_PX
                 ,typedArray.getDimension(R.styleable.CommonUserItemView_item_detail_text_size,detailText.getTextSize()));
+        int titleType = typedArray.getInt(R.styleable.CommonUserItemView_item_title_text_style,10);
+        if (titleType == 10){//normal
+            titleText.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
+        } else if (titleType == 20){//bold
+            titleText.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
+        } else if (titleType == 30){//italic
+            titleText.setTypeface(Typeface.defaultFromStyle(Typeface.ITALIC));
+        }
 
         int type = typedArray.getInt(R.styleable.CommonUserItemView_item_detail_text_style,10);
         if (type == 10){//normal

+ 2 - 2
base_library/src/main/java/com/mgtech/base_library/util/GoogleLocationUtil.java

@@ -142,7 +142,7 @@ public class GoogleLocationUtil {
         }
         Location location = locationManager.getLastKnownLocation(provider);
         if (location != null){
-            ToastUtils.showShort("getLastKnownLocation:"+location.getLatitude()+"--------"+location.getLongitude());
+//            ToastUtils.showShort("getLastKnownLocation:"+location.getLatitude()+"--------"+location.getLongitude());
             LogUtil.e("nst","getLastKnownLocation:"+location.getLatitude()+"--------"+location.getLongitude());
             locationInfoListener.locationSuccess(location.getLatitude(),location.getLongitude());
         }else{
@@ -163,7 +163,7 @@ public class GoogleLocationUtil {
             if (locationInfoListener == null)
                 return;
             if(location != null){
-                ToastUtils.showShort("onLocationChanged:"+location.getLatitude()+"--------"+location.getLongitude());
+//                ToastUtils.showShort("onLocationChanged:"+location.getLatitude()+"--------"+location.getLongitude());
 //                LogUtil.e("nst","onLocationChanged:"+location.getLatitude()+"--------"+location.getLongitude());
                 locationInfoListener.locationSuccess(location.getLatitude(),location.getLongitude());
             }else{

+ 5 - 0
base_library/src/main/res/values/attrs.xml

@@ -94,6 +94,11 @@
             <flag name="bold" value="20" />
             <flag name="italic" value="30" />
         </attr>
+        <attr name="item_title_text_style">
+            <flag name="normal" value="10" />
+            <flag name="bold" value="20" />
+            <flag name="italic" value="30" />
+        </attr>
     </declare-styleable>
 
     <declare-styleable name="MaxHeightRecyclerView">