Skip to content

Commit

Permalink
fix: fix some code analysis warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Bambooin committed Nov 5, 2023
1 parent e807808 commit 6044c64
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,8 @@ class AppsRecyclerAdapter(
)
}
holder.txtTitle.text = rowItem.label

holder.packageName.text = rowItem.packageName
holder.packageName.isSelected = true // for marquee

val enableMarqueeFilename =
(fragment.requireActivity() as MainActivity)
.getBoolean(PreferencesConstants.PREFERENCE_ENABLE_MARQUEE_FILENAME)
Expand All @@ -205,8 +203,6 @@ class AppsRecyclerAdapter(
}
marqueeAfterDelay(2000, holder.txtTitle)
}

// File f = new File(rowItem.getDesc());
if (!isBottomSheet) {
holder.txtDesc.text = rowItem.fileSize + " |"
}
Expand Down Expand Up @@ -311,11 +307,7 @@ class AppsRecyclerAdapter(
) {
context = ContextThemeWrapper(context, R.style.overflow_black)
}
val popupMenu =
PopupMenu(
context,
view,
)
val popupMenu = PopupMenu(context, view)
popupMenu.setOnMenuItemClickListener { item: MenuItem ->
val themedActivity: MainActivity = fragment.requireActivity() as MainActivity
val colorAccent = themedActivity.accent
Expand Down Expand Up @@ -349,10 +341,7 @@ class AppsRecyclerAdapter(
Intent(
Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
Uri.parse(
String.format(
"package:%s",
rowItem!!.packageName,
),
String.format("package:%s", rowItem!!.packageName),
),
),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ class ZipService : AbstractProgressiveService() {
.utilsProvider
.colorPreference
.getCurrentUserColorPreferences(this, sharedPreferences).accent

val notificationIntent =
Intent(this, MainActivity::class.java)
.putExtra(MainActivity.KEY_INTENT_PROCESS_VIEWER, true)
Expand All @@ -126,10 +125,8 @@ class ZipService : AbstractProgressiveService() {
notificationIntent,
getPendingIntentFlag(0),
)

customSmallContentViews = RemoteViews(packageName, R.layout.notification_service_small)
customBigContentViews = RemoteViews(packageName, R.layout.notification_service_big)

val stopIntent = Intent(KEY_COMPRESS_BROADCAST_CANCEL)
val stopPendingIntent =
PendingIntent.getBroadcast(
Expand All @@ -155,7 +152,6 @@ class ZipService : AbstractProgressiveService() {
.addAction(action)
.setOngoing(true)
.setColor(accentColor)

NotificationConstants.setMetadata(this, mBuilder, NotificationConstants.TYPE_NORMAL)
startForeground(NotificationConstants.ZIP_ID, mBuilder.build())
initNotificationViews()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ object FileProperties {
}
}

// Remap path
@JvmStatic
fun remapPathForApi30OrAbove(

Check warning on line 252 in app/src/main/java/com/amaze/filemanager/filesystem/FileProperties.kt

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

app/src/main/java/com/amaze/filemanager/filesystem/FileProperties.kt#L252

The function remapPathForApi30OrAbove is missing documentation.
path: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ object MakeFileOperation {
return File(extDir, file.name)
}

// Make normal file
@JvmStatic
fun mkfile(

Check warning on line 56 in app/src/main/java/com/amaze/filemanager/filesystem/MakeFileOperation.kt

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

app/src/main/java/com/amaze/filemanager/filesystem/MakeFileOperation.kt#L56

The function mkfile is missing documentation.
file: File?,
Expand Down Expand Up @@ -97,6 +98,7 @@ object MakeFileOperation {
}
}

// Make text file
@JvmStatic
fun mktextfile(

Check warning on line 103 in app/src/main/java/com/amaze/filemanager/filesystem/MakeFileOperation.kt

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

app/src/main/java/com/amaze/filemanager/filesystem/MakeFileOperation.kt#L103

The function mktextfile is missing documentation.
data: String?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ object RenameOperation {
var outChannel: FileChannel? = null
try {
inStream = FileInputStream(source)

// First try the normal way
if (FileProperties.isWritable(target)) {
// standard way
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class DrawerViewModel : ViewModel() {
return requireNotNull(menuMetadataMap[item.toNonLeaking()])
}

// Put drawer meta data
fun putDrawerMetadata(

Check warning on line 34 in app/src/main/java/com/amaze/filemanager/ui/views/drawer/DrawerViewModel.kt

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

app/src/main/java/com/amaze/filemanager/ui/views/drawer/DrawerViewModel.kt#L34

The function putDrawerMetadata is missing documentation.
item: MenuItem,
metadata: MenuMetadata,
Expand Down

0 comments on commit 6044c64

Please sign in to comment.