List of usage examples for android.widget FrameLayout setLayoutParams
public void setLayoutParams(ViewGroup.LayoutParams params)
From source file:com.google.android.apps.iosched.ui.StarredActivity.java
/** * Build and add "sessions" tab.//ww w.j a v a 2s. c o m */ private void setupSessionsTab() { // TODO: this is very inefficient and messy, clean it up FrameLayout fragmentContainer = new FrameLayout(this); fragmentContainer.setId(R.id.fragment_sessions); fragmentContainer.setLayoutParams( new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT)); ((ViewGroup) findViewById(android.R.id.tabcontent)).addView(fragmentContainer); final Intent intent = new Intent(Intent.ACTION_VIEW, Sessions.CONTENT_STARRED_URI); final FragmentManager fm = getSupportFragmentManager(); mSessionsFragment = (SessionsFragment) fm.findFragmentByTag("sessions"); if (mSessionsFragment == null) { mSessionsFragment = new SessionsFragment(); mSessionsFragment.setArguments(intentToFragmentArguments(intent)); fm.beginTransaction().add(R.id.fragment_sessions, mSessionsFragment, "sessions").commit(); } // Sessions content comes from reused activity mTabHost.addTab(mTabHost.newTabSpec(TAG_SESSIONS).setIndicator(buildIndicator(R.string.starred_sessions)) .setContent(R.id.fragment_sessions)); }
From source file:com.google.android.apps.iosched.ui.StarredActivity.java
/** * Build and add "vendors" tab./*from w ww . ja v a2 s. c o m*/ */ private void setupVendorsTab() { // TODO: this is very inefficient and messy, clean it up FrameLayout fragmentContainer = new FrameLayout(this); fragmentContainer.setId(R.id.fragment_vendors); fragmentContainer.setLayoutParams( new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT)); ((ViewGroup) findViewById(android.R.id.tabcontent)).addView(fragmentContainer); final Intent intent = new Intent(Intent.ACTION_VIEW, Vendors.CONTENT_STARRED_URI); final FragmentManager fm = getSupportFragmentManager(); mVendorsFragment = (VendorsFragment) fm.findFragmentByTag("vendors"); if (mVendorsFragment == null) { mVendorsFragment = new VendorsFragment(); mVendorsFragment.setArguments(intentToFragmentArguments(intent)); fm.beginTransaction().add(R.id.fragment_vendors, mVendorsFragment, "vendors").commit(); } // Vendors content comes from reused activity mTabHost.addTab(mTabHost.newTabSpec(TAG_VENDORS).setIndicator(buildIndicator(R.string.starred_vendors)) .setContent(R.id.fragment_vendors)); }
From source file:agronet.mpayer.zegetech.com.mpayercashbox.fragments.HomeMenuFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { switch (position) { case 0:/*w ww. j av a 2s. c o m*/ View view = inflater.inflate(R.layout.fragment_home, container, false); TextView tv = (TextView) view.findViewById(R.id.orders); tv.setTypeface(Constants.getCustomFace(getActivity(), "Open")); ImageView btnOrders = (ImageView) view.findViewById(R.id.ordersBtn); btnOrders.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(getActivity(), OrdersActivity.class); startActivity(i); } }); tv = (TextView) view.findViewById(R.id.transactions); tv.setTypeface(Constants.getCustomFace(getActivity(), "Open")); ImageView btnTransactions = (ImageView) view.findViewById(R.id.transactionsBtn); btnTransactions.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(getActivity(), TransactionsActivity.class); startActivity(i); } }); tv = (TextView) view.findViewById(R.id.accounts); tv.setTypeface(Constants.getCustomFace(getActivity(), "Open")); ImageView btnAccounts = (ImageView) view.findViewById(R.id.accountsBtn); btnAccounts.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(getActivity(), AccountsActivity.class); startActivity(i); } }); tv = (TextView) view.findViewById(R.id.members); tv.setTypeface(Constants.getCustomFace(getActivity(), "Open")); ImageView btnMembers = (ImageView) view.findViewById(R.id.membersBtn); btnMembers.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(getActivity(), MembersActivity.class); startActivity(i); } }); tv = (TextView) view.findViewById(R.id.reports); tv.setTypeface(Constants.getCustomFace(getActivity(), "Open")); ImageView btnReports = (ImageView) view.findViewById(R.id.reportsBtn); btnReports.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(getActivity(), ReportsActivity.class); startActivity(i); } }); tv = (TextView) view.findViewById(R.id.settings); tv.setTypeface(Constants.getCustomFace(getActivity(), "Open")); ImageView btnSettings = (ImageView) view.findViewById(R.id.settingsBtn); btnSettings.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(getActivity(), SettingsActivity.class); startActivity(i); } }); return view; case 1: LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); 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.setLayoutParams(params); v.setGravity(Gravity.CENTER); v.setText("LOG"); fl.addView(v); return fl; } return null; }
From source file:com.infine.android.devoxx.ui.StarredActivity.java
private void setupContent() { FrameLayout fragmentContainer = new FrameLayout(this); fragmentContainer.setId(R.id.fragment_sessions); fragmentContainer.setLayoutParams( new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT)); ((ViewGroup) findViewById(R.id.starredcontent)).addView(fragmentContainer); final Intent intent = new Intent(Intent.ACTION_VIEW, Sessions.CONTENT_STARRED_URI); final FragmentManager fm = getSupportFragmentManager(); mSessionsFragment = (SessionsFragment) fm.findFragmentByTag("sessions"); if (mSessionsFragment == null) { mSessionsFragment = new SessionsFragment(); mSessionsFragment.setArguments(intentToFragmentArguments(intent)); fm.beginTransaction().add(R.id.fragment_sessions, mSessionsFragment, "sessions").commit(); }// w w w.j av a2 s . com }
From source file:com.infine.android.devoxx.ui.StarredActivity.java
/** * Build and add "vendors" tab.//ww w.j av a2s. c o m */ private void setupVendorsTab() { // TODO: this is very inefficient and messy, clean it up FrameLayout fragmentContainer = new FrameLayout(this); fragmentContainer.setId(R.id.fragment_speakers); fragmentContainer.setLayoutParams( new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT)); ((ViewGroup) findViewById(android.R.id.tabcontent)).addView(fragmentContainer); final Intent intent = new Intent(Intent.ACTION_VIEW, Vendors.CONTENT_STARRED_URI); final FragmentManager fm = getSupportFragmentManager(); // mVendorsFragment = (VendorsFragment) fm.findFragmentByTag("vendors"); // if (mVendorsFragment == null) { // mVendorsFragment = new VendorsFragment(); // mVendorsFragment.setArguments(intentToFragmentArguments(intent)); // fm.beginTransaction() // .add(R.id.fragment_speakers, mVendorsFragment, "vendors") // .commit(); // } // Vendors content comes from reused activity mTabHost.addTab(mTabHost.newTabSpec(TAG_VENDORS).setIndicator(buildIndicator(R.string.starred_speakers)) .setContent(R.id.fragment_speakers)); }
From source file:com.google.android.apps.iosched2.ui.StarredActivity.java
/** * Build and add "vendors" tab.//from www . java2s.c o m */ private void setupVendorsTab() { // TODO: this is very inefficient and messy, clean it up FrameLayout fragmentContainer = new FrameLayout(this); fragmentContainer.setId(R.id.fragment_vendors); fragmentContainer.setLayoutParams( new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT)); ((ViewGroup) findViewById(android.R.id.tabcontent)).addView(fragmentContainer); final Intent intent = new Intent(Intent.ACTION_VIEW, Vendors.CONTENT_STARRED_URI); final FragmentManager fm = getSupportFragmentManager(); mVendorsFragment = (VendorsFragment) fm.findFragmentByTag("vendors"); if (mVendorsFragment == null) { mVendorsFragment = new VendorsFragment(); mVendorsFragment.setArguments(intentToFragmentArguments(intent)); fm.beginTransaction().add(R.id.fragment_vendors, mVendorsFragment, "vendors").commit(); } // Vendors content comes from reused activity /* * removed vendors */ if (Setup.FEATURE_VENDORS_ON) { mTabHost.addTab(mTabHost.newTabSpec(TAG_VENDORS).setIndicator(buildIndicator(R.string.starred_vendors)) .setContent(R.id.fragment_vendors)); } }
From source file:com.infine.android.devoxx.ui.SearchActivity.java
/** * Build and add "speaker" tab./*ww w.j a v a 2 s. c o m*/ * TODO : update it to search in speaker names ? */ private void setupSpeakersTab() { // TODO: this is very inefficient and messy, clean it up FrameLayout fragmentContainer = new FrameLayout(this); fragmentContainer.setId(R.id.fragment_speakers); fragmentContainer.setLayoutParams( new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT)); ((ViewGroup) findViewById(android.R.id.tabcontent)).addView(fragmentContainer); final FragmentManager fm = getSupportFragmentManager(); mSpeakersFragment = (SpeakersFragment) fm.findFragmentByTag("speakers"); if (mSpeakersFragment == null) { mSpeakersFragment = new SpeakersFragment(); mSpeakersFragment.setArguments(getSpeakersFragmentArguments()); fm.beginTransaction().add(R.id.fragment_speakers, mSpeakersFragment, "speakers").commit(); } else { mSpeakersFragment.reloadFromArguments(getSpeakersFragmentArguments()); } // Vendors content comes from reused activity mTabHost.addTab(mTabHost.newTabSpec(TAG_SPEAKERS).setIndicator(buildIndicator(R.string.starred_speakers)) .setContent(R.id.fragment_speakers)); }
From source file:com.heneryh.aquanotes.ui.SearchActivity.java
/** * Build and add "sessions" tab.// w w w .j a v a2s . co m */ private void setupSessionsTab() { // TODO: this is very inefficient and messy, clean it up FrameLayout fragmentContainer = new FrameLayout(this); fragmentContainer.setId(R.id.fragment_probes); fragmentContainer.setLayoutParams( new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT)); ((ViewGroup) findViewById(android.R.id.tabcontent)).addView(fragmentContainer); final FragmentManager fm = getSupportFragmentManager(); mSessionsFragment = (DbMaintProbesFragment) fm.findFragmentByTag("sessions"); if (mSessionsFragment == null) { mSessionsFragment = new DbMaintProbesFragment(); mSessionsFragment.setArguments(getSessionsFragmentArguments()); fm.beginTransaction().add(R.id.fragment_probes, mSessionsFragment, "sessions").commit(); } else { mSessionsFragment.reloadFromArguments(getSessionsFragmentArguments()); } // Sessions content comes from reused activity mTabHost.addTab(mTabHost.newTabSpec(TAG_SESSIONS).setIndicator(buildIndicator(R.string.db_maint_probes)) .setContent(R.id.fragment_probes)); }
From source file:com.google.android.apps.iosched.ui.SearchActivity.java
/** * Build and add "vendors" tab.// w w w . j a v a 2s . com */ private void setupVendorsTab() { // TODO: this is very inefficient and messy, clean it up FrameLayout fragmentContainer = new FrameLayout(this); fragmentContainer.setId(R.id.fragment_vendors); fragmentContainer.setLayoutParams( new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT)); ((ViewGroup) findViewById(android.R.id.tabcontent)).addView(fragmentContainer); final FragmentManager fm = getSupportFragmentManager(); mVendorsFragment = (VendorsFragment) fm.findFragmentByTag("vendors"); if (mVendorsFragment == null) { mVendorsFragment = new VendorsFragment(); mVendorsFragment.setArguments(getVendorsFragmentArguments()); fm.beginTransaction().add(R.id.fragment_vendors, mVendorsFragment, "vendors").commit(); } else { mVendorsFragment.reloadFromArguments(getVendorsFragmentArguments()); } // Vendors content comes from reused activity mTabHost.addTab(mTabHost.newTabSpec(TAG_VENDORS).setIndicator(buildIndicator(R.string.starred_vendors)) .setContent(R.id.fragment_vendors)); }
From source file:com.google.android.apps.iosched.ui.SearchActivity.java
/** * Build and add "sessions" tab.//from ww w . j a v a2s.c o m */ private void setupSessionsTab() { // TODO: this is very inefficient and messy, clean it up FrameLayout fragmentContainer = new FrameLayout(this); fragmentContainer.setId(R.id.fragment_sessions); fragmentContainer.setLayoutParams( new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT)); ((ViewGroup) findViewById(android.R.id.tabcontent)).addView(fragmentContainer); final FragmentManager fm = getSupportFragmentManager(); mSessionsFragment = (SessionsFragment) fm.findFragmentByTag("sessions"); if (mSessionsFragment == null) { mSessionsFragment = new SessionsFragment(); mSessionsFragment.setArguments(getSessionsFragmentArguments()); fm.beginTransaction().add(R.id.fragment_sessions, mSessionsFragment, "sessions").commit(); } else { mSessionsFragment.reloadFromArguments(getSessionsFragmentArguments()); } // Sessions content comes from reused activity mTabHost.addTab(mTabHost.newTabSpec(TAG_SESSIONS).setIndicator(buildIndicator(R.string.starred_sessions)) .setContent(R.id.fragment_sessions)); }