misc code style fixes
This commit is contained in:
parent
bf662d16d9
commit
0f5fef8509
8 changed files with 21 additions and 28 deletions
|
@ -8,9 +8,9 @@ import androidx.recyclerview.widget.RecyclerView
|
||||||
import com.simplemobiletools.gallery.pro.R
|
import com.simplemobiletools.gallery.pro.R
|
||||||
import com.simplemobiletools.gallery.pro.models.FilterItem
|
import com.simplemobiletools.gallery.pro.models.FilterItem
|
||||||
import kotlinx.android.synthetic.main.editor_filter_item.view.*
|
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 currentSelection = filterItems.first()
|
||||||
private var strokeBackground = context.resources.getDrawable(R.drawable.stroke_background)
|
private var strokeBackground = context.resources.getDrawable(R.drawable.stroke_background)
|
||||||
|
|
|
@ -10,18 +10,14 @@ import com.simplemobiletools.commons.extensions.isPathOnSD
|
||||||
import com.simplemobiletools.commons.interfaces.RefreshRecyclerViewListener
|
import com.simplemobiletools.commons.interfaces.RefreshRecyclerViewListener
|
||||||
import com.simplemobiletools.commons.views.MyRecyclerView
|
import com.simplemobiletools.commons.views.MyRecyclerView
|
||||||
import com.simplemobiletools.gallery.pro.R
|
import com.simplemobiletools.gallery.pro.R
|
||||||
import com.simplemobiletools.gallery.pro.extensions.config
|
|
||||||
import com.simplemobiletools.gallery.pro.extensions.removeNoMedia
|
import com.simplemobiletools.gallery.pro.extensions.removeNoMedia
|
||||||
import kotlinx.android.synthetic.main.item_manage_folder.view.*
|
import kotlinx.android.synthetic.main.item_manage_folder.view.*
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
class ManageHiddenFoldersAdapter(
|
class ManageHiddenFoldersAdapter(
|
||||||
activity: BaseSimpleActivity, var folders: ArrayList<String>, val listener: RefreshRecyclerViewListener?,
|
activity: BaseSimpleActivity, var folders: ArrayList<String>, val listener: RefreshRecyclerViewListener?,
|
||||||
recyclerView: MyRecyclerView, itemClick: (Any) -> Unit
|
recyclerView: MyRecyclerView, itemClick: (Any) -> Unit
|
||||||
) : MyRecyclerViewAdapter(activity, recyclerView, itemClick) {
|
) : MyRecyclerViewAdapter(activity, recyclerView, itemClick) {
|
||||||
|
|
||||||
private val config = activity.config
|
|
||||||
|
|
||||||
init {
|
init {
|
||||||
setupDragListener(true)
|
setupDragListener(true)
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,8 +88,7 @@ fun SimpleActivity.launchSettings() {
|
||||||
|
|
||||||
fun SimpleActivity.launchAbout() {
|
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
|
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_PICASSO or LICENSE_EXOPLAYER or LICENSE_PANORAMA_VIEW or LICENSE_SANSELAN or LICENSE_FILTERS or LICENSE_GESTURE_VIEWS or LICENSE_APNG
|
||||||
LICENSE_APNG
|
|
||||||
|
|
||||||
val faqItems = arrayListOf(
|
val faqItems = arrayListOf(
|
||||||
FAQItem(R.string.faq_3_title, R.string.faq_3_text),
|
FAQItem(R.string.faq_3_title, R.string.faq_3_text),
|
||||||
|
|
|
@ -34,7 +34,8 @@ private class ExifInterfaceAttributes {
|
||||||
ExifInterface.TAG_PIXEL_Y_DIMENSION,
|
ExifInterface.TAG_PIXEL_Y_DIMENSION,
|
||||||
ExifInterface.TAG_THUMBNAIL_IMAGE_LENGTH,
|
ExifInterface.TAG_THUMBNAIL_IMAGE_LENGTH,
|
||||||
ExifInterface.TAG_THUMBNAIL_IMAGE_WIDTH,
|
ExifInterface.TAG_THUMBNAIL_IMAGE_WIDTH,
|
||||||
ExifInterface.TAG_ORIENTATION)
|
ExifInterface.TAG_ORIENTATION
|
||||||
|
)
|
||||||
|
|
||||||
return tagFields
|
return tagFields
|
||||||
.map { tagField -> tagField.get(null) as String }
|
.map { tagField -> tagField.get(null) as String }
|
||||||
|
@ -44,8 +45,8 @@ private class ExifInterfaceAttributes {
|
||||||
|
|
||||||
private fun isExif(field: Field): Boolean {
|
private fun isExif(field: Field): Boolean {
|
||||||
return field.type == String::class.java &&
|
return field.type == String::class.java &&
|
||||||
isPublicStaticFinal(field.modifiers) &&
|
isPublicStaticFinal(field.modifiers) &&
|
||||||
field.name.startsWith("TAG_")
|
field.name.startsWith("TAG_")
|
||||||
}
|
}
|
||||||
|
|
||||||
private const val publicStaticFinal = Modifier.PUBLIC or Modifier.STATIC or Modifier.FINAL
|
private const val publicStaticFinal = Modifier.PUBLIC or Modifier.STATIC or Modifier.FINAL
|
||||||
|
|
|
@ -226,13 +226,6 @@ const val ASPECT_RATIO_FOUR_THREE = 2
|
||||||
const val ASPECT_RATIO_SIXTEEN_NINE = 3
|
const val ASPECT_RATIO_SIXTEEN_NINE = 3
|
||||||
const val ASPECT_RATIO_OTHER = 4
|
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
|
// constants related to image quality
|
||||||
const val LOW_TILE_DPI = 160
|
const val LOW_TILE_DPI = 160
|
||||||
const val NORMAL_TILE_DPI = 220
|
const val NORMAL_TILE_DPI = 220
|
||||||
|
|
|
@ -6,11 +6,13 @@ import androidx.recyclerview.widget.RecyclerView
|
||||||
import com.simplemobiletools.gallery.pro.models.Medium
|
import com.simplemobiletools.gallery.pro.models.Medium
|
||||||
import com.simplemobiletools.gallery.pro.models.ThumbnailItem
|
import com.simplemobiletools.gallery.pro.models.ThumbnailItem
|
||||||
|
|
||||||
class GridSpacingItemDecoration(val spanCount: Int, val spacing: Int, val isScrollingHorizontally: Boolean, val addSideSpacing: Boolean,
|
class GridSpacingItemDecoration(
|
||||||
var items: ArrayList<ThumbnailItem>, val useGridPosition: Boolean) : RecyclerView.ItemDecoration() {
|
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, " +
|
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) {
|
override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State) {
|
||||||
if (spacing <= 1) {
|
if (spacing <= 1) {
|
||||||
|
|
|
@ -7,7 +7,8 @@ import androidx.room.PrimaryKey
|
||||||
|
|
||||||
@Entity(tableName = "favorites", indices = [Index(value = ["full_path"], unique = true)])
|
@Entity(tableName = "favorites", indices = [Index(value = ["full_path"], unique = true)])
|
||||||
data class Favorite(
|
data class Favorite(
|
||||||
@PrimaryKey(autoGenerate = true) var id: Int?,
|
@PrimaryKey(autoGenerate = true) var id: Int?,
|
||||||
@ColumnInfo(name = "full_path") var fullPath: String,
|
@ColumnInfo(name = "full_path") var fullPath: String,
|
||||||
@ColumnInfo(name = "filename") var filename: String,
|
@ColumnInfo(name = "filename") var filename: String,
|
||||||
@ColumnInfo(name = "parent_path") var parentPath: String)
|
@ColumnInfo(name = "parent_path") var parentPath: String
|
||||||
|
)
|
||||||
|
|
|
@ -7,6 +7,7 @@ import androidx.room.PrimaryKey
|
||||||
|
|
||||||
@Entity(tableName = "widgets", indices = [(Index(value = ["widget_id"], unique = true))])
|
@Entity(tableName = "widgets", indices = [(Index(value = ["widget_id"], unique = true))])
|
||||||
data class Widget(
|
data class Widget(
|
||||||
@PrimaryKey(autoGenerate = true) var id: Int?,
|
@PrimaryKey(autoGenerate = true) var id: Int?,
|
||||||
@ColumnInfo(name = "widget_id") var widgetId: Int,
|
@ColumnInfo(name = "widget_id") var widgetId: Int,
|
||||||
@ColumnInfo(name = "folder_path") var folderPath: String)
|
@ColumnInfo(name = "folder_path") var folderPath: String
|
||||||
|
)
|
||||||
|
|
Loading…
Reference in a new issue