Skip to content

Commit

Permalink
add new icons, other reconfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
WirelessAlien committed Dec 20, 2024
1 parent 0893bfa commit 408cb86
Show file tree
Hide file tree
Showing 54 changed files with 319 additions and 699 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ class MainActivity : AppCompatActivity(), FileAdapter.OnItemClickListener, FileA
val dialogView = layoutInflater.inflate(R.layout.password_input_dialog, null)
val passwordEditText = dialogView.findViewById<TextInputEditText>(R.id.passwordInput)

MaterialAlertDialogBuilder(this)
MaterialAlertDialogBuilder(this, R.style.MaterialDialog)
.setTitle(getString(R.string.enter_password))
.setView(dialogView)
.setPositiveButton(getString(R.string.ok)) { _, _ ->
Expand All @@ -947,7 +947,7 @@ class MainActivity : AppCompatActivity(), FileAdapter.OnItemClickListener, FileA
val dialogView = layoutInflater.inflate(R.layout.password_input_dialog, null)
val passwordEditText = dialogView.findViewById<TextInputEditText>(R.id.passwordInput)

MaterialAlertDialogBuilder(this)
MaterialAlertDialogBuilder(this, R.style.MaterialDialog)
.setTitle(getString(R.string.enter_password))
.setView(dialogView)
.setPositiveButton(getString(R.string.ok)) { _, _ ->
Expand All @@ -964,7 +964,7 @@ class MainActivity : AppCompatActivity(), FileAdapter.OnItemClickListener, FileA
val dialogView = layoutInflater.inflate(R.layout.password_input_dialog, null)
val passwordEditText = dialogView.findViewById<TextInputEditText>(R.id.passwordInput)

MaterialAlertDialogBuilder(this)
MaterialAlertDialogBuilder(this, R.style.MaterialDialog)
.setTitle(getString(R.string.enter_password))
.setView(dialogView)
.setPositiveButton(getString(R.string.ok)) { _, _ ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,23 +155,31 @@ class FileAdapter(private val context: Context, private val mainActivity: MainAc

when (file.extension) {
"avi" -> holder.fileIcon.setImageResource(R.drawable.ic_avi)
"bin" -> holder.fileIcon.setImageResource(R.drawable.ic_bin)
"doc" -> holder.fileIcon.setImageResource(R.drawable.ic_doc)
"docx" -> holder.fileIcon.setImageResource(R.drawable.ic_docx)
"exe" -> holder.fileIcon.setImageResource(R.drawable.ic_unknown)
"doc", "docx" -> holder.fileIcon.setImageResource(R.drawable.ic_doc)
"exe" -> holder.fileIcon.setImageResource(R.drawable.ic_exe)
"mkv" -> holder.fileIcon.setImageResource(R.drawable.ic_mkv)
"mov" -> holder.fileIcon.setImageResource(R.drawable.ic_mov)
"mp3" -> holder.fileIcon.setImageResource(R.drawable.ic_mp3)
"mp4" -> holder.fileIcon.setImageResource(R.drawable.ic_mp4)
"pdf" -> holder.fileIcon.setImageResource(R.drawable.ic_pdf)
"ppt" -> holder.fileIcon.setImageResource(R.drawable.ic_ppt)
"txt" -> holder.fileIcon.setImageResource(R.drawable.ic_txt)
"xls" -> holder.fileIcon.setImageResource(R.drawable.ic_xls)
"xlsx" -> holder.fileIcon.setImageResource(R.drawable.ic_xlsx)
"xls", "xlsx" -> holder.fileIcon.setImageResource(R.drawable.ic_xls)
"rar" -> holder.fileIcon.setImageResource(R.drawable.ic_rar)
"zip" -> holder.fileIcon.setImageResource(R.drawable.ic_zip)
"apk" -> holder.fileIcon.setImageResource(R.drawable.ic_apk)
"png", "jpg", "bmp", "jpeg" -> {
"jar" -> holder.fileIcon.setImageResource(R.drawable.ic_jar)
"java" -> holder.fileIcon.setImageResource(R.drawable.ic_java)
"m4a" -> holder.fileIcon.setImageResource(R.drawable.ic_m4a)
"mpeg", "mpg" -> holder.fileIcon.setImageResource(R.drawable.ic_mpeg)
"svg" -> holder.fileIcon.setImageResource(R.drawable.ic_svg)
"wav" -> holder.fileIcon.setImageResource(R.drawable.ic_wav)
"webm" -> holder.fileIcon.setImageResource(R.drawable.ic_webm)
"xml" -> holder.fileIcon.setImageResource(R.drawable.ic_xml)
"tar" -> holder.fileIcon.setImageResource(R.drawable.ic_tar)
"db" -> holder.fileIcon.setImageResource(R.drawable.ic_db)
"7z" -> holder.fileIcon.setImageResource(R.drawable.ic_7z)
"png", "jpg", "bmp", "jpeg", "gif"-> {
val requestBuilder = Glide.with(context)
.asDrawable()
.sizeMultiplier(0.25f)
Expand All @@ -193,11 +201,13 @@ class FileAdapter(private val context: Context, private val mainActivity: MainAc
}

private fun truncateFileName(fileName: String, maxLength: Int): String {
return if (fileName.length <= maxLength) {
fileName
} else {
fileName.substring(0, maxLength - 3) + "..."
if (fileName.length <= maxLength) {
return fileName
}
val keepLength = (maxLength - 3) / 2
val start = fileName.substring(0, keepLength)
val end = fileName.substring(fileName.length - keepLength)
return "$start...$end"
}

fun updateFilesAndFilter(newFiles: ArrayList<File>, query: String? = null) {
Expand Down
24 changes: 0 additions & 24 deletions app/src/main/res/drawable/blank.xml

This file was deleted.

15 changes: 0 additions & 15 deletions app/src/main/res/drawable/folder.xml

This file was deleted.

10 changes: 10 additions & 0 deletions app/src/main/res/drawable/ic_7z.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24.95dp"
android:height="31dp"
android:viewportWidth="24.95"
android:viewportHeight="31"
android:tint="?attr/colorControlNormal">
<path
android:pathData="M24.5,31a0.5,0.5 0,0 1,-0.5 -0.5L24,8.68l-6.73,-7.68L3.5,1a2.5,2.5 0,0 0,-2.5 2.5v7a0.5,0.5 0,0 1,-1 0v-7a3.5,3.5 0,0 1,3.5 -3.5L17.68,-0l7.27,8.31L24.95,30.5A0.5,0.5 0,0 1,24.5 31ZM22.5,8.95a0.5,0.5 0,0 0,-0.5 -0.5L18.74,8.45a0.78,0.78 0,0 1,-0.79 -0.78L17.95,3.78a0.5,0.5 0,0 0,-1 0v3.86a1.79,1.79 0,0 0,1.79 1.78h3.21A0.5,0.5 0,0 0,22.5 8.95ZM4.59,17.95a0.68,0.68 0,0 0,0.6 0,0.21 0.21,0 0,0 0.13,-0.19v-0.7h1.89v0.46l-2.2,3.79a0.42,0.42 0,0 0,0 0.15,0.36 0.36,0 0,0 0.16,0.28 0.67,0.67 0,0 0,0.37 0.11,0.28 0.28,0 0,0 0.26,-0.12l2.15,-3.9a1,1 0,0 0,0.15 -0.44v-0.77a0.21,0.21 0,0 0,-0.12 -0.18,0.43 0.43,0 0,0 -0.25,-0.09L4.85,16.35a0.43,0.43 0,0 0,-0.26 0.09,0.21 0.21,0 0,0 -0.12,0.18v1.14A0.22,0.22 0,0 0,4.59 17.95ZM8.59,21.83h3.24a0.25,0.25 0,0 0,0.21 -0.11,0.4 0.4,0 0,0 0.07,-0.24 0.45,0.45 0,0 0,-0.07 -0.25,0.25 0.25,0 0,0 -0.21,-0.11L9.4,21.12l2.48,-4.25a0.57,0.57 0,0 0,0.09 -0.29c0,-0.15 -0.09,-0.23 -0.27,-0.23h-3a0.25,0.25 0,0 0,-0.21 0.11,0.48 0.48,0 0,0 0,0.5 0.28,0.28 0,0 0,0.21 0.1h2.17l-2.48,4.26a0.49,0.49 0,0 0,-0.09 0.28C8.32,21.71 8.41,21.79 8.58,21.79Z"
android:fillColor="#428dff"/>
</vector>
33 changes: 0 additions & 33 deletions app/src/main/res/drawable/ic_aac.xml

This file was deleted.

30 changes: 0 additions & 30 deletions app/src/main/res/drawable/ic_ai.xml

This file was deleted.

12 changes: 6 additions & 6 deletions app/src/main/res/drawable/ic_apk.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:width="24.95dp"
android:height="31dp"
android:viewportWidth="24.95"
android:viewportHeight="31"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="#FF000000"
android:pathData="M280,760h400q-4,-49 -30,-90t-68,-65l38,-68q2,-4 1,-9t-6,-7q-4,-2 -8.5,-1t-6.5,5l-39,70q-20,-8 -40,-12.5t-41,-4.5q-21,0 -41,4.5T399,595l-39,-70q-2,-5 -6.5,-5t-9.5,2l-4,15 38,68q-42,24 -68,65t-30,90ZM390,700q-8,0 -14,-6t-6,-14q0,-8 6,-14t14,-6q8,0 14,6t6,14q0,8 -6,14t-14,6ZM570,700q-8,0 -14,-6t-6,-14q0,-8 6,-14t14,-6q8,0 14,6t6,14q0,8 -6,14t-14,6ZM240,880q-33,0 -56.5,-23.5T160,800v-640q0,-33 23.5,-56.5T240,80h287q16,0 30.5,6t25.5,17l194,194q11,11 17,25.5t6,30.5v447q0,33 -23.5,56.5T720,880L240,880ZM520,320v-160L240,160v640h480v-440L560,360q-17,0 -28.5,-11.5T520,320ZM240,160v200,-200 640,-640Z"/>
android:pathData="M24.5,31a0.5,0.5 0,0 1,-0.5 -0.5L24,8.68l-6.73,-7.68L3.5,1a2.5,2.5 0,0 0,-2.5 2.5v7a0.5,0.5 0,0 1,-1 0v-7a3.5,3.5 0,0 1,3.5 -3.5L17.68,-0l7.27,8.31L24.95,30.5A0.5,0.5 0,0 1,24.5 31ZM22.5,8.95a0.5,0.5 0,0 0,-0.5 -0.5L18.74,8.45a0.79,0.79 0,0 1,-0.79 -0.79L17.95,3.78a0.5,0.5 0,0 0,-1 0v3.86a1.79,1.79 0,0 0,1.79 1.79h3.21A0.5,0.5 0,0 0,22.5 8.95ZM1.6,21.58s0,-0.05 0,-0.07l1.59,-4.85q0.11,-0.27 0.57,-0.27c0.32,0 0.51,0.08 0.58,0.25l1.58,4.85 0,0.07c0,0.1 -0.07,0.18 -0.19,0.25a1,1 0,0 1,-0.4 0.1,0.3 0.3,0 0,1 -0.31,-0.16l-0.33,-1.08h-2l-0.32,1.07a0.28,0.28 0,0 1,-0.3 0.17,0.65 0.65,0 0,1 -0.36,-0.1A0.27,0.27 0,0 1,1.6 21.58ZM2.95,20.04L4.5,20.04l-0.8,-2.57ZM6.5,21.65v-5a0.23,0.23 0,0 1,0.09 -0.18,0.38 0.38,0 0,1 0.24,-0.08L8.4,16.39a2,2 0,0 1,1.28 0.4,1.56 1.56,0 0,1 0.47,1.25v0.06a1.53,1.53 0,0 1,-0.49 1.26,2 2,0 0,1 -1.31,0.4h-1L7.35,21.65a0.22,0.22 0,0 1,-0.12 0.19,0.73 0.73,0 0,1 -0.3,0.07 0.7,0.7 0,0 1,-0.3 -0.07A0.23,0.23 0,0 1,6.5 21.65ZM7.35,19.17h1a1,1 0,0 0,0.71 -0.25,1 1,0 0,0 0.24,-0.73v-0.09a0.85,0.85 0,0 0,-0.95 -1h-1ZM10.86,21.65v-5a0.19,0.19 0,0 1,0.13 -0.19,0.56 0.56,0 0,1 0.3,-0.07 0.6,0.6 0,0 1,0.3 0.07,0.2 0.2,0 0,1 0.12,0.19L11.71,18.95l2,-2.42a0.29,0.29 0,0 1,0.24 -0.12,0.58 0.58,0 0,1 0.33,0.13 0.38,0.38 0,0 1,0.16 0.29,0.2 0.2,0 0,1 -0.06,0.15l-1.54,1.8 1.82,2.6a0.19,0.19 0,0 1,0.05 0.14,0.36 0.36,0 0,1 -0.15,0.27 0.56,0.56 0,0 1,-0.34 0.12,0.35 0.35,0 0,1 -0.31,-0.15l-1.63,-2.31 -0.52,0.61L11.76,21.65a0.22,0.22 0,0 1,-0.12 0.19,0.73 0.73,0 0,1 -0.3,0.07 0.7,0.7 0,0 1,-0.3 -0.07A0.23,0.23 0,0 1,10.87 21.65Z"
android:fillColor="#428dff"/>
</vector>
10 changes: 0 additions & 10 deletions app/src/main/res/drawable/ic_audio_file.xml

This file was deleted.

32 changes: 6 additions & 26 deletions app/src/main/res/drawable/ic_avi.xml
Original file line number Diff line number Diff line change
@@ -1,30 +1,10 @@
<!--
~ Copyright (C) 2023 WirelessAlien <https://github.com/WirelessAlien>
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <https://www.gnu.org/licenses/>.
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="200dp"
android:height="200dp"
android:viewportWidth="512"
android:viewportHeight="512"
android:width="24.95dp"
android:height="31dp"
android:viewportWidth="24.95"
android:viewportHeight="31"
android:tint="?attr/colorControlNormal">
<path
android:pathData="M154.2,338.9l-0.3,0l-9.8,29.5l19.7,0z"
android:fillColor="#ED1C24"/>
<path
android:pathData="M458,118.2L346.5,8.4C345,6.9 342.9,6 340.7,6H135c-31.1,0 -56.3,26.6 -56.3,59.4v219.2H51.3v148.6h27.4v13.4c0,32.7 25.3,59.4 56.3,59.4h269.4c31.1,0 56.3,-26.6 56.3,-59.4V124.7C460.7,122.3 459.8,119.9 458,118.2zM337.9,24.4l97,95.6h-52.8c-24.4,0 -44.2,-19.5 -44.2,-43.4V24.4zM443.7,446.6c0,22.9 -17.6,41.5 -39.3,41.5H135c-21.7,0 -39.3,-18.6 -39.3,-41.5v-13.4h187c36.5,0 66,-33.3 66,-74.3s-29.6,-74.3 -66,-74.3h-187V65.4c0,-22.9 17.6,-41.5 39.3,-41.5h185.9v52.7c0,33.8 27.4,61.3 61.2,61.3h61.6V446.6zM121.9,396.4l26.2,-75H160l25.9,75h-12.9l-5.7,-17.5h-26.6l-5.8,17.5H121.9zM187.2,321.4h13.3l17.9,54.7l1.3,5.5h0.3l1.3,-5.4l17.9,-54.8h13.3l-26.8,75H214L187.2,321.4zM265.5,396.4v-75H278v75H265.5z"
android:fillColor="#ED1C24"/>
android:pathData="M24.5,31a0.5,0.5 0,0 1,-0.5 -0.5L24,8.68l-6.73,-7.68L3.5,1a2.5,2.5 0,0 0,-2.5 2.5v7a0.5,0.5 0,0 1,-1 0v-7a3.5,3.5 0,0 1,3.5 -3.5L17.68,-0l7.27,8.31L24.95,30.5A0.5,0.5 0,0 1,24.5 31ZM22.5,10.95a0.5,0.5 0,0 0,-0.5 -0.5L18.74,10.45a0.78,0.78 0,0 1,-0.79 -0.78L17.95,5.78a0.5,0.5 0,0 0,-1 0v3.86a1.79,1.79 0,0 0,1.79 1.78h3.21A0.5,0.5 0,0 0,22.5 10.95ZM2.25,23.44a0.65,0.65 0,0 0,0.36 0.1,0.28 0.28,0 0,0 0.3,-0.17l0.32,-1.07h2L5.5,23.37a0.3,0.3 0,0 0,0.31 0.17,0.91 0.91,0 0,0 0.4,-0.1c0.12,-0.07 0.19,-0.15 0.19,-0.25a0.41,0.41 0,0 0,0 -0.07l-1.58,-4.85c-0.07,-0.17 -0.26,-0.25 -0.58,-0.25s-0.5,0.09 -0.57,0.27l-1.59,4.85s0,0 0,0.07A0.27,0.27 0,0 0,2.25 23.44ZM4.25,19.1 L5.05,21.67L3.43,21.67ZM6.31,18.46 L7.91,23.31q0.11,0.27 0.54,0.27a0.74,0.74 0,0 0,0.34 -0.07,0.31 0.31,0 0,0 0.19,-0.2L10.5,18.46a0.11,0.11 0,0 0,0 -0.07c0,-0.09 -0.06,-0.16 -0.17,-0.23a0.78,0.78 0,0 0,-0.36 -0.1,0.27 0.27,0 0,0 -0.29,0.17l-1.31,4.27 -1.32,-4.27a0.28,0.28 0,0 0,-0.3 -0.17,0.81 0.81,0 0,0 -0.36,0.1c-0.11,0.07 -0.16,0.14 -0.16,0.23ZM11.31,23.46a0.65,0.65 0,0 0,0.29 0.07,0.66 0.66,0 0,0 0.3,-0.07 0.23,0.23 0,0 0,0.13 -0.19v-5a0.21,0.21 0,0 0,-0.13 -0.19,0.68 0.68,0 0,0 -0.6,0 0.2,0.2 0,0 0,-0.12 0.19v5A0.21,0.21 0,0 0,11.31 23.47Z"
android:fillColor="#428dff"/>
</vector>
Loading

0 comments on commit 408cb86

Please sign in to comment.