Skip to content

Commit 6958b80

Browse files
committed
feat(android): enhance IME clipboard sync experience
1 parent 6964d07 commit 6958b80

6 files changed

Lines changed: 1164 additions & 304 deletions

File tree

clipSync-android/app/src/main/java/com/clipsync/app/data/ClipboardDao.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ interface ClipboardDao {
3838
@Query("SELECT * FROM clipboard_history ORDER BY createdAt DESC LIMIT :limit")
3939
suspend fun getRecent(limit: Int = 50): List<ClipboardEntity>
4040

41+
@Query("SELECT * FROM clipboard_history ORDER BY createdAt DESC LIMIT :limit")
42+
fun getRecentFlow(limit: Int = 50): Flow<List<ClipboardEntity>>
43+
4144
@Query("SELECT * FROM clipboard_history WHERE id = :id LIMIT 1")
4245
suspend fun getById(id: Int): ClipboardEntity?
4346

clipSync-android/app/src/main/java/com/clipsync/app/data/DeviceDao.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ interface DeviceDao {
2323
@Query("SELECT * FROM devices WHERE isOnline = 1")
2424
suspend fun getOnlineDevices(): List<DeviceEntity>
2525

26+
@Query("SELECT * FROM devices WHERE isOnline = 1 ORDER BY deviceName ASC")
27+
fun getOnlineDevicesFlow(): Flow<List<DeviceEntity>>
28+
2629
@Insert(onConflict = OnConflictStrategy.REPLACE)
2730
suspend fun insert(entity: DeviceEntity)
2831

0 commit comments

Comments
 (0)