package in.techware.carrefour.util.menuUtils;

import java.util.ArrayList;

import in.techware.carrefour.R;
import in.techware.carrefour.app.App;
import in.techware.carrefour.model.MenuBean;
import in.techware.carrefour.model.MenuListBean;

/**
 * Created by Jemsheer K D on 15 July, 2018.
 * Package in.techware.carrefour.util.menuUtils
 * Project Carrefour
 */
public class BaseMenuUtil {

    public static MenuListBean getAllMenu(int stringArray) {
        MenuListBean menuListBean = new MenuListBean();
        ArrayList<MenuBean> menuList = new ArrayList<>();
        String[] stringList = App.getInstance().getResources().getStringArray(stringArray);

        int count = 0;
        for (String str : stringList) {
            count++;
            MenuBean menuBean = new MenuBean();
            menuBean.setCode(String.valueOf(count));
            menuBean.setTitle(str);
            menuBean.setId(String.valueOf(count));
            menuList.add(menuBean);
        }
        menuListBean.setMenus(menuList);
        return menuListBean;

    }
}
