Java tutorial
//package com.java2s; //License from project: Apache License import java.util.Map; import java.util.Map.Entry; import android.view.View; import android.view.ViewGroup; public class Main { /** * Set layout params for map of views. * @param views * @param params */ public static void setParams(Map<Integer, ? extends View> views, Map<Integer, ? extends ViewGroup.LayoutParams> params) { for (Entry<Integer, ? extends View> entry : views.entrySet()) { setParams(entry.getValue(), params.get(entry.getKey())); } } /** * Set layout params for view. * @param view * @param params */ public static void setParams(View view, ViewGroup.LayoutParams params) { view.setLayoutParams(params); } }