Commit a2de219cb5ee1a4c77e3a950feddf45295dcc61c

Authored by YangShuai
1 parent 3892be01

1 修改分享页二维码样式

module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/activity/ShareFriendActivity.java
@@ -5,6 +5,7 @@ import android.content.Context; @@ -5,6 +5,7 @@ import android.content.Context;
5 import android.content.Intent; 5 import android.content.Intent;
6 import android.content.SharedPreferences; 6 import android.content.SharedPreferences;
7 import android.graphics.Bitmap; 7 import android.graphics.Bitmap;
  8 +import android.graphics.BitmapFactory;
8 import android.support.v4.content.ContextCompat; 9 import android.support.v4.content.ContextCompat;
9 import android.support.v7.app.AppCompatActivity; 10 import android.support.v7.app.AppCompatActivity;
10 import android.os.Bundle; 11 import android.os.Bundle;
@@ -92,7 +93,11 @@ import java.io.ByteArrayOutputStream; @@ -92,7 +93,11 @@ import java.io.ByteArrayOutputStream;
92 if (null == service) { 93 if (null == service) {
93 return; 94 return;
94 } 95 }
95 - Bitmap bitmap = service.createQRNoIconBitmap(encryptionContent, DensityUtil.dp2px(this, 245)); 96 + Bitmap logo = BitmapFactory.decodeResource(this.getResources(), R.mipmap.ic_launcher);
  97 + if (null == logo) {
  98 + return;
  99 + }
  100 + Bitmap bitmap = service.createQrIconBitMap(encryptionContent, DensityUtil.dp2px(this, 245), logo, 10);
