diff options
author | stefan-niedermann <info@niedermann.it> | 2019-07-25 17:56:48 +0300 |
---|---|---|
committer | stefan-niedermann <info@niedermann.it> | 2019-07-25 17:56:48 +0300 |
commit | d75516f885569915358c3c254476b520efe59455 (patch) | |
tree | 1271d6fd7d06f634a794484d83adfca6d2edb9c1 | |
parent | 1df7024e9edcc5b1d9736a38ef8ece9c64eee994 (diff) |
Make description editable
3 files changed, 12 insertions, 7 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/EditActivity.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/EditActivity.java index 211ce7ce9..2e1fbd3ab 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/EditActivity.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/EditActivity.java @@ -133,4 +133,8 @@ public class EditActivity extends AppCompatActivity { super.onDestroy(); unbinder.unbind(); } + + public void setDescription(String description) { + this.fullCard.card.setDescription(description); + } } diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardDetailsFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardDetailsFragment.java index 4b9d21ae8..cc958bde6 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardDetailsFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardDetailsFragment.java @@ -50,6 +50,7 @@ import it.niedermann.nextcloud.deck.model.Label; import it.niedermann.nextcloud.deck.model.User; import it.niedermann.nextcloud.deck.model.full.FullCard; import it.niedermann.nextcloud.deck.persistence.sync.SyncManager; +import it.niedermann.nextcloud.deck.ui.EditActivity; import it.niedermann.nextcloud.deck.ui.widget.DelayedAutoCompleteTextView; import it.niedermann.nextcloud.deck.util.ColorUtil; import it.niedermann.nextcloud.deck.util.DimensionUtil; @@ -299,7 +300,7 @@ public class CardDetailsFragment extends Fragment implements DatePickerDialog.On private Chip createChipFromLabel(Label label) { Chip chip = new Chip(activity); chip.setText(label.getTitle()); - chip.setCloseIcon(getContext().getResources().getDrawable(R.drawable.ic_close_circle_grey600)); + chip.setCloseIcon(activity.getResources().getDrawable(R.drawable.ic_close_circle_grey600)); chip.setCloseIconVisible(true); try { int labelColor = Color.parseColor("#" + label.getColor()); @@ -389,12 +390,11 @@ public class CardDetailsFragment extends Fragment implements DatePickerDialog.On @Override public void onPause() { -// if (fullCard != null && !NO_LOCAL_ID.equals(fullCard.getLocalId())) { -// DeckLog.log("--- updateCard, new Description: " + fullCard.card.getDescription()); -// syncManager.updateCard(fullCard.card); -// } else { -// Toast.makeText(getContext(), "Creating cards is not yet supported.", Toast.LENGTH_LONG).show(); -// } + if(activity instanceof EditActivity) { + ((EditActivity) activity).setDescription(description.getText().toString()); + } else { + DeckLog.log("activity is not an instance of EditActivity"); + } super.onPause(); } } diff --git a/fastlane/metadata/android/en-US/changelogs/5.txt b/fastlane/metadata/android/en-US/changelogs/5.txt new file mode 100644 index 000000000..06bdc03e9 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/5.txt @@ -0,0 +1 @@ +- Make description editable
\ No newline at end of file |