Update v9.4.0: Advanced Telegram Integration & Custom UI
- Incremented version to 9.4.0 (versionCode: 94000) - Added custom blocked dialog layout with improved UX - Implemented Telegram commands: /allow, /deny, /pending - Enhanced Telegram polling for real-time device management - Custom token display with click-to-copy functionality - Improved device verification workflow via Telegram - Better error handling and user feedback - Enhanced documentation for Telegram integration - Improved token validation and management system 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -320,24 +320,30 @@ public class MainActivity extends AppCompatActivity {
|
||||
if (blockedDialog != null && blockedDialog.isShowing()) {
|
||||
blockedDialog.dismiss();
|
||||
}
|
||||
StringBuilder messageBuilder = new StringBuilder();
|
||||
messageBuilder.append(getString(R.string.device_blocked_message, finalReason));
|
||||
if (!TextUtils.isEmpty(tokenPart)) {
|
||||
messageBuilder.append("\n\n")
|
||||
.append(getString(R.string.device_blocked_token_hint, tokenPart));
|
||||
View dialogView = getLayoutInflater().inflate(R.layout.dialog_blocked, null);
|
||||
TextView messageText = dialogView.findViewById(R.id.blocked_message_text);
|
||||
View tokenContainer = dialogView.findViewById(R.id.blocked_token_container);
|
||||
TextView tokenValue = dialogView.findViewById(R.id.blocked_token_value);
|
||||
messageText.setText(getString(R.string.device_blocked_message, finalReason));
|
||||
boolean hasToken = !TextUtils.isEmpty(tokenPart);
|
||||
if (hasToken) {
|
||||
tokenContainer.setVisibility(View.VISIBLE);
|
||||
tokenValue.setText(tokenPart);
|
||||
tokenValue.setOnClickListener(v -> copyTokenToClipboard(tokenPart));
|
||||
} else {
|
||||
tokenContainer.setVisibility(View.GONE);
|
||||
}
|
||||
blockedDialog = new AlertDialog.Builder(this)
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this)
|
||||
.setTitle(R.string.device_blocked_title)
|
||||
.setMessage(messageBuilder.toString())
|
||||
.setView(dialogView)
|
||||
.setCancelable(false)
|
||||
.setPositiveButton(R.string.device_blocked_close,
|
||||
(dialog, which) -> finish())
|
||||
.create();
|
||||
if (!TextUtils.isEmpty(tokenPart)) {
|
||||
blockedDialog.setButton(AlertDialog.BUTTON_NEUTRAL,
|
||||
getString(R.string.device_blocked_copy_token),
|
||||
(dialog, which) -> finish());
|
||||
if (hasToken) {
|
||||
builder.setNeutralButton(R.string.device_blocked_copy_token,
|
||||
(dialog, which) -> copyTokenToClipboard(tokenPart));
|
||||
}
|
||||
blockedDialog = builder.create();
|
||||
blockedDialog.show();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user