当前位置: 首页>>代码示例>>Java>>正文


Java ViewUtil类代码示例

本文整理汇总了Java中com.lb.utils.ViewUtil的典型用法代码示例。如果您正苦于以下问题:Java ViewUtil类的具体用法?Java ViewUtil怎么用?Java ViewUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ViewUtil类属于com.lb.utils包,在下文中一共展示了ViewUtil类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: findView

import com.lb.utils.ViewUtil; //导入依赖的package包/类
@Override
protected void findView() {
    sr_main_refresh = ViewUtil.findViewById(rootView, R.id.sr_main_refresh);
    lv_main_datas = ViewUtil.findViewById(this, R.id.lv_main_datas);
    //侧滑菜单
    dl_main_drawermenu = ViewUtil.findViewById(this, R.id.dl_main_drawermenu);
    sv_main_leftmenu = ViewUtil.findViewById(this, R.id.sv_main_leftmenu);
    tv_main_menu_username = ViewUtil.findViewById(this, R.id.tv_main_menu_username);
    ll_main_menu_setting = ViewUtil.findViewById(this, R.id.ll_main_menu_setting);
    ll_main_menu_showLike = ViewUtil.findViewById(this, R.id.ll_main_menu_showLike);
    ll_main_menu_export = ViewUtil.findViewById(this, R.id.ll_main_menu_export);

}
 
开发者ID:291700351,项目名称:WeCharEnglish,代码行数:14,代码来源:MainActivity.java

示例2: onClick

import com.lb.utils.ViewUtil; //导入依赖的package包/类
@Override
public void onClick(View view) {
    switch (view.getId()) {
        case R.id.ll_main_menu_setting://设置按钮点击事件处理
            Intent settingIntent = new Intent(mContext, SettingActivity.class);
            startActivity(settingIntent);
            dl_main_drawermenu.closeDrawers();
            break;
        case R.id.ll_main_menu_showLike://显示我的收藏或者全部
            TextView tv_main_menu_like = ViewUtil.findViewById(rootView, R.id.tv_main_menu_like);
            //更新数据源,将页面listView
            List<EnglishBean> list;
            //调用业务层
            if (!isShowLike) {
                //需要显示都长的
                tv_main_menu_like.setText(getResources().getString(R.string.txt_show_all));
                list = new EnglishServer().getDataByPage(mContext, 1, 1, pageSize);
            } else {
                tv_main_menu_like.setText(getResources().getString(R.string.txt_show_like));
                list = new EnglishServer().getDataByPage(mContext, 0, 1, pageSize);
            }
            //清空listView数据源,设置为当前常寻道的数据
            datas.clear();
            datas.addAll(list);
            adapter.notifyDataSetChanged();
            isShowLike = !isShowLike;
            //关闭菜单
            dl_main_drawermenu.closeDrawers();
            break;

        case R.id.ll_main_menu_export:
            PermissionUtil.requestPermission(this, PermissionUtil.EXTERNAL_STORAGE_REQ_CODE, new Runnable() {
                @Override
                public void run() {
                    export();
                }
            });
            break;
    }
}
 
开发者ID:291700351,项目名称:WeCharEnglish,代码行数:41,代码来源:MainActivity.java

示例3: ViewHolder

import com.lb.utils.ViewUtil; //导入依赖的package包/类
private ViewHolder(View view) {
    tv_item_title = ViewUtil.findViewById(view, R.id.tv_item_title);
    tv_item_date = ViewUtil.findViewById(view, R.id.tv_item_date);
    tv_item_desc = ViewUtil.findViewById(view, R.id.tv_item_desc);
    iv_itme_img = ViewUtil.findViewById(view, R.id.iv_itme_img);
    cb_item_check = ViewUtil.findViewById(view, R.id.cb_item_check);
}
 
开发者ID:291700351,项目名称:WeCharEnglish,代码行数:8,代码来源:HomeAdapter.java

示例4: findActionBarView

import com.lb.utils.ViewUtil; //导入依赖的package包/类
/**
 * 初始化actionbar中的控件
 */
private void findActionBarView() {
    //标题
    tv_base_actionbar_title = ViewUtil.findViewById(actionBarView, R.id.tv_base_actionbar_title);
    //收藏按钮
    sb_base_actionbar_like = ViewUtil.findViewById(actionBarView, R.id.sb_base_actionbar_like);
}
 
开发者ID:291700351,项目名称:WeCharEnglish,代码行数:10,代码来源:BaseActivity.java

示例5: findView

import com.lb.utils.ViewUtil; //导入依赖的package包/类
@Override
protected void findView() {
    ll_setting_setusername = ViewUtil.findViewById(this, R.id.ll_setting_setusername);
    //同步数据库
    ll_setting_synchronous = ViewUtil.findViewById(this, R.id.ll_setting_synchronous);
    pb_setting_synchronousing = ViewUtil.findViewById(this, R.id.pb_setting_synchronousing);

    //备份本地数据库
    ll_setting_backup = ViewUtil.findViewById(this, R.id.ll_setting_backup);
}
 
开发者ID:291700351,项目名称:WeCharEnglish,代码行数:11,代码来源:SettingActivity.java

示例6: findView

import com.lb.utils.ViewUtil; //导入依赖的package包/类
@Override
protected void findView() {
    iv_splash_pic = ViewUtil.findViewById(rootView, R.id.iv_splash_pic);
}
 
开发者ID:291700351,项目名称:WeCharEnglish,代码行数:5,代码来源:SplashActivity.java

