Skip to content

Commit 7a565ac

Browse files
committed
* use customized drag-select-recyclerview
* fixed dimensions of gallery items
1 parent b0ba615 commit 7a565ac

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

app/build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,5 @@ dependencies {
3333
compile 'com.android.support:support-v4:23.1.1'
3434
compile 'com.github.ctodobom:OpenCV-3.1.0-Android:-SNAPSHOT'
3535
compile 'us.feras.mdv:markdownview:1.1.0'
36-
compile('com.github.afollestad:drag-select-recyclerview:0.3.1@aar') {
37-
transitive = true
38-
}
36+
compile 'com.github.ctodobom:drag-select-recyclerview:0.3.4.ctodobom.sections'
3937
}

app/src/main/java/com/todobom/opennotescanner/GalleryGridActivity.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ public void onClick(int index) {
5555

5656
@Override
5757
public void onLongClick(int index) {
58+
if (!selectionMode) {
59+
setSelectionMode(true);
60+
}
5861
recyclerView.setDragSelectActive(true, index);
5962
}
6063

app/src/main/res/layout/gallery_item.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools"
44
android:layout_width="match_parent"
5-
android:layout_height="match_parent"
5+
android:layout_height="wrap_content"
66
android:padding="4dp">
77

88
<com.todobom.opennotescanner.views.SquareFrameLayout
99
android:id="@+id/colorSquare"
10-
android:layout_width="match_parent"
11-
android:layout_height="match_parent"
10+
android:layout_width="fill_parent"
11+
android:layout_height="fill_parent"
1212
android:background="@color/colorPrimaryDark"
1313
android:padding="2dp">
1414

1515
<ImageView
1616
android:id="@+id/gallery_image"
17-
android:layout_width="match_parent"
18-
android:layout_height="match_parent"
17+
android:layout_width="fill_parent"
18+
android:layout_height="fill_parent"
1919
android:layout_gravity="center" />
2020

2121
</com.todobom.opennotescanner.views.SquareFrameLayout>

0 commit comments

Comments
 (0)