Implement multiple selection and drag on press-and-hold

This commit is contained in:
2016-02-23 19:15:29 -05:00
parent cdc80bdbbd
commit 693e0143b5
47 changed files with 547 additions and 140 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 393 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 410 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 554 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 390 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 541 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 602 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 593 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 674 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 922 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 575 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 683 B

View File

@@ -1,6 +0,0 @@
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/grey"> <!-- ripple color -->
<item android:drawable="@color/white"/> <!-- normal color -->
</ripple>

View File

@@ -0,0 +1,8 @@
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?android:colorControlHighlight">
<item android:id="@android:id/mask">
<color android:color="@android:color/white" />
</item>
</ripple>

View File

@@ -0,0 +1,5 @@
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?android:colorControlHighlight">
<item android:drawable="@color/white" />
</ripple>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<solid android:color="@color/grey_100" />
<stroke android:width="2dip" android:color="@color/grey_500"/>
</shape>

View File

@@ -23,7 +23,7 @@
<ImageButton
android:id="@+id/buttonPickColor"
android:src="@drawable/ic_action_pick_color"
android:src="@drawable/ic_action_color_light"
style="@style/dialogFormInputColor" />
</LinearLayout>

View File

@@ -9,12 +9,9 @@
android:id="@+id/listView"
style="@style/habitsListStyle"
dslv:drag_enabled="true"
dslv:drag_handle_id="@drawable/habits_header_check"
dslv:drag_start_mode="onMove"
dslv:float_alpha="0.5"
dslv:drag_start_mode="onLongPress"
dslv:sort_enabled="true"
dslv:track_drag_sort="false"
dslv:use_default_controller="true"
/>
<LinearLayout

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/action_edit_habit"
android:title="@string/edit"
android:icon="@drawable/ic_action_edit_dark"/>
<item
android:id="@+id/action_color"
android:title="@string/color_picker_default_title"
android:icon="@drawable/ic_action_color_dark"/>
<item
android:id="@+id/action_archive_habit"
android:title="@string/archive"
android:icon="@drawable/ic_action_archive_dark" />
<item
android:id="@+id/action_unarchive_habit"
android:title="@string/unarchive"
android:icon="@drawable/ic_action_unarchive_dark"/>
</menu>

View File

@@ -1,19 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/action_edit_habit"
android:title="@string/edit">
</item>
android:title="@string/edit"
android:icon="@drawable/ic_action_edit_light"/>
<item
android:id="@+id/action_color"
android:title="@string/color_picker_default_title"
android:icon="@drawable/ic_action_color_light"/>
<item
android:id="@+id/action_archive_habit"
android:title="@string/archive">
</item>
android:title="@string/archive"
android:icon="@drawable/ic_action_archive_light" />
<item
android:id="@+id/action_unarchive_habit"
android:title="@string/unarchive">
</item>
android:title="@string/unarchive"
android:icon="@drawable/ic_action_unarchive_light"/>
</menu>

View File

@@ -26,7 +26,7 @@
<string name="check">Marcar</string>
<string name="clear">Limpar</string>
<string name="clear_label">Limpar</string>
<string name="color_picker_default_title">Selecionar cor</string>
<string name="color_picker_default_title">Mudar cor</string>
<string name="create_habit">Criar hábito</string>
<string name="days">dias</string>
<string name="delete">Deletar</string>
@@ -59,12 +59,12 @@
<string name="streaks">Correntes</string>
<string name="no_habits_found">Você não tem nenhum hábito ativo</string>
<string name="time_separator"></string>
<string name="toast_habit_archived">Hábito arquivado.</string>
<string name="toast_habit_archived">Hábitos arquivados.</string>
<string name="toast_habit_changed">Hábito modificado.</string>
<string name="toast_habit_changed_back">Hábito restaurado.</string>
<string name="toast_habit_created">Hábito criado.</string>
<string name="toast_habit_deleted">Hábito deletado.</string>
<string name="toast_habit_unarchived">Hábito restaurado.</string>
<string name="toast_habit_unarchived">Hábitos restaurados.</string>
<string name="toast_nothing_to_redo">Nada para refazer.</string>
<string name="toast_nothing_to_undo">Nada para desfazer.</string>
<string name="toast_repetition_toggled">Marcado.</string>

View File

@@ -7,6 +7,13 @@
</style>
<style name="habitsListCheckStyle" parent="habitsListCheckBasicStyle">
<item name="android:background">@drawable/ripple_background</item>
<item name="android:background">@drawable/ripple_transparent</item>
</style>
<style name="habitsListItemInnerPanelStyle" parent="cardStyle">
<item name="android:orientation">horizontal</item>
<item name="android:padding">3dp</item>
<item name="android:background">@drawable/ripple_white</item>
<item name="android:elevation">1dp</item>
</style>
</resources>

View File

@@ -19,8 +19,8 @@
-->
<resources>
<string name="habit_key" translatable="false"></string>
<string name="offset_key" translatable="false"></string>
<string name="toggle_key" translatable="false"></string>
<item name="KEY_TIMESTAMP" type="id"/>
<string name="habit_key" translatable="false" />
<string name="offset_key" translatable="false" />
<string name="toggle_key" translatable="false" />
<item name="timestamp_key" type="id"/>
</resources>

View File

@@ -9,7 +9,7 @@
<string name="archive">Archive</string>
<string name="unarchive">Unarchive</string>
<string name="add_habit">Add habit</string>
<string name="color_picker_default_title">Select a Color</string>
<string name="color_picker_default_title">Change color</string>
<string name="toast_habit_created">Habit created.</string>
<string name="toast_habit_deleted">Habit deleted.</string>
@@ -18,8 +18,8 @@
<string name="toast_habit_changed">Habit changed.</string>
<string name="toast_habit_changed_back">Habit changed back.</string>
<string name="toast_repetition_toggled">Repetition toggled.</string>
<string name="toast_habit_archived">Habit archived.</string>
<string name="toast_habit_unarchived">Habit unarchived.</string>
<string name="toast_habit_archived">Habits archived.</string>
<string name="toast_habit_unarchived">Habits unarchived.</string>
<string name="color_swatch_description">Color <xliff:g id="color_index" example="14">%1$d</xliff:g></string>
<string name="color_swatch_description_selected">Color <xliff:g id="color_index" example="14">%1$d</xliff:g> selected</string>
@@ -102,7 +102,7 @@
<string name="snooze_interval">Snooze interval</string>
<string name="hint_title">Did you know?</string>
<string name="hint_drag">To rearrange the entries, you can drag them by the star.</string>
<string name="hint_drag">To rearrange the entries, press-and-hold on the name of the habit, then drag it.</string>
<string name="hint_landscape">You can see more days by putting your phone in landscape mode.</string>
<string-array name="hints">