Search in sources :

Example 11 with FrameLayout

use of android.widget.FrameLayout in project Android-PullToRefresh by chrisbanes.

the class PullToRefreshListView method handleStyledAttributes.

@Override
protected void handleStyledAttributes(TypedArray a) {
    super.handleStyledAttributes(a);
    mListViewExtrasEnabled = a.getBoolean(R.styleable.PullToRefresh_ptrListViewExtrasEnabled, true);
    if (mListViewExtrasEnabled) {
        final FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT, Gravity.CENTER_HORIZONTAL);
        // Create Loading Views ready for use later
        FrameLayout frame = new FrameLayout(getContext());
        mHeaderLoadingView = createLoadingLayout(getContext(), Mode.PULL_FROM_START, a);
        mHeaderLoadingView.setVisibility(View.GONE);
        frame.addView(mHeaderLoadingView, lp);
        mRefreshableView.addHeaderView(frame, null, false);
        mLvFooterLoadingFrame = new FrameLayout(getContext());
        mFooterLoadingView = createLoadingLayout(getContext(), Mode.PULL_FROM_END, a);
        mFooterLoadingView.setVisibility(View.GONE);
        mLvFooterLoadingFrame.addView(mFooterLoadingView, lp);
        /**
			 * If the value for Scrolling While Refreshing hasn't been
			 * explicitly set via XML, enable Scrolling While Refreshing.
			 */
        if (!a.hasValue(R.styleable.PullToRefresh_ptrScrollingWhileRefreshingEnabled)) {
            setScrollingWhileRefreshingEnabled(true);
        }
    }
}
Also used : FrameLayout(android.widget.FrameLayout)

Example 12 with FrameLayout

use of android.widget.FrameLayout in project Android-PullToRefresh by chrisbanes.

the class PullToRefreshAdapterViewBase method setEmptyView.

/**
	 * Sets the Empty View to be used by the Adapter View.
	 * <p/>
	 * We need it handle it ourselves so that we can Pull-to-Refresh when the
	 * Empty View is shown.
	 * <p/>
	 * Please note, you do <strong>not</strong> usually need to call this method
	 * yourself. Calling setEmptyView on the AdapterView will automatically call
	 * this method and set everything up. This includes when the Android
	 * Framework automatically sets the Empty View based on it's ID.
	 * 
	 * @param newEmptyView - Empty View to be used
	 */
public final void setEmptyView(View newEmptyView) {
    FrameLayout refreshableViewWrapper = getRefreshableViewWrapper();
    if (null != newEmptyView) {
        // New view needs to be clickable so that Android recognizes it as a
        // target for Touch Events
        newEmptyView.setClickable(true);
        ViewParent newEmptyViewParent = newEmptyView.getParent();
        if (null != newEmptyViewParent && newEmptyViewParent instanceof ViewGroup) {
            ((ViewGroup) newEmptyViewParent).removeView(newEmptyView);
        }
        // We need to convert any LayoutParams so that it works in our
        // FrameLayout
        FrameLayout.LayoutParams lp = convertEmptyViewLayoutParams(newEmptyView.getLayoutParams());
        if (null != lp) {
            refreshableViewWrapper.addView(newEmptyView, lp);
        } else {
            refreshableViewWrapper.addView(newEmptyView);
        }
    }
    if (mRefreshableView instanceof EmptyViewMethodAccessor) {
        ((EmptyViewMethodAccessor) mRefreshableView).setEmptyViewInternal(newEmptyView);
    } else {
        mRefreshableView.setEmptyView(newEmptyView);
    }
    mEmptyView = newEmptyView;
}
Also used : ViewParent(android.view.ViewParent) ViewGroup(android.view.ViewGroup) FrameLayout(android.widget.FrameLayout) EmptyViewMethodAccessor(com.handmark.pulltorefresh.library.internal.EmptyViewMethodAccessor)

Example 13 with FrameLayout

use of android.widget.FrameLayout in project DropDownMenu by dongjunkun.

the class DropDownMenu method setDropDownMenu.

