Package com.zendesk.sdk.feedback.ui
Class AttachmentContainerHost
- java.lang.Object
-
- LinearLayout
-
- com.zendesk.sdk.feedback.ui.AttachmentContainerHost
-
public class AttachmentContainerHost extends LinearLayoutThis is aLinearLayoutwhich hosts a list ofAttachmentContainerHost.AttachmentContainer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static interfaceAttachmentContainerHost.AttachmentContainerListenerstatic classAttachmentContainerHost.AttachmentStateThis 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 voidaddAttachment(java.io.File file)Add and display an attachment.voidremoveAttachment(java.io.File file)Remove a file from the layoutvoidremoveAttachmentAndNotify(java.io.File file)Remove a file from layout and notifyAttachmentContainerHost.AttachmentContainerListenervoidreset()Reset the state of this view.voidsetAttachmentContainerListener(AttachmentContainerHost.AttachmentContainerListener attachmentContainerListener)voidsetAttachmentsDeletable(boolean deletable)Disable/enable all delete buttonsvoidsetAttachmentState(java.io.File file, AttachmentContainerHost.AttachmentState attachmentState)Set the state of an previously added filevoidsetAttachmentUploaded(java.io.File file)Set an previously added file as uploaded (AttachmentContainerHost.AttachmentState.UPLOADED)voidsetParent(View parent)voidsetState(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.AttachmentContainerand 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.UPLOADEDorAttachmentContainerHost.AttachmentState.DISABLE. Attachments with stateAttachmentContainerHost.AttachmentState.UPLOADINGwill 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.
-
-