I have a listview that stores the person’s communication history. I have one heading inside the list that acts as a message editor with edit text and a submit button. When the user types and presses the send button, messages are added to the communication list, and the editor becomes empty.
I want the user to click the submit button, the editor should become invisible, and the item should be added to the list. After that, the editor should gradually rise from the top, feeling that he is moving objects below.
I implemented the translation animation in the header, but what she does is space for her by pushing the elements down and then gradually fills the space that I don't want.
I used the negative field trick that is explained in this question , but this did not work for me. Since we cannot use layout options, others have AbsListView.LayoutParam for headers. I tried to set other parameters, but during the animation this gives me a ClassCastException. I tracked the exception and its code written inside the ListView, they try to pass these parameters using the AbsListView.LayoutParams method inside the clearRecycledState () method.
Or Is there a way to apply layout options that support the bullet in the listview header.
the code
public class PageListView extends ListView { private Application app; private CommListAdapter listAdapter; private MessageEditorHeader messageEditorHeader; private MessageItemLongClick mInterface; private Handler handler; public ProfilePageListView(Application app, MessageItemLongClick mInterface) { super(app); this.app = app; this.mInterface = mInterface; this.handler = new Handler(); setupView(); } public void applyData(ProfileData data){ listAdapter.applyData(data.getUser());
heres message editor code
public class MessageEditorHeader extends RelativeLayout { private MessageEditor msgEditor; public MessageEditorHeader(AppteraApplication context) { super(context); msgEditor = new MessageEditor(context);
source share