Skip to content

[FEATURE-REQ] Add OTP (One Time Password) tag to conversation list #122

@ADAIBLOG

Description

@ADAIBLOG

I've implemented a feature that automatically detects OTP (One Time Password) messages and adds a tag to them in the conversation list. This helps users quickly identify important verification code messages.

Features implemented:

  1. OTP Detection: Uses the existing OtpDetector class to intelligently identify OTP messages
  2. Multi-language Support: Automatically shows "OTP" or "验证码" based on the device's language setting
  3. Visual Tag: Adds a rounded tag next to OTP messages for easy identification
  4. Theme Integration: Dynamically matches the app's theme colors

Files modified:

1. Layout file

presentation/src/main/res/layout/conversation_list_item.xml

  • Added OTP tag TextView
  • Set initial visibility to gone
  • Applied rounded background style

2. Adapter code

presentation/src/main/java/com/moez/QKSMS/feature/conversations/ConversationsAdapter.kt

  • Added OtpDetector import
  • Implemented OTP detection logic
  • Added multi-language support
  • Integrated theme color matching

3. Background style

presentation/src/main/res/drawable/otp_tag_background.xml

  • Created rounded rectangle background for OTP tag

Implementation details:

  • The tag is only shown when OTP is detected with high confidence
  • Does not affect existing message content or layout
  • Matches the app's existing design language
  • Handles null values and edge cases gracefully

I believe this feature would be a valuable addition to the app, helping users quickly find and use verification codes. Let me know if you need any further information or adjustments!

code.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions