Java Code Examples for android.widget.FrameLayout
The following code examples are extracted from open source projects. You can click to
vote up the examples that are useful to you.
Example 1
From project ActionBarSherlock, under directory /samples/fragments/src/com/actionbarsherlock/sample/fragments/.
Source file: FragmentReceiveResultSupport.java

@Override protected void onCreate(Bundle savedInstanceState){ setTheme(SampleList.THEME); super.onCreate(savedInstanceState); FrameLayout.LayoutParams lp=new FrameLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,ViewGroup.LayoutParams.FILL_PARENT); FrameLayout frame=new FrameLayout(this); frame.setId(R.id.simple_fragment); setContentView(frame,lp); if (savedInstanceState == null) { Fragment newFragment=new ReceiveResultFragment(); FragmentTransaction ft=getSupportFragmentManager().beginTransaction(); ft.add(R.id.simple_fragment,newFragment).commit(); } }
Example 2
From project android-xbmcremote, under directory /src/org/xbmc/android/remote/presentation/activity/.
Source file: AbsListActivity.java

protected void setupLists(int layoutResId){ setContentView(layoutResId); FrameLayout topFrame=(FrameLayout)findViewById(android.R.id.content); topFrame.setForeground(null); mListController=(ListController)getLastNonConfigurationInstance(); if (mListController == null) { mListController=(ListController)getIntent().getSerializableExtra(ListController.EXTRA_LIST_CONTROLLER); mListController.findTitleView(findViewById(R.id.blanklist_outer_layout)); mListController.findMessageView(findViewById(R.id.blanklist_outer_layout)); mListController.onCreate(this,new Handler(),(AbsListView)findViewById(R.id.blanklist_list)); } mConfigurationManager=ConfigurationManager.getInstance(this); }
Example 3
From project android_packages_apps_Gallery2, under directory /src/com/android/gallery3d/app/.
Source file: ManageCachePage.java

@Override public void onConfigurationChanged(Configuration config){ initializeFooterViews(); FrameLayout layout=(FrameLayout)((Activity)mActivity).findViewById(R.id.footer); if (layout.getVisibility() == View.VISIBLE) { layout.removeAllViews(); layout.addView(mFooterContent); } }
Example 4
From project devoxx-france-android-in-fine, under directory /src/com/infine/android/devoxx/ui/.
Source file: 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(); } }
Example 5
From project evodroid, under directory /src/com/sonorth/evodroid/util/.
Source file: AppTitleBar.java

public void updateCommentBadge(){ if (b2evolution.currentBlog != null) { int commentCount=b2evolution.currentBlog.getUnmoderatedCommentCount(context); FrameLayout commentBadge=(FrameLayout)findViewById(R.id.comment_badge_frame); if (commentCount > 0) { commentBadge.setVisibility(View.VISIBLE); } else { commentBadge.setVisibility(View.GONE); } commentBadgeText.setText(String.valueOf(commentCount)); } }
Example 6
From project farebot, under directory /src/com/codebutler/farebot/activities/.
Source file: FragmentWrapperActivity.java

@Override protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); getSupportActionBar().setDisplayHomeAsUpEnabled(true); FrameLayout container=new FrameLayout(this); container.setLayoutParams(new LinearLayout.LayoutParams(MATCH_PARENT,MATCH_PARENT)); container.setId(R.id.content); setContentView(container); if (getFragment() == null) { FragmentTransaction transaction=getSupportFragmentManager().beginTransaction(); transaction.add(R.id.content,createFragment(),"fragment"); transaction.commit(); } }
Example 7
From project finch, under directory /libs/JakeWharton-ActionBarSherlock-2eabf25/samples/fragments/src/com/actionbarsherlock/sample/fragments/.
Source file: FragmentReceiveResultSupport.java

@Override protected void onCreate(Bundle savedInstanceState){ setTheme(SampleList.THEME); super.onCreate(savedInstanceState); FrameLayout.LayoutParams lp=new FrameLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,ViewGroup.LayoutParams.FILL_PARENT); FrameLayout frame=new FrameLayout(this); frame.setId(R.id.simple_fragment); setContentView(frame,lp); if (savedInstanceState == null) { Fragment newFragment=new ReceiveResultFragment(); FragmentTransaction ft=getSupportFragmentManager().beginTransaction(); ft.add(R.id.simple_fragment,newFragment).commit(); } }
Example 8
From project framework_base_policy, under directory /src/com/android/internal/policy/impl/.
Source file: PhoneWindow.java

/** * Called when an int feature changes, for the window to update its graphics. * @param featureId The feature being changed. * @param value The new integer value. */ protected void onIntChanged(int featureId,int value){ if (featureId == FEATURE_PROGRESS || featureId == FEATURE_INDETERMINATE_PROGRESS) { updateProgressBars(value); } else if (featureId == FEATURE_CUSTOM_TITLE) { FrameLayout titleContainer=(FrameLayout)findViewById(com.android.internal.R.id.title_container); if (titleContainer != null) { mLayoutInflater.inflate(value,titleContainer); } } }
Example 9
From project gast-lib, under directory /app/src/root/gast/playground/util/.
Source file: DialogGenerator.java

public static AlertDialog createFrameDialog(Activity finalContext,String title,View layout,DialogInterface.OnClickListener onYesListener){ final FrameLayout frame=new FrameLayout(finalContext); frame.addView(layout,new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,FrameLayout.LayoutParams.WRAP_CONTENT)); AlertDialog.Builder ab=new AlertDialog.Builder(finalContext); AlertDialog a=ab.setTitle(title).setView(frame).setCancelable(true).setNegativeButton("Cancel",DO_NOTHING).setPositiveButton("OK",onYesListener).create(); return a; }
Example 10
From project iosched, under directory /android/src/com/google/android/apps/iosched/ui/.
Source file: SearchActivity.java

/** * Build and add "sessions" tab. */ private void setupSessionsTab(){ 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(); } mTabHost.addTab(mTabHost.newTabSpec(TAG_SESSIONS).setIndicator(buildIndicator(R.string.starred_sessions)).setContent(R.id.fragment_sessions)); }
Example 11
From project iosched2011, under directory /android/src/com/google/android/apps/iosched/ui/.
Source file: SearchActivity.java

/** * Build and add "sessions" tab. */ private void setupSessionsTab(){ 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(); } mTabHost.addTab(mTabHost.newTabSpec(TAG_SESSIONS).setIndicator(buildIndicator(R.string.starred_sessions)).setContent(R.id.fragment_sessions)); }
Example 12
From project Locast-Android, under directory /src/android/support/v4_map/app/.
Source file: ListFragment.java

/** * Provide default implementation to return a simple list view. Subclasses can override to replace with their own layout. If doing so, the returned view hierarchy <em>must</em> have a ListView whose id is {@link android.R.id#list android.R.id.list} and can optionallyhave a sibling view id {@link android.R.id#empty android.R.id.empty}that is to be shown when the list is empty. <p>If you are overriding this method with your own custom content, consider including the standard layout {@link android.R.layout#list_content}in your layout file, so that you continue to retain all of the standard behavior of ListFragment. In particular, this is currently the only way to have the built-in indeterminant progress state be shown. */ @Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){ FrameLayout root=new FrameLayout(getActivity()); TextView tv=new TextView(getActivity()); tv.setId(INTERNAL_EMPTY_ID); tv.setGravity(Gravity.CENTER); root.addView(tv,new FrameLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,ViewGroup.LayoutParams.FILL_PARENT)); ListView lv=new ListView(getActivity()); lv.setId(android.R.id.list); lv.setDrawSelectorOnTop(false); root.addView(lv,new FrameLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,ViewGroup.LayoutParams.FILL_PARENT)); ListView.LayoutParams lp=new ListView.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,ViewGroup.LayoutParams.FILL_PARENT); root.setLayoutParams(lp); return root; }
Example 13
From project maven-android-plugin-samples, under directory /support4demos/src/com/example/android/supportv4/app/.
Source file: FragmentReceiveResultSupport.java

@Override protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); FrameLayout.LayoutParams lp=new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT); FrameLayout frame=new FrameLayout(this); frame.setId(R.id.simple_fragment); setContentView(frame,lp); if (savedInstanceState == null) { Fragment newFragment=new ReceiveResultFragment(); FragmentTransaction ft=getSupportFragmentManager().beginTransaction(); ft.add(R.id.simple_fragment,newFragment).commit(); } }
Example 14
From project MIT-Mobile-for-Android, under directory /src/edu/mit/mitmobile2/.
Source file: SliderActivity.java

public void showFullScreen(View view){ FrameLayout fullScreenFrameLayout=(FrameLayout)findViewById(R.id.sliderActivityFullScreen); fullScreenFrameLayout.removeAllViews(); fullScreenFrameLayout.addView(view,new FrameLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT)); fullScreenFrameLayout.setVisibility(View.VISIBLE); }
Example 15
/** * Create zoom bar and returns FrameLayout. FrameLayout is created to be hidden and not added to view, Caller needs to add the frameLayout to view, and enable visibility when needed. * @param SharedOreference settings where setting is stored * @return FrameLayout Hidden Zoom Bar */ private FrameLayout createZoomBar(SharedPreferences settings){ getMixViewData().setMyZoomBar(new SeekBar(this)); getMixViewData().getMyZoomBar().setMax(100); getMixViewData().getMyZoomBar().setProgress(settings.getInt("zoomLevel",65)); getMixViewData().getMyZoomBar().setOnSeekBarChangeListener(myZoomBarOnSeekBarChangeListener); getMixViewData().getMyZoomBar().setVisibility(View.INVISIBLE); FrameLayout frameLayout=new FrameLayout(this); frameLayout.setMinimumWidth(3000); frameLayout.addView(getMixViewData().getMyZoomBar()); frameLayout.setPadding(10,0,10,10); return frameLayout; }
Example 16
From project Monetizing-Android-Demo-Project, under directory /src/dk/trifork/geeknight/bigredbutton/.
Source file: MainActivity.java

/** * Initializes the AdWhirl component and start displaying ads */ private void initializeAdWhirl(){ FrameLayout container=(FrameLayout)findViewById(R.id.ads); AdWhirlManager.setConfigExpireTimeout(1 * 60 * 60* 1000); AdWhirlTargeting.setTestMode(true); AdWhirlTargeting.setKeywords("red button fun game"); AdWhirlLayout adsLayout=new AdWhirlLayout(this,"ef8147ec68264bce86cd371739f3f8fb"); int diWidth=320; int diHeight=52; float density=getResources().getDisplayMetrics().density; adsLayout.setAdWhirlInterface(this); adsLayout.setMaxWidth((int)(diWidth * density)); adsLayout.setMaxHeight((int)(diHeight * density)); container.addView(adsLayout); }
Example 17
public View createContentView(View view){ FrameLayout root=new FrameLayout(this); root.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT)); LinearLayout pframe=new LinearLayout(this); pframe.setId(R.id.INTERNAL_PROGRESS_CONTAINER_ID); pframe.setOrientation(LinearLayout.VERTICAL); pframe.setGravity(Gravity.CENTER); ProgressBar progress=new ProgressBar(this,null,android.R.attr.progressBarStyleLarge); pframe.addView(progress,new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT)); root.addView(pframe,new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT)); FrameLayout lframe=new FrameLayout(this); lframe.setId(R.id.INTERNAL_FRAGMENT_CONTAINER_ID); lframe.setVisibility(View.GONE); lframe.addView(view,new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT)); root.addView(lframe,new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT)); return root; }
Example 18
From project Android-GifStitch, under directory /src/com/phunkosis/gifstitch/views/.
Source file: PreviewFrameLayout.java

@Override protected void onLayout(boolean changed,int l,int t,int r,int b){ int frameWidth=getWidth(); int frameHeight=getHeight(); FrameLayout f=mFrame; int horizontalPadding=Math.max(f.getPaddingLeft() + f.getPaddingRight(),(int)(MIN_HORIZONTAL_MARGIN * mMetrics.density)); int verticalPadding=f.getPaddingBottom() + f.getPaddingTop(); int previewHeight=frameHeight; int previewWidth=frameWidth - horizontalPadding; if (mAspectRatio >= 0.0) { if (previewWidth > previewHeight * mAspectRatio) { previewWidth=(int)(previewHeight * mAspectRatio + .5); } else { previewHeight=(int)(previewWidth / mAspectRatio + .5); } } frameWidth=previewWidth + horizontalPadding; frameHeight=previewHeight + verticalPadding; int hSpace=((r - l) - frameWidth) / 2; int vSpace=((b - t) - frameHeight) / 2; mFrame.measure(MeasureSpec.makeMeasureSpec(frameWidth,MeasureSpec.EXACTLY),MeasureSpec.makeMeasureSpec(frameHeight,MeasureSpec.EXACTLY)); mFrame.layout(l + hSpace,t + vSpace,r - hSpace,b - vSpace); if (mSizeListener != null) { mSizeListener.onSizeChanged(); } }
Example 19
From project android-joedayz, under directory /Proyectos/FBConnectTest/src/com/facebook/android/.
Source file: FbDialog.java

@Override protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); mSpinner=new ProgressDialog(getContext()); mSpinner.requestWindowFeature(Window.FEATURE_NO_TITLE); mSpinner.setMessage("Loading..."); requestWindowFeature(Window.FEATURE_NO_TITLE); mContent=new FrameLayout(getContext()); createCrossImage(); int crossWidth=mCrossImage.getDrawable().getIntrinsicWidth(); setUpWebView(crossWidth / 2); mContent.addView(mCrossImage,new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT)); addContentView(mContent,new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT)); }
Example 20
From project android-pulltorefresh, under directory /library/src/com/handmark/pulltorefresh/library/.
Source file: PullToRefreshAdapterViewBase.java

/** * Sets the Empty View to be used by the Adapter View. We need it handle it ourselves so that we can Pull-to-Refresh when the Empty View is shown. 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 != mEmptyView) { refreshableViewWrapper.removeView(mEmptyView); } if (null != newEmptyView) { newEmptyView.setClickable(true); ViewParent newEmptyViewParent=newEmptyView.getParent(); if (null != newEmptyViewParent && newEmptyViewParent instanceof ViewGroup) { ((ViewGroup)newEmptyViewParent).removeView(newEmptyView); } refreshableViewWrapper.addView(newEmptyView,ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT); if (mRefreshableView instanceof EmptyViewMethodAccessor) { ((EmptyViewMethodAccessor)mRefreshableView).setEmptyViewInternal(newEmptyView); } else { mRefreshableView.setEmptyView(newEmptyView); } mEmptyView=newEmptyView; } }
Example 21
From project Android-Simple-Social-Sharing, under directory /SimpleSocialSharing/src/com/nostra13/socialsharing/facebook/extpack/com/facebook/android/.
Source file: FbDialog.java

@Override protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); mSpinner=new ProgressDialog(getContext()); mSpinner.requestWindowFeature(Window.FEATURE_NO_TITLE); mSpinner.setMessage("Loading..."); mSpinner.setCancelable(false); requestWindowFeature(Window.FEATURE_NO_TITLE); mContent=new FrameLayout(getContext()); setUpWebView(10); addContentView(mContent,new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT)); }
Example 22
From project android-tether, under directory /facebook/src/com/facebook/android/.
Source file: FbDialog.java

@Override protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); mSpinner=new ProgressDialog(getContext()); mSpinner.requestWindowFeature(Window.FEATURE_NO_TITLE); mSpinner.setMessage("Loading..."); requestWindowFeature(Window.FEATURE_NO_TITLE); mContent=new FrameLayout(getContext()); createCrossImage(); int crossWidth=mCrossImage.getDrawable().getIntrinsicWidth(); setUpWebView(crossWidth / 2); mContent.addView(mCrossImage,new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT)); addContentView(mContent,new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT)); }
Example 23
From project android_7, under directory /src/org/immopoly/android/fragments/.
Source file: PortfolioMapFragment.java

@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){ mTracker=GoogleAnalyticsTracker.getInstance(); mTracker.startNewSession(TrackingManager.UA_ACCOUNT,Const.ANALYTICS_INTERVAL,getActivity().getApplicationContext()); mTracker.trackPageView(TrackingManager.VIEW_PORTFOLIO_MAP); Log.i(Const.LOG_TAG,"PortfolioMapFragment.onCreateView"); View layout=inflater.inflate(R.layout.portfolio_map,null,false); ImmopolyUser user=ImmopolyUser.getInstance(); mFlats=user.getPortfolio(); mMapView=((ImmopolyActivity)getActivity()).acquireMapView(this); flatsOverlay=new ImmoscoutPlacesOverlay(this,mMapView,inflater,true); flatsOverlay.setFlats(mFlats); mMapView.getOverlays().add(flatsOverlay); FrameLayout mapFrame=(FrameLayout)layout.findViewById(R.id.pf_map_frame); mapFrame.addView(mMapView,0); layout.findViewById(R.id.portfolio_btn_list).setOnClickListener(new View.OnClickListener(){ public void onClick( View v){ Log.i("IMPO","PortfolioMapFragment show listg"); ((ImmopolyActivity)getActivity()).getTabManager().onTabChanged("portfolio"); } } ); UserDataManager.instance.addUserDataListener(this); double minLat=Double.MAX_VALUE, maxLat=Double.MIN_VALUE, minLon=Double.MAX_VALUE, maxLon=Double.MIN_VALUE; for ( Flat f : mFlats) { if (f.lat < minLat) minLat=f.lat; if (f.lat > maxLat) maxLat=f.lat; if (f.lng < minLon) minLon=f.lng; if (f.lng > maxLon) maxLon=f.lng; } Log.i(Const.LOG_TAG,"LAT MIN: " + minLat + " MAX: "+ maxLat); Log.i(Const.LOG_TAG,"LON MIN: " + minLon + " MAX: "+ maxLon); mMapView.getController().setCenter(new GeoPoint((int)((minLat + maxLat) / 2 * 1E6),(int)((minLon + maxLon) / 2 * 1E6))); mMapView.getController().zoomToSpan((int)((maxLat - minLat) * 1E6 * 1.1),(int)((maxLon - minLon) * 1E6 * 1.1)); return layout; }
Example 24
From project android_packages_apps_Gallery, under directory /src/com/android/camera/.
Source file: PreviewFrameLayout.java

@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){ super.onMeasure(widthMeasureSpec,heightMeasureSpec); int gripperWidth=0; int gripperHeight=0; if (mGripper != null) { measureChild(mGripper,widthMeasureSpec,heightMeasureSpec); gripperWidth=mGripper.getMeasuredWidth(); gripperHeight=mGripper.getMeasuredHeight(); } int frameWidth=getMeasuredWidth() - (int)Math.max(gripperWidth,MIN_HORIZONTAL_MARGIN * mMetrics.density); int frameHeight=getMeasuredHeight(); FrameLayout f=mFrame; int horizontalPadding=f.getPaddingLeft() + f.getPaddingRight(); int verticalPadding=f.getPaddingBottom() + f.getPaddingTop(); int previewWidth=frameWidth - horizontalPadding; int previewHeight=frameHeight - verticalPadding; if (previewWidth > previewHeight * mAspectRatio) { previewWidth=(int)(previewHeight * mAspectRatio + .5); } else { previewHeight=(int)(previewWidth / mAspectRatio + .5); } frameWidth=previewWidth + horizontalPadding; frameHeight=previewHeight + verticalPadding; measureChild(mFrame,MeasureSpec.makeMeasureSpec(MeasureSpec.EXACTLY,frameWidth),MeasureSpec.makeMeasureSpec(MeasureSpec.EXACTLY,frameHeight)); }
Example 25
From project android_packages_apps_QiblaCompass, under directory /src/com/farsitel/qiblacompass/activities/.
Source file: QiblaActivity.java

private void requestForValidationOfQibla(){ TextView textView2=(TextView)findViewById(R.id.location_text_line2); ImageView arrow=((ImageView)findViewById(R.id.arrowImage)); ImageView compass=((ImageView)findViewById(R.id.compassImage)); ImageView frame=((ImageView)findViewById(R.id.frameImage)); FrameLayout qiblaFrame=((FrameLayout)findViewById(R.id.qiblaLayout)); LinearLayout noLocationLayout=((LinearLayout)findViewById(R.id.noLocationLayout)); if (faceUp && (gpsLocationFound || currentLocation != null)) { textView2.setVisibility(View.VISIBLE); textView2.setText(location_line2); ((LinearLayout)findViewById(R.id.textLayout)).setVisibility(View.VISIBLE); noLocationLayout.setVisibility(View.INVISIBLE); qiblaFrame.setVisibility(View.VISIBLE); arrow.setVisibility(View.VISIBLE); compass.setVisibility(View.VISIBLE); frame.setVisibility(View.VISIBLE); } else { if (!faceUp) { onScreenDown(); } else if (!(gpsLocationFound || currentLocation != null)) { onGPSOn(); } } }
Example 26
From project android_packages_apps_Superuser, under directory /src/com/noshufou/android/su/.
Source file: AppDetailsFragment.java

@Override public void onActivityCreated(Bundle savedInstanceState){ super.onActivityCreated(savedInstanceState); FrameLayout fragmentContainer=(FrameLayout)getActivity().findViewById(R.id.fragment_container); if (fragmentContainer != null) { mDualPane=true; } if (savedInstanceState != null && savedInstanceState.containsKey("mShownIndex")) { mShownIndex=savedInstanceState.getLong("mShownIndex"); } else if (getArguments() != null) { mShownIndex=getArguments().getLong("index",0); } else { mShownIndex=0; } setupListView(); getLoaderManager().initLoader(DETAILS_LOADER,null,this); getLoaderManager().initLoader(LOG_LOADER,null,this); Log.d(TAG,"Before elite check, time is " + System.currentTimeMillis()); mElitePresent=Util.elitePresent(getActivity(),true,2); Log.d(TAG,"After elite check, time is " + System.currentTimeMillis()); }
Example 27
From project apps-for-android, under directory /Panoramio/src/com/google/android/panoramio/.
Source file: Panoramio.java

@Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.main); mImageManager=ImageManager.getInstance(this); FrameLayout frame=(FrameLayout)findViewById(R.id.frame); Button goButton=(Button)findViewById(R.id.go); goButton.setOnClickListener(this); mMapView=new MapView(this,"Panoramio_DummyAPIKey"); frame.addView(mMapView,new FrameLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT)); mMyLocationOverlay=new MyLocationOverlay(this,mMapView); mMyLocationOverlay.runOnFirstFix(new Runnable(){ public void run(){ mMapView.getController().animateTo(mMyLocationOverlay.getMyLocation()); } } ); mMapView.getOverlays().add(mMyLocationOverlay); mMapView.getController().setZoom(15); mMapView.setClickable(true); mMapView.setEnabled(true); mMapView.setSatellite(true); addZoomControls(frame); }
Example 28
From project AquaNotesTest, under directory /src/com/google/android/apps/iosched/ui/.
Source file: SearchActivity.java

/** * Build and add "sessions" tab. */ private void setupSessionsTab(){ 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()); } mTabHost.addTab(mTabHost.newTabSpec(TAG_SESSIONS).setIndicator(buildIndicator(R.string.starred_sessions)).setContent(R.id.fragment_sessions)); }
Example 29
From project Common-Sense-Net-2, under directory /RealFarm/src/com/commonsensenet/realfarm/ownCamera/.
Source file: OwnCameraActivity.java

@SuppressWarnings("deprecation") @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.own_camera_main); if (mCamera != null) { mCamera.release(); } try { mCamera=Camera.open(); Camera.Parameters params=mCamera.getParameters(); mCamera.setDisplayOrientation(90); params.setPictureFormat(ImageFormat.JPEG); mCamera.setParameters(params); Log.d(LOG_TAG,"Camera instantiated"); } catch ( Exception e) { Log.d(LOG_TAG,"Cannot instantiate camera"); } mPreview=new SurfaceView(getBaseContext()); mHolder=mPreview.getHolder(); mHolder.addCallback(this); mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); FrameLayout previewLayout=(FrameLayout)findViewById(R.id.camera_preview); previewLayout.addView(mPreview); View captureButton=findViewById(R.id.button_capture); captureButton.setOnLongClickListener(this); captureButton.setOnClickListener(new View.OnClickListener(){ public void onClick( View v){ mCamera.takePicture(null,null,mPicture); Log.d(LOG_TAG,"Picture taken"); Toast.makeText(OwnCameraActivity.this,"Picture taken.",Toast.LENGTH_SHORT).show(); } } ); }
Example 30
From project conference-mobile-app, under directory /android-app/src/com/google/android/apps/iosched/ui/.
Source file: SearchActivity.java

/** * Build and add "sessions" tab. */ private void setupSessionsTab(){ 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()); } mTabHost.addTab(mTabHost.newTabSpec(TAG_SESSIONS).setIndicator(buildIndicator(R.string.starred_sessions)).setContent(R.id.fragment_sessions)); }
Example 31
From project dcnyc10-android, under directory /android/src/com/lullabot/android/apps/iosched/ui/.
Source file: SearchActivity.java

/** * Build and add "sessions" tab. */ private void setupSessionsTab(){ 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()); } mTabHost.addTab(mTabHost.newTabSpec(TAG_SESSIONS).setIndicator(buildIndicator(R.string.starred_sessions)).setContent(R.id.fragment_sessions)); }
Example 32
From project dreamDroid, under directory /src/net/reichholf/dreamdroid/fragment/.
Source file: DeviceInfoFragment.java

@SuppressWarnings("deprecation") @Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){ FrameLayout root=new FrameLayout(getSherlockActivity()); TextView tv=new TextView(getSherlockActivity()); tv.setId(android.R.id.empty); tv.setGravity(Gravity.CENTER); root.addView(tv,new FrameLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,ViewGroup.LayoutParams.FILL_PARENT)); mList=new ListView(getSherlockActivity()); mList.setId(android.R.id.list); mList.setDrawSelectorOnTop(false); root.addView(mList,new FrameLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,ViewGroup.LayoutParams.FILL_PARENT)); ListView.LayoutParams lp=new ListView.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,ViewGroup.LayoutParams.FILL_PARENT); root.setLayoutParams(lp); mMerge=new MergeAdapter(); mFrontends=new ArrayList<ExtendedHashMap>(); mNics=new ArrayList<ExtendedHashMap>(); mHdds=new ArrayList<ExtendedHashMap>(); mInflater=getLayoutInflater(savedInstanceState); ScrollView fields=(ScrollView)mInflater.inflate(R.layout.device_info,null); mMerge.addView(fields); mGuiVersion=(TextView)fields.findViewById(R.id.GuiVersion); mImageVersion=(TextView)fields.findViewById(R.id.ImageVersion); mInterfaceVersion=(TextView)fields.findViewById(R.id.InterfaceVersion); mFrontprocessorVersion=(TextView)fields.findViewById(R.id.FrontprocessorVersion); mDeviceName=(TextView)fields.findViewById(R.id.DeviceName); setClient(); if (mInfo == null || mInfo.isEmpty()) { reload(); } else { onInfoReady(); } return root; }
Example 33
From project droid-fu, under directory /src/main/java/com/github/droidfu/adapters/.
Source file: WebGalleryAdapter.java

public View getView(int position,View convertView,ViewGroup parent){ String imageUrl=(String)getItem(position); ViewHolder viewHolder=null; WebImageView webImageView=null; if (convertView == null) { webImageView=new WebImageView(context,null,progressDrawable,errorDrawable,false); FrameLayout.LayoutParams lp=new FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT); lp.gravity=Gravity.CENTER; webImageView.setLayoutParams(lp); FrameLayout container=new FrameLayout(context); container.setLayoutParams(new Gallery.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT)); container.addView(webImageView,0); convertView=container; viewHolder=new ViewHolder(); viewHolder.webImageView=webImageView; convertView.setTag(viewHolder); } else { viewHolder=(ViewHolder)convertView.getTag(); webImageView=viewHolder.webImageView; } webImageView.reset(); webImageView.setImageUrl(imageUrl); webImageView.loadImage(); onGetView(position,convertView,parent); return convertView; }
Example 34
From project droidkit, under directory /src/org/droidkit/widget/.
Source file: HandyPagedView.java

@Override public void removeAllViews(){ for (int i=0; i < 3; i++) { FrameLayout container=mContainerViews.get(i); AdapterViewInfo info=mVisibleViews[i]; if (mAdapter == null) { container.removeAllViews(); } else { if (info != null && container.getChildAt(0) == info.view) { container.removeAllViews(); recycleView(info); } else { container.removeAllViews(); } } mVisibleViews[i]=null; } }
Example 35
From project facebook-android-sdk, under directory /facebook/src/com/facebook/android/.
Source file: FbDialog.java

@Override protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); mSpinner=new ProgressDialog(getContext()); mSpinner.requestWindowFeature(Window.FEATURE_NO_TITLE); mSpinner.setMessage("Loading..."); requestWindowFeature(Window.FEATURE_NO_TITLE); mContent=new FrameLayout(getContext()); createCrossImage(); int crossWidth=mCrossImage.getDrawable().getIntrinsicWidth(); setUpWebView(crossWidth / 2); mContent.addView(mCrossImage,new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT)); addContentView(mContent,new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT)); }
Example 36
From project friendica-for-android, under directory /libpulltorefresh/src/com/handmark/pulltorefresh/library/.
Source file: PullToRefreshListView.java

@Override protected final ListView createRefreshableView(Context context,AttributeSet attrs){ ListView lv=new InternalListView(context,attrs); TypedArray a=context.obtainStyledAttributes(attrs,R.styleable.PullToRefresh); FrameLayout frame=new FrameLayout(context); mHeaderLoadingView=new LoadingLayout(context,Mode.PULL_DOWN_TO_REFRESH,a); frame.addView(mHeaderLoadingView,FrameLayout.LayoutParams.FILL_PARENT,FrameLayout.LayoutParams.WRAP_CONTENT); mHeaderLoadingView.setVisibility(View.GONE); lv.addHeaderView(frame,null,false); mLvFooterLoadingFrame=new FrameLayout(context); mFooterLoadingView=new LoadingLayout(context,Mode.PULL_UP_TO_REFRESH,a); mLvFooterLoadingFrame.addView(mFooterLoadingView,FrameLayout.LayoutParams.FILL_PARENT,FrameLayout.LayoutParams.WRAP_CONTENT); mFooterLoadingView.setVisibility(View.GONE); a.recycle(); lv.setId(android.R.id.list); return lv; }
Example 37
From project gddsched2, under directory /trunk/android/src/com/google/android/apps/iosched2/ui/.
Source file: SearchActivity.java

/** * Build and add "sessions" tab. */ private void setupSessionsTab(){ 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()); } mTabHost.addTab(mTabHost.newTabSpec(TAG_SESSIONS).setIndicator(buildIndicator(R.string.starred_sessions)).setContent(R.id.fragment_sessions)); }
Example 38
From project gobandroid, under directory /src/org/ligi/gobandroid_hd/ui/.
Source file: SGFLoadActivity.java

@Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); GoPrefs.init(this); progress=new ProgressBar(this,null,android.R.attr.progressBarStyleHorizontal); progress.setMax(100); progress.setProgress(10); LinearLayout lin=new LinearLayout(this); ImageView img=new ImageView(this); img.setImageResource(R.drawable.ic_launcher); img.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.WRAP_CONTENT)); lin.setOrientation(LinearLayout.VERTICAL); lin.addView(img); FrameLayout frame=new FrameLayout(this); frame.addView(progress); message_tv=new TextView(this); message_tv.setText("starting"); message_tv.setTextColor(0xFF000000); message_tv.setPadding(7,0,0,0); frame.addView(message_tv); lin.addView(frame); alert_dlg=new AlertDialog.Builder(this).setCancelable(false).setTitle(R.string.loading_sgf).setView(lin).show(); EasyTracker.getTracker().trackEvent("ui_action","load_sgf",getIntent().getData().toString(),null); new Thread(this).start(); }
Example 39
From project google-voice-tasker-plugin, under directory /src/com/ko/googlevoice/ui/.
Source file: EditActivity.java

/** * {@inheritDoc} */ @Override protected void onCreate(final Bundle savedInstanceState){ super.onCreate(savedInstanceState); BundleScrubber.scrub(getIntent()); BundleScrubber.scrub(getIntent().getBundleExtra(com.twofortyfouram.locale.Intent.EXTRA_BUNDLE)); setContentView(R.layout.main); setTitle(BreadCrumber.generateBreadcrumb(getApplicationContext(),getIntent(),getString(R.string.plugin_name))); final FrameLayout frame=(FrameLayout)findViewById(R.id.frame); frame.addView(getLayoutInflater().cloneInContext(new ContextThemeWrapper(this,R.style.Theme_Locale_Light)).inflate(R.layout.frame,frame,false)); if (null == savedInstanceState) { final Bundle forwardedBundle=getIntent().getBundleExtra(com.twofortyfouram.locale.Intent.EXTRA_BUNDLE); if (PluginBundleManager.isBundleValid(forwardedBundle)) { ((EditText)findViewById(R.id.messagebody)).setText(forwardedBundle.getString(PluginBundleManager.BUNDLE_EXTRA_STRING_MESSAGE)); ((EditText)findViewById(R.id.phone)).setText(forwardedBundle.getString(PluginBundleManager.BUNDLE_EXTRA_STRING_PHONE)); ((EditText)findViewById(R.id.gvuser)).setText(forwardedBundle.getString(PluginBundleManager.BUNDLE_EXTRA_STRING_USER)); ((EditText)findViewById(R.id.gvpass)).setText(forwardedBundle.getString(PluginBundleManager.BUNDLE_EXTRA_STRING_PASS)); } } }
Example 40
From project ignition, under directory /ignition-core/ignition-core-lib/src/com/github/ignition/core/adapters/.
Source file: RemoteImageGalleryAdapter.java

@Override public View getView(int position,View convertView,ViewGroup parent){ String imageUrl=(String)getItem(position); ViewHolder viewHolder=null; RemoteImageView remoteImageView=null; if (convertView == null) { remoteImageView=new RemoteImageView(context,null,progressDrawable,errorDrawable,false); FrameLayout.LayoutParams lp=new FrameLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT); lp.gravity=Gravity.CENTER; remoteImageView.setLayoutParams(lp); FrameLayout container=new FrameLayout(context); container.setLayoutParams(new Gallery.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT)); container.addView(remoteImageView,0); convertView=container; viewHolder=new ViewHolder(); viewHolder.webImageView=remoteImageView; convertView.setTag(viewHolder); } else { viewHolder=(ViewHolder)convertView.getTag(); remoteImageView=viewHolder.webImageView; } remoteImageView.reset(); remoteImageView.setImageUrl(imageUrl); remoteImageView.loadImage(); onGetView(position,remoteImageView,(ViewGroup)convertView,parent); return convertView; }
Example 41
From project iosched_2, under directory /android/src/com/google/android/apps/iosched/ui/.
Source file: SearchActivity.java

/** * Build and add "sessions" tab. */ private void setupSessionsTab(){ 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()); } mTabHost.addTab(mTabHost.newTabSpec(TAG_SESSIONS).setIndicator(buildIndicator(R.string.starred_sessions)).setContent(R.id.fragment_sessions)); }
Example 42
From project Juggernaut_SystemUI, under directory /src/com/android/systemui/statusbar/.
Source file: StatusBarService.java

void onTrackingViewAttached(){ WindowManager.LayoutParams lp; int pixelFormat; Drawable bg; pixelFormat=PixelFormat.TRANSLUCENT; final int disph=mDisplay.getHeight(); lp=mExpandedDialog.getWindow().getAttributes(); lp.width=ViewGroup.LayoutParams.MATCH_PARENT; lp.height=getExpandedHeight(); lp.x=0; mTrackingPosition=lp.y=-disph; lp.type=WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL; lp.flags=WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL| WindowManager.LayoutParams.FLAG_DITHER| WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; lp.format=pixelFormat; lp.gravity=Gravity.TOP | Gravity.FILL_HORIZONTAL; lp.setTitle("StatusBarExpanded"); mExpandedDialog.getWindow().setAttributes(lp); mExpandedDialog.getWindow().setFormat(pixelFormat); mExpandedParams=lp; mExpandedDialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE); mExpandedDialog.setContentView(mExpandedView,new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT)); mExpandedDialog.getWindow().setBackgroundDrawable(null); mExpandedDialog.show(); FrameLayout hack=(FrameLayout)mExpandedView.getParent(); mStatusBarView.setVisibility(View.VISIBLE); }
Example 43
From project madvertise-android-sdk, under directory /madvertiseSDK/src/de/madvertise/android/sdk/.
Source file: MadvertiseMraidView.java

