Java Code Examples for android.widget.LinearLayout.setSelected()

The following are Jave code examples for showing how to use setSelected() of the android.widget.LinearLayout class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: MyLife   File: MainActivity.java   View Source Code Vote up 6 votes
/**
 * 切换tab页
 * @param itemLayout
 */
public void onTabSelect(LinearLayout itemLayout) {
    int id = itemLayout.getId();
    FragmentManager manager = getSupportFragmentManager();
    FragmentTransaction transaction = manager.beginTransaction();
    hideFragments(manager, transaction);

    //下面图标颜色变化
    for (int i = 0; i < mLayouts.length; i++) {
        mLayouts[i].setSelected(false);
    }
    itemLayout.setSelected(true);

    if (id == R.id.layout_home) {
        selectedFragment(transaction, mHomeFragment, Main0Fragment.class, FRAGMENT_TAG_HOME);
    } else if (id == R.id.layout_categorize) {
        selectedFragment(transaction, mCategorizeFragment, Main1Fragment.class, FRAGMENT_TAG_Categorize);
    }  else if (id == R.id.layout_more) {
        selectedFragment(transaction, mPersonFragment, Main2Fragment.class, FRAGMENT_TAG_PERSON);
    }
    transaction.commit();
}
 
Example 2
Project: Expert-Android-Programming   File: PlaceDetailActivity.java   View Source Code Vote up 6 votes
private void initTiming() {
    dayMonday = (LinearLayout) findViewById(R.id.dayMonday);
    dayTuesday = (LinearLayout) findViewById(R.id.dayTuesday);
    dayWednesday = (LinearLayout) findViewById(R.id.dayWednesday);
    dayThursday = (LinearLayout) findViewById(R.id.dayThursday);
    dayFriday = (LinearLayout) findViewById(R.id.dayFriday);
    daySaturday = (LinearLayout) findViewById(R.id.daySaturday);
    daySunday = (LinearLayout) findViewById(R.id.daySunday);

    timingMonday = (TextView) findViewById(R.id.timingMonday);
    timingTuesday = (TextView) findViewById(R.id.timingTuesday);
    timingWednesday = (TextView) findViewById(R.id.timingWednesday);
    timingThursday = (TextView) findViewById(R.id.timingThursday);
    timingFriday = (TextView) findViewById(R.id.timingFriday);
    timingSaturday = (TextView) findViewById(R.id.timingSaturday);
    timingSunday = (TextView) findViewById(R.id.timingSunday);

    dayMonday.setSelected(false);
    dayTuesday.setSelected(false);
    dayWednesday.setSelected(false);
    dayThursday.setSelected(false);
    dayFriday.setSelected(false);
    daySaturday.setSelected(false);
    daySunday.setSelected(false);
}
 
Example 3
Project: CXJPadProject   File: QuickPanelPlugin.java   View Source Code Vote up 4 votes
private void initView() {
        ll_message = (LinearLayout) findViewById(R.id.ll_message);
        ll_service = (LinearLayout) findViewById(R.id.ll_service);
        ll_outget = (LinearLayout) findViewById(R.id.ll_outget);
        ll_bestPro = (LinearLayout) findViewById(R.id.ll_bestpro);
        ll_promotion = (LinearLayout) findViewById(R.id.ll_promotion);

        serviceLabel = (TextView) findViewById(R.id.serviceLabel);
        outgetLabel = (TextView) findViewById(R.id.outgetLabel);
        bestproLabel = (TextView) findViewById(R.id.bestproLabel);
        promotionLabel = (TextView) findViewById(R.id.promotionLabel);

        platsview = (TextView) findViewById(R.id.plats);
        paidAmt = (TextView) findViewById(R.id.paidAmt);
        originalTotalAmt = (TextView) findViewById(R.id.originalTotalAmt);
        zhekou = (TextView) findViewById(R.id.zhekou);
        shadowView = (ImageView) findViewById(R.id.shadowView);
        shadowView.setOnClickListener(this);
        shadowView.setVisibility(View.GONE);
        findViewById(R.id.rootpan).setOnClickListener(this);
        ll_message.setOnClickListener(this);
        ll_service.setOnClickListener(this);
        ll_outget.setOnClickListener(this);
        ll_promotion.setOnClickListener(this);
        ll_bestPro.setOnClickListener(this);
        ll_message.setSelected(true);
        OrderDetailFragment.setActionListener(new OrderDetailFragment.TransModelAction() {
            @Override
            public void send(QuickFixModel model) {
                platsview.setText(model.plates);
//                paidAmt.setText(model.paidAmt);
//                originalTotalAmt.setText(model.originalTotalAmt);
//                if (model.apAmt != null && model.originalTotalAmt != null)
//                    zhekou.setText((Double.parseDouble(model.originalTotalAmt) - Double.parseDouble(model.apAmt)) + "");

                // 企业工单不允许显示促销
                if ( model.orderCustType.equals("1")) {
                    setProPluginVisible(GONE);
                }
                // 返修单不允许显示促销,并且则托外、精品不允许添加
                //08.05 lyy 返修订单不允许有托外、精品和促销!
                if (model.orderType.equals("2") ) {
                    setProPluginVisible(GONE);
                    setBestProPluginVisible(GONE);
                    setOutgetPluginVisible(GONE);
                }
                if (model.orderType.equals("4")) {
                    setProPluginVisible(GONE);
                    setBestProPluginVisible(GONE);
                    setOutgetPluginVisible(GONE);
                }
            }
        });

    }