微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

android.widget.FrameLayout的实例源码

项目:ChromeLikeTabSwitcher    文件PhoneArithmetics.java   
@Override
public final void setPosition(@NonNull final Axis axis,@NonNull final AbstractItem item,final float position) {
    ensureNotNull(axis,"The axis may not be null");
    ensureNotNull(item,"The item may not be null");
    View view = item.getView();

    if (getorientationInvariantAxis(axis) == Axis.DRAGGING_AXIS) {
        Toolbar[] toolbars = getTabSwitcher().getToolbars();
        view.setY((getTabSwitcher().aretoolbaRSShown() && getTabSwitcher().isSwitcherShown() &&
                toolbars != null ?
                toolbars[TabSwitcher.PRIMARY_TOOLBAR_INDEX].getHeight() - tabInset : 0) +
                getTabSwitcherPadding(axis,Gravity.START) + position);
    } else {
        FrameLayout.LayoutParams layoutParams =
                (FrameLayout.LayoutParams) view.getLayoutParams();
        view.setX(position + layoutParams.leftMargin + getTabSwitcher().getPaddingLeft() / 2f -
                getTabSwitcher().getPaddingRight() / 2f -
                (getTabSwitcher().getLayout() == Layout.PHONE_LANDSCAPE &&
                        getTabSwitcher().isSwitcherShown() ?
                        stackedTabCount * stackedTabSpacing / 2f : 0));
    }
}
项目:SScheduleView-Android    文件SScheduleView.java   
/**
     * 绘制其他行其他列,即每个课程背景格子
     */
    private void drawOtherRowOtherCol(LinearLayout scrollContentView) {
        contentView = new FrameLayout(getContext());
        contentView.setClickable(true);

        LinearLayout.LayoutParams contentViewLP = new LinearLayout.LayoutParams(android.view.ViewGroup.LayoutParams.MATCH_PARENT,android.view.ViewGroup.LayoutParams.MATCH_PARENT);
        contentView.setLayoutParams(contentViewLP);
        scrollContentView.addView(contentView);

        for (int i = 0; i < showDaysNum * showJiesNum; i++) {
            final int row = i / showDaysNum;
            final int col = i % showDaysNum;
            // 课程背景格子
            View courseBackView=mAdapter.getCourseBackView();
//            FrameLayout courseBackView = new FrameLayout(getContext());
            FrameLayout.LayoutParams courseBackViewLP = new FrameLayout.LayoutParams(notFirstEveryColumnsWidth,notFirstEveryRowHeight);
//            courseBackView.setBackgroundResource(R.drawable.course_back);
            courseBackViewLP.setMargins(col * notFirstEveryColumnsWidth,row * notFirstEveryRowHeight,0);
            courseBackView.setLayoutParams(courseBackViewLP);
            contentView.addView(courseBackView);
        }
    }
项目:TestChat    文件DragLayout.java   
@Override
protected void onFinishInflate() {
        super.onFinishInflate();
        menu = (ViewGroup) getChildAt(0);
        View view = getChildAt(getChildCount() - 1);
        if (view instanceof ContentView) {
                content = (ContentView) view;
                LogUtil.e("range" + range);
                LogUtil.e("range1" + getWidth() * 0.8);
                content.setRange((int) (getWidth() * 0.8));
        }
        if (SHADOW) {
                ivShadow = new ImageView(getContext());
                LogUtil.e("这里执行了吗");
                FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT);
                ivShadow.setimageResource(R.drawable.shadow);
                addView(ivShadow,1,layoutParams);
        }
        menu.setClickable(true);
        content.setClickable(true);
}
项目:Coder    文件StateActivity.java   
/**
 * 加载中
 */
@DoMain
public void onLoadingState() {
    FrameLayout contains = (FrameLayout) findViewById(R.id.state_contains);
    contains.removeAllViews();
    View loading = View.inflate(this,R.layout.view_loading,null);
    contains.addView(loading);
    ImageView loading_img = (ImageView) loading.findViewById(R.id.loading_icon);
    RotateAnimation rotateAnimation = new RotateAnimation(0,360,Animation.RELATIVE_TO_SELF,0.5f,0.5f);
    rotateAnimation.setDuration(500);
    rotateAnimation.setRepeatMode(RotateAnimation.RESTART);
    rotateAnimation.setRepeatCount(-1);
    loading_img.setAnimation(rotateAnimation);
}
项目:MyRepository    文件PageIndicator.java   
public PageIndicator(Context context,AttributeSet attrs) {
    super(context,attrs);
    this.context = context;

    TypedArray a = context.obtainStyledAttributes(attrs,R.styleable.PageIndicator);
    normalIndicator = a.getResourceId(R.styleable.PageIndicator_normal_indicator,R.drawable.shape_point_white_alpha);
    selectedindicator = a.getResourceId(R.styleable.PageIndicator_selected_indicator,R.drawable.shape_point_black);
    a.recycle();

    FrameLayout.LayoutParams params = new FrameLayout.LayoutParams
            (LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
    llIndicators = new LinearLayout(context);
    llIndicators.setLayoutParams(params);
    llIndicators.setorientation(LinearLayout.HORIZONTAL);

    indicator = new ImageView(context);
    FrameLayout.LayoutParams params1 = new FrameLayout.LayoutParams
            (LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
    indicator.setLayoutParams(params1);
    indicator.setimageResource(selectedindicator);//认使用白色实心点

    this.addView(llIndicators);
    this.addView(indicator);


}
项目:andcoachmark    文件dismissOnTouchNoButtonRenderer.java   
@Override
public View render(final CoachmarkViewLayout layout) {

    if (inflated == null) {
        LayoutInflater inflater = (LayoutInflater) layout.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        inflated = inflater.inflate(R.layout.dismiss_no_button_view,null);
        layout.addView(inflated);
    }


    inflated.setonClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if (mListener == null || mListener.onClicked()) {
                layout.dismiss();
            }
        }
    });

    FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,FrameLayout.LayoutParams.MATCH_PARENT);
    inflated.setLayoutParams(params);
    inflated.setVisibility(View.VISIBLE);

    return inflated;

}
项目:weex-uikit    文件WXScroller.java   
@Override
protected MeasureOutput measure(int width,int height) {
  MeasureOutput measureOutput = new MeasureOutput();
  if (this.mOrientation == Constants.Orientation.HORIZONTAL) {
    int screenW = WXViewUtils.getScreenWidth(WXEnvironment.sApplication);
    int weexW = WXViewUtils.getWeexWidth(getInstanceId());
    measureOutput.width = width > (weexW >= screenW ? screenW : weexW) ? FrameLayout.LayoutParams.MATCH_PARENT
                                                                       : width;
    measureOutput.height = height;
  } else {
    int screenH = WXViewUtils.getScreenHeight(WXEnvironment.sApplication);
    int weexH = WXViewUtils.getWeexHeight(getInstanceId());
    measureOutput.height = height > (weexH >= screenH ? screenH : weexH) ? FrameLayout.LayoutParams.MATCH_PARENT
                                                                         : height;
    measureOutput.width = width;
  }
  return measureOutput;
}
项目:mobile-store    文件CategoryController.java   
CategoryController(final Activity activity,LoaderManager loaderManager,View itemView) {
    super(itemView);

    this.activity = activity;
    this.loaderManager = loaderManager;

    appCardsAdapter = new AppPreviewAdapter(activity);

    viewAll = (Button) itemView.findViewById(R.id.button);
    viewAll.setonClickListener(onViewAll);

    heading = (TextView) itemView.findViewById(R.id.name);
    image = (FeatureImage) itemView.findViewById(R.id.category_image);
    background = (FrameLayout) itemView.findViewById(R.id.category_background);

    RecyclerView appCards = (RecyclerView) itemView.findViewById(R.id.app_cards);
    appCards.setAdapter(appCardsAdapter);
    appCards.addItemdecoration(new ItemDecorator(activity));

    displayImageOptions = new displayImageOptions.Builder()
            .cacheInMemory(true)
            .imageScaleType(ImageScaleType.NONE)
            .displayer(new FadeInBitmapdisplayer(100,true,false))
            .bitmapConfig(Bitmap.Config.RGB_565)
            .build();
}
项目:OSchina_resources_android    文件EventViewPagerFragment.java   
@Override
protected void onSetupTabAdapter(ViewPageFragmentAdapter adapter) {

    FrameLayout generalActionBar = (FrameLayout) mRoot.findViewById(R.id.general_actionbar);
    generalActionBar.setVisibility(View.GONE);

    String[] title = getResources().getStringArray(R.array.events);
    if (position == 0) {
        adapter.addTab(title[0],"new_event",EventFragment.class,getBundle(EventList.EVENT_LIST_TYPE_NEW_EVENT));
        adapter.addTab(title[1],"my_event",getBundle(EventList.EVENT_LIST_TYPE_MY_EVENT));
        mTabStrip.setVisibility(View.VISIBLE);
    } else {
        adapter.addTab(title[1],getBundle(EventList.EVENT_LIST_TYPE_MY_EVENT));
        mTabStrip.setVisibility(View.GONE);
    }
    mViewPager.setCurrentItem(position,true);
}
项目:YCCardView    文件CardViewLayout.java   
/**
 * 数据更新通知
 */
public void notifyDataSetChanged() {
    int num = getChildCount();
    for (int i = 0; i < num; i++) {
        FrameLayout frameLayout = (FrameLayout) getChildAt(i);
        int tag = Integer.parseInt(frameLayout.getTag().toString());
        if (tag > 0 && tag < adapter.getItemCount()) {
            frameLayout.setVisibility(View.VISIBLE);
            adapter.bindView(frameLayout.getChildAt(0),tag);
        } else {
            frameLayout.setVisibility(View.INVISIBLE);
        }

        if (i == 3 && tag == 0) {
            adapter.displaying(0);
        }
    }
}
项目:Coder    文件ImmersionBar.java   
/**
 * 设置一个可以自定义颜色的状态栏
 */
private void setupStatusBarView() {
    if (mBarParams.statusBarView == null) {
        mBarParams.statusBarView = new View(mActivity);
    }
    FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,getStatusBarHeight(mActivity));
    params.gravity = Gravity.TOP;
    if (!isNavigationAtBottom(mActivity)) {
        params.rightMargin = getNavigationBarWidth(mActivity);
    }
    mBarParams.statusBarView.setLayoutParams(params);
    mBarParams.statusBarView.setBackgroundColor(ColorUtils.blendARGB(mBarParams.statusBarColor,mBarParams.statusBarColorTransform,mBarParams.statusBaralpha));
    mBarParams.statusBarView.setVisibility(View.VISIBLE);
    ViewGroup viewGroup = (ViewGroup) mBarParams.statusBarView.getParent();
    if (viewGroup != null)
        viewGroup.removeView(mBarParams.statusBarView);
    mViewGroup.addView(mBarParams.statusBarView);
}
项目:revolution-irc    文件RecyclerViewScrollbar.java   
public RecyclerViewScrollbar(Context context,@Nullable AttributeSet attrs,int defStyleAttr) {
    super(context,attrs,defStyleAttr);

    TypedArray ta = context.getTheme().obtainStyledAttributes(attrs,R.styleable.RecyclerViewScrollbar,defStyleAttr,0);
    mRecyclerViewId = ta.getResourceId(R.styleable.RecyclerViewScrollbar_recyclerView,0);
    mScrollbarDrawable = ta.getDrawable(R.styleable.RecyclerViewScrollbar_scrollbarDrawable);
    mLetterDrawable = ta.getDrawable(R.styleable.RecyclerViewScrollbar_letterDrawable);
    int letterTextResId = ta.getResourceId(R.styleable.RecyclerViewScrollbar_letterTextAppearance,0);
    mMinScrollbarHeight = ta.getDimensionPixelOffset(R.styleable.RecyclerViewScrollbar_minScrollbarHeight,0);
    ta.recycle();

    mLetterView = new TextView(getContext());
    mLetterView.setBackgroundDrawable(mLetterDrawable);
    TextViewCompat.setTextAppearance(mLetterView,letterTextResId);
    FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
            ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT);
    params.gravity = GravityCompat.END;
    mLetterView.setLayoutParams(params);
    mLetterView.setGravity(Gravity.CENTER);
}
项目:IslamicLibraryAndroid    文件DownloadProgressActivity.java   
void showAlternativeView(int viewType) {
    FrameLayout recyclerFrame = findViewById(R.id.recycler_frame);
    recyclerFrame.setVisibility(View.GONE);
    mShowCancelAll = false;

    switch (viewType) {
        case ZERO_DOWNLOAD_TYPE:
            ViewStub zeroView = findViewById(R.id.zero_downloads);
            zeroView.setVisibility(View.VISIBLE);
            break;
        case FINISHED_DOWNLOAD_TYPE:
            ViewStub finishedView = findViewById(R.id.finished_downloads);
            finishedView.setVisibility(View.VISIBLE);


            break;
        case CANCELLED_DOWNLOAD_TYPE:
            ViewStub cancelledView = findViewById(R.id.cancelled_downloads);
            cancelledView.setVisibility(View.VISIBLE);
            break;

    }
    new Handler().postDelayed(this::finish,10000);
}
项目:localcloud_fe    文件CordovaActivity.java   
@SuppressWarnings({"deprecation","ResourceType"})
protected void createViews() {
    //Why are we setting a constant as the ID? This should be investigated
    appView.getView().setId(100);
    appView.getView().setLayoutParams(new FrameLayout.LayoutParams(
            ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT));

    setContentView(appView.getView());

    if (preferences.contains("BackgroundColor")) {
        try {
            int backgroundColor = preferences.getInteger("BackgroundColor",Color.BLACK);
            // Background of activity:
            appView.getView().setBackgroundColor(backgroundColor);
        }
        catch (NumberFormatException e){
            e.printstacktrace();
        }
    }

    appView.getView().requestFocusFromTouch();
}
项目:show-case-card-view    文件ShowCaseView.java   
private void configureCard(ViewGroup card) {
    cardContent.setMaxWidth(getCardWidth());
    cardContent.setPadding(
            CARD_PADDING_VERTICAL,CARD_PADDING_HORIZONTAL,CARD_PADDING_VERTICAL,CARD_PADDING_HORIZONTAL
    );
    cardContent.setLayoutParams(new FrameLayout.LayoutParams(
            LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT
    ));

    card.setBackgroundResource(getCardBackgroundDrawable());
    card.addView(cardContent);

    FrameLayout.LayoutParams cardlayoutParams = generateDefaultLayoutParams();
    cardlayoutParams.width = LayoutParams.WRAP_CONTENT;
    cardlayoutParams.height = LayoutParams.WRAP_CONTENT;
    cardlayoutParams.gravity = getCardGravity();
    cardlayoutParams.leftMargin = getCardMarginLeft();
    cardlayoutParams.topMargin = getCardMarginTop();
    cardlayoutParams.rightMargin = getCardMarginRight();
    cardlayoutParams.bottomMargin = getCardMarginBottom();
    card.setLayoutParams(cardlayoutParams);
}
项目:prebid-mobile-android    文件MoPubBannerFragment.java   
private void setupBannerWithWait(final int waitTime) {
    FrameLayout adFrame = (FrameLayout) root.findViewById(R.id.adFrame2);
    adFrame.removeAllViews();
    adView2 = new MoPubView(this.getActivity());
    adView2.setAdUnitId(Constants.MOPUB_BANNER_ADUNIT_ID_300x250);
    adView2.setBannerAdListener(this);
    adView2.setAutorefreshEnabled(true);
    adView2.setMinimumWidth(300);
    adView2.setMinimumHeight(250);
    FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT);
    lp.gravity = Gravity.CENTER;
    adView2.setLayoutParams(lp);
    adFrame.addView(adView2);
    //region Prebid API usage
    Prebid.attachBidsWhenReady(adView2,Constants.BANNER_300x250,this,waitTime,this.getActivity());
    //endregion

}
项目:Krgallery    文件BaseDialog.java   
private void initView() {
    Window window = getwindow();
    window.setGravity(Gravity.CENTER); // 此处可以设置dialog显示的位置为居中
    window.setwindowAnimations(R.style.bottom_menu_animation); // 添加动画效果
    View child = getLayoutInflater().inflate(R.layout.layout_dialog_base,null,false);
    setContentView(child);
    mContainer = (FrameLayout) findViewById(R.id.fl_container);
    mBtnPanel = (FrameLayout) findViewById(R.id.fl_btn_panel);
    closeIV = (ImageView) findViewById(R.id.iv_close);
    closeIV.setonClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            dismiss();
        }
    });
    Window dialogWindow = getwindow();
    WindowManager.LayoutParams lp = dialogWindow.getAttributes();
    displayMetrics d = mContext.getResources().getdisplayMetrics(); // 获取屏幕宽、高用
    lp.width = (int) (d.widthPixels * 0.8); // 宽度设置为屏幕的0.9
    dialogWindow.setAttributes(lp);
    setIsCancelable(true);

    setondismissListener(this);
}
项目:encdroidMC    文件EDFileChooserActivity.java   
protected void onPostExecute(Boolean result) {
    super.onPostExecute(result);

    // Restore the layout parameters
    mLayout.setLayoutParams(new FrameLayout.LayoutParams(
            LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
    mLayout.setGravity(Gravity.TOP);

    // Remove the progress bar and replace it with the list view
    mLayout.removeView(mProgBar);
    mLayout.addView(mListView);

    if (result == true) {
        if (mPrefs.getBoolean("auto_import",true)) {
            showDialog(DIALOG_AUTO_IMPORT);
        }
    }
}
项目:MyWidgetSample    文件ViewAttachment.java   
private void attachTo(View view) {
    ViewParent viewParent = view.getParent();
    ViewGroup parent = (ViewGroup) viewParent;
    int index = parent.indexOfChild(view);
    parent.removeView(view);
    attachmentRoot = new FrameLayout(view.getContext());
    attachmentRoot.setLayoutParams(view.getLayoutParams());
    view.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT));
    attachmentRoot.addView(view);
    if (child != null) {
        attachmentRoot.addView(child);
    }
    parent.addView(attachmentRoot,index);
}
项目:YcslideView    文件FirstActivity.java   
private void initViewId() {
    ll_title_menu = (FrameLayout) findViewById(R.id.ll_title_menu);
    toolbar_title = (TextView) findViewById(R.id.toolbar_title);
    tv_title_right = (TextView) findViewById(R.id.tv_title_right);
    toolbar = (Toolbar) findViewById(R.id.toolbar);
    recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
}
项目:Hotspot-master-devp    文件CustomAlertPPtDialog.java   
public CustomAlertPPtDialog builder() {
    view = LayoutInflater.from(context).inflate(R.layout.view_alertdialog,null);

    lLayout_bg = (LinearLayout) view.findViewById(R.id.layout_bg);
    txt_title = (TextView) view.findViewById(R.id.txt_title);
    txt_title.setVisibility(View.GONE);
    txt_msg = (TextView) view.findViewById(R.id.txt_msg);
    txt_msg.setVisibility(View.GONE);
    et_input = (EditText) view.findViewById(R.id.et_input);
    et_input.setVisibility(View.GONE);
    btn_neg = (Button) view.findViewById(R.id.btn_neg);
    btn_neg.setVisibility(View.GONE);
    btn_pos = (Button) view.findViewById(R.id.btn_pos);
    btn_pos.setVisibility(View.GONE);
    btn_mid = (Button) view.findViewById(R.id.btn_mid);
    btn_mid.setVisibility(View.GONE);
    line1 = (ImageView) view.findViewById(R.id.line1);
    line1.setVisibility(View.GONE);
    line2 = (ImageView) view.findViewById(R.id.line2);
    line2.setVisibility(View.GONE);

    dialog = new Dialog(context,R.style.AlertDialogStyle);
    dialog.setContentView(view);

    lLayout_bg.setLayoutParams(new FrameLayout.LayoutParams((int) (
            display.getWidth() * 0.85),LayoutParams.WRAP_CONTENT));

    return this;
}
项目:MyFire    文件WrapperAdapter.java   
public WrapperAdapter(RecyclerView.Adapter adapter,RefreshHeaderLayout refreshHeaderContainer,LinearLayout headerContainer,LinearLayout footerContainer,FrameLayout loadMoreFooterContainer) {
    this.mAdapter = adapter;
    this.mRefreshHeaderContainer = refreshHeaderContainer;
    this.mHeaderContainer = headerContainer;
    this.mFooterContainer = footerContainer;
    this.mloadMoreFooterContainer = loadMoreFooterContainer;
    mAdapter.registeradapterDataObserver(mObserver);
}
项目:OSchina_resources_android    文件CommonDialog.java   
public void setItems(CharSequence[] items,int index,AdapterView.OnItemClickListener onItemClickListener) {
    ListView listview = new ListView(content.getContext());
    listview.setCacheColorHint(0);
    listview.setDivider(null);
    listview.setLayoutParams(new FrameLayout.LayoutParams(
            LayoutParams.MATCH_PARENT,LayoutParams.WRAP_CONTENT));
    listview.setAdapter(new DialogAdapter(items,index));
    listview.setonItemClickListener(onItemClickListener);
    setContent(listview,0);
}
项目:sctalk    文件PullToRefreshBase.java   
private void addRefreshableView(Context context,T refreshableView) {
    mRefreshableViewWrapper = new FrameLayout(context);
    mRefreshableViewWrapper.addView(refreshableView,ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT);

    addViewInternal(mRefreshableViewWrapper,new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT));
}
项目:OpenLive-Android    文件VideoViewAdapter.java   
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder,int position) {
    VideoUserStatusHolder myHolder = ((VideoUserStatusHolder) holder);

    final VideoStatusData user = mUsers.get(position);

    Log.d("VideoViewAdapter","onBindViewHolder " + position + " " + user + " " + myHolder + " " + myHolder.itemView);

    log.debug("onBindViewHolder " + position + " " + user + " " + myHolder + " " + myHolder.itemView);

    FrameLayout holderView = (FrameLayout) myHolder.itemView;

    if (holderView.getChildCount() == 0) {
        SurfaceView target = user.mView;
        stripSurfaceView(target);
        holderView.addView(target,new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT));
    }

    holderView.setonTouchListener(new OnDoubleTapListener(mContext) {
        @Override
        public void onDoubleTap(View view,MotionEvent e) {
            if (mListener != null) {
                mListener.onItemDoubleClick(view,user);
            }
        }

        @Override
        public void onSingleTapUp() {
        }
    });

}
项目:pagopa-android-example    文件MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    MainFragment fragment = new MainFragment();
    FrameLayout flFrameContainer = findViewById(R.id.fl_fragment_container);
    FragmentManager fm = getSupportFragmentManager();
    FragmentTransaction ft = fm.beginTransaction();

    ft.replace(flFrameContainer.getId(),fragment,"main");
    ft.commit();

    PagoPaCore.init();
}
项目:leanback-extensions    文件LoadingFragment.java   
@Override
public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_loading,container,false);

    FrameLayout loadingContainer = (FrameLayout) view.findViewById(R.id.fragment_loading_container);
    loadingContainer.setBackgroundColor(backgroundColor);

    progressBar = new ProgressBar(container.getContext());
    if (container instanceof FrameLayout) {
        FrameLayout.LayoutParams layoutParams =
                new FrameLayout.LayoutParams(progressWidth,progressHeight,Gravity.CENTER);
        progressBar.setLayoutParams(layoutParams);
    }

    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
        if (progressBar.getIndeterminateDrawable() != null) {
            progressBar.getIndeterminateDrawable().setColorFilter(getResources().getColor(progressColor),PorterDuff.Mode.SRC_IN);
        }
    } else {
        ColorStateList stateList = ColorStateList.valueOf(progressColor);
        progressBar.setIndeterminateTintMode(PorterDuff.Mode.SRC_IN);
        progressBar.setIndeterminateTintList(stateList);
        progressBar.setProgressBackgroundTintMode(PorterDuff.Mode.SRC_IN);
        progressBar.setProgressBackgroundTintList(stateList);
        progressBar.setIndeterminate(true);
    }

    loadingContainer.addView(progressBar);

    return view;
}
项目:youkes_browser    文件browserActivity.java   
@Override
public void onShowCustomView(View view,int requestedOrientation,CustomViewCallback callback) {
    if (view == null) {
        return;
    }
    if (mCustomView != null && callback != null) {
        callback.onCustomViewHidden();
        return;
    }
    try {
        view.setKeepScreenOn(true);
    } catch (SecurityException e) {
        Log.e(Constants.TAG,"WebView is not allowed to keep the screen on");
    }
    mOriginalOrientation = getRequestedOrientation();
    FrameLayout decor = (FrameLayout) getwindow().getDecorView();
    mFullscreenContainer = new FullscreenHolder(this);
    mCustomView = view;
    mFullscreenContainer.addView(mCustomView,COVER_SCREEN_ParaMS);
    decor.addView(mFullscreenContainer,COVER_SCREEN_ParaMS);
    setFullscreen(true);
    getCurrentWebView().setVisibility(View.GONE);
    if (view instanceof FrameLayout) {
        if (((FrameLayout) view).getFocusedChild() instanceof VideoView) {
            mVideoView = (VideoView) ((FrameLayout) view).getFocusedChild();
            mVideoView.setonErrorListener(new VideoCompletionListener());
            mVideoView.setonCompletionListener(new VideoCompletionListener());
        }
    }
    mCustomViewCallback = callback;
}
项目:trascendentAR    文件ARLauncher.java   
@Override
protected void onResume() {
    super.onResume();
    //Crea la view de la camara
    preview = new CaptureCameraPreview(this,this);

    FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.MATCH_PARENT);
    //Añade las views al layout
    mainLayout.addView(gameView,layoutParams);
    mainLayout.addView(preview,layoutParams);

}
项目:TextReader    文件RecyclerArrayAdapter.java   
public View setMore(final int res,final OnLoadMoreListener listener) {
    FrameLayout container = new FrameLayout(getContext());
    container.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT));
    LayoutInflater.from(getContext()).inflate(res,container);
    getEventDelegate().setMore(container,listener);
    return container;
}
项目:PlusGram    文件ChatAttachAlert.java   
@TargetApi(16)
public void showCamera() {
    if (cameraview == null) {
        cameraview = new Cameraview(baseFragment.getParentActivity());
        container.addView(cameraview,LayoutHelper.createFrame(80,80));
        cameraview.setDelegate(new Cameraview.CameraviewDelegate() {
            @Override
            public void onCameraInit() {
                int count = attachPhotoRecyclerView.getChildCount();
                for (int a = 0; a < count; a++) {
                    View child = attachPhotoRecyclerView.getChildAt(a);
                    if (child instanceof PhotoAttachCameraCell) {
                        child.setVisibility(View.INVISIBLE);
                        break;
                    }
                }

                String current = cameraview.getCameraSession().getCurrentFlashMode();
                String next = cameraview.getCameraSession().getNextFlashMode();
                if (current.equals(next)) {
                    for (int a = 0; a < 2; a++) {
                        flashModeButton[a].setVisibility(View.INVISIBLE);
                        flashModeButton[a].setAlpha(0.0f);
                        flashModeButton[a].setTranslationY(0.0f);
                    }
                } else {
                    setCameraFlashModeIcon(flashModeButton[0],cameraview.getCameraSession().getCurrentFlashMode());
                    for (int a = 0; a < 2; a++) {
                        flashModeButton[a].setVisibility(a == 0 ? View.VISIBLE : View.INVISIBLE);
                        flashModeButton[a].setAlpha(a == 0 && cameraOpened ? 1.0f : 0.0f);
                        flashModeButton[a].setTranslationY(0.0f);
                    }
                }
                switchCameraButton.setimageResource(cameraview.isFrontface() ? R.drawable.camera_revert1 : R.drawable.camera_revert2);
                switchCameraButton.setVisibility(cameraview.hasFrontFaceCamera() ? View.VISIBLE : View.INVISIBLE);
            }
        });

        cameraIcon = new FrameLayout(baseFragment.getParentActivity());
        container.addView(cameraIcon,2,80));

        ImageView cameraimageView = new ImageView(baseFragment.getParentActivity());
        cameraimageView.setScaleType(ImageView.ScaleType.CENTER);
        cameraimageView.setimageResource(R.drawable.instant_camera);
        cameraIcon.addView(cameraimageView,80,Gravity.RIGHT | Gravity.BottOM));
    }
    cameraview.setTranslationX(cameraviewLocation[0]);
    cameraview.setTranslationY(cameraviewLocation[1]);
    cameraIcon.setTranslationX(cameraviewLocation[0]);
    cameraIcon.setTranslationY(cameraviewLocation[1]);
}
项目:CipherSharedPrefs    文件MainActivity.java   
@Override
public void onInitialized(MainPresenter presenter,MainViewState viewState) {
    if (!presenter.isInitialized()) {
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setTitle(R.string.enter_key);
        builder.setMessage(R.string.key_requirments_message);

        EditText editText = new EditText(this);
        editText.setFilters(new InputFilter[]{new InputFilter.LengthFilter(16)});
        builder.setView(editText);

        builder.setPositiveButton(R.string.apply,null);

        AlertDialog dialog = builder.create();
        dialog.setCancelable(false);
        dialog.setCanceledOnTouchOutside(false);
        dialog.show();

        dialog.getButton(DialogInterface.BUTTON_POSITIVE).setonClickListener(v -> {
            if (editText.getText().length() == 16) {
                String key = editText.getText().toString();
                presenter.initializeWithKey(key);
                presenter.getValues();
                dialog.dismiss();
            } else {
                Toast.makeText(this,R.string.bad_key,Toast.LENGTH_LONG).show();
            }
        });

        FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) editText.getLayoutParams();
        int margin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,16f,getResources().getdisplayMetrics());
        layoutParams.setMargins(margin,margin,margin);
        editText.requestLayout();
    } else {
        if (!viewState.isPrefsLoaded() && !presenter.isTaskRunning(MainPresenter.TASK_GET_RUNNING)) {
            presenter.getValues();
        }
    }
}
项目:leoapp-sources    文件NumberPickerPreference.java   
@Override
protected View onCreateDialogView() {
    FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(
            ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT);
    layoutParams.gravity = Gravity.CENTER;
    picker = new NumberPicker(getContext());
    picker.setLayoutParams(layoutParams);
    FrameLayout dialogView = new FrameLayout(getContext());
    dialogView.addView(picker);
    return dialogView;
}
项目:KokoWalk    文件Charaview.java   
public void create(float winX,float winY,FrameLayout field,ArrayList<Charaview> charaviews,Charaview chara,int walkSec) {
    try {
        if (charaviews.size() >= MAX_CHara) {
            //Toast.makeText(field.getContext(),"同時に呼び出せるのは"+ MAX_CHara +"人までです",Toast.LENGTH_SHORT).show();
            field.removeView(charaviews.get(0));
            charaviews.remove(0);
            return;
        }
        mWindowSizeX = winX;
        mWindowSizeY = winY;
        charaviews.add(chara);
        Charaview c = charaviews.get(charaviews.size() - 1);
        field.addView(c);
        int r = (int) (Math.random() * 3);
        switch (r) {
            case 0:
            case 1:
            case 2:
                c.randomAnimation(MainActivity.walkSec);
                break;
        }
        PropertyValuesHolder holderX = PropertyValuesHolder.ofFloat("translationX",0);
        PropertyValuesHolder holderY = PropertyValuesHolder.ofFloat("translationY",winY * 0.7f);
        PropertyValuesHolder holderRotaion = PropertyValuesHolder.ofFloat("rotation",0);
        c.setXY(0,winY * 0.7f);

        // targetに対してholderX,holderY,holderRotationを同時に実行させます
        ObjectAnimator objectAnimator = ObjectAnimator.ofPropertyValuesHolder(c,holderX,holderRotaion);
        objectAnimator.setDuration(MainActivity.walkSec);
        objectAnimator.start();
        //button.setText("納沙幸子 * " + charaviews.size());
    } catch (OutOfMemoryError e){
        Toast.makeText(field.getContext(),"メモリがいっぱいです : " + charaviews.size() + "人",Toast.LENGTH_SHORT).show();
    }
}
项目:qmui    文件QDLoopViewPagerFragment.java   
public ItemView(Context context) {
    super(context);
    mTextView = new TextView(context);
    mTextView.setTextSize(20);
    mTextView.setTextColor(ContextCompat.getColor(context,R.color.app_color_theme_5));
    mTextView.setGravity(Gravity.CENTER);
    mTextView.setBackgroundColor(ContextCompat.getColor(context,R.color.qmui_config_color_white));
    int size = QMUIdisplayHelper.dp2px(context,300);
    FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(size,size);
    lp.gravity = Gravity.CENTER;
    addView(mTextView,lp);
}
项目:MyEyepetizer    文件EndAreaBinder.java   
public ViewHolder(View itemView) {
    super(itemView);
    text = (TextView) itemView.findViewById(R.id.end_text);
    background = (FrameLayout) itemView.findViewById(R.id.end_layout);
    if (mFlag == FLAG_TEXT_COLOR_BLACK) {
        text.setTextColor(ContextCompat.getColor(text.getContext(),R.color.colorBlack));
        background.setBackgroundColor(ContextCompat.getColor(background.getContext(),R.color.colorWhite));
    }
}
项目:PlusGram    文件ScrollSlidingTabStrip.java   
public TextView addIconTabWithCounter(int resId) {
    final int position = tabCount++;
    FrameLayout tab = new FrameLayout(getContext());
    tab.setFocusable(true);
    tabsContainer.addView(tab);

    ImageView imageView = new ImageView(getContext());
    imageView.setimageResource(resId);
    imageView.setScaleType(ImageView.ScaleType.CENTER);
    tab.setonClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            delegate.onPageSelected(position);
        }
    });
    tab.addView(imageView,LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT,LayoutHelper.MATCH_PARENT));

    tab.setSelected(position == currentPosition);

    TextView textView = new TextView(getContext());
    textView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
    textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP,12);
    textView.setTextColor(0xffffffff);
    textView.setGravity(Gravity.CENTER);
    textView.setBackgroundResource(R.drawable.sticker_badge);
    textView.setMinWidth(AndroidUtilities.dp(18));
    textView.setPadding(AndroidUtilities.dp(5),AndroidUtilities.dp(5),AndroidUtilities.dp(1));
    tab.addView(textView,LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT,18,Gravity.TOP | Gravity.LEFT,26,6,0));

    return textView;
}
项目:LaunchEnr    文件FolderIcon.java   
public static FolderIcon fromXml(int resId,Launcher launcher,ViewGroup group,FolderInfo folderInfo) {
    @SuppressWarnings("all") // suppress dead code warning
    final boolean error = INITIAL_ITEM_ANIMATION_DURATION >= DROP_IN_ANIMATION_DURATION;
    if (error) {
        throw new IllegalStateException("DROP_IN_ANIMATION_DURATION must be greater than " +
                "INITIAL_ITEM_ANIMATION_DURATION,as sequencing of adding first two items " +
                "is dependent on this");
    }

    DeviceProfile grid = launcher.getDeviceProfile();
    FolderIcon icon = (FolderIcon) LayoutInflater.from(launcher).inflate(resId,group,false);

    icon.setClipToPadding(false);
    icon.mFolderName = (BubbleTextView) icon.findViewById(R.id.folder_icon_name);
    icon.mFolderName.setText(folderInfo.title);
    icon.mFolderName.setCompoundDrawablePadding(0);
    FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) icon.mFolderName.getLayoutParams();
    lp.topMargin = grid.iconSizePx + grid.iconDrawablePaddingPx;

    icon.setTag(folderInfo);
    icon.setonClickListener(launcher);
    icon.mInfo = folderInfo;
    icon.mLauncher = launcher;
    icon.mBadgeRenderer = launcher.getDeviceProfile().mBadgeRenderer;
    icon.setContentDescription(launcher.getString(R.string.folder_name_format,folderInfo.title));
    Folder folder = Folder.fromXml(launcher);
    folder.setDragController(launcher.getDragController());
    folder.setFolderIcon(icon);
    folder.bind(folderInfo);
    icon.setFolder(folder);
    icon.setAccessibilityDelegate(launcher.getAccessibilityDelegate());

    folderInfo.addListener(icon);

    icon.setonFocuschangelistener(launcher.mFocusHandler);
    return icon;
}
项目:MVPtemplate    文件WrapperAdapter.java   
public WrapperAdapter(RecyclerView.Adapter adapter,FrameLayout loadMoreFooterContainer) {
    this.mAdapter = adapter;
    this.mRefreshHeaderContainer = refreshHeaderContainer;
    this.mHeaderContainer = headerContainer;
    this.mFooterContainer = footerContainer;
    this.mloadMoreFooterContainer = loadMoreFooterContainer;
    mAdapter.registeradapterDataObserver(mObserver);
}
项目:ShaddockVideoPlayer    文件EyesKitKat.java   
private static void removeMarginTopOfContentChild(View mContentChild,int statusBarHeight) {
    if (mContentChild == null) {
        return;
    }
    if (TAG_MARGIN_ADDED.equals(mContentChild.getTag())) {
        FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) mContentChild.getLayoutParams();
        lp.topMargin -= statusBarHeight;
        mContentChild.setLayoutParams(lp);
        mContentChild.setTag(null);
    }
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。