Initial
This commit is contained in:
200
app/src/main/res/layout/activity_main.xml
Normal file → Executable file
200
app/src/main/res/layout/activity_main.xml
Normal file → Executable file
@@ -1,101 +1,101 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".MainActivity">
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/colorPrimary"
|
||||
android:layout_height="wrap_content"
|
||||
app:contentInsetLeft="0dp"
|
||||
app:contentInsetStart="0dp">
|
||||
<TextView
|
||||
android:id="@+id/tvTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/title_height"
|
||||
android:gravity="center"
|
||||
android:singleLine="true"
|
||||
android:textSize="@dimen/size_18sp"
|
||||
android:textColor="@color/white"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="@string/app_name"/>
|
||||
</android.support.v7.widget.Toolbar>
|
||||
<android.support.constraint.Guideline
|
||||
android:id="@+id/line"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@+id/toolbar"
|
||||
app:layout_constraintGuide_percent="0.2"/>
|
||||
<Button
|
||||
android:id="@+id/btn1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:text="默认扫码"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/line"
|
||||
style="@style/OnClick"/>
|
||||
<Button
|
||||
android:id="@+id/btn2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:text="简单自定义布局扫码"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/btn1"
|
||||
style="@style/OnClick"/>
|
||||
<Button
|
||||
android:id="@+id/btn3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:text="自定义布局扫码"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/btn2"
|
||||
style="@style/OnClick"/>
|
||||
<Button
|
||||
android:id="@+id/btn4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:text="生成条形码"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/btn3"
|
||||
style="@style/OnClick"/>
|
||||
<Button
|
||||
android:id="@+id/btn5"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:text="生成二维码"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/btn4"
|
||||
style="@style/OnClick"/>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".MainActivity">
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/colorPrimary"
|
||||
android:layout_height="wrap_content"
|
||||
app:contentInsetLeft="0dp"
|
||||
app:contentInsetStart="0dp">
|
||||
<TextView
|
||||
android:id="@+id/tvTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/title_height"
|
||||
android:gravity="center"
|
||||
android:singleLine="true"
|
||||
android:textSize="@dimen/size_18sp"
|
||||
android:textColor="@color/white"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="@string/app_name"/>
|
||||
</android.support.v7.widget.Toolbar>
|
||||
<android.support.constraint.Guideline
|
||||
android:id="@+id/line"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@+id/toolbar"
|
||||
app:layout_constraintGuide_percent="0.2"/>
|
||||
<Button
|
||||
android:id="@+id/btn1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:text="默认扫码"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/line"
|
||||
style="@style/OnClick"/>
|
||||
<Button
|
||||
android:id="@+id/btn2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:text="简单自定义布局扫码"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/btn1"
|
||||
style="@style/OnClick"/>
|
||||
<Button
|
||||
android:id="@+id/btn3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:text="自定义布局扫码"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/btn2"
|
||||
style="@style/OnClick"/>
|
||||
<Button
|
||||
android:id="@+id/btn4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:text="生成条形码"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/btn3"
|
||||
style="@style/OnClick"/>
|
||||
<Button
|
||||
android:id="@+id/btn5"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:text="生成二维码"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/btn4"
|
||||
style="@style/OnClick"/>
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
34
app/src/main/res/layout/code_activity.xml
Normal file → Executable file
34
app/src/main/res/layout/code_activity.xml
Normal file → Executable file
@@ -1,18 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<include android:id="@+id/toolbar"
|
||||
layout="@layout/toolbar"/>
|
||||
<ImageView
|
||||
android:id="@+id/ivCode"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/toolbar"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<include android:id="@+id/toolbar"
|
||||
layout="@layout/toolbar"/>
|
||||
<ImageView
|
||||
android:id="@+id/ivCode"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/toolbar"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
68
app/src/main/res/layout/custom_capture_activity.xml
Normal file → Executable file
68
app/src/main/res/layout/custom_capture_activity.xml
Normal file → Executable file
@@ -1,35 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<SurfaceView
|
||||
android:id="@+id/preview_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
<com.king.zxing.ViewfinderView
|
||||
android:id="@+id/viewfinder_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:text="@string/tips_scan_code"
|
||||
app:textSize="@dimen/size_14sp"
|
||||
app:laserColor="@color/colorAccent"
|
||||
app:frameColor="@color/colorPrimary"
|
||||
app:cornerColor="@color/colorPrimary"
|
||||
app:resultPointColor="@color/colorAccent"
|
||||
app:textLocation="bottom"/>
|
||||
<ImageView
|
||||
android:id="@+id/ivFlash"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/flash_selected_selector"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginTop="160dp"
|
||||
style="@style/OnClick"/>
|
||||
<include layout="@layout/toolbar_capture"/>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<SurfaceView
|
||||
android:id="@+id/preview_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
<com.king.zxing.ViewfinderView
|
||||
android:id="@+id/viewfinder_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:text="@string/tips_scan_code"
|
||||
app:textSize="@dimen/size_14sp"
|
||||
app:laserColor="@color/colorAccent"
|
||||
app:frameColor="@color/colorPrimary"
|
||||
app:cornerColor="@color/colorPrimary"
|
||||
app:resultPointColor="@color/colorAccent"
|
||||
app:textLocation="bottom"/>
|
||||
<ImageView
|
||||
android:id="@+id/ivFlash"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/flash_selected_selector"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginTop="160dp"
|
||||
style="@style/OnClick"/>
|
||||
<include layout="@layout/toolbar_capture"/>
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
14
app/src/main/res/layout/easy_capture_activity.xml
Normal file → Executable file
14
app/src/main/res/layout/easy_capture_activity.xml
Normal file → Executable file
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<include layout="@layout/capture"/>
|
||||
<include layout="@layout/toolbar_capture"/>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<include layout="@layout/capture"/>
|
||||
<include layout="@layout/toolbar_capture"/>
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
22
app/src/main/res/layout/toolbar.xml
Normal file → Executable file
22
app/src/main/res/layout/toolbar.xml
Normal file → Executable file
@@ -1,12 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/colorPrimary"
|
||||
android:layout_height="wrap_content"
|
||||
app:contentInsetLeft="0dp"
|
||||
app:contentInsetStart="0dp">
|
||||
<include layout="@layout/top_title_back_bar"/>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/colorPrimary"
|
||||
android:layout_height="wrap_content"
|
||||
app:contentInsetLeft="0dp"
|
||||
app:contentInsetStart="0dp">
|
||||
<include layout="@layout/top_title_back_bar"/>
|
||||
</android.support.v7.widget.Toolbar>
|
||||
20
app/src/main/res/layout/toolbar_capture.xml
Normal file → Executable file
20
app/src/main/res/layout/toolbar_capture.xml
Normal file → Executable file
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:contentInsetLeft="0dp"
|
||||
app:contentInsetStart="0dp">
|
||||
<include layout="@layout/top_title_back_bar"/>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:contentInsetLeft="0dp"
|
||||
app:contentInsetStart="0dp">
|
||||
<include layout="@layout/top_title_back_bar"/>
|
||||
</android.support.v7.widget.Toolbar>
|
||||
68
app/src/main/res/layout/top_title_back_bar.xml
Normal file → Executable file
68
app/src/main/res/layout/top_title_back_bar.xml
Normal file → Executable file
@@ -1,35 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/ll"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/title_height"
|
||||
android:gravity="center">
|
||||
<ImageView
|
||||
android:id="@+id/ivLeft"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@drawable/btn_back_selector"
|
||||
android:paddingLeft="@dimen/size_14dp"
|
||||
android:paddingRight="@dimen/size_14dp"
|
||||
style="@style/OnClick"/>
|
||||
<TextView
|
||||
android:id="@+id/tvTitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:singleLine="true"
|
||||
android:textSize="@dimen/size_18sp"
|
||||
android:textColor="@color/white"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="@string/app_name"/>
|
||||
<ImageView
|
||||
android:id="@+id/ivRight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingLeft="@dimen/size_14dp"
|
||||
android:paddingRight="@dimen/size_14dp"
|
||||
android:src="@drawable/btn_none"
|
||||
style="@style/OnClick"/>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/ll"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/title_height"
|
||||
android:gravity="center">
|
||||
<ImageView
|
||||
android:id="@+id/ivLeft"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@drawable/btn_back_selector"
|
||||
android:paddingLeft="@dimen/size_14dp"
|
||||
android:paddingRight="@dimen/size_14dp"
|
||||
style="@style/OnClick"/>
|
||||
<TextView
|
||||
android:id="@+id/tvTitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:singleLine="true"
|
||||
android:textSize="@dimen/size_18sp"
|
||||
android:textColor="@color/white"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="@string/app_name"/>
|
||||
<ImageView
|
||||
android:id="@+id/ivRight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingLeft="@dimen/size_14dp"
|
||||
android:paddingRight="@dimen/size_14dp"
|
||||
android:src="@drawable/btn_none"
|
||||
style="@style/OnClick"/>
|
||||
</LinearLayout>
|
||||
Reference in New Issue
Block a user