forked from upstream-mirrors/OpenTracks
Update contextual action bar title
This commit is contained in:
@@ -1021,13 +1021,6 @@ limitations under the License.
|
|||||||
Imported %1$s from %2$s.
|
Imported %1$s from %2$s.
|
||||||
</string>
|
</string>
|
||||||
|
|
||||||
<!-- List item -->
|
|
||||||
<string name="list_item_selected"
|
|
||||||
translation_description="Title indicating the number of items selected in a list.
|
|
||||||
%1$d an integer value. E.g., '2'.">
|
|
||||||
%1$d selected
|
|
||||||
</string>
|
|
||||||
|
|
||||||
<!-- Marker -->
|
<!-- Marker -->
|
||||||
<string name="marker_add_error"
|
<string name="marker_add_error"
|
||||||
translation_description="When adding a marker, the message indicating error due to no GPS
|
translation_description="When adding a marker, the message indicating error due to no GPS
|
||||||
|
|||||||
@@ -69,7 +69,6 @@ public class Api11Adapter extends Api10Adapter {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
|
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
|
||||||
mode.getMenuInflater().inflate(R.menu.list_context_menu, menu);
|
mode.getMenuInflater().inflate(R.menu.list_context_menu, menu);
|
||||||
setActionModeTitle(mode);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,7 +87,6 @@ public class Api11Adapter extends Api10Adapter {
|
|||||||
@Override
|
@Override
|
||||||
public void onItemCheckedStateChanged(
|
public void onItemCheckedStateChanged(
|
||||||
ActionMode mode, int position, long id, boolean checked) {
|
ActionMode mode, int position, long id, boolean checked) {
|
||||||
setActionModeTitle(mode);
|
|
||||||
mode.invalidate();
|
mode.invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,16 +99,6 @@ public class Api11Adapter extends Api10Adapter {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the action mode title
|
|
||||||
*
|
|
||||||
* @param mode action mode
|
|
||||||
*/
|
|
||||||
private void setActionModeTitle(ActionMode mode) {
|
|
||||||
int count = listView.getCheckedItemCount();
|
|
||||||
mode.setTitle(activity.getString(R.string.list_item_selected, count));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the checked positions in a list view.
|
* Gets the checked positions in a list view.
|
||||||
*
|
*
|
||||||
|
|||||||
-8
@@ -133,19 +133,11 @@ public class DeleteTest extends ActivityInstrumentationTestCase2<TrackListActivi
|
|||||||
|
|
||||||
// Select 3 tracks.
|
// Select 3 tracks.
|
||||||
EndToEndTestUtils.SOLO.clickLongOnView(trackListView.get(0).getChildAt(0));
|
EndToEndTestUtils.SOLO.clickLongOnView(trackListView.get(0).getChildAt(0));
|
||||||
assertTrue(EndToEndTestUtils.SOLO.searchText(activityMyTracks.getString(
|
|
||||||
R.string.list_item_selected, 1)));
|
|
||||||
EndToEndTestUtils.SOLO.clickOnView(trackListView.get(0).getChildAt(1));
|
EndToEndTestUtils.SOLO.clickOnView(trackListView.get(0).getChildAt(1));
|
||||||
assertTrue(EndToEndTestUtils.SOLO.searchText(activityMyTracks.getString(
|
|
||||||
R.string.list_item_selected, 2)));
|
|
||||||
EndToEndTestUtils.SOLO.clickOnView(trackListView.get(0).getChildAt(2));
|
EndToEndTestUtils.SOLO.clickOnView(trackListView.get(0).getChildAt(2));
|
||||||
assertTrue(EndToEndTestUtils.SOLO.searchText(activityMyTracks.getString(
|
|
||||||
R.string.list_item_selected, 3)));
|
|
||||||
|
|
||||||
// Deselect the first one.
|
// Deselect the first one.
|
||||||
EndToEndTestUtils.SOLO.clickOnView(trackListView.get(0).getChildAt(0));
|
EndToEndTestUtils.SOLO.clickOnView(trackListView.get(0).getChildAt(0));
|
||||||
assertTrue(EndToEndTestUtils.SOLO.searchText(activityMyTracks.getString(
|
|
||||||
R.string.list_item_selected, 2)));
|
|
||||||
|
|
||||||
EndToEndTestUtils.findMenuItem(activityMyTracks.getString(R.string.menu_delete), true);
|
EndToEndTestUtils.findMenuItem(activityMyTracks.getString(R.string.menu_delete), true);
|
||||||
EndToEndTestUtils.getButtonOnScreen(activityMyTracks.getString(R.string.generic_yes), true,
|
EndToEndTestUtils.getButtonOnScreen(activityMyTracks.getString(R.string.generic_yes), true,
|
||||||
|
|||||||
Reference in New Issue
Block a user