List of usage examples for android.widget FrameLayout FrameLayout
public FrameLayout(@NonNull Context context)
From source file:com.arta.lib.demo.widget.pagerslidingtabstrip.SuperAwesomeCardFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); FrameLayout fl = new FrameLayout(getActivity()); fl.setLayoutParams(params);//from www.j av a 2 s. co m final int margin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 8, getResources().getDisplayMetrics()); TextView v = new TextView(getActivity()); params.setMargins(margin, margin, margin, margin); v.setLayoutParams(params); v.setLayoutParams(params); v.setGravity(Gravity.CENTER); v.setBackgroundResource(R.drawable.pagerslidingtabstrip_background_card); v.setText("CARD " + (position + 1)); fl.addView(v); return fl; }
From source file:com.commnsense.proximity.fragments.SuperAwesomeCardFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); FrameLayout fl = new FrameLayout(getActivity()); fl.setLayoutParams(params);// w w w . j av a 2 s . c o m fl.setBackgroundColor(0xffa9a9a9); final int margin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 8, getResources().getDisplayMetrics()); TextView v = new TextView(getActivity()); params.setMargins(margin, margin, margin, margin); v.setLayoutParams(params); v.setLayoutParams(params); v.setGravity(Gravity.CENTER); v.setBackgroundResource(R.drawable.background_card); v.setText("CARD " + (position + 1)); fl.addView(v); return fl; }
From source file:com.duguang.baseanimation.ui.tab.PagerTabStrip.SuperAwesomeCardFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); FrameLayout fl = new FrameLayout(getActivity()); fl.setLayoutParams(params);/*from w w w .ja v a2 s. c om*/ final int margin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 8, getResources().getDisplayMetrics()); TextView v = new TextView(getActivity()); params.setMargins(margin, margin, margin, margin); v.setLayoutParams(params); v.setLayoutParams(params); v.setGravity(Gravity.CENTER); v.setBackgroundResource(R.drawable.tab_pagertab_background_card); v.setText("CARD " + (position + 1)); fl.addView(v); return fl; }
From source file:com.visk.xperiatuner.cpucontrol.CpuControlFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); FrameLayout fl = new FrameLayout(getActivity()); fl.setLayoutParams(params);/*from w w w.j a v a 2 s .co m*/ final int margin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 8, getResources().getDisplayMetrics()); TextView v = new TextView(getActivity()); params.setMargins(margin, margin, margin, margin); v.setLayoutParams(params); v.setLayoutParams(params); v.setGravity(Gravity.CENTER); v.setBackgroundResource(R.drawable.background_card); // v.setText("CARD " + (position + 1)); v.setText("CARD "); fl.addView(v); return fl; }
From source file:com.marshalchen.common.demoofui.viewpagerSlidingTab.SuperAwesomeCardFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); FrameLayout fl = new FrameLayout(getActivity()); fl.setLayoutParams(params);//from www.jav a 2s .c o m final int margin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 8, getResources().getDisplayMetrics()); TextView v = new TextView(getActivity()); params.setMargins(margin, margin, margin, margin); v.setLayoutParams(params); v.setLayoutParams(params); v.setGravity(Gravity.CENTER); v.setBackgroundResource(R.drawable.view_sliding_tab_background_card); v.setText("CARD " + (position + 1)); fl.addView(v); return fl; }
From source file:sync.ess.hsb.xinwen.ui.SuperAwesomeCardFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); FrameLayout fl = new FrameLayout(getActivity()); fl.setLayoutParams(params);//from ww w . java 2 s . c o m // mListView = (ListView) f1.findViewById(R.id.listview); final int margin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 8, getResources().getDisplayMetrics()); TextView v = new TextView(getActivity()); params.setMargins(margin, margin, margin, margin); v.setLayoutParams(params); v.setLayoutParams(params); v.setGravity(Gravity.CENTER); v.setBackgroundResource(R.drawable.background_card); v.setText("CARD " + (position + 1)); fl.addView(v); return fl; }
From source file:com.codeslap.topy.BaseSinglePaneActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); View rootView = getRootView(); if ((getRootResource() != Integer.MIN_VALUE || rootView != null) && getRootResourceId() == ID) { throw new IllegalStateException("When overriding root view, you must also override getRootResourceId()" + " passing the ID of the view group where the content returned view onCreatePane will" + " be placed."); }// www . ja v a2s .co m if (getRootResource() != Integer.MIN_VALUE) { setContentView(getRootResource()); } else if (rootView != null) { setContentView(rootView); } else { FrameLayout frameLayout = new FrameLayout(this); frameLayout.setId(getRootResourceId()); setContentView(frameLayout); } setSupportProgressBarIndeterminateVisibility(false); if (savedInstanceState == null) { Fragment fragment = onCreatePane(); fragment.setArguments(intentToFragmentArguments(getIntent())); String tag = fragment.getClass().getName(); getSupportFragmentManager().beginTransaction().add(getRootResourceId(), fragment, tag).commit(); } }
From source file:com.carinsurance.pagerslidingtabstrip.SuperAwesomeCardFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { LayoutParams params = new LayoutParams(android.view.ViewGroup.LayoutParams.MATCH_PARENT, android.view.ViewGroup.LayoutParams.MATCH_PARENT); FrameLayout fl = new FrameLayout(getActivity()); fl.setLayoutParams(params);//from w w w.ja v a 2s . co m final int margin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 8, getResources().getDisplayMetrics()); TextView v = new TextView(getActivity()); params.setMargins(margin, margin, margin, margin); v.setLayoutParams(params); v.setLayoutParams(params); v.setGravity(Gravity.CENTER); v.setBackgroundResource(R.drawable.background_card); v.setText("CARD " + (position + 1)); fl.addView(v); return fl; }
From source file:com.marshalchen.common.demoofui.pagerSlidingTabStrip.SuperAwesomeCardFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); params.gravity = Gravity.CENTER;/*from w ww . ja va 2 s .com*/ FrameLayout fl = new FrameLayout(getActivity()); fl.setLayoutParams(params); final int margin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 8, getResources().getDisplayMetrics()); TextView v = new TextView(getActivity()); params.setMargins(margin, margin, margin, margin); v.setLayoutParams(params); v.setGravity(Gravity.CENTER); v.setBackgroundResource(R.drawable.view_sliding_tab_background_card); v.setText("CARD " + (position + 1)); fl.addView(v); return fl; }
From source file:mobi.cangol.mobile.navigation.SlidingMenuLayout.java
public SlidingMenuLayout(Context context, AttributeSet attrs) { super(context, attrs); mMenuView = new FrameLayout(context); mContentView = new FrameLayout(context); int width = (int) (mMenuWidth * context.getResources().getDisplayMetrics().widthPixels); ViewGroup.LayoutParams lp1 = new ViewGroup.LayoutParams(width, LayoutParams.MATCH_PARENT); mMenuView.setId(R.id.menu_view);// w ww .j av a 2 s.co m this.addView(mMenuView, lp1); ViewGroup.LayoutParams lp2 = new ViewGroup.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); mContentView.setId(R.id.content_view); this.addView(mContentView, lp2); mContentView.setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { return true; } }); this.setSliderFadeColor(Color.TRANSPARENT); }