Skip to content

Commit

Permalink
Merge pull request #3 from AlfredoHdez1709/develop
Browse files Browse the repository at this point in the history
rename UI
  • Loading branch information
AlfredoHdez1709 authored Jul 25, 2022
2 parents 9abec19 + 504ec38 commit 4d29625
Show file tree
Hide file tree
Showing 17 changed files with 20 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ import java.io.File
import java.text.SimpleDateFormat
import java.util.*
import kotlin.math.abs
import kotlin.math.log
import kotlin.math.max
import kotlin.math.min

Expand Down Expand Up @@ -160,23 +159,23 @@ class CameraActivity : AppCompatActivity() {
private fun caseFlashMode(){
when(flashMode){
ImageCapture.FLASH_MODE_OFF ->{
binding.ibFlashCamera.setImageResource(R.drawable.ic_baseline_flash_off_24)
binding.ibFlashCamera.setImageResource(R.drawable.ic_flash_off_camera)
}
ImageCapture.FLASH_MODE_ON -> {
binding.ibFlashCamera.setImageResource(R.drawable.ic_baseline_flash_on_24)
binding.ibFlashCamera.setImageResource(R.drawable.ic_flash_on_camera)

}
ImageCapture.FLASH_MODE_AUTO -> {
binding.ibFlashCamera.setImageResource(R.drawable.ic_baseline_flash_auto_24)
binding.ibFlashCamera.setImageResource(R.drawable.ic_flash_auto_camera)
}
}
}

private fun enableFrontCamera(isFront : Boolean) {
if (isFront){
binding.ibFrontCamera.setImageResource(R.drawable.ic_baseline_camera_rear_24)
binding.ibFrontCamera.setImageResource(R.drawable.ic_camera_back)
}else{
binding.ibFrontCamera.setImageResource(R.drawable.ic_baseline_camera_front_24)
binding.ibFrontCamera.setImageResource(R.drawable.ic_front_camera)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide
import dev.ahrsoft.easycameraandgallery.databinding.ImagePickerListBinding
import dev.ahrsoft.easycameraandgallery.databinding.ImagePickerListCameraBinding

class GalleryAdapter(private val context : Context, private val imageList : List<ImageModel>) : RecyclerView.Adapter<GalleryAdapter.GalleryHolder>() {

class GalleryHolder(private val binding: ImagePickerListBinding) : RecyclerView.ViewHolder(binding.root){
class GalleryHolder(private val binding: ImagePickerListCameraBinding) : RecyclerView.ViewHolder(binding.root){
fun bind(context: Context,imageModel: ImageModel){
with(binding){
Glide.with(context)
Expand All @@ -23,7 +23,7 @@ class GalleryAdapter(private val context : Context, private val imageList : List
override fun getItemCount(): Int = imageList.size

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): GalleryHolder {
val itembinding = ImagePickerListBinding.inflate(LayoutInflater.from(parent.context),parent,false)
val itembinding = ImagePickerListCameraBinding.inflate(LayoutInflater.from(parent.context),parent,false)
return GalleryHolder(itembinding)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_checked="true"
android:drawable="@drawable/ic_checked"/>
android:drawable="@drawable/ic_checked_camera"/>
<item
android:state_pressed="true"
android:drawable="@drawable/ic_checked"/>
android:drawable="@drawable/ic_checked_camera"/>
<item
android:state_pressed="false"
android:drawable="@drawable/ic_unchecked"/>
android:drawable="@drawable/ic_unchecked_camera"/>
</selector>
16 changes: 8 additions & 8 deletions EasyCameraAndGallery/src/main/res/layout/activity_camera.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:src="@drawable/ic_baseline_camera_front_24"
android:src="@drawable/ic_front_camera"
android:background="@android:color/transparent"
android:padding="10dp"
android:elevation="9dp"
Expand All @@ -25,7 +25,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:src="@drawable/ic_baseline_flash_auto_24"
android:src="@drawable/ic_flash_auto_camera"
android:background="@android:color/transparent"
android:elevation="9dp"
android:padding="10dp"
Expand All @@ -41,7 +41,7 @@
android:clickable="true"
app:layout_constraintBottom_toTopOf="@+id/rv.gallery.camera"
app:layout_constraintEnd_toEndOf="parent"
app:srcCompat="@drawable/ic_baseline_check_24"
app:srcCompat="@drawable/ic_check_select"
android:focusable="true"
android:visibility="gone"/>

Expand All @@ -64,15 +64,15 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:itemCount="8"
tools:listitem="@layout/image_picker_list"
tools:listitem="@layout/image_picker_list_camera"
tools:orientation="horizontal" />

<ImageButton
android:id="@+id/camera.capture.button.camera"
android:layout_width="@dimen/round_button_large"
android:layout_height="@dimen/round_button_large"
android:layout_marginBottom="24dp"
android:background="@drawable/ic_camera"
android:background="@drawable/ic_capture_photo_camera"
android:contentDescription="@string/tomar_foto"
android:elevation="9dp"
android:scaleType="fitCenter"
Expand All @@ -86,7 +86,7 @@
android:layout_width="@dimen/round_button_medium"
android:layout_height="@dimen/round_button_medium"
android:layout_marginRight="24dp"
android:background="@drawable/ic_baseline_image_24"
android:background="@drawable/ic_gallery_camera"
android:contentDescription="@string/tomar_foto"
android:elevation="9dp"
android:scaleType="fitCenter"
Expand All @@ -97,7 +97,7 @@
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@drawable/gradient_bottom"
android:background="@drawable/gradient_bottom_camera"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -107,7 +107,7 @@
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@drawable/gradient_top"
android:background="@drawable/gradient_top_camera"
android:elevation="8dp"
app:layout_constraintBottom_toBottomOf="@+id/ib.front.camera"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
android:id="@+id/checkBoxPickerCamera"
android:layout_width="20dp"
android:layout_height="20dp"
android:button="@drawable/custom_checkbox"
android:button="@drawable/custom_checkbox_camera"
android:clickable="false"
app:layout_constraintTop_toTopOf="@+id/imagePickerCamera"
app:layout_constraintEnd_toEndOf="@id/imagePickerCamera"/>
Expand Down

0 comments on commit 4d29625

Please sign in to comment.