當前位置: 首頁>>代碼示例>>Java>>正文


Java Menu.FIRST屬性代碼示例

本文整理匯總了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);
    }
}
 
開發者ID:dkzwm,項目名稱:SmoothRefreshLayout,代碼行數:19,代碼來源:TestTwoLevelRefreshActivity.java

示例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);
    }
}
 
開發者ID:dkzwm,項目名稱:SmoothRefreshLayout,代碼行數:16,代碼來源:WithRecyclerViewActivity.java

示例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);
    }
}
 
開發者ID:dkzwm,項目名稱:SmoothRefreshLayout,代碼行數:19,代碼來源:TestNestedHorizontalViewsActivity.java

示例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);
    }
}
 
開發者ID:dkzwm,項目名稱:SmoothRefreshLayout,代碼行數:34,代碼來源:WithListViewActivity.java

示例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);
    }
}
 
開發者ID:dkzwm,項目名稱:SmoothRefreshLayout,代碼行數:13,代碼來源:WithWebViewActivity.java

示例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;
}
 
開發者ID:dkzwm,項目名稱:SmoothRefreshLayout,代碼行數:11,代碼來源:MainActivity.java

示例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);
    }
}
 
開發者ID:dkzwm,項目名稱:SmoothRefreshLayout,代碼行數:34,代碼來源:TestReleaseToRefreshActivity.java

示例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;
}
 
開發者ID:woshiwpa,項目名稱:SmartMath,代碼行數:15,代碼來源:ActivityPlotPolarGraph.java

示例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);
}
 
開發者ID:woshiwpa,項目名稱:SmartMath,代碼行數:35,代碼來源:ActivityPlotXYGraph.java

示例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);
}
 
開發者ID:woshiwpa,項目名稱:SmartMath,代碼行數:14,代碼來源:ActivitySettings.java

示例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);
}
 
開發者ID:woshiwpa,項目名稱:SmartMath,代碼行數:37,代碼來源:ActivityPlotXYZGraph.java

示例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;
}
 
開發者ID:dkzwm,項目名稱:ItemDecorations,代碼行數:53,代碼來源:MainActivity.java

示例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);
}
 
開發者ID:woshiwpa,項目名稱:SmartMath,代碼行數:48,代碼來源:ActivityIntegrate.java


注:本文中的android.view.Menu.FIRST屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。