Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ import kotlinx.coroutines.android.awaitFrame
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import me.saket.telephoto.ExperimentalTelephotoApi
import me.saket.telephoto.zoomable.DoubleClickToZoomListener
import me.saket.telephoto.zoomable.Viewport
import me.saket.telephoto.zoomable.ZoomSpec
import me.saket.telephoto.zoomable.coil3.ZoomableAsyncImage
Expand Down Expand Up @@ -782,6 +783,7 @@ private fun ImageItem(
onLongClick = {
onLongClick.invoke()
},
onDoubleClick = DoubleClickToZoomListener.cycle(2f),
)
}

Expand Down Expand Up @@ -901,6 +903,15 @@ private fun statusMediaPresenter(
context.getString(R.string.media_menu_share_image),
),
)
} ?: run {
withContext(Dispatchers.Main) {
Toast
.makeText(
context,
context.getString(R.string.media_is_downloading),
Toast.LENGTH_SHORT,
).show()
}
}
}
}
Expand Down Expand Up @@ -952,23 +963,23 @@ private fun statusMediaPresenter(
val byteArray = it.data.toFile().readBytes()
val fileName = uri.substringAfterLast("/")
saveByteArrayToDownloads(context, byteArray, fileName)
}
withContext(Dispatchers.Main) {
withContext(Dispatchers.Main) {
Toast
.makeText(
context,
context.getString(R.string.media_save_success),
Toast.LENGTH_SHORT,
).show()
}
} ?: withContext(Dispatchers.Main) {
Toast
.makeText(
context,
context.getString(R.string.media_save_success),
context.getString(R.string.media_is_downloading),
Toast.LENGTH_SHORT,
).show()
}
}
}
}
}

// suspend fun copyFile(
// sourceFile: File,
// destinationFile: File,
// ) = withContext(Dispatchers.IO) {
// sourceFile.copyTo(destinationFile, overwrite = true)
// }
14 changes: 7 additions & 7 deletions app/src/main/java/dev/dimension/flare/ui/theme/Theme.kt
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ private fun ColorScheme.withPureColorLightMode(): ColorScheme =

private fun ColorScheme.withPureColorDarkMode(): ColorScheme =
copy(
background = MoreColors.Gray900,
surface = Color.Black,
background = Color.Black,
surface = MoreColors.Gray900,
onBackground = Color.White,
onSurface = Color.White,
surfaceContainer = Color.Black,
surfaceContainerLow = MoreColors.Gray900,
surfaceContainerHigh = Color.Black,
surfaceContainerLowest = Color.Black,
surfaceContainerHighest = Color.Black,
surfaceContainer = MoreColors.Gray900,
surfaceContainerLow = Color.Black,
surfaceContainerHigh = MoreColors.Gray900,
surfaceContainerLowest = MoreColors.Gray900,
surfaceContainerHighest = MoreColors.Gray900,
onSurfaceVariant = MoreColors.Gray400,
outlineVariant = MoreColors.Gray800,
)
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@
<string name="media_save_success">Saved to Downloads</string>
<string name="media_save_fail">Failed to save</string>
<string name="media_alt_text">Alt text</string>
<string name="media_is_downloading">The media is downloading, please try again later</string>

<string name="settings_side_panel_empty">Default will display side panel depends on the account platform.</string>
<string name="tab_settings_add">Add</string>
Expand Down