本文整理匯總了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);
}
示例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;
}
}
示例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);
}
示例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);
}
示例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);
}
示例6: findView
import com.lb.utils.ViewUtil; //導入依賴的package包/類
@Override
protected void findView() {
iv_splash_pic = ViewUtil.findViewById(rootView, R.id.iv_splash_pic);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例11: findView
import com.lb.utils.ViewUtil; //導入依賴的package包/類
/**
* 初始化界麵控件
*/
private void findView() {
tv_dialog_desc = ViewUtil.findViewById(contentView, R.id.tv_dialog_desc);
}
示例12: findView
import com.lb.utils.ViewUtil; //導入依賴的package包/類
/**
* 初始化界麵中的控件
*/
private void findView() {
tv_normal_message = ViewUtil.findViewById(contextView, R.id.tv_normal_message);
}
示例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);
}