96 // binding.ivQr.setBackgroundDrawable(bitmap); 101 // binding.ivQr.setBackgroundDrawable(bitmap);
97 if (null != bitmap) { 102 if (null != bitmap) {
98 GlideApp.with(this).load(bitmap).into(erweima); 103 GlideApp.with(this).load(bitmap).into(erweima);
module_xiaojiaSoundBox/src/main/res/layout/activity_share_friend.xml
@@ -11,46 +11,47 @@ @@ -11,46 +11,47 @@
11 <com.qmuiteam.qmui.widget.QMUITopBar 11 <com.qmuiteam.qmui.widget.QMUITopBar
12 android:id="@+id/topbar" 12 android:id="@+id/topbar"
13 android:layout_width="match_parent" 13 android:layout_width="match_parent"
14 - android:layout_height="?attr/qmui_topbar_height"/> 14 + android:layout_height="?attr/qmui_topbar_height" />
15 15
16 <RelativeLayout 16 <RelativeLayout
17 android:id="@+id/share_ry" 17 android:id="@+id/share_ry"
18 android:layout_width="match_parent" 18 android:layout_width="match_parent"
19 android:layout_height="match_parent" 19 android:layout_height="match_parent"
20 android:layout_below="@id/topbar" 20 android:layout_below="@id/topbar"
21 - android:layout_marginTop="20dp"  
22 android:layout_marginLeft="20dp" 21 android:layout_marginLeft="20dp"
  22 + android:layout_marginTop="20dp"
23 android:layout_marginRight="20dp" 23 android:layout_marginRight="20dp"
24 android:layout_marginBottom="60dp" 24 android:layout_marginBottom="60dp"
25 android:background="@drawable/family_bg"> 25 android:background="@drawable/family_bg">
26 26
27 <LinearLayout 27 <LinearLayout
28 - android:layout_width="wrap_content" 28 + android:layout_width="match_parent"
29 android:layout_height="wrap_content" 29 android:layout_height="wrap_content"
30 android:layout_centerHorizontal="true" 30 android:layout_centerHorizontal="true"
31 android:layout_margin="20dp" 31 android:layout_margin="20dp"
32 android:orientation="vertical"> 32 android:orientation="vertical">
  33 +
33 <LinearLayout 34 <LinearLayout
34 android:layout_width="wrap_content" 35 android:layout_width="wrap_content"
35 android:layout_height="37dp" 36 android:layout_height="37dp"
36 android:layout_gravity="center_horizontal" 37 android:layout_gravity="center_horizontal"
37 android:orientation="horizontal"> 38 android:orientation="horizontal">
  39 +
38 <ImageView 40 <ImageView
39 android:id="@+id/img_icon" 41 android:id="@+id/img_icon"
40 android:layout_width="37dp" 42 android:layout_width="37dp"
41 android:layout_height="37dp" 43 android:layout_height="37dp"
42 - android:src="@drawable/icon_friend"/> 44 + android:src="@drawable/icon_friend" />
43 45
44 <TextView 46 <TextView
45 android:id="@+id/name" 47 android:id="@+id/name"
46 android:layout_width="wrap_content" 48 android:layout_width="wrap_content"
47 android:layout_height="wrap_content" 49 android:layout_height="wrap_content"
48 - android:textColor="@color/color_282828"  
49 - android:textSize="16sp"  
50 - android:layout_marginLeft="10dp"  
51 android:layout_gravity="center_vertical" 50 android:layout_gravity="center_vertical"
  51 + android:layout_marginLeft="10dp"
52 android:text="轻轻的路过" 52 android:text="轻轻的路过"
53 - /> 53 + android:textColor="@color/color_282828"
  54 + android:textSize="16sp" />
54 55
55 <TextView 56 <TextView
56 android:layout_width="wrap_content" 57 android:layout_width="wrap_content"
@@ -59,28 +60,29 @@ @@ -59,28 +60,29 @@
59 android:layout_marginLeft="10dp" 60 android:layout_marginLeft="10dp"
60 android:text="@string/invite_you" 61 android:text="@string/invite_you"
61 android:textColor="@color/color_fff" 62 android:textColor="@color/color_fff"
62 - android:textSize="15sp"  
63 - /> 63 + android:textSize="15sp" />
64 </LinearLayout> 64 </LinearLayout>
  65 +
65 <TextView 66 <TextView
66 android:layout_width="wrap_content" 67 android:layout_width="wrap_content"
67 android:layout_height="wrap_content" 68 android:layout_height="wrap_content"
68 - android:text="@string/scanto_get_invite" 69 + android:layout_gravity="center_horizontal"
69 android:layout_marginTop="15dp" 70 android:layout_marginTop="15dp"
70 - android:textSize="15sp" 71 + android:text="@string/scanto_get_invite"
71 android:textColor="@color/color_fff" 72 android:textColor="@color/color_fff"
72 - /> 73 + android:textSize="15sp" />
73 74
74 <ImageView 75 <ImageView
75 android:id="@+id/erweima" 76 android:id="@+id/erweima"
76 android:layout_width="150dp" 77 android:layout_width="150dp"
77 android:layout_height="150dp" 78 android:layout_height="150dp"
78 - android:layout_marginTop="15dp"  
79 - android:layout_gravity="center_horizontal"/> 79 + android:layout_gravity="center_horizontal"
  80 + android:layout_marginTop="15dp" />
80 81
81 <LinearLayout 82 <LinearLayout
82 android:layout_width="match_parent" 83 android:layout_width="match_parent"
83 android:layout_height="wrap_content" 84 android:layout_height="wrap_content"
  85 + android:layout_gravity="center_horizontal"
84 android:layout_marginTop="15dp" 86 android:layout_marginTop="15dp"
85 android:gravity="center"> 87 android:gravity="center">
86 88
@@ -134,45 +136,52 @@ @@ -134,45 +136,52 @@
134 android:textSize="11sp" 136 android:textSize="11sp"
135 android:textStyle="bold" /> 137 android:textStyle="bold" />
136 138
  139 + <TextView
  140 + android:layout_width="wrap_content"
  141 + android:layout_height="wrap_content"
  142 + android:layout_marginLeft="5dp"
  143 + android:layout_marginRight="5dp"
  144 + android:text="注册/登录 >"
  145 + android:textColor="@color/color_282828"
  146 + android:textSize="12sp"
  147 + android:textStyle="bold" />
137 </LinearLayout> 148 </LinearLayout>
138 149
139 <TextView 150 <TextView
140 android:layout_width="wrap_content" 151 android:layout_width="wrap_content"
141 android:layout_height="wrap_content" 152 android:layout_height="wrap_content"
142 - android:text="@string/haseapp_login"  
143 android:layout_gravity="center_horizontal" 153 android:layout_gravity="center_horizontal"
144 android:layout_marginTop="15dp" 154 android:layout_marginTop="15dp"
145 - android:textSize="15sp" 155 + android:text="@string/haseapp_login"
146 android:textColor="@color/color_282828" 156 android:textColor="@color/color_282828"
147 - android:textStyle="bold"  
148 - /> 157 + android:textSize="15sp"
  158 + android:textStyle="bold" />
149 </LinearLayout> 159 </LinearLayout>
150 160
151 <TextView 161 <TextView
152 android:layout_width="wrap_content" 162 android:layout_width="wrap_content"
153 android:layout_height="wrap_content" 163 android:layout_height="wrap_content"
154 - android:layout_centerHorizontal="true"  
155 android:layout_alignParentBottom="true" 164 android:layout_alignParentBottom="true"
  165 + android:layout_centerHorizontal="true"
156 android:layout_marginBottom="5dp" 166 android:layout_marginBottom="5dp"
157 android:text="@string/save_bitmap_app_scan" 167 android:text="@string/save_bitmap_app_scan"
158 android:textColor="@color/color_282828" 168 android:textColor="@color/color_282828"
159 - android:textSize="15sp"  
160 - /> 169 + android:textSize="15sp" />
161 </RelativeLayout> 170 </RelativeLayout>
162 - <TextView  
163 - android:id="@+id/share_btn"  
164 - android:layout_width="wrap_content"  
165 - android:layout_height="wrap_content"  
166 - android:layout_alignParentBottom="true"  
167 - android:layout_centerHorizontal="true"  
168 - android:layout_marginBottom="15dp"  
169 - android:text="@string/share_family"  
170 - android:background="@drawable/selector_btn_green"  
171 - android:textColor="@color/color_fff"  
172 - android:textSize="16sp"  
173 - android:paddingTop="5dp"  
174 - android:paddingBottom="5dp"  
175 - android:paddingLeft="15dp"  
176 - android:paddingRight="15dp"  
177 - /> 171 +
  172 + <TextView
  173 + android:id="@+id/share_btn"
  174 + android:layout_width="wrap_content"
  175 + android:layout_height="wrap_content"
  176 + android:layout_alignParentBottom="true"
  177 + android:layout_centerHorizontal="true"
  178 + android:layout_marginBottom="15dp"
  179 + android:background="@drawable/selector_btn_green"
  180 + android:paddingLeft="15dp"
  181 + android:paddingTop="5dp"
  182 + android:paddingRight="15dp"
  183 + android:paddingBottom="5dp"
  184 + android:text="@string/share_family"
  185 + android:textColor="@color/color_fff"
  186 + android:textSize="16sp" />
178 </RelativeLayout> 187 </RelativeLayout>
179 \ No newline at end of file 188 \ No newline at end of file