All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.robobinding.widget.adapterview.DynamicLayoutAttribute Maven / Gradle / Ivy

There is a newer version: 0.8.14
Show newest version
package org.robobinding.widget.adapterview;

import org.robobinding.viewattribute.property.AlwaysPreInitializingView;
import org.robobinding.viewattribute.property.OneWayPropertyViewAttribute;

import android.widget.AdapterView;

/**
 * 
 * @since 1.0
 * @version $Revision: 1.0 $
 * @author Robert Taylor
 */
class DynamicLayoutAttribute implements OneWayPropertyViewAttribute, Integer>, AlwaysPreInitializingView {
	private final RowLayoutUpdater rowLayoutUpdater;
	private final DataSetAdapterUpdater dataSetAdapterUpdater;

	public DynamicLayoutAttribute(RowLayoutUpdater rowLayoutUpdater, DataSetAdapterUpdater dataSetAdapterUpdater) {
		this.rowLayoutUpdater = rowLayoutUpdater;
		this.dataSetAdapterUpdater = dataSetAdapterUpdater;
	}

	@Override
	public void updateView(AdapterView view, Integer newItemLayoutId) {
		rowLayoutUpdater.updateRowLayout(newItemLayoutId);
		dataSetAdapterUpdater.update();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy