misc code style fixes

This commit is contained in:
tibbi 2023-02-04 15:45:47 +01:00
parent bf662d16d9
commit 0f5fef8509
8 changed files with 21 additions and 28 deletions

View File

@ -8,9 +8,9 @@ import androidx.recyclerview.widget.RecyclerView
import com.simplemobiletools.gallery.pro.R
import com.simplemobiletools.gallery.pro.models.FilterItem
import kotlinx.android.synthetic.main.editor_filter_item.view.*
import java.util.*
class FiltersAdapter(val context: Context, val filterItems: ArrayList<FilterItem>, val itemClick: (Int) -> Unit) : RecyclerView.Adapter<FiltersAdapter.ViewHolder>() {
class FiltersAdapter(val context: Context, val filterItems: ArrayList<FilterItem>, val itemClick: (Int) -> Unit) :
RecyclerView.Adapter<FiltersAdapter.ViewHolder>() {
private var currentSelection = filterItems.first()
private var strokeBackground = context.resources.getDrawable(R.drawable.stroke_background)

View File

@ -10,18 +10,14 @@ import com.simplemobiletools.commons.extensions.isPathOnSD
import com.simplemobiletools.commons.interfaces.RefreshRecyclerViewListener
import com.simplemobiletools.commons.views.MyRecyclerView
import com.simplemobiletools.gallery.pro.R
import com.simplemobiletools.gallery.pro.extensions.config
import com.simplemobiletools.gallery.pro.extensions.removeNoMedia
import kotlinx.android.synthetic.main.item_manage_folder.view.*
import java.util.*
class ManageHiddenFoldersAdapter(
activity: BaseSimpleActivity, var folders: ArrayList<String>, val listener: RefreshRecyclerViewListener?,
recyclerView: MyRecyclerView, itemClick: (Any) -> Unit
) : MyRecyclerViewAdapter(activity, recyclerView, itemClick) {
private val config = activity.config
init {
setupDragListener(true)
}

View File

@ -88,8 +88,7 @@ fun SimpleActivity.launchSettings() {
fun SimpleActivity.launchAbout() {
val licenses = LICENSE_GLIDE or LICENSE_CROPPER or LICENSE_RTL or LICENSE_SUBSAMPLING or LICENSE_PATTERN or LICENSE_REPRINT or LICENSE_GIF_DRAWABLE or
LICENSE_PICASSO or LICENSE_EXOPLAYER or LICENSE_PANORAMA_VIEW or LICENSE_SANSELAN or LICENSE_FILTERS or LICENSE_GESTURE_VIEWS or
LICENSE_APNG
LICENSE_PICASSO or LICENSE_EXOPLAYER or LICENSE_PANORAMA_VIEW or LICENSE_SANSELAN or LICENSE_FILTERS or LICENSE_GESTURE_VIEWS or LICENSE_APNG
val faqItems = arrayListOf(
FAQItem(R.string.faq_3_title, R.string.faq_3_text),

View File

@ -34,7 +34,8 @@ private class ExifInterfaceAttributes {
ExifInterface.TAG_PIXEL_Y_DIMENSION,
ExifInterface.TAG_THUMBNAIL_IMAGE_LENGTH,
ExifInterface.TAG_THUMBNAIL_IMAGE_WIDTH,
ExifInterface.TAG_ORIENTATION)
ExifInterface.TAG_ORIENTATION
)
return tagFields
.map { tagField -> tagField.get(null) as String }
@ -44,8 +45,8 @@ private class ExifInterfaceAttributes {
private fun isExif(field: Field): Boolean {
return field.type == String::class.java &&
isPublicStaticFinal(field.modifiers) &&
field.name.startsWith("TAG_")
isPublicStaticFinal(field.modifiers) &&
field.name.startsWith("TAG_")
}
private const val publicStaticFinal = Modifier.PUBLIC or Modifier.STATIC or Modifier.FINAL

View File

@ -226,13 +226,6 @@ const val ASPECT_RATIO_FOUR_THREE = 2
const val ASPECT_RATIO_SIXTEEN_NINE = 3
const val ASPECT_RATIO_OTHER = 4
// some constants related to zooming videos
const val MIN_VIDEO_ZOOM_SCALE = 1f
const val MAX_VIDEO_ZOOM_SCALE = 5f
const val ZOOM_MODE_NONE = 0
const val ZOOM_MODE_DRAG = 1
const val ZOOM_MODE_ZOOM = 2
// constants related to image quality
const val LOW_TILE_DPI = 160
const val NORMAL_TILE_DPI = 220

View File

@ -6,11 +6,13 @@ import androidx.recyclerview.widget.RecyclerView
import com.simplemobiletools.gallery.pro.models.Medium
import com.simplemobiletools.gallery.pro.models.ThumbnailItem
class GridSpacingItemDecoration(val spanCount: Int, val spacing: Int, val isScrollingHorizontally: Boolean, val addSideSpacing: Boolean,
var items: ArrayList<ThumbnailItem>, val useGridPosition: Boolean) : RecyclerView.ItemDecoration() {
class GridSpacingItemDecoration(
val spanCount: Int, val spacing: Int, val isScrollingHorizontally: Boolean, val addSideSpacing: Boolean,
var items: ArrayList<ThumbnailItem>, val useGridPosition: Boolean
) : RecyclerView.ItemDecoration() {
override fun toString() = "spanCount: $spanCount, spacing: $spacing, isScrollingHorizontally: $isScrollingHorizontally, addSideSpacing: $addSideSpacing, " +
"items: ${items.hashCode()}, useGridPosition: $useGridPosition"
"items: ${items.hashCode()}, useGridPosition: $useGridPosition"
override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State) {
if (spacing <= 1) {

View File

@ -7,7 +7,8 @@ import androidx.room.PrimaryKey
@Entity(tableName = "favorites", indices = [Index(value = ["full_path"], unique = true)])
data class Favorite(
@PrimaryKey(autoGenerate = true) var id: Int?,
@ColumnInfo(name = "full_path") var fullPath: String,
@ColumnInfo(name = "filename") var filename: String,
@ColumnInfo(name = "parent_path") var parentPath: String)
@PrimaryKey(autoGenerate = true) var id: Int?,
@ColumnInfo(name = "full_path") var fullPath: String,
@ColumnInfo(name = "filename") var filename: String,
@ColumnInfo(name = "parent_path") var parentPath: String
)

View File

@ -7,6 +7,7 @@ import androidx.room.PrimaryKey
@Entity(tableName = "widgets", indices = [(Index(value = ["widget_id"], unique = true))])
data class Widget(
@PrimaryKey(autoGenerate = true) var id: Int?,
@ColumnInfo(name = "widget_id") var widgetId: Int,
@ColumnInfo(name = "folder_path") var folderPath: String)
@PrimaryKey(autoGenerate = true) var id: Int?,
@ColumnInfo(name = "widget_id") var widgetId: Int,
@ColumnInfo(name = "folder_path") var folderPath: String
)