Sfoglia il codice sorgente

Add Utils.generateSceneName

Wayne 6 anni fa
parent
commit
33e49e035f

+ 7 - 0
src/main/java/com/bomostory/sceneeditmodule/utils/Utils.kt

@@ -9,6 +9,13 @@ import com.example.tfat.myapplication.R
 import java.io.File
 
 object Utils {
+
+    fun generateSceneName(index: Int): String {
+        val book = ('A'.toInt() + ((index + 1) / 22)).toChar()
+        val num = (index + 1) % 22
+        return "$book$num"
+    }
+
     fun showExportPdfCompleteThenViewDialog(context: Context, authority: String, file: File) {
         AlertDialog.Builder(context)
                 .setMessage(R.string.export_pdf_complete_dialog_msg)