Search in sources :

Example 1 with AppBean

use of com.xhsemoticonskeyboard.common.data.AppBean in project XhsEmoticonsKeyboard by w446108264.

the class AppsAdapter method getView.

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    ViewHolder viewHolder;
    if (convertView == null) {
        viewHolder = new ViewHolder();
        convertView = inflater.inflate(R.layout.item_app, null);
        viewHolder.iv_icon = (ImageView) convertView.findViewById(R.id.iv_icon);
        viewHolder.tv_name = (TextView) convertView.findViewById(R.id.tv_name);
        convertView.setTag(viewHolder);
    } else {
        viewHolder = (ViewHolder) convertView.getTag();
    }
    final AppBean appBean = mDdata.get(position);
    if (appBean != null) {
        viewHolder.iv_icon.setBackgroundResource(appBean.getIcon());
        viewHolder.tv_name.setText(appBean.getFuncName());
        convertView.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                Toast.makeText(mContext, appBean.getFuncName(), Toast.LENGTH_SHORT).show();
            }
        });
    }
    return convertView;
}
Also used : AppBean(com.xhsemoticonskeyboard.common.data.AppBean) TextView(android.widget.TextView) ImageView(android.widget.ImageView) View(android.view.View)

Example 2 with AppBean

use of com.xhsemoticonskeyboard.common.data.AppBean in project XhsEmoticonsKeyboard by w446108264.

the class SimpleUserDefAppsGridView method init.

protected void init() {
    GridView gv_apps = (GridView) view.findViewById(R.id.gv_apps);
    gv_apps.setSelector(new ColorDrawable(Color.TRANSPARENT));
    gv_apps.setNumColumns(2);
    ArrayList<AppBean> mAppBeanList = new ArrayList<>();
    mAppBeanList.add(new AppBean(R.mipmap.chatting_photo, "图片"));
    mAppBeanList.add(new AppBean(R.mipmap.chatting_camera, "拍照"));
    ChattingAppsAdapter adapter = new ChattingAppsAdapter(getContext(), mAppBeanList);
    gv_apps.setAdapter(adapter);
}
Also used : ColorDrawable(android.graphics.drawable.ColorDrawable) ArrayList(java.util.ArrayList) GridView(android.widget.GridView) SimpleAppsGridView(com.xhsemoticonskeyboard.common.widget.SimpleAppsGridView) AppBean(com.xhsemoticonskeyboard.common.data.AppBean)

Example 3 with AppBean

use of com.xhsemoticonskeyboard.common.data.AppBean in project XhsEmoticonsKeyboard by w446108264.

the class SimpleAppsGridView method init.

protected void init() {
    GridView gv_apps = (GridView) view.findViewById(R.id.gv_apps);
    ArrayList<AppBean> mAppBeanList = new ArrayList<>();
    mAppBeanList.add(new AppBean(R.mipmap.icon_photo, "图片"));
    mAppBeanList.add(new AppBean(R.mipmap.icon_camera, "拍照"));
    mAppBeanList.add(new AppBean(R.mipmap.icon_audio, "视频"));
    mAppBeanList.add(new AppBean(R.mipmap.icon_qzone, "空间"));
    mAppBeanList.add(new AppBean(R.mipmap.icon_contact, "联系人"));
    mAppBeanList.add(new AppBean(R.mipmap.icon_file, "文件"));
    mAppBeanList.add(new AppBean(R.mipmap.icon_loaction, "位置"));
    AppsAdapter adapter = new AppsAdapter(getContext(), mAppBeanList);
    gv_apps.setAdapter(adapter);
}
Also used : AppsAdapter(com.xhsemoticonskeyboard.common.adapter.AppsAdapter) ArrayList(java.util.ArrayList) GridView(android.widget.GridView) AppBean(com.xhsemoticonskeyboard.common.data.AppBean)

Example 4 with AppBean

use of com.xhsemoticonskeyboard.common.data.AppBean in project XhsEmoticonsKeyboard by w446108264.

the class SimpleQqGridView method init.

protected void init() {
    GridView gv_apps = (GridView) view.findViewById(R.id.gv_apps);
    gv_apps.setPadding(0, 0, 0, EmoticonsKeyboardUtils.dip2px(context, 20));
    RelativeLayout.LayoutParams params = (LayoutParams) gv_apps.getLayoutParams();
    params.bottomMargin = EmoticonsKeyboardUtils.dip2px(context, 20);
    gv_apps.setLayoutParams(params);
    gv_apps.setVerticalSpacing(EmoticonsKeyboardUtils.dip2px(context, 18));
    ArrayList<AppBean> mAppBeanList = new ArrayList<>();
    mAppBeanList.add(new AppBean(R.mipmap.lcw, "QQ电话"));
    mAppBeanList.add(new AppBean(R.mipmap.lde, "视频电话"));
    mAppBeanList.add(new AppBean(R.mipmap.ldh, "短视频"));
    mAppBeanList.add(new AppBean(R.mipmap.lcx, "收藏"));
    mAppBeanList.add(new AppBean(R.mipmap.ldc, "发红包"));
    mAppBeanList.add(new AppBean(R.mipmap.ldk, "转账"));
    mAppBeanList.add(new AppBean(R.mipmap.ldf, "悄悄话"));
    mAppBeanList.add(new AppBean(R.mipmap.lcu, "文件"));
    AppsAdapter adapter = new AppsAdapter(getContext(), mAppBeanList);
    gv_apps.setAdapter(adapter);
}
Also used : AppsAdapter(com.xhsemoticonskeyboard.common.adapter.AppsAdapter) RelativeLayout(android.widget.RelativeLayout) ArrayList(java.util.ArrayList) GridView(android.widget.GridView) AppBean(com.xhsemoticonskeyboard.common.data.AppBean)

Example 5 with AppBean

use of com.xhsemoticonskeyboard.common.data.AppBean in project XhsEmoticonsKeyboard by w446108264.

the class ChattingAppsAdapter method getView.

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    ViewHolder viewHolder = null;
    if (convertView == null) {
        viewHolder = new ViewHolder();
        convertView = inflater.inflate(R.layout.item_app_userdef, null);
        viewHolder.iv_icon = (ImageView) convertView.findViewById(R.id.iv_icon);
        viewHolder.tv_name = (TextView) convertView.findViewById(R.id.tv_name);
        convertView.setTag(viewHolder);
    } else {
        viewHolder = (ViewHolder) convertView.getTag();
    }
    final AppBean appBean = mDdata.get(position);
    if (appBean != null) {
        viewHolder.iv_icon.setBackgroundResource(appBean.getIcon());
        viewHolder.tv_name.setText(appBean.getFuncName());
        convertView.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                Toast.makeText(mContext, appBean.getFuncName(), Toast.LENGTH_SHORT).show();
            }
        });
    }
    return convertView;
}
Also used : AppBean(com.xhsemoticonskeyboard.common.data.AppBean) TextView(android.widget.TextView) ImageView(android.widget.ImageView) View(android.view.View)

Aggregations

AppBean (com.xhsemoticonskeyboard.common.data.AppBean)5 GridView (android.widget.GridView)3 ArrayList (java.util.ArrayList)3 View (android.view.View)2 ImageView (android.widget.ImageView)2 TextView (android.widget.TextView)2 AppsAdapter (com.xhsemoticonskeyboard.common.adapter.AppsAdapter)2 ColorDrawable (android.graphics.drawable.ColorDrawable)1 RelativeLayout (android.widget.RelativeLayout)1 SimpleAppsGridView (com.xhsemoticonskeyboard.common.widget.SimpleAppsGridView)1