当前位置: 首页>>代码示例>>Java>>正文


Java LinearLayout.setClickable方法代码示例

本文整理汇总了Java中android.widget.LinearLayout.setClickable方法的典型用法代码示例。如果您正苦于以下问题:Java LinearLayout.setClickable方法的具体用法?Java LinearLayout.setClickable怎么用?Java LinearLayout.setClickable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.LinearLayout的用法示例。


在下文中一共展示了LinearLayout.setClickable方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setOverlayVisibility

import android.widget.LinearLayout; //导入方法依赖的package包/类
public void setOverlayVisibility(boolean isVisible) {
    final LinearLayout overlay = (LinearLayout) findViewById(R.id.overlay);

    if (isVisible) {
    	overlay.setVisibility(View.VISIBLE);
    	overlay.setClickable(true);
    	overlay.bringToFront();
    }
    else {
    	overlay.setVisibility(View.GONE);
    }
}
 
开发者ID:rtr-nettest,项目名称:open-rmbt,代码行数:13,代码来源:RMBTMainActivity.java

示例2: getView

import android.widget.LinearLayout; //导入方法依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {

    Project project = mProjects.get(position);
    if(convertView == null) {
        LayoutInflater inflater = LayoutInflater.from(MBApp.getApp());
        convertView = inflater.inflate(R.layout.project_items, null);
    }

    Button appNameButton = (Button) convertView.findViewById(R.id.appNameButton);
    appNameButton.setTypeface(MBApp.getApp().getRobotoTypeface());

    ExtendedEditText appNameEdit = (ExtendedEditText) convertView.findViewById(R.id.appNameEdit);
    appNameEdit.setTypeface(MBApp.getApp().getRobotoTypeface());

    LinearLayout actionBarLayout = (LinearLayout) convertView.findViewById(R.id.actionBarForProgram);
    if(actionBarLayout != null) {
        if(project.actionBarExpanded) {
            actionBarLayout.setVisibility(View.VISIBLE);
            appNameButton.setCompoundDrawablesWithIntrinsicBounds(null, null, ContextCompat.getDrawable(MBApp.getApp()
                    , R.drawable.ic_arrow_down), null);
        } else {
            actionBarLayout.setVisibility(View.GONE);
            appNameButton.setCompoundDrawablesWithIntrinsicBounds(null, null, ContextCompat.getDrawable(MBApp.getApp()
                    , R.drawable.ic_arrow_left), null);
        }
    }

    appNameButton.setText(project.name);
    appNameButton.setTag(R.id.positionId, position);
    appNameButton.setTag(R.id.textEdit, appNameEdit);
    appNameButton.setOnClickListener(appNameClickListener);
    appNameButton.setOnLongClickListener(appNameLongClickListener);

    appNameEdit.setTag(R.id.positionId, position);
    appNameEdit.setTag(R.id.editbutton, appNameButton);
    appNameEdit.setOnEditorActionListener(editorOnActionListener);
    appNameEdit.setFilters(new InputFilter[]{renameFilter});

    if(project.inEditMode) {
        appNameEdit.setVisibility(View.VISIBLE);

        appNameEdit.setText(project.name);
        appNameEdit.setSelection(project.name.length());
        appNameEdit.requestFocus();
        appNameButton.setVisibility(View.INVISIBLE);

    } else {
        appNameEdit.setVisibility(View.INVISIBLE);
        appNameButton.setVisibility(View.VISIBLE);
        //dismissKeyBoard(appNameEdit, false);
    }

    //appNameEdit.setOnClickListener(appNameClickListener);

    TextView flashBtnText = (TextView) convertView.findViewById(R.id.project_item_text);
    flashBtnText.setTypeface(MBApp.getApp().getRobotoTypeface());
    LinearLayout sendBtnLayout = (LinearLayout) convertView.findViewById(R.id.sendBtn);
    sendBtnLayout.setTag(position);
    sendBtnLayout.setOnClickListener(sendBtnClickListener);

    ImageButton deleteBtn = (ImageButton) convertView.findViewById(R.id.deleteBtn);
    deleteBtn.setTag(position);
    deleteBtn.setOnClickListener(deleteBtnClickListener);
    deleteBtn.setEnabled(true);


    Drawable myIcon;
    if(project.runStatus) {
        flashBtnText.setText("");
        myIcon = convertView.getResources().getDrawable(R.drawable.green_btn);
    } else {
        flashBtnText.setText(R.string.flash);
        myIcon = convertView.getResources().getDrawable(R.drawable.blue_btn);
    }
    sendBtnLayout.setBackground(myIcon);

    sendBtnLayout.setClickable(true);
    return convertView;
}
 
开发者ID:Samsung,项目名称:microbit,代码行数:81,代码来源:ProjectAdapter.java

示例3: createGraph

import android.widget.LinearLayout; //导入方法依赖的package包/类
protected void createGraph() {
        graphRenderer = new XYMultipleSeriesRenderer();

        graphRenderer.setChartTitle("Line Graph");
        graphRenderer.setChartTitleTextSize(50);
        graphRenderer.setMargins(new int[] {100, 100, 70, 50});     // top, left, bottom, right

        graphRenderer.setBackgroundColor(Color.WHITE);
        graphRenderer.setMarginsColor(Color.parseColor("#FFFFFF"));
        graphRenderer.setAxesColor(Color.DKGRAY);

        graphRenderer.setXTitle("Time(sec)");
        graphRenderer.setYTitle("Value");
        graphRenderer.setAxisTitleTextSize(30);
        graphRenderer.setLabelsTextSize(25);
        graphRenderer.setYLabelsAlign(Paint.Align.RIGHT);

//        graphRenderer.setPointSize(50);
        graphRenderer.setLegendTextSize(30);

        graphRenderer.setXAxisMin(0);
        graphRenderer.setXAxisMax(100);
        graphRenderer.setZoomEnabled(false, false);

        graphDataSerieses = new XYSeries[sensorInfo.getType().getValueNumbers()];
        XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();;
        for(int loop1 = 0 ; loop1 < sensorInfo.getType().getValueNumbers() ; loop1++) {
            graphDataSerieses[loop1] = new TimeSeries(sensorInfo.getType().getValueInfos()[loop1][0] + "(" + sensorInfo.getType().getValueInfos()[loop1][1] + ")");
            dataset.addSeries(graphDataSerieses[loop1]);

            XYSeriesRenderer seriesRenderer = new XYSeriesRenderer();
            seriesRenderer.setColor(Color.parseColor(COLORS[loop1]));
            seriesRenderer.setPointStyle(PointStyle.POINT);
            seriesRenderer.setLineWidth(3);
            graphRenderer.addSeriesRenderer(seriesRenderer);
        }
        graphView = ChartFactory.getLineChartView(this, dataset, graphRenderer);

        LinearLayout graphArea = (LinearLayout) findViewById(R.id.ll_graph_area);
        graphArea.addView(graphView);
        graphArea.setClickable(false);
    }
 
开发者ID:SKT-ThingPlug,项目名称:thingplug-sdk-android,代码行数:43,代码来源:SensorDetailActivity.java

示例4: ChatRoomView

import android.widget.LinearLayout; //导入方法依赖的package包/类
public ChatRoomView(Context context, final ViewGroup container, Type type) {

        this.mContainer = (AbsoluteLayout) container;
        this.mContext = context;
        this.type = type;

        int width = ScreenUtils.getScreenWidth(mContext);
        AbsoluteLayout.LayoutParams params = new AbsoluteLayout.LayoutParams(width, ViewGroup.LayoutParams
                .MATCH_PARENT, 0, 0);


        mainView = new LinearLayout(mContext);
        mainView.setLayoutParams(new ViewGroup.LayoutParams(ScreenUtils.getScreenWidth(mContext),
                ViewGroup.LayoutParams.MATCH_PARENT));
        mainView.setOrientation(LinearLayout.VERTICAL);

        mRecyclerView = new RecyclerView(mContext);
        mRecyclerView.setId(android.R.id.list);
        mRecyclerView.setLayoutManager(new LinearLayoutManager(mContext) {
            @Override
            public boolean canScrollVertically() {
                return !isDragging;
            }
        });

        mainView.addView(initToolbar());
        mainView.addView(mRecyclerView);
        mainView.setClickable(true);

        mainView.setBackgroundColor(Color.parseColor("#" + AppSaveInfoUtils.INSTANCE.helperColorInfo()));

        initSwipeBack();

        mContainer.addView(swipeBackLayout, params);

        swipeBackLayout.post(new Runnable() {
            @Override
            public void run() {
                swipeBackLayout.mSlideOffset = 1;
                Log.v("dispatchKeyEvent", " isShowing, mSlideOffset = " + swipeBackLayout.mSlideOffset);
            }
        });
        swipeBackLayout.mSlideOffset = 1;

        uuid = DeviceUtils.getIMELCode(context);

        ApiManager.INSTANCE.sendRequestForUserStatistics("init", uuid, Build.MODEL);
    }
 
开发者ID:zhudongya123,项目名称:WechatChatroomHelper,代码行数:49,代码来源:ChatRoomView.java


注:本文中的android.widget.LinearLayout.setClickable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。