Commit a2de219cb5ee1a4c77e3a950feddf45295dcc61c
1 parent
3892be01
1 修改分享页二维码样式
Showing
2 changed files
with
53 additions
and
39 deletions
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/activity/ShareFriendActivity.java
| ... | ... | @@ -5,6 +5,7 @@ import android.content.Context; |
| 5 | 5 | import android.content.Intent; |
| 6 | 6 | import android.content.SharedPreferences; |
| 7 | 7 | import android.graphics.Bitmap; |
| 8 | +import android.graphics.BitmapFactory; | |
| 8 | 9 | import android.support.v4.content.ContextCompat; |
| 9 | 10 | import android.support.v7.app.AppCompatActivity; |
| 10 | 11 | import android.os.Bundle; |
| ... | ... | @@ -92,7 +93,11 @@ import java.io.ByteArrayOutputStream; |
| 92 | 93 | if (null == service) { |
| 93 | 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 | 101 | // binding.ivQr.setBackgroundDrawable(bitmap); |
| 97 | 102 | if (null != bitmap) { |
| 98 | 103 | GlideApp.with(this).load(bitmap).into(erweima); | ... | ... |
module_xiaojiaSoundBox/src/main/res/layout/activity_share_friend.xml
| ... | ... | @@ -11,46 +11,47 @@ |
| 11 | 11 | <com.qmuiteam.qmui.widget.QMUITopBar |
| 12 | 12 | android:id="@+id/topbar" |
| 13 | 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 | 16 | <RelativeLayout |
| 17 | 17 | android:id="@+id/share_ry" |
| 18 | 18 | android:layout_width="match_parent" |
| 19 | 19 | android:layout_height="match_parent" |
| 20 | 20 | android:layout_below="@id/topbar" |
| 21 | - android:layout_marginTop="20dp" | |
| 22 | 21 | android:layout_marginLeft="20dp" |
| 22 | + android:layout_marginTop="20dp" | |
| 23 | 23 | android:layout_marginRight="20dp" |
| 24 | 24 | android:layout_marginBottom="60dp" |
| 25 | 25 | android:background="@drawable/family_bg"> |
| 26 | 26 | |
| 27 | 27 | <LinearLayout |
| 28 | - android:layout_width="wrap_content" | |
| 28 | + android:layout_width="match_parent" | |
| 29 | 29 | android:layout_height="wrap_content" |
| 30 | 30 | android:layout_centerHorizontal="true" |
| 31 | 31 | android:layout_margin="20dp" |
| 32 | 32 | android:orientation="vertical"> |
| 33 | + | |
| 33 | 34 | <LinearLayout |
| 34 | 35 | android:layout_width="wrap_content" |
| 35 | 36 | android:layout_height="37dp" |
| 36 | 37 | android:layout_gravity="center_horizontal" |
| 37 | 38 | android:orientation="horizontal"> |
| 39 | + | |
| 38 | 40 | <ImageView |
| 39 | 41 | android:id="@+id/img_icon" |
| 40 | 42 | android:layout_width="37dp" |
| 41 | 43 | android:layout_height="37dp" |
| 42 | - android:src="@drawable/icon_friend"/> | |
| 44 | + android:src="@drawable/icon_friend" /> | |
| 43 | 45 | |
| 44 | 46 | <TextView |
| 45 | 47 | android:id="@+id/name" |
| 46 | 48 | android:layout_width="wrap_content" |
| 47 | 49 | android:layout_height="wrap_content" |
| 48 | - android:textColor="@color/color_282828" | |
| 49 | - android:textSize="16sp" | |
| 50 | - android:layout_marginLeft="10dp" | |
| 51 | 50 | android:layout_gravity="center_vertical" |
| 51 | + android:layout_marginLeft="10dp" | |
| 52 | 52 | android:text="轻轻的路过" |
| 53 | - /> | |
| 53 | + android:textColor="@color/color_282828" | |
| 54 | + android:textSize="16sp" /> | |
| 54 | 55 | |
| 55 | 56 | <TextView |
| 56 | 57 | android:layout_width="wrap_content" |
| ... | ... | @@ -59,28 +60,29 @@ |
| 59 | 60 | android:layout_marginLeft="10dp" |
| 60 | 61 | android:text="@string/invite_you" |
| 61 | 62 | android:textColor="@color/color_fff" |
| 62 | - android:textSize="15sp" | |
| 63 | - /> | |
| 63 | + android:textSize="15sp" /> | |
| 64 | 64 | </LinearLayout> |
| 65 | + | |
| 65 | 66 | <TextView |
| 66 | 67 | android:layout_width="wrap_content" |
| 67 | 68 | android:layout_height="wrap_content" |
| 68 | - android:text="@string/scanto_get_invite" | |
| 69 | + android:layout_gravity="center_horizontal" | |
| 69 | 70 | android:layout_marginTop="15dp" |
| 70 | - android:textSize="15sp" | |
| 71 | + android:text="@string/scanto_get_invite" | |
| 71 | 72 | android:textColor="@color/color_fff" |
| 72 | - /> | |
| 73 | + android:textSize="15sp" /> | |
| 73 | 74 | |
| 74 | 75 | <ImageView |
| 75 | 76 | android:id="@+id/erweima" |
| 76 | 77 | android:layout_width="150dp" |
| 77 | 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 | 82 | <LinearLayout |
| 82 | 83 | android:layout_width="match_parent" |
| 83 | 84 | android:layout_height="wrap_content" |
| 85 | + android:layout_gravity="center_horizontal" | |
| 84 | 86 | android:layout_marginTop="15dp" |
| 85 | 87 | android:gravity="center"> |
| 86 | 88 | |
| ... | ... | @@ -134,45 +136,52 @@ |
| 134 | 136 | android:textSize="11sp" |
| 135 | 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 | 148 | </LinearLayout> |
| 138 | 149 | |
| 139 | 150 | <TextView |
| 140 | 151 | android:layout_width="wrap_content" |
| 141 | 152 | android:layout_height="wrap_content" |
| 142 | - android:text="@string/haseapp_login" | |
| 143 | 153 | android:layout_gravity="center_horizontal" |
| 144 | 154 | android:layout_marginTop="15dp" |
| 145 | - android:textSize="15sp" | |
| 155 | + android:text="@string/haseapp_login" | |
| 146 | 156 | android:textColor="@color/color_282828" |
| 147 | - android:textStyle="bold" | |
| 148 | - /> | |
| 157 | + android:textSize="15sp" | |
| 158 | + android:textStyle="bold" /> | |
| 149 | 159 | </LinearLayout> |
| 150 | 160 | |
| 151 | 161 | <TextView |
| 152 | 162 | android:layout_width="wrap_content" |
| 153 | 163 | android:layout_height="wrap_content" |
| 154 | - android:layout_centerHorizontal="true" | |
| 155 | 164 | android:layout_alignParentBottom="true" |
| 165 | + android:layout_centerHorizontal="true" | |
| 156 | 166 | android:layout_marginBottom="5dp" |
| 157 | 167 | android:text="@string/save_bitmap_app_scan" |
| 158 | 168 | android:textColor="@color/color_282828" |
| 159 | - android:textSize="15sp" | |
| 160 | - /> | |
| 169 | + android:textSize="15sp" /> | |
| 161 | 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 | 187 | </RelativeLayout> |
| 179 | 188 | \ No newline at end of file | ... | ... |