Search in sources :

Example 81 with FrameLayout

use of android.widget.FrameLayout in project FastDev4Android by jiangqqlmj.

the class BaseQuickAdapter method createIndeterminateProgressView.

/**
     * 创建进度条 显示在view的结尾
     * @param convertView
     * @param parent
     * @return
     */
private View createIndeterminateProgressView(View convertView, ViewGroup parent) {
    if (convertView == null) {
        FrameLayout container = new FrameLayout(context);
        container.setForegroundGravity(Gravity.CENTER);
        ProgressBar progress = new ProgressBar(context);
        container.addView(progress);
        convertView = container;
    }
    return convertView;
}
Also used : FrameLayout(android.widget.FrameLayout) ProgressBar(android.widget.ProgressBar)

Example 82 with FrameLayout

use of android.widget.FrameLayout in project ToolBarLib by jjhesk.

the class CLayO method inflate.

@Override
public View inflate() {
    final View t = ToolbarHelper.generateView(layoutRes.getResourceId(), mContext);
    if (layoutRes == LayoutAsset.i_logo_ii) {
        ImageView k1 = (ImageView) t.findViewById(R.id.i_kl1);
        ImageView k2 = (ImageView) t.findViewById(R.id.i_kr1);
        ImageView k3 = (ImageView) t.findViewById(R.id.i_kr2);
        ImageView k4 = (ImageView) t.findViewById(R.id.logo_k);
        if (topBuilder.getCompanyLogoRes() != 0)
            k4.setImageResource(topBuilder.getCompanyLogoRes());
        final int[] overrides = topBuilder.getOverrideIcons_i_t_ii();
        if (overrides[0] != 0)
            k1.setImageResource(overrides[0]);
        if (overrides[1] != 0)
            k2.setImageResource(overrides[1]);
        if (overrides[2] != 0)
            k3.setImageResource(overrides[2]);
        k1.setOnClickListener(this);
        k2.setOnClickListener(this);
        k3.setOnClickListener(this);
    } else if (layoutRes == LayoutAsset.i_logo_ir) {
        ImageView k1 = (ImageView) t.findViewById(R.id.i_kl1);
        ImageView k2 = (ImageView) t.findViewById(R.id.i_kr2);
        FrameLayout dynamic_button_frame = (FrameLayout) t.findViewById(R.id.liveicon_counterpanel);
        ImageView k3 = (ImageView) t.findViewById(R.id.liveiconloc);
        ImageView k4 = (ImageView) t.findViewById(R.id.logo_k);
        if (topBuilder.getCompanyLogoRes() != 0)
            k4.setImageResource(topBuilder.getCompanyLogoRes());
        final int[] overrides = topBuilder.getOverrideIcons_i_t_ii();
        if (overrides[0] != 0)
            k1.setImageResource(overrides[0]);
        if (overrides[1] != 0)
            k2.setImageResource(overrides[1]);
        if (overrides[2] != 0)
            k3.setImageResource(overrides[2]);
        numberView = (TextView) t.findViewById(R.id.liveicon_text);
        k1.setOnClickListener(this);
        k2.setOnClickListener(this);
        dynamic_button_frame.setOnClickListener(this);
    }
    return t;
}
Also used : FrameLayout(android.widget.FrameLayout) TextView(android.widget.TextView) ImageView(android.widget.ImageView) TextView(android.widget.TextView) ImageView(android.widget.ImageView) View(android.view.View)

Example 83 with FrameLayout

use of android.widget.FrameLayout in project ToolBarLib by jjhesk.

the class LiveIcon method initView.

private View initView(final MenuItem item_menu) {
    //  View vm = ToolbarHelper.generateView(this.layout, n);
    item_menu.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
    View vm = item_menu.setActionView(this.layout).getActionView();
    holder = (TextView) vm.findViewById(R.id.liveicon_text);
    image_view = (ImageView) vm.findViewById(R.id.liveiconloc);
    if (this.icon != 0) {
        this.image_view.setImageResource(this.icon);
    }
    if (this.holder != null && holder_text != null) {
        holder.setText(holder_text);
    }
    FrameLayout frm = (FrameLayout) vm.findViewById(R.id.liveicon_counterpanel);
    frm.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            activity.onOptionsItemSelected(item_menu);
        }
    });
    item_menu.setVisible(true);
    return vm;
}
Also used : FrameLayout(android.widget.FrameLayout) TextView(android.widget.TextView) ImageView(android.widget.ImageView) View(android.view.View)

Example 84 with FrameLayout

use of android.widget.FrameLayout in project android-viewbadger by jgilfelt.

the class BadgeView method applyTo.

private void applyTo(View target) {
    LayoutParams lp = target.getLayoutParams();
    ViewParent parent = target.getParent();
    FrameLayout container = new FrameLayout(context);
    if (target instanceof TabWidget) {
        // set target to the relevant tab child container
        target = ((TabWidget) target).getChildTabViewAt(targetTabIndex);
        this.target = target;
        ((ViewGroup) target).addView(container, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
        this.setVisibility(View.GONE);
        container.addView(this);
    } else {
        // TODO verify that parent is indeed a ViewGroup
        ViewGroup group = (ViewGroup) parent;
        int index = group.indexOfChild(target);
        group.removeView(target);
        group.addView(container, index, lp);
        container.addView(target);
        this.setVisibility(View.GONE);
        container.addView(this);
        group.invalidate();
    }
}
Also used : LayoutParams(android.view.ViewGroup.LayoutParams) ViewParent(android.view.ViewParent) ViewGroup(android.view.ViewGroup) FrameLayout(android.widget.FrameLayout) TabWidget(android.widget.TabWidget)

Example 85 with FrameLayout

use of android.widget.FrameLayout in project SmartAndroidSource by jaychou2012.

the class PullToRefreshAdapterViewBase method addIndicatorViews.

private void addIndicatorViews() {
    Mode mode = getMode();
    FrameLayout refreshableViewWrapper = getRefreshableViewWrapper();
    if (mode.showHeaderLoadingLayout() && null == mIndicatorIvTop) {
        // If the mode can pull down, and we don't have one set already
        mIndicatorIvTop = new IndicatorLayout(getContext(), Mode.PULL_FROM_START);
        FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
        params.rightMargin = getResources().getDimensionPixelSize(getResources().getIdentifier("indicator_right_padding", "dimen", context.getPackageName()));
        // R.dimen.indicator_right_padding);
        params.gravity = Gravity.TOP | Gravity.RIGHT;
        refreshableViewWrapper.addView(mIndicatorIvTop, params);
    } else if (!mode.showHeaderLoadingLayout() && null != mIndicatorIvTop) {
        // If we can't pull down, but have a View then remove it
        refreshableViewWrapper.removeView(mIndicatorIvTop);
        mIndicatorIvTop = null;
    }
    if (mode.showFooterLoadingLayout() && null == mIndicatorIvBottom) {
        // If the mode can pull down, and we don't have one set already
        mIndicatorIvBottom = new IndicatorLayout(getContext(), Mode.PULL_FROM_END);
        FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
        params.rightMargin = getResources().getDimensionPixelSize(getResources().getIdentifier("indicator_right_padding", "dimen", context.getPackageName()));
        // R.dimen.indicator_right_padding);
        params.gravity = Gravity.BOTTOM | Gravity.RIGHT;
        refreshableViewWrapper.addView(mIndicatorIvBottom, params);
    } else if (!mode.showFooterLoadingLayout() && null != mIndicatorIvBottom) {
        // If we can't pull down, but have a View then remove it
        refreshableViewWrapper.removeView(mIndicatorIvBottom);
        mIndicatorIvBottom = null;
    }
}
Also used : IndicatorLayout(com.smartandroid.sa.pullto.internal.IndicatorLayout) FrameLayout(android.widget.FrameLayout)

Aggregations

FrameLayout (android.widget.FrameLayout)634 View (android.view.View)244 TextView (android.widget.TextView)143 ViewGroup (android.view.ViewGroup)128 ImageView (android.widget.ImageView)95 LinearLayout (android.widget.LinearLayout)89 ListView (android.widget.ListView)54 AdapterView (android.widget.AdapterView)49 Button (android.widget.Button)44 LayoutInflater (android.view.LayoutInflater)42 Bitmap (android.graphics.Bitmap)41 LayoutParams (android.view.ViewGroup.LayoutParams)37 AbsListView (android.widget.AbsListView)37 Context (android.content.Context)35 Intent (android.content.Intent)28 Activity (android.app.Activity)25 TextureView (android.view.TextureView)25 ColorDrawable (android.graphics.drawable.ColorDrawable)23 FileOutputStream (java.io.FileOutputStream)23 Drawable (android.graphics.drawable.Drawable)20