private void resize(final int width,final int height){ final FrameLayout content=(FrameLayout)getRootView().findViewById(android.R.id.content); final FrameLayout.LayoutParams adParams=new FrameLayout.LayoutParams(width,height); final View placeholderView=new View(getContext()); placeholderView.setLayoutParams(getLayoutParams()); mExpandLayout=new FrameLayout(getContext()); final FrameLayout.LayoutParams layoutParams=new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT,FrameLayout.LayoutParams.WRAP_CONTENT); layoutParams.gravity=Gravity.CENTER; mExpandLayout.setLayoutParams(layoutParams); mOriginalParent=(ViewGroup)getParent(); int index=0; if (mOriginalParent != null) { int count=mOriginalParent.getChildCount(); for (index=0; index < count; index++) { if (mOriginalParent.getChildAt(index) == this) break; } mIndex=index; this.setLayoutParams(adParams); mOriginalParent.removeView(this); mExpandLayout.addView(this); mCloseButton=addCloseButtonToViewGroup(((ViewGroup)getParent())); mCloseButton.setId(43); if (!mExpandProperties.useCustomClose) { mCloseButton.setImageResource(android.R.drawable.ic_menu_close_clear_cancel); } content.addView(mExpandLayout); mOriginalParent.addView(placeholderView,mIndex); mOriginalParent.setVisibility(View.GONE); mState=STATE_EXPANDED; } }
Example 44
From project 2Degrees-Toolbox, under directory /ActionBarSherlock/src/com/actionbarsherlock/internal/view/menu/.
Source file: MenuPopupHelper.java

private int measureContentWidth(ListAdapter adapter){ int width=0; View itemView=null; int itemType=0; final int widthMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int heightMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int count=adapter.getCount(); for (int i=0; i < count; i++) { final int positionType=adapter.getItemViewType(i); if (positionType != itemType) { itemType=positionType; itemView=null; } if (mMeasureParent == null) { mMeasureParent=new FrameLayout(mContext); } itemView=adapter.getView(i,itemView,mMeasureParent); itemView.measure(widthMeasureSpec,heightMeasureSpec); width=Math.max(width,itemView.getMeasuredWidth()); } return width; }
Example 45
From project 4308Cirrus, under directory /Extras/actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/.
Source file: MenuPopupHelper.java

private int measureContentWidth(ListAdapter adapter){ int width=0; View itemView=null; int itemType=0; final int widthMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int heightMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int count=adapter.getCount(); for (int i=0; i < count; i++) { final int positionType=adapter.getItemViewType(i); if (positionType != itemType) { itemType=positionType; itemView=null; } if (mMeasureParent == null) { mMeasureParent=new FrameLayout(mContext); } itemView=adapter.getView(i,itemView,mMeasureParent); itemView.measure(widthMeasureSpec,heightMeasureSpec); width=Math.max(width,itemView.getMeasuredWidth()); } return width; }
Example 46
From project Amantech, under directory /Android/action_bar_sherlock/src/com/actionbarsherlock/internal/view/menu/.
Source file: MenuPopupHelper.java

private int measureContentWidth(ListAdapter adapter){ int width=0; View itemView=null; int itemType=0; final int widthMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int heightMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int count=adapter.getCount(); for (int i=0; i < count; i++) { final int positionType=adapter.getItemViewType(i); if (positionType != itemType) { itemType=positionType; itemView=null; } if (mMeasureParent == null) { mMeasureParent=new FrameLayout(mContext); } itemView=adapter.getView(i,itemView,mMeasureParent); itemView.measure(widthMeasureSpec,heightMeasureSpec); width=Math.max(width,itemView.getMeasuredWidth()); } return width; }
Example 47
From project andlytics, under directory /actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/.
Source file: MenuPopupHelper.java

private int measureContentWidth(ListAdapter adapter){ int width=0; View itemView=null; int itemType=0; final int widthMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int heightMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int count=adapter.getCount(); for (int i=0; i < count; i++) { final int positionType=adapter.getItemViewType(i); if (positionType != itemType) { itemType=positionType; itemView=null; } if (mMeasureParent == null) { mMeasureParent=new FrameLayout(mContext); } itemView=adapter.getView(i,itemView,mMeasureParent); itemView.measure(widthMeasureSpec,heightMeasureSpec); width=Math.max(width,itemView.getMeasuredWidth()); } return width; }
Example 48
From project androidZenWriter, under directory /library/src/com/actionbarsherlock/internal/view/menu/.
Source file: MenuPopupHelper.java

private int measureContentWidth(ListAdapter adapter){ int width=0; View itemView=null; int itemType=0; final int widthMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int heightMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int count=adapter.getCount(); for (int i=0; i < count; i++) { final int positionType=adapter.getItemViewType(i); if (positionType != itemType) { itemType=positionType; itemView=null; } if (mMeasureParent == null) { mMeasureParent=new FrameLayout(mContext); } itemView=adapter.getView(i,itemView,mMeasureParent); itemView.measure(widthMeasureSpec,heightMeasureSpec); width=Math.max(width,itemView.getMeasuredWidth()); } return width; }
Example 49
@Override public void onFinishInflate(){ super.onFinishInflate(); this.setFocusable(true); final float DENSITY=this.getResources().getDisplayMetrics().density; mFrame=new FrameLayout(mContext); mFrame.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT)); int padding=(int)(DENSITY * 1 + 0.5f); mFrame.setPadding(0,padding,0,padding); mFrame.setBackgroundColor(R.color.black); mFrameForeground=new View(mContext); mFrameForeground.setBackgroundColor(this.getResources().getColor(R.color.genericBG)); mFrameForeground.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT)); mTeamText=new TextView(mContext); mTeamText.setText("No team assigned"); mTeamText.setLayoutParams(new LayoutParams((int)(DENSITY * INITIAL_TEXTWIDTH + 0.5f),LayoutParams.FILL_PARENT)); mTeamText.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT); mTeamText.setIncludeFontPadding(false); mTeamText.setPadding((int)(DENSITY * 15 + 0.5f),0,0,0); mTeamText.setTextSize(TypedValue.COMPLEX_UNIT_DIP,INITIAL_TEXTSIZE); mFrame.addView(mFrameForeground); mFrame.addView(mTeamText); mButtons=new LinearLayout(mContext); mButtons.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT)); mButtons.setOrientation(LinearLayout.HORIZONTAL); mButtonAddTeam=new View(mContext); mButtonAddTeam.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT,1f)); mButtonAddTeam.setOnClickListener(mAddTeamListener); mButtonEditTeamName=new ImageButton(mContext); LinearLayout.LayoutParams buttonParams=new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT); buttonParams.gravity=(Gravity.CENTER_VERTICAL); buttonParams.rightMargin=(int)(DENSITY * 10 + 0.5f); mButtonEditTeamName.setLayoutParams(buttonParams); mButtonEditTeamName.setBackgroundDrawable(this.getResources().getDrawable(R.drawable.gamesetup_editicon_selector)); mButtonEditTeamName.setOnClickListener(mEditTeamListener); mButtons.addView(mButtonAddTeam); mButtons.addView(mButtonEditTeamName); this.addView(mFrame); this.addView(mButtons); }
Example 50
From project CHMI, under directory /src/org/kaldax/app/chmi/.
Source file: StandardLayoutProviderLegacy.java

public void AllocateLayoutItems(){ dateTextView=new TextView(chmiActivity); iv=new ImageView(chmiActivity){ @Override public boolean onTouchEvent( MotionEvent event){ iZoomOriginWidth=this.getWidth(); iZoomOriginHeight=this.getHeight(); iZoomXCenterPos=event.getX(); iZoomYCenterPos=event.getY(); bZoomActive=!bZoomActive; ShowImage(chmiActivity.getCurrentImgIdx()); return super.onTouchEvent(event); } } ; seekBar=new SeekBar(chmiActivity); btPlay=new ImageButton(chmiActivity); lSeekBar=new LinearLayout(chmiActivity); imgProgressText=new TextView(chmiActivity); statusText=new TextView(chmiActivity); layout=new TableLayout(chmiActivity); row2lin=new LinearLayout(chmiActivity); imgs=new FrameLayout(chmiActivity); tableButtons=new TableLayout(chmiActivity); row2a=new TableRow(chmiActivity); row2b=new TableRow(chmiActivity); row2c=new TableRow(chmiActivity); row2d=new TableRow(chmiActivity); row2e=new TableRow(chmiActivity); frLayout=new FrameLayout(chmiActivity); row1=new TableRow(chmiActivity); row2fr=new FrameLayout(chmiActivity); row4=new LinearLayout(chmiActivity); row5=new LinearLayout(chmiActivity); row3=new LinearLayout(chmiActivity); imgScrollView=new ScrollView(chmiActivity); }
Example 51
From project cow, under directory /libs/ActionBarSherlock/library/src/com/actionbarsherlock/internal/view/menu/.
Source file: MenuPopupHelper.java

private int measureContentWidth(ListAdapter adapter){ int width=0; View itemView=null; int itemType=0; final int widthMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int heightMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int count=adapter.getCount(); for (int i=0; i < count; i++) { final int positionType=adapter.getItemViewType(i); if (positionType != itemType) { itemType=positionType; itemView=null; } if (mMeasureParent == null) { mMeasureParent=new FrameLayout(mContext); } itemView=adapter.getView(i,itemView,mMeasureParent); itemView.measure(widthMeasureSpec,heightMeasureSpec); width=Math.max(width,itemView.getMeasuredWidth()); } return width; }
Example 52
From project cw-omnibus, under directory /external/ActionBarSherlock/src/com/actionbarsherlock/internal/view/menu/.
Source file: MenuPopupHelper.java

