Package com.zendesk.sdk.feedback.ui
Class AttachmentContainerHost
- java.lang.Object
-
- LinearLayout
-
- com.zendesk.sdk.feedback.ui.AttachmentContainerHost
-
public class AttachmentContainerHost extends LinearLayout
This is aLinearLayout
which hosts a list ofAttachmentContainerHost.AttachmentContainer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static interface
AttachmentContainerHost.AttachmentContainerListener
static class
AttachmentContainerHost.AttachmentState
This enum describes the state of a single attachment
-
Constructor Summary
Constructors Constructor and Description AttachmentContainerHost(Context context)
AttachmentContainerHost(Context context, AttributeSet attrs)
AttachmentContainerHost(Context context, AttributeSet attrs, int defStyleAttr)
AttachmentContainerHost(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
addAttachment(java.io.File file)
Add and display an attachment.void
removeAttachment(java.io.File file)
Remove a file from the layoutvoid
removeAttachmentAndNotify(java.io.File file)
Remove a file from layout and notifyAttachmentContainerHost.AttachmentContainerListener
void
reset()
Reset the state of this view.void
setAttachmentContainerListener(AttachmentContainerHost.AttachmentContainerListener attachmentContainerListener)
void
setAttachmentsDeletable(boolean deletable)
Disable/enable all delete buttonsvoid
setAttachmentState(java.io.File file, AttachmentContainerHost.AttachmentState attachmentState)
Set the state of an previously added filevoid
setAttachmentUploaded(java.io.File file)
Set an previously added file as uploaded (AttachmentContainerHost.AttachmentState.UPLOADED
)void
setParent(View parent)
void
setState(ImageUploadHelper imageUploadHelper)
-
-
-
Constructor Detail
-
AttachmentContainerHost
public AttachmentContainerHost(Context context)
-
AttachmentContainerHost
public AttachmentContainerHost(Context context, AttributeSet attrs)
-
AttachmentContainerHost
public AttachmentContainerHost(Context context, AttributeSet attrs, int defStyleAttr)
-
AttachmentContainerHost
public AttachmentContainerHost(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
-
-
Method Detail
-
setAttachmentContainerListener
public void setAttachmentContainerListener(AttachmentContainerHost.AttachmentContainerListener attachmentContainerListener)
-
setParent
public void setParent(View parent)
-
setState
public void setState(ImageUploadHelper imageUploadHelper)
-
addAttachment
public void addAttachment(java.io.File file)
Add and display an attachment.This will create an
AttachmentContainerHost.AttachmentContainer
and add it to the layout.
The state will be:AttachmentContainerHost.AttachmentState.UPLOADING
- Parameters:
file
- A file pointing to local attachment on external storage.
-
setAttachmentUploaded
public void setAttachmentUploaded(java.io.File file)
Set an previously added file as uploaded (AttachmentContainerHost.AttachmentState.UPLOADED
)- Parameters:
file
- The file
-
setAttachmentState
public void setAttachmentState(java.io.File file, AttachmentContainerHost.AttachmentState attachmentState)
Set the state of an previously added file- Parameters:
file
- The fileattachmentState
- The new state of the file
-
removeAttachment
public void removeAttachment(java.io.File file)
Remove a file from the layout- Parameters:
file
- The file which should be removed
-
removeAttachmentAndNotify
public void removeAttachmentAndNotify(java.io.File file)
Remove a file from layout and notifyAttachmentContainerHost.AttachmentContainerListener
- Parameters:
file
- A file which should be removed
-
setAttachmentsDeletable
public void setAttachmentsDeletable(boolean deletable)
Disable/enable all delete buttonsOnly applicable for attachment with state
AttachmentContainerHost.AttachmentState.UPLOADED
orAttachmentContainerHost.AttachmentState.DISABLE
. Attachments with stateAttachmentContainerHost.AttachmentState.UPLOADING
will be skipped- Parameters:
deletable
- True if a delete button should be shown, false if the button should be hidden
-
reset
public void reset()
Reset the state of this view.This should be called if e.g. the user has submitted a comment.
-
-