add icons
@ -17,7 +17,7 @@ import butterknife.OnClick;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
@BindView(R.id.viewHolder) RelativeLayout viewHolder;
|
||||
@BindView(R.id.toggle_camera) View toggleCameraBtn;
|
||||
@BindView(R.id.toggle_camera) ImageView toggleCameraBtn;
|
||||
@BindView(R.id.toggle_flash) ImageView toggleFlashBtn;
|
||||
|
||||
private Preview preview;
|
||||
@ -42,8 +42,10 @@ public class MainActivity extends AppCompatActivity {
|
||||
public void toggleCamera() {
|
||||
if (currCamera == Camera.CameraInfo.CAMERA_FACING_BACK) {
|
||||
currCamera = Camera.CameraInfo.CAMERA_FACING_FRONT;
|
||||
toggleCameraBtn.setImageResource(R.mipmap.camera_rear);
|
||||
} else {
|
||||
currCamera = Camera.CameraInfo.CAMERA_FACING_BACK;
|
||||
toggleCameraBtn.setImageResource(R.mipmap.camera_front);
|
||||
}
|
||||
|
||||
disableFlash();
|
||||
|
@ -16,26 +16,26 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginBottom="@dimen/preview_btn_margin"
|
||||
android:gravity="center_horizontal">
|
||||
android:gravity="center_horizontal|bottom">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/toggle_camera"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="@dimen/side_icon_size"
|
||||
android:layout_height="@dimen/side_icon_size"
|
||||
android:layout_weight="1"
|
||||
android:src="@mipmap/ic_launcher"/>
|
||||
android:src="@mipmap/camera_front"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/shutter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="@dimen/main_icon_size"
|
||||
android:layout_height="@dimen/main_icon_size"
|
||||
android:layout_weight="1"
|
||||
android:src="@mipmap/ic_launcher"/>
|
||||
android:src="@mipmap/camera"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/toggle_flash"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="@dimen/side_icon_size"
|
||||
android:layout_height="@dimen/side_icon_size"
|
||||
android:layout_weight="1"
|
||||
android:src="@mipmap/flash_off"/>
|
||||
|
||||
|
BIN
app/src/main/res/mipmap-hdpi/camera.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
app/src/main/res/mipmap-hdpi/camera_front.png
Normal file
After Width: | Height: | Size: 444 B |
BIN
app/src/main/res/mipmap-hdpi/camera_rear.png
Normal file
After Width: | Height: | Size: 377 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 485 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 318 B |
BIN
app/src/main/res/mipmap-mdpi/camera.png
Normal file
After Width: | Height: | Size: 758 B |
BIN
app/src/main/res/mipmap-mdpi/camera_front.png
Normal file
After Width: | Height: | Size: 317 B |
BIN
app/src/main/res/mipmap-mdpi/camera_rear.png
Normal file
After Width: | Height: | Size: 266 B |
BIN
app/src/main/res/mipmap-mdpi/flash_off.png
Normal file
After Width: | Height: | Size: 345 B |
BIN
app/src/main/res/mipmap-mdpi/flash_on.png
Normal file
After Width: | Height: | Size: 239 B |
BIN
app/src/main/res/mipmap-xhdpi/camera.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
app/src/main/res/mipmap-xhdpi/camera_front.png
Normal file
After Width: | Height: | Size: 570 B |
BIN
app/src/main/res/mipmap-xhdpi/camera_rear.png
Normal file
After Width: | Height: | Size: 489 B |
BIN
app/src/main/res/mipmap-xhdpi/flash_off.png
Normal file
After Width: | Height: | Size: 602 B |
BIN
app/src/main/res/mipmap-xhdpi/flash_on.png
Normal file
After Width: | Height: | Size: 386 B |
BIN
app/src/main/res/mipmap-xxhdpi/camera.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/camera_front.png
Normal file
After Width: | Height: | Size: 875 B |
BIN
app/src/main/res/mipmap-xxhdpi/camera_rear.png
Normal file
After Width: | Height: | Size: 745 B |
BIN
app/src/main/res/mipmap-xxhdpi/flash_off.png
Normal file
After Width: | Height: | Size: 875 B |
BIN
app/src/main/res/mipmap-xxhdpi/flash_on.png
Normal file
After Width: | Height: | Size: 516 B |
BIN
app/src/main/res/mipmap-xxxhdpi/camera.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/camera_front.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/camera_rear.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/flash_off.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/flash_on.png
Normal file
After Width: | Height: | Size: 680 B |
@ -1,4 +1,6 @@
|
||||
<resources>
|
||||
<dimen name="activity_margin">16dp</dimen>
|
||||
<dimen name="preview_btn_margin">32dp</dimen>
|
||||
<dimen name="side_icon_size">36dp</dimen>
|
||||
<dimen name="main_icon_size">48dp</dimen>
|
||||
</resources>
|
||||
|