Skip to content

Commit

Permalink
修复报 透明颜色值导致的崩溃问题(A TaskDescription's primary color should be opaque)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuzhiqiang1993 committed Mar 23, 2018
1 parent 797e752 commit 8fb11f5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 19 deletions.
10 changes: 5 additions & 5 deletions app/src/main/java/com/yzq/zxing/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,18 @@ protected void onCreate(Bundle savedInstanceState) {

private void initView() {
/*扫描按钮*/
scanBtn = (Button) findViewById(R.id.scanBtn);
scanBtn = findViewById(R.id.scanBtn);
scanBtn.setOnClickListener(this);
/*扫描结果*/
result = (TextView) findViewById(R.id.result);
result = findViewById(R.id.result);

/*要生成二维码的输入框*/
contentEt = (EditText) findViewById(R.id.contentEt);
contentEt = findViewById(R.id.contentEt);
/*生成按钮*/
encodeBtn = (Button) findViewById(R.id.encodeBtn);
encodeBtn = findViewById(R.id.encodeBtn);
encodeBtn.setOnClickListener(this);
/*生成的图片*/
contentIv = (ImageView) findViewById(R.id.contentIv);
contentIv = findViewById(R.id.contentIv);

toolbar=findViewById(R.id.toolbar);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ protected void onCreate(Bundle savedInstanceState) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.setStatusBarColor(Color.BLACK);
}
Log.i("onCreate", "setContentView");

/*先获取配置信息*/
try {
config = (ZxingConfig) getIntent().getExtras().get(Constant.INTENT_ZXING_CONFIG);
Expand Down
7 changes: 3 additions & 4 deletions zxinglibrary/src/main/res/layout/activity_capture.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="扫一扫"
android:textColor="#ffffffff"
android:textColor="#ffffff"
android:textSize="20sp" />


Expand Down Expand Up @@ -84,8 +84,7 @@
android:layout_marginTop="5dp"
android:gravity="center"
android:text="打开闪光灯"

android:textColor="@color/result_text" />
android:textColor="#ffffff" />

</android.support.v7.widget.LinearLayoutCompat>

Expand All @@ -111,7 +110,7 @@
android:gravity="center"
android:text="相册"

android:textColor="@color/result_text" />
android:textColor="#ffffff"/>
</android.support.v7.widget.LinearLayoutCompat>


Expand Down
18 changes: 9 additions & 9 deletions zxinglibrary/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
<resources>

<!--zxing-->
<color name="contents_text">#ff000000</color>
<color name="encode_view">#ffffffff</color>
<color name="possible_result_points">#c0ffbd21</color> <!-- Android standard ICS color -->
<color name="result_minor_text">#ffc0c0c0</color>
<color name="result_points">#c099cc00</color> <!-- Android standard ICS color -->
<color name="result_text">#ffffffff</color>
<color name="result_view">#b0000000</color>
<color name="status_text">#ffffffff</color>
<color name="contents_text">#000000</color>
<color name="encode_view">#ffffff</color>
<color name="possible_result_points">#ffbd21</color> <!-- Android standard ICS color -->
<color name="result_minor_text">#c0c0c0</color>
<color name="result_points">#99cc00</color> <!-- Android standard ICS color -->
<color name="result_text">#ffffff</color>
<color name="result_view">#000000</color>
<color name="status_text">#ffffff</color>
<color name="transparent">#00000000</color>
<color name="viewfinder_laser">#ffcc0000</color> <!-- Android standard ICS color -->
<color name="viewfinder_laser">#cc0000</color> <!-- Android standard ICS color -->
<color name="viewfinder_mask">#50000000</color>

</resources>

0 comments on commit 8fb11f5

Please sign in to comment.