Skip to content
This repository has been archived by the owner on Jun 9, 2020. It is now read-only.

section can't reserve its status #81

Open
AndyGu opened this issue Dec 10, 2015 · 3 comments
Open

section can't reserve its status #81

AndyGu opened this issue Dec 10, 2015 · 3 comments

Comments

@AndyGu
Copy link

AndyGu commented Dec 10, 2015

I set a textview in section , then set a clicklistener of it so it can change its background when I click it. But after I scroll the list, I found that the section can't reserve its status. After the section get to the top of the list, or scroll down when section was on the top of the list, it turned to be the orign background color, pls help check this issue

@sergejsha
Copy link
Owner

Not the best solution, but you could call notifyDataChanged() which should cause pinned section view to be recreated from the changed section view.

@Firoz-Shaikh
Copy link

Firoz-Shaikh commented Nov 13, 2017

Where can I set notifyDataChanged() ?

@Depp-Jay
Copy link

You can mark the textview state when onClick. Refresh the state in adapter getView()
For example:

public View getView(int position, View convertView, ViewGroup parent) {
   switch(viewType) {
		case HEADER_VIEW:
			//init view
			
			//refresh state
			refreshState(state);
			
			//set click event
			textView.setOnClickListener(v -> {
				//mark the state
				int state = 1;
			});

	}
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants