本文整理汇总了Java中com.jeremyfeinstein.slidingmenu.example.R类的典型用法代码示例。如果您正苦于以下问题:Java R类的具体用法?Java R怎么用?Java R使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
R类属于com.jeremyfeinstein.slidingmenu.example包,在下文中一共展示了R类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onListItemClick
import com.jeremyfeinstein.slidingmenu.example.R; //导入依赖的package包/类
@Override
public void onListItemClick(ListView lv, View v, int position, long id) {
Fragment newContent = null;
switch (position) {
case 0:
newContent = new ColorFragment(R.color.red);
break;
case 1:
newContent = new ColorFragment(R.color.green);
break;
case 2:
newContent = new ColorFragment(R.color.blue);
break;
case 3:
newContent = new ColorFragment(android.R.color.white);
break;
case 4:
newContent = new ColorFragment(android.R.color.black);
break;
}
if (newContent != null)
switchFragment(newContent);
}
开发者ID:JoeSteven,项目名称:Moring-Alarm,代码行数:24,代码来源:ColorMenuFragment.java
示例2: onCreateView
import com.jeremyfeinstein.slidingmenu.example.R; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
if (mPos == -1 && savedInstanceState != null)
mPos = savedInstanceState.getInt("mPos");
TypedArray imgs = getResources().obtainTypedArray(R.array.birds_img);
mImgRes = imgs.getResourceId(mPos, -1);
GridView gv = (GridView) inflater.inflate(R.layout.list_grid, null);
gv.setBackgroundResource(android.R.color.black);
gv.setAdapter(new GridAdapter());
gv.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position,
long id) {
if (getActivity() == null)
return;
ResponsiveUIActivity activity = (ResponsiveUIActivity) getActivity();
activity.onBirdPressed(mPos);
}
});
return gv;
}
开发者ID:JoeSteven,项目名称:Moring-Alarm,代码行数:23,代码来源:BirdGridFragment.java
示例3: onCreate
import com.jeremyfeinstein.slidingmenu.example.R; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// set the Above View
if (savedInstanceState != null)
mContent = getSupportFragmentManager().getFragment(savedInstanceState, "mContent");
if (mContent == null)
mContent = new ColorFragment(R.color.red);
// set the Above View
setContentView(R.layout.content_frame);
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.content_frame, mContent)
.commit();
// set the Behind View
setBehindContentView(R.layout.menu_frame);
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.menu_frame, new ColorMenuFragment())
.commit();
// customize the SlidingMenu
getSlidingMenu().setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
}
开发者ID:JoeSteven,项目名称:Moring-Alarm,代码行数:27,代码来源:FragmentChangeActivity.java
示例4: onOptionsItemSelected
import com.jeremyfeinstein.slidingmenu.example.R; //导入依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
toggle();
}
return super.onOptionsItemSelected(item);
}
开发者ID:JoeSteven,项目名称:Moring-Alarm,代码行数:9,代码来源:ResponsiveUIActivity.java
示例5: switchContent
import com.jeremyfeinstein.slidingmenu.example.R; //导入依赖的package包/类
public void switchContent(final Fragment fragment) {
mContent = fragment;
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.content_frame, fragment)
.commit();
Handler h = new Handler();
h.postDelayed(new Runnable() {
public void run() {
getSlidingMenu().showContent();
}
}, 50);
}
开发者ID:JoeSteven,项目名称:Moring-Alarm,代码行数:14,代码来源:ResponsiveUIActivity.java
示例6: onActivityCreated
import com.jeremyfeinstein.slidingmenu.example.R; //导入依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
String[] colors = getResources().getStringArray(R.array.color_names);
ArrayAdapter<String> colorAdapter = new ArrayAdapter<String>(getActivity(),
android.R.layout.simple_list_item_1, android.R.id.text1, colors);
setListAdapter(colorAdapter);
}
开发者ID:JoeSteven,项目名称:Moring-Alarm,代码行数:9,代码来源:ColorMenuFragment.java
示例7: getView
import com.jeremyfeinstein.slidingmenu.example.R; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
convertView = getActivity().getLayoutInflater().inflate(R.layout.grid_item, null);
}
ImageView img = (ImageView) convertView.findViewById(R.id.grid_item_img);
img.setImageResource(mImgRes);
return convertView;
}
开发者ID:JoeSteven,项目名称:Moring-Alarm,代码行数:10,代码来源:BirdGridFragment.java
示例8: onCreate
import com.jeremyfeinstein.slidingmenu.example.R; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
int pos = 0;
if (getIntent().getExtras() != null) {
pos = getIntent().getExtras().getInt("pos");
}
String[] birds = getResources().getStringArray(R.array.birds);
TypedArray imgs = getResources().obtainTypedArray(R.array.birds_img);
int resId = imgs.getResourceId(pos, -1);
setTitle(birds[pos]);
getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
ColorDrawable color = new ColorDrawable(Color.BLACK);
color.setAlpha(128);
getSupportActionBar().setBackgroundDrawable(color);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mHandler = new Handler();
ImageView imageView = new ImageView(this);
imageView.setScaleType(ScaleType.CENTER_INSIDE);
imageView.setImageResource(resId);
imageView.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
getSupportActionBar().show();
hideActionBarDelayed(mHandler);
}
});
setContentView(imageView);
this.getWindow().setBackgroundDrawableResource(android.R.color.black);
}
开发者ID:JoeSteven,项目名称:Moring-Alarm,代码行数:33,代码来源:BirdActivity.java
示例9: onOptionsItemSelected
import com.jeremyfeinstein.slidingmenu.example.R; //导入依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
开发者ID:JoeSteven,项目名称:Moring-Alarm,代码行数:10,代码来源:BirdActivity.java
示例10: switchContent
import com.jeremyfeinstein.slidingmenu.example.R; //导入依赖的package包/类
public void switchContent(Fragment fragment) {
mContent = fragment;
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.content_frame, fragment)
.commit();
getSlidingMenu().showContent();
}
开发者ID:JoeSteven,项目名称:Moring-Alarm,代码行数:9,代码来源:FragmentChangeActivity.java
示例11: onActivityCreated
import com.jeremyfeinstein.slidingmenu.example.R; //导入依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
String[] birds = getResources().getStringArray(R.array.birds);
ArrayAdapter<String> colorAdapter = new ArrayAdapter<String>(getActivity(),
android.R.layout.simple_list_item_1, android.R.id.text1, birds);
setListAdapter(colorAdapter);
}
开发者ID:JoeSteven,项目名称:Moring-Alarm,代码行数:9,代码来源:BirdMenuFragment.java
示例12: CustomZoomAnimation
import com.jeremyfeinstein.slidingmenu.example.R; //导入依赖的package包/类
public CustomZoomAnimation() {
// see the class CustomAnimation for how to attach
// the CanvasTransformer to the SlidingMenu
super(R.string.anim_zoom, new CanvasTransformer() {
@Override
public void transformCanvas(Canvas canvas, float percentOpen) {
float scale = (float) (percentOpen*0.25 + 0.75);
canvas.scale(scale, scale, canvas.getWidth()/2, canvas.getHeight()/2);
}
});
}
开发者ID:JoeSteven,项目名称:Moring-Alarm,代码行数:12,代码来源:CustomZoomAnimation.java
示例13: onCreate
import com.jeremyfeinstein.slidingmenu.example.R; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// set the Above View
setContentView(R.layout.content_frame);
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.content_frame, new SampleListFragment())
.commit();
SlidingMenu sm = getSlidingMenu();
setSlidingActionBarEnabled(true);
sm.setBehindScrollScale(0.0f);
sm.setBehindCanvasTransformer(mTransformer);
}
开发者ID:JoeSteven,项目名称:Moring-Alarm,代码行数:16,代码来源:CustomAnimation.java
示例14: CustomScaleAnimation
import com.jeremyfeinstein.slidingmenu.example.R; //导入依赖的package包/类
public CustomScaleAnimation() {
super(R.string.anim_scale, new CanvasTransformer() {
@Override
public void transformCanvas(Canvas canvas, float percentOpen) {
canvas.scale(percentOpen, 1, 0, 0);
}
});
}
开发者ID:JoeSteven,项目名称:Moring-Alarm,代码行数:9,代码来源:CustomScaleAnimation.java
示例15: CustomSlideAnimation
import com.jeremyfeinstein.slidingmenu.example.R; //导入依赖的package包/类
public CustomSlideAnimation() {
// see the class CustomAnimation for how to attach
// the CanvasTransformer to the SlidingMenu
super(R.string.anim_slide, new CanvasTransformer() {
@Override
public void transformCanvas(Canvas canvas, float percentOpen) {
canvas.translate(0, canvas.getHeight()*(1-interp.getInterpolation(percentOpen)));
}
});
}
开发者ID:JoeSteven,项目名称:Moring-Alarm,代码行数:11,代码来源:CustomSlideAnimation.java
注:本文中的com.jeremyfeinstein.slidingmenu.example.R类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论