Skip to content

Commit

Permalink
added visual cue to the editor mission items list when in delete mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
m4gr3d committed Jan 28, 2015
1 parent 27c3ec0 commit 217b46b
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ android {
applicationId 'org.droidplanner.android'
minSdkVersion 14
targetSdkVersion 21
versionCode 30015
versionCode 30016
versionName getGitVersion()
}

Expand Down
2 changes: 1 addition & 1 deletion Android/res/drawable/button_mission_default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">

<corners android:radius="4dp" />
<corners android:radius="2dp" />
<gradient
android:startColor="#ff007845"
android:endColor="#ff55aa89"
Expand Down
2 changes: 1 addition & 1 deletion Android/res/drawable/button_mission_selected.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">

<corners android:radius="4dp" />
<corners android:radius="2dp" />
<gradient
android:startColor="#ff0058c1"
android:endColor="#ff0096d8"
Expand Down
2 changes: 0 additions & 2 deletions Android/res/layout/fragment_editor_list_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ Used to Style the horizontal list of mission items.
android:layout_marginBottom="1dp"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:layout_marginRight="2dp"
android:layout_marginEnd="2dp"
>

<TextView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.droidplanner.android.dialogs.EditInputDialog;
import org.droidplanner.android.dialogs.openfile.OpenFileDialog;
import org.droidplanner.android.dialogs.openfile.OpenMissionDialog;
import org.droidplanner.android.fragments.EditorListFragment;
import org.droidplanner.android.fragments.EditorMapFragment;
import org.droidplanner.android.fragments.EditorToolsFragment;
import org.droidplanner.android.fragments.EditorToolsFragment.EditorTools;
Expand Down Expand Up @@ -111,6 +112,7 @@ public void onReceive(Context context, Intent intent) {

private View mLocationButtonsContainer;
private ImageButton itemDetailToggle;
private EditorListFragment editorListFragment;

@Override
public void onCreate(Bundle savedInstanceState) {
Expand All @@ -121,6 +123,7 @@ public void onCreate(Bundle savedInstanceState) {

gestureMapFragment = ((GestureMapFragment) fragmentManager.findFragmentById(R.id.gestureMapFragment));
editorToolsFragment = (EditorToolsFragment) fragmentManager.findFragmentById(R.id.editor_tools_fragment);
editorListFragment = (EditorListFragment) fragmentManager.findFragmentById(R.id.mission_list_fragment);

infoView = (TextView) findViewById(R.id.editorInfoWindow);

Expand Down Expand Up @@ -410,7 +413,9 @@ public void skipMarkerClickEvents(boolean skip) {
}

private void setupTool() {
getToolImpl().setup();
final EditorToolsFragment.EditorToolsImpl toolImpl = getToolImpl();
toolImpl.setup();
editorListFragment.enableDeleteMode(toolImpl.getEditorTools() == EditorTools.TRASH);
}

@Override
Expand Down Expand Up @@ -505,7 +510,7 @@ public void onItemClick(MissionItemProxy item, boolean zoomToFit) {
}

@Override
public void zoomToFitSelected(){
public void zoomToFitSelected() {
final EditorMapFragment planningMapFragment = gestureMapFragment.getMapFragment();
List<MissionItemProxy> selected = missionProxy.selection.getSelected();
if (selected.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ public void onViewCreated(View view, Bundle savedInstanceState) {

}

public void enableDeleteMode(boolean isEnabled){
if(isEnabled)
recyclerView.setBackgroundResource(android.R.color.holo_red_light);
else
recyclerView.setBackgroundResource(R.color.editor_bar);
}

@Override
public void onStart() {
super.onStart();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
*/
public class UnitManager {

private static final UnitSystem unitSystem = new MetricUnitSystem();

private static DroidPlannerPrefs dpPrefs;
private static MetricUnitSystem metricUnitSystem;
private static ImperialUnitSystem imperialUnitSystem;
Expand Down

0 comments on commit 217b46b

Please sign in to comment.