Skip to content

Commit

Permalink
Add images and videos compression options
Browse files Browse the repository at this point in the history
  • Loading branch information
VishalNehra committed Aug 12, 2023
1 parent 080af5e commit 660633f
Show file tree
Hide file tree
Showing 53 changed files with 2,008 additions and 47 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Analyse:
- Group old downloads, recordings or screenshots
- Group unused / most used / least used installed apps, large apps or games, apps that use most data
- Clear RAM for better performance
- Compress media files

Media Files:
- View / group / sort in list or grid
Expand All @@ -48,12 +49,14 @@ Video Player:
- Lock gestures or orientation
- Search and download online subtitles within player
- Change playback aspect ratio, pitch and speed
- Compress videos to save data

Image Viewer:
- View, share or delete images
- Edit using inbuilt image editor
- Add stickers, text, rotate, crop or draw over images
- View image histogram or other metadata
- Compress images to save data

Document Viewer:
- View pdf, epub, docx, xps, oxps, cbz, fb2 and mobi files using inbuilt viewer
Expand All @@ -65,6 +68,10 @@ Transfer:
- Transfer data between devices through wifi p2p
- High transfer speeds using android Wifi-direct

Trash bin (Recycle bin):
- Delete files temporarily to recycle bin
- Restore / delete permanently based on max number of files / maximum days / maximum size

Contact:
Telegram - https://t.me/AmazeFileManager

Expand Down
14 changes: 10 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ android {
buildTypes {
debug {
applicationIdSuffix ".debug"
minifyEnabled false
shrinkResources false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
buildConfigField "String", "OPENSUBTITLES_API_KEY", "\"${OPENSUBTITLES_API_KEY_DEBUG}\""
debuggable true //For "debug" banner on icon
Expand Down Expand Up @@ -218,6 +218,7 @@ android {
}

dependencies {
implementation 'androidx.core:core:1.7.0'
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.6.1'
Expand All @@ -243,7 +244,7 @@ dependencies {
implementation 'org.zwobble.mammoth:mammoth:1.4.2'
implementation 'me.zhanghai.android.fastscroll:library:1.1.8'
implementation "ch.acra:acra-core:5.7.0"
implementation 'com.github.TeamAmaze:AmazeTrashBin:1.0.4'
implementation 'com.github.TeamAmaze:AmazeTrashBin:1.0.5'

// https://mvnrepository.com/artifact/com.drewnoakes/metadata-extractor
implementation group: 'com.drewnoakes', name: 'metadata-extractor', version: '2.16.0'
Expand Down Expand Up @@ -284,8 +285,13 @@ dependencies {
api "com.caverock:androidsvg:1.4"
implementation 'com.burhanrashid52:photoeditor:2.0.0'
implementation 'com.github.CanHub:Android-Image-Cropper:4.3.1'
api 'com.github.TeamAmaze:mupdf-android-viewer:1.0.25'
api 'com.github.TeamAmaze:mupdf-android-viewer:1.0.26'
implementation "androidx.documentfile:documentfile:1.0.1"
implementation 'id.zelory:compressor:3.0.1'
implementation('com.github.AbedElazizShe:LightCompressor:1.3.1') {
exclude group: 'androidx.core', module: 'core'
exclude group: 'androidx.core', module: 'core-ktx'
}

//Detect memory leaks
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
package="com.amaze.fileutilities">

<uses-sdk tools:overrideLibrary="linc.com.amplituda, me.zhanghai.android.fastscroll,
org.opencv, com.mikepenz.aboutlibraries" />
org.opencv, com.mikepenz.aboutlibraries, com.abedelazizshe.lightcompressorlibrary" />

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ class AnalysisTypeView(context: Context, attrs: AttributeSet?) : LinearLayout(co
gravity = Gravity.CENTER_HORIZONTAL
setPadding(8.px.toInt(), 8.px.toInt(), 8.px.toInt(), 8.px.toInt())
background = resources.getDrawable(R.drawable.background_curved)

var cleanButtonText = a.getString(R.styleable.AnalysisTypeView_cleanButtonText)
if (cleanButtonText != null) {
cleanButton.text = cleanButtonText
}
showPreview = a.getBoolean(R.styleable.AnalysisTypeView_showPreview, false)
}

/**
Expand Down Expand Up @@ -171,6 +177,10 @@ class AnalysisTypeView(context: Context, attrs: AttributeSet?) : LinearLayout(co
}
imagesListParent.addView(getSummaryView(mediaFileInfoList.size))
}
cleanButtonClickListener(cleanButtonClick)
}

fun cleanButtonClickListener(cleanButtonClick: () -> Unit) {
cleanButton.setOnClickListener {
cleanButtonClick.invoke()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import androidx.fragment.app.activityViewModels
import androidx.recyclerview.widget.LinearLayoutManager
import com.amaze.fileutilities.R
import com.amaze.fileutilities.databinding.FragmentFilesBinding
import com.amaze.fileutilities.home_page.MainActivity
import com.amaze.fileutilities.home_page.ui.analyse.ReviewImagesFragment
import com.amaze.fileutilities.home_page.ui.media_tile.MediaTypeView
import com.amaze.fileutilities.utilis.AbstractMediaFilesAdapter
Expand Down Expand Up @@ -329,36 +330,38 @@ class FilesFragment : ItemsActionBarFragment() {
binding.recentFilesList.adapter = mediaFileAdapter
}
}
progressTrashBinFilesLiveData().observe(
viewLifecycleOwner
) { trashBinFiles ->
if (trashBinFiles != null) {
binding.trashBinTab.setOnClickListener {
ReviewImagesFragment.newInstance(
ReviewImagesFragment.TYPE_TRASH_BIN,
this@FilesFragment
)
}
val capacity = getTrashBinInstance().getTrashBinMetadata().getCapacity()
if (capacity == -1) {
binding.trashBinTab.setItemsAndHideProgress(
MediaTypeView.MediaTypeContent(
trashBinFiles.size, trashBinFiles.size.toString(), capacity
if ((requireActivity() as MainActivity).haveStoragePermissions()) {
progressTrashBinFilesLiveData().observe(
viewLifecycleOwner
) { trashBinFiles ->
if (trashBinFiles != null) {
binding.trashBinTab.setOnClickListener {
ReviewImagesFragment.newInstance(
ReviewImagesFragment.TYPE_TRASH_BIN,
this@FilesFragment
)
)
}
val capacity = getTrashBinInstance().getTrashBinMetadata().getCapacity()
if (capacity == -1) {
binding.trashBinTab.setItemsAndHideProgress(
MediaTypeView.MediaTypeContent(
trashBinFiles.size, trashBinFiles.size.toString(), capacity
)
)
} else {
binding.trashBinTab.setProgress(
MediaTypeView.MediaTypeContent(
trashBinFiles.size, trashBinFiles.size.toString(), capacity
)
)
}
} else {
binding.trashBinTab.setProgress(
MediaTypeView.MediaTypeContent(
trashBinFiles.size, trashBinFiles.size.toString(), capacity
binding.trashBinTab.setOnClickListener {
requireContext().showToastInCenter(
resources
.getString(R.string.please_wait)
)
)
}
} else {
binding.trashBinTab.setOnClickListener {
requireContext().showToastInCenter(
resources
.getString(R.string.please_wait)
)
}
}
}
}
Expand Down
Loading

0 comments on commit 660633f

Please sign in to comment.