Skip to content

Commit

Permalink
style: renamed some variables that were not following naming convention
Browse files Browse the repository at this point in the history
  • Loading branch information
joragua committed Jan 20, 2025
1 parent ee7d99a commit 5979aa1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class CreateFolderDialogFragment : DialogFragment() {
private lateinit var parentFolder: OCFile
private lateinit var createFolderListener: CreateFolderListener
private var isButtonEnabled: Boolean = false
private val MAX_FILENAME_LENGTH = 223
private val maxFilenameLength = 223

override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {

Expand Down Expand Up @@ -101,10 +101,10 @@ class CreateFolderDialogFragment : DialogFragment() {
if (text.isNullOrBlank()) {
okButton.isEnabled = false
error = getString(R.string.uploader_upload_text_dialog_filename_error_empty)
} else if (text.length > MAX_FILENAME_LENGTH) {
} else if (text.length > maxFilenameLength) {
error = String.format(
getString(R.string.uploader_upload_text_dialog_filename_error_length_max),
MAX_FILENAME_LENGTH
maxFilenameLength
)
} else if (forbiddenChars.any { text.contains(it) }) {
error = getString(R.string.filename_forbidden_characters)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class RenameFileDialogFragment : DialogFragment(), DialogInterface.OnClickListen
private var targetFile: OCFile? = null
private val filesViewModel: FileOperationsViewModel by sharedViewModel()
private var isButtonEnabled = true
private val MAX_FILENAME_LENGTH = 223
private val maxFilenameLength = 223
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
if (savedInstanceState != null) {
isButtonEnabled = savedInstanceState.getBoolean(IS_BUTTON_ENABLED_FLAG_KEY)
Expand Down Expand Up @@ -105,10 +105,10 @@ class RenameFileDialogFragment : DialogFragment(), DialogInterface.OnClickListen
if (text.isNullOrBlank()) {
okButton.isEnabled = false
error = getString(R.string.uploader_upload_text_dialog_filename_error_empty)
} else if (text.length > MAX_FILENAME_LENGTH) {
} else if (text.length > maxFilenameLength) {
error = String.format(
getString(R.string.uploader_upload_text_dialog_filename_error_length_max),
MAX_FILENAME_LENGTH
maxFilenameLength
)
} else if (forbiddenChars.any { text.contains(it) }) {
error = getString(R.string.filename_forbidden_characters)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@ class PassCodeActivity : AppCompatActivity(), NumberKeyboardListener, EnableBiom
}

private fun inflatePasscodeTxtLine() {
val layout_code = findViewById<LinearLayout>(R.id.layout_code)
val layoutCode = findViewById<LinearLayout>(R.id.layout_code)
val numberOfPasscodeDigits = (passCodeViewModel.getPassCode()?.length ?: passCodeViewModel.getNumberOfPassCodeDigits())
for (i in 0 until numberOfPasscodeDigits) {
val txt = layoutInflater.inflate(R.layout.passcode_edit_text, layout_code, false) as EditText
layout_code.addView(txt)
val txt = layoutInflater.inflate(R.layout.passcode_edit_text, layoutCode, false) as EditText
layoutCode.addView(txt)
passCodeEditTexts[i] = txt
}
passCodeEditTexts.first()?.requestFocus()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ class PreviewTextFragment : FileFragment() {
var viewPager: ViewPager2
) : AsyncTask<OCFile, Unit, StringWriter>() {

private val DIALOG_WAIT_TAG = "DIALOG_WAIT"
private val dialogWaitTag = "DIALOG_WAIT"
private lateinit var mimeType: String

override fun onPreExecute() {
Expand Down Expand Up @@ -345,22 +345,22 @@ class PreviewTextFragment : FileFragment() {
}

fun showLoadingDialog() {
val waitDialogFragment = requireActivity().supportFragmentManager.findFragmentByTag(DIALOG_WAIT_TAG)
val waitDialogFragment = requireActivity().supportFragmentManager.findFragmentByTag(dialogWaitTag)
val loading: LoadingDialog

if (waitDialogFragment == null) {
loading = LoadingDialog.newInstance(R.string.wait_a_moment, false)
val fragmentManager = requireActivity().supportFragmentManager
val fragmentTransaction = fragmentManager.beginTransaction()
loading.show(fragmentTransaction, DIALOG_WAIT_TAG)
loading.show(fragmentTransaction, dialogWaitTag)
} else {
loading = waitDialogFragment as LoadingDialog
loading.showsDialog = true
}
}

fun dismissLoadingDialog() {
val waitDialogFragment = requireActivity().supportFragmentManager.findFragmentByTag(DIALOG_WAIT_TAG)
val waitDialogFragment = requireActivity().supportFragmentManager.findFragmentByTag(dialogWaitTag)
waitDialogFragment?.let {
val loading = waitDialogFragment as LoadingDialog
loading.dismiss()
Expand Down

0 comments on commit 5979aa1

Please sign in to comment.