Skip to content

Commit

Permalink
Merge pull request #105 from FOR-GRAD/14-커리어
Browse files Browse the repository at this point in the history
14 커리어
  • Loading branch information
kimyujin-com authored Feb 20, 2024
2 parents f598c89 + fc215b3 commit 2e6e61d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package umc.com.mobile.project.ui.career

import android.Manifest
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.net.Uri
Expand All @@ -14,8 +12,6 @@ import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Toast
import androidx.core.content.ContextCompat
import androidx.fragment.app.activityViewModels
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import umc.com.mobile.project.databinding.FragmentUploadBottomBinding
Expand All @@ -32,9 +28,6 @@ class UploadBottomFragment(context: Context, private val viewModelType: Int) :
private val editViewModel: CareerEditActivityViewModel by activityViewModels()
private val binding get() = _binding!!

private val REQUEST_CODE_PERMISSIONS = 10
private val REQUIRED_PERMISSIONS = arrayOf(Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE)

override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
Expand All @@ -54,27 +47,9 @@ class UploadBottomFragment(context: Context, private val viewModelType: Int) :
dialog!!.dismiss()
}

if (!allPermissionsGranted()) {
requestPermissions(REQUIRED_PERMISSIONS, REQUEST_CODE_PERMISSIONS)
}
return binding.root
}

private fun allPermissionsGranted() = REQUIRED_PERMISSIONS.all {
ContextCompat.checkSelfPermission(requireContext(), it) == PackageManager.PERMISSION_GRANTED
}

override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String>, grantResults: IntArray) {
if (requestCode == REQUEST_CODE_PERMISSIONS) {
if (allPermissionsGranted()) {
// 권한이 모두 부여되었을 때 실행할 코드를 여기에 작성합니다.
} else {
Toast.makeText(requireContext(), "Permissions not granted by the user.", Toast.LENGTH_SHORT).show()
activity?.finish()
}
}
}

private val PICK_IMAGE_MULTIPLE = 2

private fun openGallery() {
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/fragment_career_add_volunteer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
android:background="@drawable/bg_solid_gray_radius_15"
android:gravity="top"
android:hint="숫자만 기입해주세요"
android:inputType="number"
android:paddingStart="18dp"
android:paddingTop="11dp"
android:paddingBottom="10dp"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/fragment_career_edit_volunteer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
android:background="@drawable/bg_solid_gray_radius_15"
android:gravity="top"
android:hint=""
android:inputType="number"
android:paddingStart="18dp"
android:paddingTop="11dp"
android:paddingBottom="10dp"
Expand Down

0 comments on commit 2e6e61d

Please sign in to comment.