示例7: findView

import com.lb.utils.ViewUtil; //导入依赖的package包/类
@Override
protected void findView() {
    tv_detail_title = ViewUtil.findViewById(this, R.id.tv_detail_title);
    tv_detail_time = ViewUtil.findViewById(this, R.id.tv_detail_time);
    tv_detail_desc = ViewUtil.findViewById(this, R.id.tv_detail_desc);
}
 
开发者ID:291700351,项目名称:WeCharEnglish,代码行数:7,代码来源:EnglishDetailActivity.java

示例8: findView

import com.lb.utils.ViewUtil; //导入依赖的package包/类
/**
 * 初始化界面中的控件
 */
private void findView() {
    btn_normal = ViewUtil.findViewById(this, R.id.btn_normal);
    btn_input = ViewUtil.findViewById(this, R.id.btn_input);
    btn_loading = ViewUtil.findViewById(this, R.id.btn_loading);
}
 
开发者ID:291700351,项目名称:MaterialDesignDialog,代码行数:9,代码来源:MainActivity.java

示例9: initView

import com.lb.utils.ViewUtil; //导入依赖的package包/类
/**
 * 进行初始化的操作
 */
private void initView() {
    //显示Dialog
    dialog = new AlertDialog.Builder(context).create();
    dialog.setCancelable(true);
    dialog.show();
    dialog.getWindow()
            .clearFlags(
                    WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE |
                            WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
    dialog.getWindow()
            .setSoftInputMode(
                    WindowManager.LayoutParams.SOFT_INPUT_MASK_STATE);

    //设置Material Design风格的背景
    Window window = dialog.getWindow();
    View rootView = LayoutInflater.from(context).inflate(R.layout.dialog_base, null, false);
    window.setContentView(rootView);

    //初始化title部分
    fl_base_title = ViewUtil.findViewById(rootView, R.id.fl_base_title);
    View titleView = initTitle();
    if (null == titleView) {
        fl_base_title.setVisibility(View.GONE);
        fl_base_title.removeAllViews();
    } else {
        fl_base_title.setVisibility(View.VISIBLE);
        fl_base_title.addView(titleView);
    }

    //初始化正文部分
    fl_base_content = ViewUtil.findViewById(rootView, R.id.fl_base_content);
    View contentView = initContent();
    if (null == contentView)
        throw new UnsupportedOperationException("The dialog must show a view in the window!");
    else
        fl_base_content.addView(contentView);

    //初始化底部
    fl_base_bottom = ViewUtil.findViewById(rootView, R.id.fl_base_bottom);
    View bottomView = initBottom();
    if (null == bottomView)
        fl_base_bottom.setVisibility(View.GONE);
    else
        fl_base_bottom.addView(bottomView);
}
 
开发者ID:291700351,项目名称:MaterialDesignDialog,代码行数:49,代码来源:DialogBase.java

示例10: findView

import com.lb.utils.ViewUtil; //导入依赖的package包/类
/**
 * 初始化界面中的控件
 */
private void findView() {
    tv_dialog_desc = ViewUtil.findViewById(contextView, R.id.tv_dialog_desc);

    et_dialog_input = ViewUtil.findViewById(contextView, R.id.et_dialog_input);
}
 
开发者ID:291700351,项目名称:MaterialDesignDialog,代码行数:9,代码来源:MaterialDialogInput.java

示例11: findView

import com.lb.utils.ViewUtil; //导入依赖的package包/类
/**
 * 初始化界面控件
 */
private void findView() {
    tv_dialog_desc = ViewUtil.findViewById(contentView, R.id.tv_dialog_desc);
}
 
开发者ID:291700351,项目名称:MaterialDesignDialog,代码行数:7,代码来源:MaterialDialogLoading.java

示例12: findView

import com.lb.utils.ViewUtil; //导入依赖的package包/类
/**
 * 初始化界面中的控件
 */
private void findView() {
    tv_normal_message = ViewUtil.findViewById(contextView, R.id.tv_normal_message);
}
 
开发者ID:291700351,项目名称:MaterialDesignDialog,代码行数:7,代码来源:MaterialDialogNormal.java

示例13: onCreate

import com.lb.utils.ViewUtil; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    tv = ViewUtil.findViewById(this, R.id.tv);

    GradientDrawable drawableN = DrawableUtil.createRectangleDrawable(Color.GREEN, 30f, 10f, 10f, 30f);
    GradientDrawable drawableP = DrawableUtil.createRectangleDrawable(Color.RED, 30f, 10f, 10f, 30f);

    StateListDrawable selector = SelectorUtil.createNormalAndPressedSelector(drawableN, drawableP);


    tv.setBackgroundDrawable(selector);

    CacheUtil.putString(this, "key", "你好");

    tv.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            ToastUtil.showShortToast(MainActivity.this, String.valueOf(CacheUtil.getString(MainActivity.this, "key", "ajdkjadask")));
        }
    });


    LogUtil.initLog(true, LogUtil.Level.e);
    String desDecrypt = EncryptUtil.desEncrypt("key", "This is data");
    LogUtil.log(this, "加密之后:" + desDecrypt);

    String data = EncryptUtil.desDecrypt("key", desDecrypt);
    LogUtil.log(this, "解密之后:" + data);

}
 
开发者ID:291700351,项目名称:UtilsLib,代码行数:34,代码来源:MainActivity.java


注:本文中的com.lb.utils.ViewUtil类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。