Skip to content

Commit 18b48ee

Browse files
committed
更新app图标
1 parent 0b4cd80 commit 18b48ee

File tree

8 files changed

+28
-44
lines changed

8 files changed

+28
-44
lines changed

app/src/main/AndroidManifest.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
<application
99
android:allowBackup="true"
10-
android:icon="@drawable/frame_foreground"
10+
android:icon="@drawable/app_icon"
1111
android:label="@string/app_name"
12-
android:roundIcon="@drawable/frame_foreground"
12+
android:roundIcon="@drawable/app_icon"
1313
android:supportsRtl="true"
1414
android:theme="@style/Theme.AppCompat.NoActionBar"
1515
tools:ignore="GoogleAppIndexingWarning">

app/src/main/frame-playstore.png

-9.53 KB
Binary file not shown.

app/src/main/java/com/android/NBZxing/CusScanView.kt

+1-24
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import kotlinx.android.synthetic.main.floorview_layout.view.*
1717
* @Author: SWY
1818
* @CreateDate: 2020/4/30 4:06 PM
1919
*/
20-
class CusScanView @JvmOverloads constructor(context: Context, attributeSet: AttributeSet? = null, def: Int = 0) : FreeZxingView(context, attributeSet, def) {
20+
class CusScanView @JvmOverloads constructor(context: Context, attributeSet: AttributeSet? = null, def: Int = 0) : NBZxingView(context, attributeSet, def) {
2121

2222
init {
2323
setAspectRatio(AspectRatio.of(16, 9))
@@ -48,27 +48,4 @@ class CusScanView @JvmOverloads constructor(context: Context, attributeSet: Attr
4848
Toast.makeText(context, "未扫描到内容", Toast.LENGTH_SHORT).show()
4949
else Toast.makeText(context, content, Toast.LENGTH_SHORT).show()
5050
}
51-
52-
override fun provideFloorView(): Int {
53-
return R.layout.floorview_layout
54-
}
55-
56-
57-
override fun provideParseRectView(): View? {
58-
return scanRectView
59-
}
60-
61-
override fun provideScanBarView(): ScanBarCallBack? {
62-
return scanBarView
63-
}
64-
65-
override fun provideLightView(): ScanLightViewCallBack? {
66-
return lightView
67-
}
68-
69-
override fun provideLocView(): ScanLocViewCallBack? {
70-
return locView
71-
}
72-
73-
7451
}
18.1 KB
Loading

app/src/main/res/layout/floorview_layout.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
android:layout_margin="5dp"
3535
android:background="@drawable/frame_foreground" />
3636

37-
<com.ailiwean.core.view.CameraZxingMaskView
37+
<com.ailiwean.core.view.MaskView
3838
android:layout_width="match_parent"
3939
android:layout_height="match_parent"
4040
app:camera_clearById="@id/scanRectView"

module_camera/src/main/java/com/ailiwean/core/view/CameraZxingMaskView.java renamed to module_camera/src/main/java/com/ailiwean/core/view/MaskView.java

+11-11
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* @Author: SWY
2323
* @CreateDate: 2020/9/2 9:48 AM
2424
*/
25-
public class CameraZxingMaskView extends View {
25+
public class MaskView extends View {
2626

2727
private Paint paint;
2828
private Rect clearRect;
@@ -34,24 +34,24 @@ public class CameraZxingMaskView extends View {
3434
private int id;
3535
private int bgColor;
3636

37-
public CameraZxingMaskView(Context context) {
37+
public MaskView(Context context) {
3838
this(context, null);
3939
}
4040

41-
public CameraZxingMaskView(Context context, @Nullable AttributeSet attrs) {
41+
public MaskView(Context context, @Nullable AttributeSet attrs) {
4242
this(context, attrs, 0);
4343
}
4444

45-
public CameraZxingMaskView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
45+
public MaskView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
4646
super(context, attrs, defStyleAttr);
4747
initPaint();
48-
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.CameraZxingMaskView);
49-
id = typedArray.getResourceId(R.styleable.CameraZxingMaskView_camera_clearById, 0);
50-
margin_left = typedArray.getDimension(R.styleable.CameraZxingMaskView_camera_clear_margin_left, 0f);
51-
margin_top = typedArray.getDimension(R.styleable.CameraZxingMaskView_camera_clear_margin_top, 0f);
52-
margin_right = typedArray.getDimension(R.styleable.CameraZxingMaskView_camera_clear_margin_right, 0f);
53-
margin_bottom = typedArray.getDimension(R.styleable.CameraZxingMaskView_camera_clear_margin_bottom, 0f);
54-
bgColor = typedArray.getColor(R.styleable.CameraZxingMaskView_camera_maskBgColor, Color.parseColor("#1f000000"));
48+
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.MaskView);
49+
id = typedArray.getResourceId(R.styleable.MaskView_camera_clearById, 0);
50+
margin_left = typedArray.getDimension(R.styleable.MaskView_camera_clear_margin_left, 0f);
51+
margin_top = typedArray.getDimension(R.styleable.MaskView_camera_clear_margin_top, 0f);
52+
margin_right = typedArray.getDimension(R.styleable.MaskView_camera_clear_margin_right, 0f);
53+
margin_bottom = typedArray.getDimension(R.styleable.MaskView_camera_clear_margin_bottom, 0f);
54+
bgColor = typedArray.getColor(R.styleable.MaskView_camera_maskBgColor, Color.parseColor("#1f000000"));
5555
paint.setColor(bgColor);
5656
typedArray.recycle();
5757
}

module_camera/src/main/res/layout/nbzxing_default_floorview.xml

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
34
android:id="@+id/base_floor"
45
android:layout_width="match_parent"
56
android:layout_height="match_parent"
@@ -27,9 +28,15 @@
2728

2829
<View
2930
android:id="@+id/scanRectView"
30-
android:layout_width="150dp"
31-
android:layout_height="150dp"
32-
android:layout_gravity="center"
33-
android:background="#1f000000" />
31+
android:layout_width="200dp"
32+
android:layout_height="200dp"
33+
android:layout_gravity="center" />
34+
35+
36+
<com.ailiwean.core.view.MaskView
37+
android:layout_width="match_parent"
38+
android:layout_height="match_parent"
39+
app:camera_clearById="@id/scanRectView"
40+
app:camera_maskBgColor="#5f000000" />
3441

3542
</FrameLayout>

module_camera/src/main/res/values/attrs.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
See the License for the specific language governing permissions and
1111
limitations under the License.
1212
-->
13-
<resources>
13+
<resources xmlns:tools="http://schemas.android.com/tools">
1414
<declare-styleable name="CameraView">
1515
<!--
1616
Set this to true if you want the CameraView to adjust its bounds to preserve the aspect
@@ -55,7 +55,7 @@
5555
</attr>
5656
</declare-styleable>
5757

58-
<declare-styleable name="CameraZxingMaskView">
58+
<declare-styleable name="MaskView" tools:ignore="ResourceName">
5959

6060
<attr name="camera_clearById" format="reference" />
6161
<attr name="camera_maskBgColor" format="color" />

0 commit comments

Comments
 (0)