Skip to content

Commit

Permalink
refactor: add InitialKeyboard to display before deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
goofyz committed Dec 30, 2023
1 parent 6d73bad commit 44d8e0a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
29 changes: 29 additions & 0 deletions app/src/main/java/com/osfans/trime/ime/keyboard/InitialKeyboard.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.osfans.trime.ime.keyboard

import android.content.Context
import android.view.LayoutInflater
import android.view.View
import com.osfans.trime.R
import com.osfans.trime.databinding.InitialKeyboardBinding

/**
* Keyboard to be displayed before Rime is deployed completely.
*
* It displays a loading screen (if deploying) or error message (if cannot deploy).
*
* TODO: Add a help or info button to show what's problem is behind the scene.
*/
class InitialKeyboard(context: Context) {
private var binding = InitialKeyboardBinding.inflate(LayoutInflater.from(context))

fun change(start: Boolean): View {
if (start) {
binding.progressBar.setVisibility(View.VISIBLE)
binding.deploying.setText(R.string.deploy_progress)
} else {
binding.progressBar.setVisibility(View.INVISIBLE)
binding.deploying.setText(R.string.external_storage_permission_not_available)
}
return binding.root
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
/>

</androidx.constraintlayout.widget.ConstraintLayout>

0 comments on commit 44d8e0a

Please sign in to comment.