本文整理汇总了Java中cn.eoe.app.R类的典型用法代码示例。如果您正苦于以下问题:Java R类的具体用法?Java R怎么用?Java R使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
R类属于cn.eoe.app包,在下文中一共展示了R类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ViewfinderView
import cn.eoe.app.R; //导入依赖的package包/类
public ViewfinderView(Context context, AttributeSet attrs) {
super(context, attrs);
// Initialize these once for performance rather than calling them every
// time in onDraw().
paint = new Paint();
Resources resources = getResources();
qrLineBitmap = BitmapFactory.decodeResource(resources, R.drawable.qrcode_scan_line);
qrWidth = qrLineBitmap.getWidth();
qrHeight = qrLineBitmap.getHeight();
qrSrc=new Rect(0, 0, qrWidth, qrHeight);
maskColor = resources.getColor(R.color.viewfinder_mask);
resultColor = resources.getColor(R.color.result_view);
frameColor = resources.getColor(R.color.viewfinder_frame);
resultPointColor = resources.getColor(R.color.possible_result_points);
possibleResultPoints = new HashSet<ResultPoint>(5);
}
示例2: onResume
import cn.eoe.app.R; //导入依赖的package包/类
@Override
protected void onResume() {
super.onResume();
SurfaceView surfaceView = (SurfaceView) findViewById(R.id.preview_view);
SurfaceHolder surfaceHolder = surfaceView.getHolder();
if (hasSurface) {
initCamera(surfaceHolder);
} else {
surfaceHolder.addCallback(this);
surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
}
decodeFormats = null;
characterSet = null;
playBeep = true;
AudioManager audioService = (AudioManager) getSystemService(AUDIO_SERVICE);
if (audioService.getRingerMode() != AudioManager.RINGER_MODE_NORMAL) {
playBeep = false;
}
initBeepSound();
vibrate = true;
}
示例3: initBeepSound
import cn.eoe.app.R; //导入依赖的package包/类
/**
* 扫描正确后的震动声音,如果感觉apk大了,可以删除
*/
private void initBeepSound() {
if (playBeep && mediaPlayer == null) {
// The volume on STREAM_SYSTEM is not adjustable, and users found it
// too loud,
// so we now play on the music stream.
setVolumeControlStream(AudioManager.STREAM_MUSIC);
mediaPlayer = new MediaPlayer();
mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
mediaPlayer.setOnCompletionListener(beepListener);
AssetFileDescriptor file = getResources().openRawResourceFd(
R.raw.beep);
try {
mediaPlayer.setDataSource(file.getFileDescriptor(),
file.getStartOffset(), file.getLength());
file.close();
mediaPlayer.setVolume(BEEP_VOLUME, BEEP_VOLUME);
mediaPlayer.prepare();
} catch (IOException e) {
mediaPlayer = null;
}
}
}
示例4: getView
import cn.eoe.app.R; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
ViewHolder holder;
WikiContentItem item = mList.get(position);
if (convertView == null) {
holder = new ViewHolder();
convertView = mInflater
.inflate(R.layout.wiki_item_layout, null);
holder.title_ = (TextView) convertView
.findViewById(R.id.wiki_title);
holder.title_.setText(item.getTitle());
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
holder.title_.setText(item.getTitle());
}
return convertView;
}
示例5: onCreateView
import cn.eoe.app.R; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreateView(inflater, container, savedInstanceState);
mContext = inflater.getContext();
wm = (WindowManager) mActivity.getSystemService(Context.WINDOW_SERVICE);
View view = inflater.inflate(R.layout.user_collect_fragment, null);
mLinearLayout = (LinearLayout) view
.findViewById(R.id.user_linear_collect_name);
initLinear();
mFragmentManager = mActivity.getSupportFragmentManager();
mUserFragment = new UserCollectListFragment(mActivity, mUserResponse
.getFavorite().get(0));
mFragmentManager.beginTransaction()
.replace(R.id.user_linear_Collect_replace, mUserFragment)
.commit();
return view;
}
示例6: onCreateView
import cn.eoe.app.R; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreateView(inflater, container, savedInstanceState);
mContext = inflater.getContext();
View view = inflater.inflate(R.layout.user_collect_list, null);
mlv = (ListView) view.findViewById(R.id.user_listview_collect);
mlist = new ArrayList<Map<String, Object>>();
getData();
mAdapter = new SimpleAdapter(inflater.getContext(), mlist,
R.layout.user_collect_list_item, new String[] { "name",
"content" }, new int[] {
R.id.user_textview_collectTitle,
R.id.user_textview_collectContent });
mlv.setAdapter(mAdapter);
mlv.setOnItemClickListener(this);
return view;
}
示例7: drawSelector
import cn.eoe.app.R; //导入依赖的package包/类
public void drawSelector(View content, Canvas canvas, float openPercent) {
if (!mSelectorEnabled) return;
if (mSelectorDrawable != null && mSelectedView != null) {
String tag = (String) mSelectedView.getTag(R.id.selected_view);
if (tag.equals(TAG+"SelectedView")) {
canvas.save();
int left, right, offset;
offset = (int) (mSelectorDrawable.getWidth() * openPercent);
if (mMode == SlidingMenu.LEFT) {
right = content.getLeft();
left = right - offset;
canvas.clipRect(left, 0, right, getHeight());
canvas.drawBitmap(mSelectorDrawable, left, getSelectorTop(), null);
} else if (mMode == SlidingMenu.RIGHT) {
left = content.getRight();
right = left + offset;
canvas.clipRect(left, 0, right, getHeight());
canvas.drawBitmap(mSelectorDrawable, right - mSelectorDrawable.getWidth(), getSelectorTop(), null);
}
canvas.restore();
}
}
}
示例8: showActionWindow
import cn.eoe.app.R; //导入依赖的package包/类
public void showActionWindow(View parent, Context context, List<T> tabs) {
// final RingtoneclipModel currentData = model;
// final int res_id = currentData.getId();
int[] location = new int[2];
int popWidth = context.getResources().getDimensionPixelOffset(
R.dimen.popupWindow_width);
parent.getLocationOnScreen(location);
View view = getView(context, tabs);
popupWindow = new PopupWindow(view, popWidth,
LayoutParams.WRAP_CONTENT);// new
// PopupWindow(view,
// popWidth,
// LayoutParams.WRAP_CONTENT);
popupWindow.setFocusable(true);
popupWindow.setOutsideTouchable(true);
popupWindow.setBackgroundDrawable(new BitmapDrawable());
WindowManager windowManager = (WindowManager) context
.getSystemService(Context.WINDOW_SERVICE);
// 显示的位置为:屏幕的最右端
int xPos = (int) (windowManager.getDefaultDisplay().getWidth()
- popupWindow.getWidth() - context.getResources().getDimension(
R.dimen.popupWindow_margin));
// popupWindow.showAsDropDown(parent, -10,0);
popupWindow.showAtLocation(parent, Gravity.NO_GRAVITY, xPos,
location[1] + parent.getHeight() - 20);
}
示例9: onPostExecute
import cn.eoe.app.R; //导入依赖的package包/类
@Override
protected void onPostExecute(Boolean result) {
// TODO Auto-generated method stub
super.onPostExecute(result);
mAlertDialog.dismiss();
if (result) {
showLongToast("登录成功");
Editor edit = share.edit();
edit.putString(UserLoginUidActivity.KEY, editKey.getText()
.toString());
edit.commit();
IntentUtil.start_activity(UserLoginActivity.this,
UserCenterActivity.class);
finish();
} else {
showLongToast(getResources().getString(
R.string.user_loginKey_error));
}
}
示例10: onCreate
import cn.eoe.app.R; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.details_activity);
Intent i = getIntent();
mUrl = i.getStringExtra("url");
mTitle = i.getStringExtra("title");
shareTitle = i.getStringExtra("sharetitle");
sharePre = getSharedPreferences(UserLoginUidActivity.SharedName,
Context.MODE_PRIVATE);
mKey = sharePre.getString(UserLoginUidActivity.KEY, "");
initData();
initControl();
initAppraise();
}
示例11: onClick
import cn.eoe.app.R; //导入依赖的package包/类
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
switch (v.getId()) {
case R.id.button_user_login:
checkUsername(editUserID.getText().toString(), editPwd.getText()
.toString());
break;
case R.id.Linear_above_toHome:
if (share.contains(UserLoginUidActivity.KEY)
&& !share.getString(UserLoginUidActivity.KEY, "")
.equals("")) {
IntentUtil.start_activity(this, UserCenterActivity.class);
finish();
} else {
showLongToast(getResources().getString(
R.string.user_center_error));
}
break;
}
}
示例12: onPostExecute
import cn.eoe.app.R; //导入依赖的package包/类
@Override
protected void onPostExecute(Boolean result) {
// TODO Auto-generated method stub
super.onPostExecute(result);
mAlertDialog.dismiss();
if (result) {
showLongToast("登录成功");
Editor edit = share.edit();
edit.putString(UID, editUserID.getText().toString());
edit.putString(PWD, editPwd.getText().toString());
edit.putString(KEY, key);
edit.commit();
IntentUtil.start_activity(UserLoginUidActivity.this, UserCenterActivity.class);
finish();
} else {
showLongToast(getResources().getString(
R.string.user_login_error));
editUserID.setText("");
editPwd.setText("");
}
}
示例13: getData
import cn.eoe.app.R; //导入依赖的package包/类
private List<Map<String, Object>> getData() {
List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
Map<String, Object> map = new HashMap<String, Object>();
map.put(LIST_TEXT, getResources().getString(R.string.menuGood));
map.put(LIST_IMAGEVIEW, R.drawable.dis_menu_handpick);
list.add(map);
map = new HashMap<String, Object>();
map.put(LIST_TEXT, getResources().getString(R.string.menuNews));
map.put(LIST_IMAGEVIEW, R.drawable.dis_menu_news);
list.add(map);
map = new HashMap<String, Object>();
map.put(LIST_TEXT, getResources().getString(R.string.menuStudio));
map.put(LIST_IMAGEVIEW, R.drawable.dis_menu_studio);
list.add(map);
map = new HashMap<String, Object>();
map.put(LIST_TEXT, getResources().getString(R.string.menuBlog));
map.put(LIST_IMAGEVIEW, R.drawable.dis_menu_blog);
list.add(map);
return list;
}
示例14: initControl
import cn.eoe.app.R; //导入依赖的package包/类
private void initControl() {
ImgLeft = (ImageView) findViewById(R.id.imageview_user_left);
ImgRight = (ImageView) findViewById(R.id.imageview_user_right);
imgTitleButton = (ImageView) findViewById(R.id.imageview_user_title);
imgTitleButton.setImageResource(R.drawable.button_user_more);
imgTitleButton.setOnClickListener(new myOnClickListener());
mViewPager = (ViewPager) findViewById(R.id.user_pager);
mViewPager.setOffscreenPageLimit(2);
mIndicator = (PageIndicator) findViewById(R.id.user_indicator);
mIndicator
.setOnPageChangeListener(new IndicatorOnPageChangedListener());
llGoHome = (LinearLayout) findViewById(R.id.Linear_above_toHome);
llGoHome.setOnClickListener(this);
loadLayout = (LinearLayout) findViewById(R.id.view_loading);
loadFaillayout = (LinearLayout) findViewById(R.id.view_load_fail);
}
示例15: onPostExecute
import cn.eoe.app.R; //导入依赖的package包/类
@Override
protected void onPostExecute(UserResponse result) {
// TODO Auto-generated method stub
super.onPostExecute(result);
loadLayout.setVisibility(View.GONE);
if (result == null) {
UserLogOutFragment fragment=new UserLogOutFragment(
UserCenterActivity.this,true);
mTabsAdapter.addTab(getString(R.string.user_center_get_info_error),fragment );
return;
}
mTabsAdapter.addTab(getString(R.string.user_center_my_Collect), new UserCollectFragment(result,
UserCenterActivity.this));
mTabsAdapter.addTab(getString(R.string.user_center_my_Intro), new UserIntroFragment(result));
mTabsAdapter.addTab(getString(R.string.user_center_exit), new UserLogOutFragment(
UserCenterActivity.this,false));
mTabsAdapter.notifyDataSetChanged();
mViewPager.setCurrentItem(1);
}