add some temp images for flashlight off and on

This commit is contained in:
tibbi 2016-01-06 16:32:32 +01:00
parent f4e495a4ce
commit 599137903d
12 changed files with 3 additions and 4 deletions

View File

@ -59,13 +59,13 @@ public class MainActivity extends AppCompatActivity {
private void enableFlashlight() {
params.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH);
camera.setParameters(params);
toggleBtn.getDrawable().setColorFilter(Color.GREEN, PorterDuff.Mode.SRC_ATOP);
toggleBtn.setBackground(getResources().getDrawable(R.mipmap.flashlight_big_on));
}
private void disableFlashlight() {
params.setFlashMode(Camera.Parameters.FLASH_MODE_OFF);
camera.setParameters(params);
toggleBtn.getDrawable().setColorFilter(Color.RED, PorterDuff.Mode.SRC_ATOP);
toggleBtn.setBackground(getResources().getDrawable(R.mipmap.flashlight_big_off));
}
private void releaseCamera() {

View File

@ -13,6 +13,5 @@
<ImageView
android:id="@+id/toggle_btn"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@mipmap/ic_launcher"/>
android:layout_height="match_parent"/>
</RelativeLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 821 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB