quick fixes

This commit is contained in:
Rosty 2016-12-27 17:27:21 +02:00
parent 8573f7f66a
commit 8881e8a2ff
4 changed files with 15 additions and 3 deletions

View file

@ -25,6 +25,8 @@
<TextView
android:id="@+id/title"
android:textAlignment="center"
android:gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"

View file

@ -184,7 +184,7 @@ public class CreateEditActionDialog extends DialogFragment {
action.fillParams();
quickActionRegistry.addQuickAction(action);
quickActionRegistry.getUpdatesListener().onActionsUpdated();
quickActionRegistry.notifyUpdates();
dismiss();
}

View file

@ -223,6 +223,14 @@ public class QuickActionListFragment extends BaseOsmAndFragment implements Quick
}
});
itemVH.container.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
CreateEditActionDialog dialog = CreateEditActionDialog.newInstance(item.id);
dialog.show(getFragmentManager(), AddQuickActionDialog.TAG);
}
});
LinearLayout.LayoutParams dividerParams = (LinearLayout.LayoutParams) itemVH.divider.getLayoutParams();
//noinspection ResourceType
dividerParams.setMargins(!isLongDivider(position) ? dpToPx(56f) : 0, 0, 0, 0);
@ -378,6 +386,7 @@ public class QuickActionListFragment extends BaseOsmAndFragment implements Quick
public View divider;
public ImageView handleView;
public ImageView closeBtn;
public View container;
public QuickActionItemVH(View itemView) {
super(itemView);
@ -388,6 +397,7 @@ public class QuickActionListFragment extends BaseOsmAndFragment implements Quick
divider = itemView.findViewById(R.id.divider);
handleView = (ImageView) itemView.findViewById(R.id.handle_view);
closeBtn = (ImageView) itemView.findViewById(R.id.closeImageButton);
container = itemView.findViewById(R.id.searchListItemLayout);
handleView.setImageDrawable(getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_action_reorder));
closeBtn.setImageDrawable(getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_action_remove_dark));

View file

@ -35,8 +35,8 @@ public class QuickActionRegistry {
this.updatesListener = updatesListener;
}
public QuickActionUpdatesListener getUpdatesListener() {
return updatesListener;
public void notifyUpdates() {
if (updatesListener != null) updatesListener.onActionsUpdated();
}
public List<QuickAction> getQuickActions() {