private int measureContentWidth(ListAdapter adapter){ int width=0; View itemView=null; int itemType=0; final int widthMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int heightMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int count=adapter.getCount(); for (int i=0; i < count; i++) { final int positionType=adapter.getItemViewType(i); if (positionType != itemType) { itemType=positionType; itemView=null; } if (mMeasureParent == null) { mMeasureParent=new FrameLayout(mContext); } itemView=adapter.getView(i,itemView,mMeasureParent); itemView.measure(widthMeasureSpec,heightMeasureSpec); width=Math.max(width,itemView.getMeasuredWidth()); } return width; }
Example 53
From project DeskSMS, under directory /ActionBarSherlock/src/com/actionbarsherlock/internal/view/menu/.
Source file: MenuPopupHelper.java

private int measureContentWidth(ListAdapter adapter){ int width=0; View itemView=null; int itemType=0; final int widthMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int heightMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int count=adapter.getCount(); for (int i=0; i < count; i++) { final int positionType=adapter.getItemViewType(i); if (positionType != itemType) { itemType=positionType; itemView=null; } if (mMeasureParent == null) { mMeasureParent=new FrameLayout(mContext); } itemView=adapter.getView(i,itemView,mMeasureParent); itemView.measure(widthMeasureSpec,heightMeasureSpec); width=Math.max(width,itemView.getMeasuredWidth()); } return width; }
Example 54
From project dmix, under directory /ActionBarSherlock/src/com/actionbarsherlock/internal/view/menu/.
Source file: MenuPopupHelper.java

private int measureContentWidth(ListAdapter adapter){ int width=0; View itemView=null; int itemType=0; final int widthMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int heightMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int count=adapter.getCount(); for (int i=0; i < count; i++) { final int positionType=adapter.getItemViewType(i); if (positionType != itemType) { itemType=positionType; itemView=null; } if (mMeasureParent == null) { mMeasureParent=new FrameLayout(mContext); } itemView=adapter.getView(i,itemView,mMeasureParent); itemView.measure(widthMeasureSpec,heightMeasureSpec); width=Math.max(width,itemView.getMeasuredWidth()); } return width; }
Example 55
From project examples_2, under directory /SearchView/actionbarsherlock-lib/src/com/actionbarsherlock/internal/view/menu/.
Source file: MenuPopupHelper.java

private int measureContentWidth(ListAdapter adapter){ int width=0; View itemView=null; int itemType=0; final int widthMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int heightMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int count=adapter.getCount(); for (int i=0; i < count; i++) { final int positionType=adapter.getItemViewType(i); if (positionType != itemType) { itemType=positionType; itemView=null; } if (mMeasureParent == null) { mMeasureParent=new FrameLayout(mContext); } itemView=adapter.getView(i,itemView,mMeasureParent); itemView.measure(widthMeasureSpec,heightMeasureSpec); width=Math.max(width,itemView.getMeasuredWidth()); } return width; }
Example 56
From project GnucashMobile, under directory /com_actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/.
Source file: MenuPopupHelper.java

private int measureContentWidth(ListAdapter adapter){ int width=0; View itemView=null; int itemType=0; final int widthMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int heightMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int count=adapter.getCount(); for (int i=0; i < count; i++) { final int positionType=adapter.getItemViewType(i); if (positionType != itemType) { itemType=positionType; itemView=null; } if (mMeasureParent == null) { mMeasureParent=new FrameLayout(mContext); } itemView=adapter.getView(i,itemView,mMeasureParent); itemView.measure(widthMeasureSpec,heightMeasureSpec); width=Math.max(width,itemView.getMeasuredWidth()); } return width; }
Example 57
From project Google-Tasks-Client, under directory /actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/.
Source file: MenuPopupHelper.java

private int measureContentWidth(ListAdapter adapter){ int width=0; View itemView=null; int itemType=0; final int widthMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int heightMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int count=adapter.getCount(); for (int i=0; i < count; i++) { final int positionType=adapter.getItemViewType(i); if (positionType != itemType) { itemType=positionType; itemView=null; } if (mMeasureParent == null) { mMeasureParent=new FrameLayout(mContext); } itemView=adapter.getView(i,itemView,mMeasureParent); itemView.measure(widthMeasureSpec,heightMeasureSpec); width=Math.max(width,itemView.getMeasuredWidth()); } return width; }
Example 58
From project HSR-Timetable, under directory /ActionBarSherlock/src/com/actionbarsherlock/internal/view/menu/.
Source file: MenuPopupHelper.java

private int measureContentWidth(ListAdapter adapter){ int width=0; View itemView=null; int itemType=0; final int widthMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int heightMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int count=adapter.getCount(); for (int i=0; i < count; i++) { final int positionType=adapter.getItemViewType(i); if (positionType != itemType) { itemType=positionType; itemView=null; } if (mMeasureParent == null) { mMeasureParent=new FrameLayout(mContext); } itemView=adapter.getView(i,itemView,mMeasureParent); itemView.measure(widthMeasureSpec,heightMeasureSpec); width=Math.max(width,itemView.getMeasuredWidth()); } return width; }
Example 59
From project iosched_3, under directory /libprojects/abs/src/com/actionbarsherlock/internal/view/menu/.
Source file: MenuPopupHelper.java

private int measureContentWidth(ListAdapter adapter){ int width=0; View itemView=null; int itemType=0; final int widthMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int heightMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int count=adapter.getCount(); for (int i=0; i < count; i++) { final int positionType=adapter.getItemViewType(i); if (positionType != itemType) { itemType=positionType; itemView=null; } if (mMeasureParent == null) { mMeasureParent=new FrameLayout(mContext); } itemView=adapter.getView(i,itemView,mMeasureParent); itemView.measure(widthMeasureSpec,heightMeasureSpec); width=Math.max(width,itemView.getMeasuredWidth()); } return width; }
Example 60
From project IRC-Client, under directory /actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/.
Source file: MenuPopupHelper.java

private int measureContentWidth(ListAdapter adapter){ int width=0; View itemView=null; int itemType=0; final int widthMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int heightMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int count=adapter.getCount(); for (int i=0; i < count; i++) { final int positionType=adapter.getItemViewType(i); if (positionType != itemType) { itemType=positionType; itemView=null; } if (mMeasureParent == null) { mMeasureParent=new FrameLayout(mContext); } itemView=adapter.getView(i,itemView,mMeasureParent); itemView.measure(widthMeasureSpec,heightMeasureSpec); width=Math.max(width,itemView.getMeasuredWidth()); } return width; }
Example 61
From project MensaUPB, under directory /libs/ActionbarSherlock/src/com/actionbarsherlock/internal/view/menu/.
Source file: MenuPopupHelper.java

private int measureContentWidth(ListAdapter adapter){ int width=0; View itemView=null; int itemType=0; final int widthMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int heightMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int count=adapter.getCount(); for (int i=0; i < count; i++) { final int positionType=adapter.getItemViewType(i); if (positionType != itemType) { itemType=positionType; itemView=null; } if (mMeasureParent == null) { mMeasureParent=new FrameLayout(mContext); } itemView=adapter.getView(i,itemView,mMeasureParent); itemView.measure(widthMeasureSpec,heightMeasureSpec); width=Math.max(width,itemView.getMeasuredWidth()); } return width; }
Example 62
From project mWater-Android-App, under directory /android/actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/.
Source file: MenuPopupHelper.java

private int measureContentWidth(ListAdapter adapter){ int width=0; View itemView=null; int itemType=0; final int widthMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int heightMeasureSpec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); final int count=adapter.getCount(); for (int i=0; i < count; i++) { final int positionType=adapter.getItemViewType(i); if (positionType != itemType) { itemType=positionType; itemView=null; } if (mMeasureParent == null) { mMeasureParent=new FrameLayout(mContext); } itemView=adapter.getView(i,itemView,mMeasureParent); itemView.measure(widthMeasureSpec,heightMeasureSpec); width=Math.max(width,itemView.getMeasuredWidth()); } return width; }
Example 63
From project ActionBarCompat, under directory /ActionBarCompat/src/sk/m217/actionbarcompat/.
Source file: ActionBarCompatHoneycomb.java

public static void setHomeButtonEnabled(Activity activity,boolean enabled){ View v=activity.findViewById(android.R.id.home); if (v != null) { ViewParent vp=v.getParent(); if (vp != null && vp instanceof FrameLayout) { ((FrameLayout)vp).setEnabled(enabled); ((FrameLayout)vp).setClickable(enabled); } } }
Example 64
From project AirCastingAndroidClient, under directory /src/main/java/pl/llp/aircasting/activity/.
Source file: ButtonsActivity.java

protected void setButton(FrameLayout layout,int id){ layout.removeAllViews(); View view=layoutInflater.inflate(id,null); view.setOnClickListener(this); layout.addView(view); }
Example 65
From project android-mapviewballoons, under directory /android-mapviewballoons/src/com/readystatesoftware/mapviewballoons/.
Source file: BalloonOverlayView.java

/** * Create a new BalloonOverlayView. * @param context - The activity context. * @param balloonBottomOffset - The bottom padding (in pixels) to be appliedwhen rendering this view. */ public BalloonOverlayView(Context context,int balloonBottomOffset){ super(context); setPadding(10,0,10,balloonBottomOffset); layout=new LimitLinearLayout(context); layout.setVisibility(VISIBLE); setupView(context,layout); FrameLayout.LayoutParams params=new FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT); params.gravity=Gravity.NO_GRAVITY; addView(layout,params); }
Example 66
From project android-thaiime, under directory /latinime/src/com/android/inputmethod/compat/.
Source file: FrameLayoutCompatUtils.java

public static MarginLayoutParams newLayoutParam(ViewGroup placer,int width,int height){ if (placer instanceof FrameLayout) { return new FrameLayout.LayoutParams(width,height); } else if (placer instanceof RelativeLayout) { return new RelativeLayout.LayoutParams(width,height); } else if (placer == null) { throw new NullPointerException("placer is null"); } else { throw new IllegalArgumentException("placer is neither FrameLayout nor RelativeLayout: " + placer.getClass().getName()); } }
Example 67
@Override protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); RelativeLayout layout=new RelativeLayout(getContext()); layout.setBackgroundColor(0xFFFFFFFF); setupWebView(layout); setupProgress(layout); FrameLayout.LayoutParams FILL=new FrameLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,ViewGroup.LayoutParams.FILL_PARENT); addContentView(layout,FILL); }
Example 68
From project android_packages_apps_TouchWiz30Launcher, under directory /src/com/sec/android/app/twlauncher/.
Source file: QuickViewMainMenu.java

public QuickViewMainMenu(Context context,AttributeSet attributeset,int i){ FrameLayout(context,attributeset,i); mAnimationStyle=1; mScrollState=0; mScrollRunnable=new ScrollRunnable(); mMaxDeltaY=0; mTmpRect=new Rect(); mScreenRect=new Rect(); mTouchState=0; mMultiTouchUsed=false; mPinchOutProcess=false; mScreenBgDrawablePadding=new Rect(); mOrientation=1; mUseFullScreenInLandScapeMode=true; mAnimationState=7; mIsDBUpdate=false; mTmpLocation=new int[4]; Resources resources=getResources(); mItemNumOfPage=LauncherConfig.getItemNoOfPage(context); mPanelSizeShort=resources.getDimensionPixelSize(0x7f090027); mPanelSizeLong=resources.getDimensionPixelSize(0x7f090028); mPanelSizeLong2=resources.getDimensionPixelSize(0x7f090029); init(); }
Example 69
From project android_packages_inputmethods_LatinIME, under directory /java/src/com/android/inputmethod/compat/.
Source file: FrameLayoutCompatUtils.java

public static MarginLayoutParams newLayoutParam(ViewGroup placer,int width,int height){ if (placer instanceof FrameLayout) { return new FrameLayout.LayoutParams(width,height); } else if (placer instanceof RelativeLayout) { return new RelativeLayout.LayoutParams(width,height); } else if (placer == null) { throw new NullPointerException("placer is null"); } else { throw new IllegalArgumentException("placer is neither FrameLayout nor RelativeLayout: " + placer.getClass().getName()); } }
Example 70
From project Backyard-Brains-Android-App, under directory /src/com/backyardbrains/.
Source file: BackyardAndroidActivity.java

@Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.backyard_main); getSettings(); mainscreenGLLayout=(FrameLayout)findViewById(R.id.glContainer); UIFactory.getUi().setupLabels(this); UIFactory.setupMsLineView(this); UIFactory.setupRecordingButtons(this); UIFactory.setupSampleSlider(this); }
Example 71
public ButtonsView(Context context){ super(context); this.context=context; setVisibility(INVISIBLE); Display display=((WindowManager)context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay(); int h=display.getHeight() - display.getWidth(); setLayoutParams(new FrameLayout.LayoutParams(LayoutParams.FILL_PARENT,h,Gravity.BOTTOM)); cancel=button(R.drawable.cancel,doCancel,0); addView(cancel); ok=button(R.drawable.checkmark,doOk,1); addView(ok); setOkState(false); }
Example 72
From project CineShowTime-Android, under directory /Libraries/GreenDroid/src/greendroid/widget/.
Source file: ActionBarHost.java

@Override protected void onFinishInflate(){ super.onFinishInflate(); mActionBar=(ActionBar)findViewById(R.id.gd_action_bar); if (mActionBar == null || !(mActionBar instanceof ActionBar)) { throw new IllegalArgumentException("No ActionBar with the id R.id.gd_action_bar found in the layout."); } mContentView=(FrameLayout)findViewById(R.id.gd_action_bar_content_view); if (mContentView == null || !(mContentView instanceof FrameLayout)) { throw new IllegalArgumentException("No FrameLayout with the id R.id.gd_action_bar_content_view found in the layout."); } }
Example 73
From project CityBikes, under directory /src/net/homelinux/penecoptero/android/citybikes/app/.
Source file: StationSlidingDrawer.java

public void updateFrame(){ frameLayout=(FrameLayout)findViewById(R.id.content); if (frameLayout != null) { frameLayout.setBackgroundColor(Color.BLACK); frameLayout.removeAllViews(); frameLayout.addView(listView); } }
Example 74
From project DigitbooksExamples, under directory /DigitbooksExamples/src/fr/digitbooks/android/examples/chapitre03/.
Source file: SimpleLayoutActivity.java

/** * M?hode appel? lorsque que l'activit vient d'?re cr?e pour la premi?e fois */ @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); if (METHOD == JAVA_METHOD) { TextView textView=new TextView(this); LayoutParams layoutParams=new FrameLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT); textView.setLayoutParams(layoutParams); textView.setGravity(Gravity.CENTER); textView.setText("Bonjour Android !"); setContentView(textView); } else { setContentView(R.layout.simple_layout); } }
Example 75
From project droid-comic-viewer, under directory /src/net/robotmedia/acv/ui/widget/.
Source file: ComicFrame.java

private void init(Context context){ final int defStyle=context.getResources().getIdentifier("scrollViewStyle","attr",context.getPackageName()); mImage=new SuperImageView(context,null,defStyle); mImage.setScaleType(ImageView.ScaleType.CENTER); mImage.setLayoutParams(new FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT)); this.addView(mImage); mContentContainer=new AbsoluteLayout(context); mContentContainer.setLayoutParams(new FrameLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT)); this.addView(mContentContainer); mLetterbox=new Letterbox(context); mLetterbox.setLayoutParams(new FrameLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT)); this.addView(mLetterbox); }
Example 76
From project fanfoudroid, under directory /src/com/ch_linghu/fanfoudroid/ui/module/.
Source file: TweetCursorAdapter.java

@Override public View newView(Context context,Cursor cursor,ViewGroup parent){ View view=mInflater.inflate(R.layout.tweet,parent,false); TweetCursorAdapter.ViewHolder holder=new ViewHolder(); holder.tweetUserText=(TextView)view.findViewById(R.id.tweet_user_text); holder.tweetText=(TextView)view.findViewById(R.id.tweet_text); holder.profileLayout=(FrameLayout)view.findViewById(R.id.profile_layout); holder.profileImage=(ImageView)view.findViewById(R.id.profile_image); holder.metaText=(TextView)view.findViewById(R.id.tweet_meta_text); holder.fav=(ImageView)view.findViewById(R.id.tweet_fav); holder.has_image=(ImageView)view.findViewById(R.id.tweet_has_image); holder.retweet=(ImageView)view.findViewById(R.id.tweet_retweet); holder.reply=(ImageView)view.findViewById(R.id.tweet_reply); holder.tweetLayout=(LinearLayout)view.findViewById(R.id.tweet_layout); view.setTag(holder); return view; }
Example 77
From project flexymind-alpha, under directory /src/com/flexymind/alpha/customviews/.
Source file: PianoKeyboard.java

private ArrayList<View> getTouchedViews(final int x,final int y){ final ArrayList<View> touchedViews=new ArrayList<View>(); final ArrayList<View> possibleViews=new ArrayList<View>(); if (parent instanceof ViewGroup) { possibleViews.add(parent); for (int i=0; i < possibleViews.size(); i++) { final View view=possibleViews.get(i); final int location[]={0,0}; view.getLocationOnScreen(location); if (((view.getHeight() + location[1] >= y) & (view.getWidth() + location[0] >= x) & (view.getLeft() <= x)& (view.getTop() <= y)) || view instanceof FrameLayout) { touchedViews.add(view); possibleViews.addAll(getChildViews(view)); } } } if (touchedViews.size() > 0) { PianoKey lastKey=(PianoKey)touchedViews.get(touchedViews.size() - 1); if (touchedViews.size() > 2 && !lastKey.isWhite()) { touchedViews.remove(1); } } return touchedViews; }
Example 78
From project FlickrCity, under directory /src/com/FlickrCity/FlickrCityAndroid/Overlays/.
Source file: BalloonOverlayView.java

/** * Create a new BalloonOverlayView. * @param context - The activity context. * @param balloonBottomOffset - The bottom padding (in pixels) to be appliedwhen rendering this view. */ public BalloonOverlayView(Context context,int balloonBottomOffset){ super(context); setPadding(10,0,10,balloonBottomOffset); layout=new LinearLayout(context); layout.setVisibility(VISIBLE); LayoutInflater inflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View v=inflater.inflate(R.layout.balloon_overlay,layout); title=(TextView)v.findViewById(R.id.balloon_item_title); snippet=(TextView)v.findViewById(R.id.balloon_item_snippet); ImageView close=(ImageView)v.findViewById(R.id.close_img_button); close.setOnClickListener(new OnClickListener(){ public void onClick( View v){ layout.setVisibility(GONE); } } ); FrameLayout.LayoutParams params=new FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT); params.gravity=Gravity.NO_GRAVITY; addView(layout,params); }
Example 79
From project FlipDroid, under directory /app/src/com/goal98/flipdroid2/activity/.
Source file: SourceGridArrayAdapter.java

