Quellcode durchsuchen

Merge branch 'sheep_develop' of 10.8.230.114:xmy_android/small_sheep_android into sheep_develop

hanjing vor 7 Jahren
Ursprung
Commit
1e3d8f8bb6

+ 5 - 1
app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java

@@ -1713,6 +1713,10 @@ public class CommonUtil {
                     int count = mTabStrip.getChildCount();
                     int fillCount = Math.min(5, count);//一屏的个数
 
+                    int tabWidth = tabLayout.getWidth();
+                    if(tabWidth == 0){
+                        tabWidth = G.WIDTH;
+                    }
                     for (int i = 0; i < count; i++) {
                         View tabView = mTabStrip.getChildAt(i);
 
@@ -1736,7 +1740,7 @@ public class CommonUtil {
                         //设置tab左右间距为10dp  注意这里不能使用Padding 因为源码中线的宽度是根据 tabView的宽度来设置的
                         LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) tabView.getLayoutParams();
                         params.width = width;
-                        int margin = (G.WIDTH - fillCount * width - 2 * add) / (fillCount * 2);
+                        int margin = (tabWidth - fillCount * width - 2 * add) / (fillCount * 2);
                         params.leftMargin = margin + (i == 0 ? add : 0);
                         params.rightMargin = margin + (i + 1 == count ? add : 0);
                         tabView.setLayoutParams(params);

+ 7 - 0
app/src/main/java/com/sheep/gamegroup/util/StringUtils.java

@@ -276,6 +276,13 @@ public class StringUtils {
         Matcher m = p.matcher(name);
         return m.matches();
     }
+    // 校验中文姓名
+    public static boolean isChineseName(String name) {
+        if(name.contains("·")){
+            return isChinese(name.replaceAll("·", ""));
+        }
+        return isChinese(name);
+    }
 
     public static boolean isUserName(String name) {
         Pattern p = Pattern.compile("^[a-zA-Z0-9_.-@]{4,20}$");

+ 4 - 1
app/src/main/java/com/sheep/gamegroup/util/TestUtil.java

@@ -260,7 +260,7 @@ public class TestUtil {
      */
     public static void test(final Activity activity) {
         final String[] items = {"复制token", "添加token", "复制打点数据", "从jenkins下载小绵羊安装包", "测试表情包",
-                "切换皮肤", "默认皮肤", "我的游戏", "优惠券弹窗", "填写收件地址弹窗",
+                "少数民族姓名", "切换皮肤", "默认皮肤", "我的游戏", "优惠券弹窗", "填写收件地址弹窗",
                 "朗读文字", "游戏搜索", "测试插件","测试bitmap", "剪切视频", "我的关注", "足迹",
                 "测试联通卡", "测试联通卡2", "测试签名1", "测试签名2", "测试孔剑秋faq正式服",
                 "跳转QQ1", "跳转QQ2", "跳转QQ3", "跳转白白QQ", "龙猫竞猜", "龙猫竞猜-scheme",
@@ -280,6 +280,9 @@ public class TestUtil {
                     @Override
                     public void onClick(DialogInterface dialog, int which) {
                         switch (items[which]) {
+                            case "少数民族姓名":
+                                G.showToast(Boolean.toString(StringUtils.isChineseName("麦麦提·阿尤甫")));
+                                break;
                             case "切换皮肤":
                                 SkinUtil.changeSkin(null);
                                 break;

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/view/activity/RealNameAuthenAct.java

@@ -207,7 +207,7 @@ public class RealNameAuthenAct extends BaseActivity implements RealNameAutherCon
             G.showToast("银行行预留手机号不能为空");
             return;
         }
-        if (!StringUtils.isChinese(realName)) {
+        if (!StringUtils.isChineseName(realName)) {
             G.showToast("姓名必须是基本汉字!");
             return;
         }

+ 11 - 0
app/src/main/res/color/selector_color_tab2.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item android:state_enabled="false" android:color="#2ebef2" />
+    <item android:state_activated="true" android:color="#2ebef2" />
+    <item android:state_focused="true" android:color="#2ebef2" />
+    <item android:state_checked="true" android:color="#2ebef2"/>
+    <item android:state_selected="true" android:color="#2ebef2"/>
+    <item android:state_pressed="true" android:color="#2ebef2"/>
+    <item android:color="@color/color_tab_nor"/>
+</selector>

+ 6 - 0
app/src/main/res/drawable/drawable_selector_ic_home_download.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item android:drawable="@drawable/index_download"/>
+
+</selector>

+ 6 - 3
app/src/main/res/layout/fgt_find.xml

@@ -2,12 +2,15 @@
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:fitsSystemWindows="true"
     android:background="@color/white">
-
+    <ImageView
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:src="@drawable/drawable_selector_bg_home_search"/>
     <android.support.design.widget.TabLayout
         android:id="@+id/indicator"
-        style="@style/style_tab" />
+        android:layout_marginTop="20dp"
+        style="@style/style_tab_2"/>
 
     <android.support.v4.view.ViewPager
         android:id="@+id/pager"

+ 12 - 8
app/src/main/res/layout/fgt_game_center.xml

@@ -2,13 +2,16 @@
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:background="@color/white"
-    android:fitsSystemWindows="true">
-
+    android:background="@color/white">
+    <ImageView
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:src="@drawable/drawable_selector_bg_home_search"/>
     <RelativeLayout
         android:id="@+id/top_bar"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content">
+        android:layout_height="wrap_content"
+        android:layout_marginTop="20dp">
 
         <ImageButton
             android:id="@+id/back_btn"
@@ -21,7 +24,7 @@
 
         <android.support.design.widget.TabLayout
             android:id="@+id/indicator"
-            style="@style/style_tab"
+            style="@style/style_tab_2"
             android:layout_width="wrap_content"
             android:layout_centerInParent="true" />
 
@@ -34,7 +37,7 @@
             android:background="@android:color/transparent"
             android:gravity="center"
             android:minWidth="?attr/actionBarSize"
-            android:src="@drawable/index_download" />
+            android:src="@drawable/drawable_selector_ic_home_download" />
 
         <ImageButton
             android:id="@+id/search_btn"
@@ -46,7 +49,7 @@
             android:background="@android:color/transparent"
             android:gravity="center"
             android:minWidth="?attr/actionBarSize"
-            android:src="@drawable/search_black_img" />
+            android:src="@drawable/drawable_selector_ic_home_search" />
 
         <Button
             android:id="@+id/my_walfare_btn"
@@ -61,7 +64,7 @@
             android:paddingEnd="17dp"
             android:paddingStart="17dp"
             android:text="我的礼包"
-            android:textColor="@color/black_text_deep"
+            android:textColor="@color/tc_home_search_2"
             android:textSize="12sp"
             android:visibility="gone" />
     </RelativeLayout>
@@ -70,6 +73,7 @@
         android:id="@+id/pager"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
+        android:background="@color/white"
         android:layout_below="@+id/top_bar" />
 
 </RelativeLayout>

+ 2 - 0
app/src/main/res/values/colors.xml

@@ -11,6 +11,7 @@
     <color name="bg_class_grey">#f9f9f9</color>
     <color name="gray_CBCBCB">#cbcbcb</color>
 
+    <!--支持换肤的颜色-->
     <color name="tc_dialog_gtg_name">#272727</color>
     <color name="tc_dialog_gtg_amout">#ffff2d4b</color>
     <color name="red_FD2D54">#FD2D54</color>
@@ -18,4 +19,5 @@
     <color name="color_bg_line_home">#fff5f5f5</color>
     <color name="tc_home_search_1">#8f8f8f</color>
     <color name="tc_home_search_2">#333333</color>
+    <color name="color_tab_nor">#000000</color>
 </resources>

+ 15 - 0
app/src/main/res/values/dd_styles.xml

@@ -288,6 +288,10 @@
         <item name="android:textSize">14sp</item>
         <item name="android:textColor">#000000</item>
     </style>
+    <style name="SheepTabLayoutTextAppearance2" parent="@android:style/TextAppearance.Holo.Large">
+        <item name="android:textSize">14sp</item>
+        <item name="android:textColor">@color/selector_color_tab2</item>
+    </style>
     <style name="SheepTabLayoutTextAppearanceAskmoney" parent="@android:style/TextAppearance.Holo.Large">
         <item name="android:textSize">14sp</item>
         <item name="android:textColor">#996633</item>
@@ -378,6 +382,17 @@
         <item name="tabSelectedTextColor">#2ebef2</item>
         <item name="tabTextAppearance">@style/SheepTabLayoutTextAppearance</item>
     </style>
+    <style name="style_tab_2">
+        <item name="android:layout_width">match_parent</item>
+        <item name="android:layout_height">36dp</item>
+        <item name="tabBackground">@android:color/transparent</item>
+        <item name="tabIndicatorHeight">2dp</item>
+        <item name="tabGravity">center</item>
+        <item name="tabIndicatorColor">#2ebef2</item>
+        <item name="tabMode">scrollable</item>
+        <item name="tabTextAppearance">@style/SheepTabLayoutTextAppearance2</item>
+        <item name="tabSelectedTextColor">#2ebef2</item>
+    </style>
 
     <style name="style_tab_askgetmoney">
         <item name="android:layout_width">match_parent</item>

+ 11 - 0
skin_newYear/src/main/res/color/selector_color_tab2.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item android:state_enabled="false" android:color="#2ebef2" />
+    <item android:state_activated="true" android:color="#2ebef2" />
+    <item android:state_focused="true" android:color="#2ebef2" />
+    <item android:state_checked="true" android:color="#2ebef2"/>
+    <item android:state_selected="true" android:color="#2ebef2"/>
+    <item android:state_pressed="true" android:color="#2ebef2"/>
+    <item android:color="@color/color_tab_nor"/>
+</selector>

BIN
skin_newYear/src/main/res/drawable-xxhdpi/index_download_white.png


+ 6 - 0
skin_newYear/src/main/res/drawable/drawable_selector_ic_home_download.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item android:drawable="@drawable/index_download_white"/>
+
+</selector>

+ 1 - 0
skin_newYear/src/main/res/values/colors.xml

@@ -7,4 +7,5 @@
     <color name="color_bg_line_home">#EDEAEA</color>
     <color name="tc_home_search_1">#66ffffff</color>
     <color name="tc_home_search_2">#ffffff</color>
+    <color name="color_tab_nor">#ffffff</color>
 </resources>