/**
     * 初始化DropDownMenu
     *
     * @param tabTexts
     * @param popupViews
     * @param contentView
     */
public void setDropDownMenu(@NonNull List<String> tabTexts, @NonNull List<View> popupViews, @NonNull View contentView) {
    if (tabTexts.size() != popupViews.size()) {
        throw new IllegalArgumentException("params not match, tabTexts.size() should be equal popupViews.size()");
    }
    for (int i = 0; i < tabTexts.size(); i++) {
        addTab(tabTexts, i);
    }
    containerView.addView(contentView, 0);
    maskView = new View(getContext());
    maskView.setLayoutParams(new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT));
    maskView.setBackgroundColor(maskColor);
    maskView.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            closeMenu();
        }
    });
    containerView.addView(maskView, 1);
    maskView.setVisibility(GONE);
    popupMenuViews = new FrameLayout(getContext());
    popupMenuViews.setVisibility(GONE);
    containerView.addView(popupMenuViews, 2);
    for (int i = 0; i < popupViews.size(); i++) {
        popupViews.get(i).setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
        popupMenuViews.addView(popupViews.get(i), i);
    }
}
Also used : ViewGroup(android.view.ViewGroup) FrameLayout(android.widget.FrameLayout) TextView(android.widget.TextView) View(android.view.View)

Example 14 with FrameLayout

use of android.widget.FrameLayout in project TextureViewDemo by dalinaum.

the class CameraSurfaceTextureListener method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.content);
    ActionBar actionBar = getActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    final AdView adView = new AdView(this, AdSize.SMART_BANNER, "a1513f5a0d88abc");
    final FrameLayout adContainer = (FrameLayout) findViewById(R.id.adContainer);
    adContainer.addView(adView);
    AdRequest adRequest = new AdRequest();
    // adRequest.addTestDevice(AdRequest.TEST_EMULATOR);
    adView.loadAd(adRequest);
    mCameraSurfaceTextureListener = new CameraSurfaceTextureListener(this);
    mTextureView = (TextureView) findViewById(R.id.texture_view);
    mTextureView.setSurfaceTextureListener(mCameraSurfaceTextureListener);
}
Also used : AdRequest(com.google.ads.AdRequest) FrameLayout(android.widget.FrameLayout) AdView(com.google.ads.AdView) ActionBar(android.app.ActionBar)

Example 15 with FrameLayout

use of android.widget.FrameLayout in project glasquare by davidvavra.

the class QrScanActivity method onCreate.

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_scan_qr);
    this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    autoFocusHandler = new Handler();
    mCamera = getCameraInstance();
    /* Instance barcode scanner */
    scanner = new ImageScanner();
    scanner.setConfig(0, Config.X_DENSITY, 3);
    scanner.setConfig(0, Config.Y_DENSITY, 3);
    mPreview = new CameraPreview(this, mCamera, previewCb, autoFocusCB);
    FrameLayout preview = (FrameLayout) findViewById(R.id.cameraPreview);
    preview.addView(mPreview);
}
Also used : FrameLayout(android.widget.FrameLayout) ImageScanner(net.sourceforge.zbar.ImageScanner) Handler(android.os.Handler)

Aggregations

FrameLayout (android.widget.FrameLayout)619 View (android.view.View)238 TextView (android.widget.TextView)136 ViewGroup (android.view.ViewGroup)125 ImageView (android.widget.ImageView)93 LinearLayout (android.widget.LinearLayout)89 ListView (android.widget.ListView)54 AdapterView (android.widget.AdapterView)47 Button (android.widget.Button)44 LayoutInflater (android.view.LayoutInflater)42 Bitmap (android.graphics.Bitmap)40 LayoutParams (android.view.ViewGroup.LayoutParams)37 AbsListView (android.widget.AbsListView)37 Context (android.content.Context)34 Activity (android.app.Activity)25 Intent (android.content.Intent)25 TextureView (android.view.TextureView)25 ColorDrawable (android.graphics.drawable.ColorDrawable)23 FileOutputStream (java.io.FileOutputStream)23 Drawable (android.graphics.drawable.Drawable)20