public View getView(int position,View convertView,ViewGroup viewGroup){ ViewGroup sourceItemView; final SourceItem item=getItem(position); if (convertView == null) { sourceItemView=(ViewGroup)inflator.inflate(sourceItemLayoutResource,null); } else { sourceItemView=(ViewGroup)convertView; } sourceItemView.removeAllViews(); WebImageView sourceImageView=new WebImageView(this.getContext(),item.getFirstImage(),this.getContext().getResources().getDrawable(Constants.DEFAULT_PIC),this.getContext().getResources().getDrawable(Constants.DEFAULT_PIC),false,false,ImageView.ScaleType.CENTER_CROP); sourceImageView.setScaleType(ImageView.ScaleType.CENTER_CROP); if (deviceInfo.isLargeScreen()) { sourceImageView.setDefaultHeight(200); sourceImageView.setDefaultWidth(200); } else if (deviceInfo.isSmallScreen()) { sourceImageView.setDefaultHeight(120); sourceImageView.setDefaultWidth(120); } try { if (item.getFirstImage() != null) { System.out.println(item.getFirstImage()); sourceImageView.setImageUrl(item.getFirstImage()); sourceImageView.loadImage(); } } catch ( Exception e) { Log.e(this.getClass().getName(),e.getMessage(),e); } item.setSourceItemView(sourceItemView); sourceItemView.addView(sourceImageView,new FrameLayout.LayoutParams(FrameLayout.LayoutParams.FILL_PARENT,200)); return sourceItemView; }
Example 80
From project GreenDroid, under directory /GreenDroid/src/greendroid/widget/.
Source file: ActionBarHost.java

@Override protected void onFinishInflate(){ super.onFinishInflate(); mActionBar=(ActionBar)findViewById(R.id.gd_action_bar); if (mActionBar == null || !(mActionBar instanceof ActionBar)) { throw new IllegalArgumentException("No ActionBar with the id R.id.gd_action_bar found in the layout."); } mContentView=(FrameLayout)findViewById(R.id.gd_action_bar_content_view); if (mContentView == null || !(mContentView instanceof FrameLayout)) { throw new IllegalArgumentException("No FrameLayout with the id R.id.gd_action_bar_content_view found in the layout."); } }
Example 81
From project GreenDroidQABar, under directory /src/greendroid/widget/.
Source file: ActionBarHost.java

@Override protected void onFinishInflate(){ super.onFinishInflate(); mActionBar=(ActionBar)findViewById(R.id.gd_action_bar); if (mActionBar == null || !(mActionBar instanceof ActionBar)) { throw new IllegalArgumentException("No ActionBar with the id R.id.gd_action_bar found in the layout."); } mContentView=(FrameLayout)findViewById(R.id.gd_action_bar_content_view); if (mContentView == null || !(mContentView instanceof FrameLayout)) { throw new IllegalArgumentException("No FrameLayout with the id R.id.gd_action_bar_content_view found in the layout."); } }
Example 82
From project Hackful-Europe-Reader, under directory /src/com/nineducks/hereader/ui/.
Source file: NewsItemsFragment.java

private void initUI(){ Log.d("hereader","Creating UI"); webViewContainer=(FrameLayout)getActivity().findViewById(R.id.webview_container); mDualPane=webViewContainer != null && webViewContainer.getVisibility() == View.VISIBLE; actionBar=(ActionBar)getActivity().findViewById(R.id.action_bar); actionBar.setHomeIcon(R.drawable.hackful_icon); actionBar.addAction(new LoadFrontpageItemsAction(HackfulReaderActivity.getContext(),this)); actionBar.addAction(new LoadNewItemsAction(HackfulReaderActivity.getContext(),this)); actionBar.addAction(new LoadAskItemsAction(HackfulReaderActivity.getContext(),this)); actionBar.addAction(new AboutAction(HackfulReaderActivity.getContext(),this)); if (mDualPane || getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { actionBar.setTitle(R.string.app_name); } if (mDualPane) { if (webView == null) { Log.d("hereader","WebView is null, creating new instance"); final ActionBar actionB=actionBar; webView=new WebView(getActivity()); webView.setId(R.id.webview_id); webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().setSupportZoom(true); webView.setWebChromeClient(new WebChromeClient(){ @Override public void onProgressChanged( WebView view, int newProgress){ if (newProgress == 100) { actionB.setProgressBarVisibility(View.GONE); } } } ); } webViewContainer.addView(webView,LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT); } Log.d("hereader","UI created"); }
Example 83
From project HapiPodcastJ, under directory /src/info/xuluan/podcast/.
Source file: HomeActivity.java

FrameLayout frame(){ if (frameLayout == null) { frameLayout=(FrameLayout)activity.getLayoutInflater().inflate(R.layout.framed_grid,null); linLay1=(LinearLayout)frameLayout.findViewById(R.id.linearLayout1); TextView tv=(TextView)frameLayout.findViewById(R.id.borderText); tv.setText(frameLabel); } return frameLayout; }
Example 84
From project Hax-Launcher, under directory /src/com/t3hh4xx0r/haxlauncher/.
Source file: AppsCustomizeTabHost.java

/** * Setup the tab host and create all necessary tabs. */ @Override protected void onFinishInflate(){ setup(); final ViewGroup tabsContainer=(ViewGroup)findViewById(R.id.tabs_container); final TabWidget tabs=(TabWidget)findViewById(android.R.id.tabs); final AppsCustomizePagedView appsCustomizePane=(AppsCustomizePagedView)findViewById(R.id.apps_customize_pane_content); mTabs=tabs; mTabsContainer=tabsContainer; mAppsCustomizePane=appsCustomizePane; mAnimationBuffer=(FrameLayout)findViewById(R.id.animation_buffer); mContent=(LinearLayout)findViewById(R.id.apps_customize_content); if (tabs == null || mAppsCustomizePane == null) throw new Resources.NotFoundException(); TabContentFactory contentFactory=new TabContentFactory(){ public View createTabContent( String tag){ return appsCustomizePane; } } ; TextView tabView; String label; label=getContext().getString(R.string.all_apps_button_label); tabView=(TextView)mLayoutInflater.inflate(R.layout.tab_widget_indicator,tabs,false); tabView.setText(label); tabView.setContentDescription(label); addTab(newTabSpec(APPS_TAB_TAG).setIndicator(tabView).setContent(contentFactory)); label=getContext().getString(R.string.widgets_tab_label); tabView=(TextView)mLayoutInflater.inflate(R.layout.tab_widget_indicator,tabs,false); tabView.setText(label); tabView.setContentDescription(label); addTab(newTabSpec(WIDGETS_TAB_TAG).setIndicator(tabView).setContent(contentFactory)); setOnTabChangedListener(this); AppsCustomizeTabKeyEventListener keyListener=new AppsCustomizeTabKeyEventListener(); View lastTab=tabs.getChildTabViewAt(tabs.getTabCount() - 1); lastTab.setOnKeyListener(keyListener); View shopButton=findViewById(R.id.market_button); shopButton.setOnKeyListener(keyListener); mTabsContainer.setAlpha(0f); }
Example 85
From project ICS_LatinIME_QHD, under directory /java/src/com/android/inputmethod/compat/.
Source file: FrameLayoutCompatUtils.java

public static MarginLayoutParams newLayoutParam(ViewGroup placer,int width,int height){ if (placer instanceof FrameLayout) { return new FrameLayout.LayoutParams(width,height); } else if (placer instanceof RelativeLayout) { return new RelativeLayout.LayoutParams(width,height); } else if (placer == null) { throw new NullPointerException("placer is null"); } else { throw new IllegalArgumentException("placer is neither FrameLayout nor RelativeLayout: " + placer.getClass().getName()); } }
Example 86
From project incubator-cordova-android, under directory /test/src/org/apache/cordova/test/.
Source file: BackButtonMultiPageTest.java

protected void setUp() throws Exception { super.setUp(); testActivity=this.getActivity(); containerView=(FrameLayout)testActivity.findViewById(android.R.id.content); innerContainer=(LinearLayout)containerView.getChildAt(0); testView=(CordovaWebView)innerContainer.getChildAt(0); }
Example 87
From project k-9, under directory /src/com/nobu_games/android/view/web/.
Source file: TitleBarWebView.java

/** * The hidden method setEmbeddedTitleBar has been removed from Jelly Bean. This method replicates the functionality. * @param v */ private void setEmbeddedTitleBarJellyBean(View v){ if (mTitleBar == v) return; if (mTitleBar != null) { removeView(mTitleBar); } if (null != v) { LayoutParams vParams=new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT,0,0); TouchBlockView tbv=new TouchBlockView(getContext()); FrameLayout.LayoutParams tbvParams=new FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.WRAP_CONTENT); tbv.addView(v,tbvParams); addView(tbv,vParams); v=tbv; } mTitleBar=v; }
Example 88
From project mediautilities, under directory /src/ac/robinson/view/.
Source file: CustomMediaController.java

/** * Set the view that acts as the anchor for the control view. This can for example be a VideoView, or your Activity's main view. * @param view The view to which to anchor the controller when it is visible. */ public void setAnchorView(View view){ mAnchor=view; FrameLayout.LayoutParams frameParams=new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT); removeAllViews(); View v=makeControllerView(); addView(v,frameParams); }