-
-
Notifications
You must be signed in to change notification settings - Fork 381
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: add
InitialKeyboard
to display before deployment
- Loading branch information
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
app/src/main/java/com/osfans/trime/ime/keyboard/InitialKeyboard.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters