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


Java FrameLayout.setId方法代码示例

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


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

示例1: addProcessingCanvas

import android.widget.FrameLayout; //导入方法依赖的package包/类
/**
 * Adds a processing view.
 * This Processing view acts quite similar to Processing.org for Android. In fact is the same, although
 * some things work a bit differently to play well with the rest of the framework.
 *
 * - All the Processing functions prepend the Processing (p) object.
 * p.fill(255); p.stroke(); p.rect();
 *
 * @param x
 * @param y
 * @param w
 * @param h
 * @return
 *
 * @exampleLink /examples/Others/Processing
 */
@ProtoMethod(description = "", example = "")
@ProtoMethodParam(params = {"x", "y", "w", "h"})
public PProcessing addProcessingCanvas(Object x, Object y, Object w, Object h) {
    // Create the main layout. This is where all the items actually go
    FrameLayout fl = new FrameLayout(getContext());
    fl.setLayoutParams(new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT));
    fl.setId(200 + (int) (200 * Math.random()));

    // Add the view
    addViewAbsolute(fl, x, y, w, h);

    PProcessing p = new PProcessing(getAppRunner());

    FragmentTransaction ft = getActivity().getSupportFragmentManager().beginTransaction();
    ft.add(fl.getId(), p, String.valueOf(fl.getId()));
    ft.commit();

    return p;
}
 
开发者ID:victordiaz,项目名称:phonk,代码行数:36,代码来源:PUI.java

示例2: onCreateView

import android.widget.FrameLayout; //导入方法依赖的package包/类
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    Context context = getActivity();
    FrameLayout root = new FrameLayout(context);
    LinearLayout pframe = new LinearLayout(context);
    pframe.setId(INTERNAL_PROGRESS_CONTAINER_ID);
    pframe.setOrientation(1);
    pframe.setVisibility(8);
    pframe.setGravity(17);
    pframe.addView(new ProgressBar(context, null, 16842874), new LayoutParams(-2, -2));
    root.addView(pframe, new LayoutParams(-1, -1));
    FrameLayout lframe = new FrameLayout(context);
    lframe.setId(INTERNAL_LIST_CONTAINER_ID);
    TextView tv = new TextView(getActivity());
    tv.setId(INTERNAL_EMPTY_ID);
    tv.setGravity(17);
    lframe.addView(tv, new LayoutParams(-1, -1));
    ListView lv = new ListView(getActivity());
    lv.setId(16908298);
    lv.setDrawSelectorOnTop(false);
    lframe.addView(lv, new LayoutParams(-1, -1));
    root.addView(lframe, new LayoutParams(-1, -1));
    root.setLayoutParams(new LayoutParams(-1, -1));
    return root;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:25,代码来源:ListFragment.java

示例3: onVideoItemChangeToFullScreenClick

import android.widget.FrameLayout; //导入方法依赖的package包/类
@Override
public void onVideoItemChangeToFullScreenClick(EssayAdapter.VideoViewHolder videoViewHolder) {
    // 这里这个ViewGroup 是Window的
    final ViewGroup vp = (ViewGroup)(findViewById(Window.ID_ANDROID_CONTENT));

    videoViewHolder.basicVideoView.setPlayer(null);

    final BasicVideoView newBasicVideoView = (BasicVideoView) View.inflate(this, R.layout.basic_videoview, null);
    newBasicVideoView.setPlayer(mPlayer);
    View changeToInsetScreen = newBasicVideoView.findViewById(R.id.changeToInsetScreen);
    changeToInsetScreen.setOnClickListener(this);

    final FrameLayout.LayoutParams lpParent = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
    final FrameLayout frameLayout = new FrameLayout(this);
    frameLayout.setId(R.id.full_screen_id);

    FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
    lp.gravity = Gravity.CENTER;
    frameLayout.addView(newBasicVideoView, lp);
    vp.addView(frameLayout, lpParent);
    mPlayer.seekTo(mPlayer.getCurrentPosition() - 20);
}
 
开发者ID:xinpianchang,项目名称:NSMPlayer-Android,代码行数:23,代码来源:EssayDetailActivity.java

示例4: ensureHierarchy

import android.widget.FrameLayout; //导入方法依赖的package包/类
private void ensureHierarchy(Context context) {
    // If owner hasn't made its own view hierarchy, then as a convenience
    // we will construct a standard one here.
    if (findViewById(android.R.id.tabs) == null) {
        LinearLayout ll = new LinearLayout(context);
        ll.setOrientation(LinearLayout.VERTICAL);
        addView(ll, new LayoutParams(
                ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.MATCH_PARENT));

        TabWidget tw = new TabWidget(context);
        tw.setId(android.R.id.tabs);
        tw.setOrientation(TabWidget.HORIZONTAL);
        ll.addView(tw, new LinearLayout.LayoutParams(
                ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.WRAP_CONTENT, 0));

        FrameLayout fl = new FrameLayout(context);
        fl.setId(android.R.id.tabcontent);
        ll.addView(fl, new LinearLayout.LayoutParams(0, 0, 0));

        mRealTabContent = fl = new FrameLayout(context);
        mRealTabContent.setId(mContainerId);
        ll.addView(fl, new LinearLayout.LayoutParams(
                LinearLayout.LayoutParams.MATCH_PARENT, 0, 1));
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:28,代码来源:FragmentTabHost.java

示例5: onCreate

import android.widget.FrameLayout; //导入方法依赖的package包/类
/**
 */
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	final FrameLayout contentView = new FrameLayout(this);
	contentView.setId(CONTENT_VIEW_ID);
	setContentView(contentView);
}
 
开发者ID:universum-studios,项目名称:android_ui,代码行数:10,代码来源:TestActivity.java

示例6: addHeader

import android.widget.FrameLayout; //导入方法依赖的package包/类
private void addHeader() {
    FrameLayout headViewLayout = new FrameLayout(getContext());
    LayoutParams layoutParams = new LayoutParams(LayoutParams.MATCH_PARENT, 0);
    layoutParams.addRule(ALIGN_PARENT_TOP);

    FrameLayout extraHeadLayout = new FrameLayout(getContext());
    extraHeadLayout.setId(R.id.ex_header);
    LayoutParams layoutParams2 = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);

    this.addView(extraHeadLayout, layoutParams2);
    this.addView(headViewLayout, layoutParams);

    mExtraHeadLayout = extraHeadLayout;
    mHeadLayout = headViewLayout;

    if (mHeadView == null) {
        if (!TextUtils.isEmpty(HEADER_CLASS_NAME)) {
            try {
                Class headClazz = Class.forName(HEADER_CLASS_NAME);
                Constructor ct = headClazz.getDeclaredConstructor(Context.class);
                setHeaderView((IHeaderView) ct.newInstance(getContext()));
            } catch (Exception e) {
                Log.e("TwinklingRefreshLayout:", "setDefaultHeader classname=" + e.getMessage());
                setHeaderView(new GoogleDotView(getContext()));
            }
        } else {
            setHeaderView(new GoogleDotView(getContext()));
        }
    }
}
 
开发者ID:Justson,项目名称:AgentWebX5,代码行数:31,代码来源:TwinklingRefreshLayout.java

示例7: onCreate

import android.widget.FrameLayout; //导入方法依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mFragmentClazz = getIntent().getStringExtra(EXTRA_FRAGMENT);
    FrameLayout frameLayout = new FrameLayout(this);
    frameLayout.setId(widget_frame);
    setContentView(frameLayout);
    replaceFragment();
}
 
开发者ID:scwang90,项目名称:SmartRefreshLayout,代码行数:10,代码来源:FragmentActivity.java

示例8: onCreate

import android.widget.FrameLayout; //导入方法依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  FrameLayout content = new FrameLayout(this);
  content.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
    ViewGroup.LayoutParams.MATCH_PARENT));
  content.setId(R.id.container);
  setContentView(content);
}
 
开发者ID:mapbox,项目名称:mapbox-plugins-android,代码行数:10,代码来源:SingleFragmentActivity.java

示例9: onCreateView

import android.widget.FrameLayout; //导入方法依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    final Context context = getContext();

    FrameLayout root = new FrameLayout(context);

    // ------------------------------------------------------------------

    mRecyclerContainer = new FrameLayout(context);
    mRecyclerContainer.setId(R.id.recycler_container_id);

    mStandardEmptyView = new TextView(context);
    mStandardEmptyView.setId(R.id.recycler_empty_id);
    mStandardEmptyView.setGravity(Gravity.CENTER);
    mStandardEmptyView.setVisibility(View.GONE);
    mRecyclerContainer.addView(mStandardEmptyView, new FrameLayout.LayoutParams(
            ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));

    mRecyclerView = new RecyclerView(context);
    mRecyclerView.setId(R.id.recycler);
    mRecyclerContainer.addView(mRecyclerView, new FrameLayout.LayoutParams(
            ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));

    root.addView(mRecyclerContainer, new FrameLayout.LayoutParams(
            ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));

    // ------------------------------------------------------------------

    root.setLayoutParams(new FrameLayout.LayoutParams(
            ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));

    return root;
}
 
开发者ID:halohoop,项目名称:AndroidDigIn,代码行数:35,代码来源:RecyclerFragment.java

示例10: createBottomSelectionBar

import android.widget.FrameLayout; //导入方法依赖的package包/类
/**
     * Creates bottom selection bar to show selected days
     */
    private void createBottomSelectionBar() {
        flBottomSelectionBar = new FrameLayout(getContext());
//        flBottomSelectionBar.setLayoutTransition(new LayoutTransition());
        flBottomSelectionBar.setId(View.generateViewId());
        RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
        params.addRule(RelativeLayout.BELOW, rvMonths.getId());
        flBottomSelectionBar.setLayoutParams(params);
        flBottomSelectionBar.setBackgroundResource(R.drawable.border_top_bottom);
        flBottomSelectionBar.setVisibility(settingsManager.getCalendarOrientation() == OrientationHelper.HORIZONTAL ? View.VISIBLE : View.GONE);
        addView(flBottomSelectionBar);

        createMultipleSelectionBarRecycler();
        createRangeSelectionLayout();
    }
 
开发者ID:ApplikeySolutions,项目名称:CosmoCalendar,代码行数:18,代码来源:CalendarView.java

示例11: wrapKeyboardView

import android.widget.FrameLayout; //导入方法依赖的package包/类
@NonNull
private static FrameLayout wrapKeyboardView(Activity activity, KeyboardView keyboardView) {
    FrameLayout keyboardWrapper = new FrameLayout(activity);
    keyboardWrapper.setId(R.id.keyboard_wrapper_id);
    keyboardWrapper.setClipChildren(false);

    FrameLayout.LayoutParams keyboardParams = new FrameLayout.LayoutParams(
            ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.BOTTOM);
    keyboardWrapper.addView(keyboardView, keyboardParams);
    return keyboardWrapper;
}
 
开发者ID:parkingwang,项目名称:vehicle-keyboard-android,代码行数:12,代码来源:PopupHelper.java

示例12: onCreate

import android.widget.FrameLayout; //导入方法依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    FrameLayout content = new FrameLayout(this);
    content.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.MATCH_PARENT));
    content.setId(R.id.container);
    setContentView(content);
}
 
开发者ID:googlesamples,项目名称:android-architecture-components,代码行数:10,代码来源:SingleFragmentActivity.java

示例13: onCreate

import android.widget.FrameLayout; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle bundle) {
    super.onCreate(bundle);

    FrameLayout layout = new FrameLayout(this);
    layout.setId((int) (Math.random() * 1000000));
    setContentView(layout, new FrameLayout.LayoutParams(
            ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.MATCH_PARENT));

    Bundle args = getIntent().getExtras();
    String fragmentClassName = args.getString("fragment");

    try {
        Fragment fragment = (Fragment) Class.forName(fragmentClassName).newInstance();
        Bundle argument = args.getBundle("args");
        if (argument != null)
            fragment.setArguments(argument);

        final FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
        transaction.add(android.R.id.content, fragment, fragment.getClass().getName());
        transaction.commitAllowingStateLoss();
    }
    catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:fengdongfei,项目名称:CXJPadProject,代码行数:28,代码来源:CFCommonActivity.java

示例14: drawFirstRow

import android.widget.FrameLayout; //导入方法依赖的package包/类
/**
 * 绘制第一行
 */
@SuppressWarnings("ResourceType")
private void drawFirstRow() {
    headView = new FrameLayout(getContext());
    headView.setId(headViewID);
    RelativeLayout.LayoutParams rlp = new RelativeLayout.LayoutParams(android.view.ViewGroup.LayoutParams.MATCH_PARENT, firstRowHeight);
    headView.setLayoutParams(rlp);
    addView(headView);

    datesOfMonth = getDaysListForWeek(termStartDate, showWeekNum);

    drawFirstRowFirstColCell();
    drawFirstRowOtherColCell();
}
 
开发者ID:huangshuai-IOT,项目名称:SScheduleView-Android,代码行数:17,代码来源:SScheduleView.java

示例15: replaceLayout

import android.widget.FrameLayout; //导入方法依赖的package包/类
private boolean replaceLayout(View target) {
    if (getParent() != null || target == null || target.getParent() == null || _labelViewContainerID != -1) {
        return false;
    }

    ViewGroup parentContainer = (ViewGroup) target.getParent();

    if (target.getParent() instanceof FrameLayout) {
        ((FrameLayout) target.getParent()).addView(this);
    } else if (target.getParent() instanceof ViewGroup) {

        int groupIndex = parentContainer.indexOfChild(target);
        _labelViewContainerID = generateViewId();

        // relativeLayout need copy rule
        if (target.getParent() instanceof RelativeLayout) {
            for (int i = 0; i < parentContainer.getChildCount(); i++) {
                if (i == groupIndex) {
                    continue;
                }
                View view = parentContainer.getChildAt(i);
                RelativeLayout.LayoutParams para = (RelativeLayout.LayoutParams) view.getLayoutParams();
                for (int j = 0; j < para.getRules().length; j++) {
                    if (para.getRules()[j] == target.getId()) {
                        para.getRules()[j] = _labelViewContainerID;
                    }
                }
                view.setLayoutParams(para);
            }
        }
        parentContainer.removeView(target);

        // new dummy layout
        FrameLayout labelViewContainer = new FrameLayout(getContext());
        ViewGroup.LayoutParams targetLayoutParam = target.getLayoutParams();
        labelViewContainer.setLayoutParams(targetLayoutParam);
        target.setLayoutParams(new ViewGroup.LayoutParams(
                ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));

        // add target and label in dummy layout
        labelViewContainer.addView(target);
        labelViewContainer.addView(this);
        labelViewContainer.setId(_labelViewContainerID);

        // add dummy layout in parent container
        parentContainer.addView(labelViewContainer, groupIndex, targetLayoutParam);
    }
    return true;
}
 
开发者ID:open-android,项目名称:labelview,代码行数:50,代码来源:LabelView.java


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