本文整理汇总了Java中android.view.Menu.FIRST属性的典型用法代码示例。如果您正苦于以下问题:Java Menu.FIRST属性的具体用法?Java Menu.FIRST怎么用?Java Menu.FIRST使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.view.Menu
的用法示例。
在下文中一共展示了Menu.FIRST属性的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onOptionsItemSelected
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
onBackPressed();
return true;
case Menu.FIRST:
if (!mRefreshLayout.isDisabledTwoLevelRefresh()) {
item.setTitle(R.string.enable_two_level_refresh);
mRefreshLayout.setDisableTwoLevelRefresh(true);
} else {
item.setTitle(R.string.disable_two_level_refresh);
mRefreshLayout.setDisableTwoLevelRefresh(false);
}
return true;
default:
return super.onOptionsItemSelected(item);
}
}
示例2: onOptionsItemSelected
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
onBackPressed();
return true;
case Menu.FIRST:
if (mRefreshLayout.getDefaultFooter().getStyle() == IRefreshView.STYLE_SCALE)
mRefreshLayout.getDefaultFooter().setStyle(IRefreshView.STYLE_DEFAULT);
else
mRefreshLayout.getDefaultFooter().setStyle(IRefreshView.STYLE_SCALE);
return true;
default:
return super.onOptionsItemSelected(item);
}
}
示例3: onOptionsItemSelected
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
onBackPressed();
return true;
case Menu.FIRST:
if (mRefreshLayout.isEnableCheckFingerInsideAnotherDirectionView()) {
mRefreshLayout.setEnableCheckFingerInsideAnotherDirectionView(false);
item.setTitle(R.string.enable_check_finger_inside_horizontal_view);
} else {
mRefreshLayout.setEnableCheckFingerInsideAnotherDirectionView(true);
item.setTitle(R.string.disable_check_finger_inside_horizontal_view);
}
return true;
default:
return super.onOptionsItemSelected(item);
}
}
示例4: onOptionsItemSelected
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
onBackPressed();
return true;
case Menu.FIRST:
mClassicHeader.setStyle(IRefreshView.STYLE_DEFAULT);
mClassicFooter.setStyle(IRefreshView.STYLE_DEFAULT);
return true;
case Menu.FIRST + 1:
mClassicHeader.setStyle(IRefreshView.STYLE_SCALE);
mClassicFooter.setStyle(IRefreshView.STYLE_SCALE);
return true;
case Menu.FIRST + 2:
mClassicHeader.setStyle(IRefreshView.STYLE_PIN);
mClassicFooter.setStyle(IRefreshView.STYLE_PIN);
return true;
case Menu.FIRST + 3:
mClassicHeader.setStyle(IRefreshView.STYLE_FOLLOW_SCALE);
mClassicFooter.setStyle(IRefreshView.STYLE_FOLLOW_SCALE);
return true;
case Menu.FIRST + 4:
mClassicHeader.setStyle(IRefreshView.STYLE_FOLLOW_PIN);
mClassicFooter.setStyle(IRefreshView.STYLE_FOLLOW_PIN);
return true;
case Menu.FIRST + 5:
mClassicHeader.setStyle(IRefreshView.STYLE_FOLLOW_CENTER);
mClassicFooter.setStyle(IRefreshView.STYLE_FOLLOW_CENTER);
return true;
default:
return super.onOptionsItemSelected(item);
}
}
示例5: onOptionsItemSelected
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
onBackPressed();
return true;
case Menu.FIRST:
mAutoRefreshUtil.autoRefresh(true, false, true);
return true;
default:
return super.onOptionsItemSelected(item);
}
}
示例6: onOptionsItemSelected
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == Menu.FIRST) {
if (mRefreshLayout.getDefaultHeader().getStyle() == IRefreshView.STYLE_SCALE)
mRefreshLayout.getDefaultHeader().setStyle(IRefreshView.STYLE_PIN);
else
mRefreshLayout.getDefaultHeader().setStyle(IRefreshView.STYLE_SCALE);
return true;
}
return false;
}
示例7: onOptionsItemSelected
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
onBackPressed();
return true;
case Menu.FIRST:
mStoreHouseHeader.setStyle(IRefreshView.STYLE_DEFAULT);
mStoreHouseHeader.setStyle(IRefreshView.STYLE_DEFAULT);
return true;
case Menu.FIRST + 1:
mStoreHouseHeader.setStyle(IRefreshView.STYLE_SCALE);
mStoreHouseHeader.setStyle(IRefreshView.STYLE_SCALE);
return true;
case Menu.FIRST + 2:
mStoreHouseHeader.setStyle(IRefreshView.STYLE_PIN);
mStoreHouseHeader.setStyle(IRefreshView.STYLE_PIN);
return true;
case Menu.FIRST + 3:
mStoreHouseHeader.setStyle(IRefreshView.STYLE_FOLLOW_SCALE);
mStoreHouseHeader.setStyle(IRefreshView.STYLE_FOLLOW_SCALE);
return true;
case Menu.FIRST + 4:
mStoreHouseHeader.setStyle(IRefreshView.STYLE_FOLLOW_PIN);
mStoreHouseHeader.setStyle(IRefreshView.STYLE_FOLLOW_PIN);
return true;
case Menu.FIRST + 5:
mStoreHouseHeader.setStyle(IRefreshView.STYLE_FOLLOW_CENTER);
mStoreHouseHeader.setStyle(IRefreshView.STYLE_FOLLOW_CENTER);
return true;
default:
return super.onOptionsItemSelected(item);
}
}
示例8: onOptionsItemSelected
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int itemID = item.getItemId();
boolean bReturnVal = super.onOptionsItemSelected(item);
switch (itemID) {
case Menu.FIRST:
// initial a one-curve example
EditText edtXTitle = (EditText)findViewById(R.id.graph_Xtitle_edit);
edtXTitle.setText(getString(R.string.graph_Rtitle_hint));
EditText edtYTitle = (EditText)findViewById(R.id.graph_Ytitle_edit);
edtYTitle.setText(getString(R.string.graph_Angletitle_hint));
break;
}
return bReturnVal;
}
示例9: onOptionsItemSelected
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case Menu.FIRST:
// initial a one-curve example
EditText edtChartName = (EditText)findViewById(R.id.graph_name_edit);
edtChartName.setText(getString(R.string.graph_name_hint));
EditText edtChartTitle = (EditText)findViewById(R.id.graph_title_edit);
edtChartTitle.setText(getString(R.string.graph_title_hint));
EditText edtXTitle = (EditText)findViewById(R.id.graph_Xtitle_edit);
edtXTitle.setText(getString(R.string.graph_Xtitle_hint));
EditText edtYTitle = (EditText)findViewById(R.id.graph_Ytitle_edit);
edtYTitle.setText(getString(R.string.graph_Ytitle_hint));
setExample();
break;
case Menu.FIRST + 1:
if (mnSoftKeyState == ENABLE_SHOW_SOFTKEY) {
// code to hide the soft keyboard
setSoftKeyState(minputMethod.medtInput, ENABLE_HIDE_INPUTPAD);
} else {
// code to enable the soft keyboard
setSoftKeyState(minputMethod.medtInput, ENABLE_SHOW_SOFTKEY);
}
break;
case Menu.FIRST + 2:
Intent intentHelp = new Intent(this, ActivityShowHelp.class);
Bundle bundle = new Bundle();
bundle.putString("HELP_CONTENT", "plot_graph");
//Add this bundle to the intent
intentHelp.putExtras(bundle);
startActivity(intentHelp);
break;
}
return super.onOptionsItemSelected(item);
}
示例10: onOptionsItemSelected
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case Menu.FIRST:
Intent intentHelp = new Intent(this, ActivityShowHelp.class);
Bundle bundle = new Bundle();
bundle.putString("HELP_CONTENT", "settings");
//Add this bundle to the intent
intentHelp.putExtras(bundle);
startActivity(intentHelp);
break;
}
return super.onOptionsItemSelected(item);
}
示例11: onOptionsItemSelected
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case Menu.FIRST:
// initial a one-curve example
EditText edtChartName = (EditText)findViewById(R.id.graph_name_edit);
edtChartName.setText(getString(R.string.graph_name_hint));
EditText edtChartTitle = (EditText)findViewById(R.id.graph_title_edit);
edtChartTitle.setText(getString(R.string.graph_title_hint));
EditText edtXTitle = (EditText)findViewById(R.id.graph_Xtitle_edit);
edtXTitle.setText(getString(R.string.graph_Xtitle_hint));
EditText edtYTitle = (EditText)findViewById(R.id.graph_Ytitle_edit);
edtYTitle.setText(getString(R.string.graph_Ytitle_hint));
EditText edtZTitle = (EditText)findViewById(R.id.graph_Ztitle_edit);
edtZTitle.setText(getString(R.string.graph_Ztitle_hint));
setExample();
break;
case Menu.FIRST + 1:
if (mnSoftKeyState == ENABLE_SHOW_SOFTKEY) {
// code to hide the soft keyboard
setSoftKeyState(minputMethod.medtInput, ENABLE_HIDE_INPUTPAD);
} else {
// code to enable the soft keyboard
setSoftKeyState(minputMethod.medtInput, ENABLE_SHOW_SOFTKEY);
}
break;
case Menu.FIRST + 2:
Intent intentHelp = new Intent(this, ActivityShowHelp.class);
Bundle bundle = new Bundle();
bundle.putString("HELP_CONTENT", "plot_graph");
//Add this bundle to the intent
intentHelp.putExtras(bundle);
startActivity(intentHelp);
break;
}
return super.onOptionsItemSelected(item);
}
示例12: onOptionsItemSelected
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int randomInt = mRandom.nextInt();
if (item.getItemId() == Menu.FIRST) {
final int randomSpan = randomInt % 8 == 0 ? 1 : randomInt % 8;
mGridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
return (position + 1) % randomSpan == 0 ? mGridLayoutManager.getSpanCount() : 1;
}
});
if (randomInt % 3 == 0) {
mLinearLayoutManager.setOrientation(OrientationHelper.HORIZONTAL);
} else {
mLinearLayoutManager.setOrientation(OrientationHelper.VERTICAL);
}
if (randomSpan % 2 == 0)
mGridLayoutManager.setReverseLayout(true);
else
mGridLayoutManager.setReverseLayout(false);
mRecyclerView.removeItemDecoration(mLinearItemDecoration);
mRecyclerView.removeItemDecoration(mGridItemDecoration);
mRecyclerView.addItemDecoration(mGridItemDecoration);
mRecyclerView.setLayoutManager(mGridLayoutManager);
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
mRecyclerView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}
mRecyclerView.setAdapter(mAdapter);
return true;
} else if (item.getItemId() == Menu.FIRST + 1) {
if (randomInt % 4 == 0) {
mLinearLayoutManager.setOrientation(OrientationHelper.HORIZONTAL);
} else {
mLinearLayoutManager.setOrientation(OrientationHelper.VERTICAL);
}
randomInt = mRandom.nextInt();
if (randomInt % 2 == 0) {
mLinearLayoutManager.setReverseLayout(false);
} else {
mLinearLayoutManager.setReverseLayout(true);
}
mRecyclerView.removeItemDecoration(mGridItemDecoration);
mRecyclerView.removeItemDecoration(mLinearItemDecoration);
mRecyclerView.addItemDecoration(mLinearItemDecoration);
mRecyclerView.setLayoutManager(mLinearLayoutManager);
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
mRecyclerView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
}
mRecyclerView.setAdapter(mAdapter);
return true;
}
return false;
}
示例13: onOptionsItemSelected
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case Menu.FIRST:
EditText edtIntegExpr = (EditText) findViewById(R.id.integrated_expr_edit);
edtIntegExpr.setText("sin(x)*y");
EditText edtXName = (EditText) findViewById(R.id.x_variable_name_edit);
edtXName.setText("x");
EditText edtXFrom = (EditText) findViewById(R.id.x_variable_from_edit);
edtXFrom.setText("3 + 4*i");
EditText edtXTo = (EditText) findViewById(R.id.x_variable_to_edit);
edtXTo.setText("13 - 32.33*i");
EditText edtXNumberOfSteps = (EditText) findViewById(R.id.x_variable_number_of_steps_edit);
edtXNumberOfSteps.setText("20");
EditText edtYName = (EditText) findViewById(R.id.y_variable_name_edit);
edtYName.setText("y");
EditText edtYFrom = (EditText) findViewById(R.id.y_variable_from_edit);
edtYFrom.setText("18");
EditText edtYTo = (EditText) findViewById(R.id.y_variable_to_edit);
edtYTo.setText("64");
EditText edtYNumberOfSteps = (EditText) findViewById(R.id.y_variable_number_of_steps_edit);
edtYNumberOfSteps.setText("15");
Spinner spinnerMultipleIntegral = (Spinner) findViewById(R.id.multiple_integral_spinner);
spinnerMultipleIntegral.setSelection(SELECT_2ND_LEVEL_INTEGRAL); // level 2 integration
break;
case Menu.FIRST + 1:
if (mnSoftKeyState == ENABLE_SHOW_SOFTKEY) {
// code to hide the soft keyboard
setSoftKeyState(minputMethod.medtInput, ENABLE_HIDE_INPUTPAD);
} else {
// code to enable the soft keyboard
setSoftKeyState(minputMethod.medtInput, ENABLE_SHOW_SOFTKEY);
}
break;
case Menu.FIRST + 2:
Intent intentHelp = new Intent(this, ActivityShowHelp.class);
Bundle bundle = new Bundle();
bundle.putString("HELP_CONTENT", "integration");
//Add this bundle to the intent
intentHelp.putExtras(bundle);
startActivity(intentHelp);
break;
}
return super.onOptionsItemSelected(item);
}