
package com.socialize.demo.implementations.like;

import com.socialize.LikeUtils;
import com.socialize.demo.SDKDemoActivity;
import com.socialize.entity.Like;
import com.socialize.error.SocializeException;
import com.socialize.listener.like.LikeListListener;

import java.util.List;


/**
 * @author Jason Polites
 *
 */
public class GetLikesByEntityActivity extends SDKDemoActivity {

	/* (non-Javadoc)
	 * @see com.socialize.demo.DemoActivity#executeDemo()
	 */
	@Override
	public void executeDemo(String text) {
		LikeUtils.getLikesByEntity(this, entity.getKey(), 0, PAGE_SIZE, new LikeListListener() {
			@Override
			public void onList(List<Like> items, int totalSize) {
				handleSocializeResult(items);
			}
			
			@Override
			public void onError(SocializeException error) {
				handleError(GetLikesByEntityActivity.this, error);
			}
		});
	}
	
	@Override
	public boolean isTextEntryRequired() {
		return false;
	}

	/* (non-Javadoc)
	 * @see com.socialize.demo.DemoActivity#getButtonText()
	 */
	@Override
	public String getButtonText() {
		return "List " + PAGE_SIZE + " Likes for Current Entity";
	}
}
