Skip to content

Commit a004d44

Browse files
committed
fix icon launcher conflict
1 parent 41a0d34 commit a004d44

File tree

5 files changed

+37
-12
lines changed

5 files changed

+37
-12
lines changed

FilePicker/src/main/java/com/mahdiasd/filepicker/FilePickerAdapter.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ class FilePickerAdapter(
6565
it.presenter = this
6666
it.type = config.selectedMode
6767
it.checkbox.buttonTintList = ColorStateList.valueOf(config.activeColor)
68+
it.view.setColorFilter(config.cardBackgroundColor)
6869
}
6970
}
7071
}

FilePicker/src/main/java/com/mahdiasd/filepicker/FilePickerFragment.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ class FilePickerFragment : BottomSheetDialogFragment() {
3737
private var myAdapter: FilePickerAdapter? = null
3838
private lateinit var binding: FilePickerFragmentBinding
3939

40-
private var totalFiles: MutableList<String> = ArrayList()
41-
4240
private var imageList: MutableList<FileModel> = ArrayList()
4341
private var videoList: MutableList<FileModel> = ArrayList()
4442
private var audioList: MutableList<FileModel> = ArrayList()
@@ -47,7 +45,6 @@ class FilePickerFragment : BottomSheetDialogFragment() {
4745

4846
private lateinit var config: FilePicker
4947
private var storageIsOpen = false
50-
private val TAG = "TAG"
5148

5249
companion object {
5350
fun newInstance() = FilePickerFragment()
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<shape xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:shape="rectangle">
4+
<solid android:color="@color/white" />
5+
<corners android:radius="2dp" />
6+
7+
</shape>

FilePicker/src/main/res/layout/item_file_picker.xml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
<variable
2020
name="type"
2121
type="PickerMode" />
22+
23+
<variable
24+
name="config"
25+
type="com.mahdiasd.filepicker.FilePicker" />
2226
</data>
2327

2428
<androidx.constraintlayout.widget.ConstraintLayout
@@ -31,11 +35,11 @@
3135
android:layout_width="0dp"
3236
android:layout_height="0dp"
3337
android:adjustViewBounds="true"
38+
android:onClick="@{(v) -> presenter.onClick(v , item)}"
3439
android:scaleType="centerCrop"
3540
app:layout_constraintBottom_toBottomOf="parent"
3641
app:layout_constraintDimensionRatio="1"
3742
app:layout_constraintLeft_toLeftOf="parent"
38-
android:onClick="@{(v) -> presenter.onClick(v , item)}"
3943
app:layout_constraintRight_toRightOf="parent"
4044
app:layout_constraintTop_toTopOf="parent"
4145
app:shapeAppearanceOverlay="@style/imageViewRadius" />
@@ -45,25 +49,37 @@
4549
android:layout_height="48dp"
4650
android:layout_centerInParent="true"
4751
android:elevation="5dp"
52+
android:onClick="@{(v) -> presenter.onClick(v , item)}"
4853
android:src="@drawable/ic_play"
4954
android:tint="@color/white"
50-
android:onClick="@{(v) -> presenter.onClick(v , item)}"
5155
android:visibility="@{type == PickerMode.Video ? View.VISIBLE : View.GONE , default = gone}"
5256
app:layout_constraintBottom_toBottomOf="@id/image"
5357
app:layout_constraintLeft_toLeftOf="@id/image"
5458
app:layout_constraintRight_toRightOf="@id/image"
5559
app:layout_constraintTop_toTopOf="@id/image" />
5660

61+
<ImageView
62+
android:id="@+id/view"
63+
android:layout_width="18dp"
64+
android:layout_height="18dp"
65+
android:src="@drawable/shape_square"
66+
android:layout_margin="4dp"
67+
android:elevation="6dp"
68+
app:layout_constraintRight_toRightOf="parent"
69+
app:layout_constraintTop_toTopOf="parent"
70+
/>
71+
5772
<com.google.android.material.checkbox.MaterialCheckBox
5873
android:id="@+id/checkbox"
59-
android:layout_width="32dp"
60-
android:layout_height="32dp"
74+
android:layout_width="20dp"
75+
android:layout_height="20dp"
6176
android:checked="@{item.selected}"
6277
android:elevation="6dp"
63-
android:gravity="center"
6478
android:onClick="@{(v) -> presenter.checkBox(v , item)}"
65-
app:layout_constraintRight_toRightOf="parent"
66-
app:layout_constraintTop_toTopOf="parent" />
79+
app:layout_constraintRight_toRightOf="@id/view"
80+
app:layout_constraintLeft_toLeftOf="@id/view"
81+
app:layout_constraintBottom_toBottomOf="@id/view"
82+
app:layout_constraintTop_toTopOf="@id/view" />
6783
</androidx.constraintlayout.widget.ConstraintLayout>
6884

6985

app/src/main/java/com/mahdiasd/sample/MainActivity.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class MainActivity : AppCompatActivity() {
4848
}
4949

5050
val max =
51-
if (binding.maxSelection.text.isEmpty())1 else binding.maxSelection.text.toString()
51+
if (binding.maxSelection.text.isEmpty()) 1 else binding.maxSelection.text.toString()
5252
.toInt()
5353

5454
val activeColor =
@@ -59,10 +59,14 @@ class MainActivity : AppCompatActivity() {
5959
if (binding.deActiveColor.text.isEmpty()) "#A4A4A4" else binding.deActiveColor.text.toString()
6060

6161

62+
val cardBackgroundColor =
63+
if (binding.cardViewColor.text.isEmpty()) "#ffffff" else binding.cardViewColor.text.toString()
64+
65+
6266
FilePicker(this, supportFragmentManager)
6367
.setMode(*modes.toTypedArray())
6468
.setDefaultMode(PickerMode.Image)
65-
.setMaxSelection(max)
69+
.setMaxSelection(max).setCardBackgroundColor(Color.parseColor(cardBackgroundColor))
6670
.setCustomText(
6771
binding.videoTitle.text.toString(),
6872
binding.audioTitle.text.toString(),

0 commit comments

Comments
 (0)