List of usage examples for android.widget FrameLayout setMinimumWidth
public void setMinimumWidth(int minWidth)
From source file:com.jgraves.achievementunlocked.AchievementsList_Fragment.java
private void addAchievementToList(Long id, String name, int points) { Log.i(ExploraApp.TAG, "Adding achievement image request of id " + id + " with height, " + imageViewHeight); FrameLayout fl = new FrameLayout(getActivity()); touchMap.put(fl, id);//from w ww. j a va 2 s. co m fl.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Long id = touchMap.get(v); Log.i(ExploraApp.TAG, "TOUCHED " + id); Intent intent = new Intent(getActivity(), Activity_AchievementInfo.class); intent.putExtra("achievement_id", Long.toString(id)); startActivity(intent); } }); TextView tv_name = new TextView(getActivity()); TextView tv_points = new TextView(getActivity()); ImageView iv = new ImageView(getActivity()); fl.setMinimumHeight(imageViewHeight); fl.setMinimumWidth(ExploraApp.screenWidth); robotoTypeface = Typeface.createFromAsset(getActivity().getAssets(), "Roboto-Thin.ttf"); tv_name.setText(name); tv_name.setTextSize(15f); tv_points.setTextSize(15f); tv_name.setTypeface(robotoTypeface); tv_points.setTypeface(robotoTypeface); tv_points.setText(Integer.toString(points)); tv_points.setGravity(Gravity.RIGHT); tv_points.setTextColor(Color.WHITE); tv_name.setTextColor(Color.WHITE); iv.setMinimumHeight(imageViewHeight); iv.setMinimumWidth(ExploraApp.screenWidth); fl.addView(iv); fl.addView(tv_name); fl.addView(tv_points); ll_images_container.addView(fl); sv_images.bringChildToFront(mQuickReturnView); DefaultImageListener listener = new DefaultImageListener(iv); ImageRequest imageRequest = new ImageRequest( ExploraApp.url_main + "/achievement/" + id + "/photo?y=" + imageViewHeight + "&x=" + ExploraApp.screenWidth, listener, ExploraApp.screenWidth, imageViewHeight, Bitmap.Config.ARGB_8888, listener); ExploraApp.mRequestQueue.add(imageRequest); }
From source file:com.dragon4.owo.ar_trace.ARCore.MixView.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); DataSource.createIcons(getResources()); try {/*from w w w .j a va 2 s . c o m*/ // ?? final PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); // ? ?? ? this.mWakeLock = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, "My Tag"); // ?? locationMgr = (LocationManager) getSystemService(Context.LOCATION_SERVICE); // ?? . 2 ?? (1/1000s), 3 ?? (m)? ? locationMgr.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000, 3, this); //orientation sensor sensorMgr_ori = (SensorManager) getSystemService(Context.SENSOR_SERVICE); orientationSensor = sensorMgr_ori.getDefaultSensor(Sensor.TYPE_ORIENTATION); killOnError(); // ? ? requestWindowFeature(Window.FEATURE_NO_TITLE); // ? ? // ?? FrameLayout frameLayout = new FrameLayout(this); // ? ?, ? frameLayout.setMinimumWidth(3000); frameLayout.setPadding(10, 0, 10, 10); // ? ? ? ?? ? camScreen = new CameraSurface(this); augScreen = new AugmentedView(this); setContentView(camScreen); // ? ?? ? ? // ? ?? ? addContentView(augScreen, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); // ? ? ? ? ?. // ? ? ? ?? ? ? ? addContentView(frameLayout, new FrameLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT, Gravity.BOTTOM)); topLayoutOnMixView = new TopLayoutOnMixView(this); RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT); addContentView(topLayoutOnMixView.mainArView, params); // ? ? ? topLayoutOnMixView ? ? handleIntent(getIntent()); // ?? // ? ? ? if (!isInited) { mixContext = new MixContext(this); // ? ? // ? ? mixContext.downloadManager = new DownloadManager(mixContext); //? ? ? navigator = new Navigator(mixContext, topLayoutOnMixView.naverFragment); // ? ? ?? ? ? dWindow = new PaintScreen(); dataView = new DataView(mixContext); isInited = true; // true } if (mixContext.isActualLocation() == false) { Toast.makeText(this, getString(DataView.CONNECTION_GPS_DIALOG_TEXT), Toast.LENGTH_LONG).show(); } } catch (Exception ex) { doError(ex); // ? ? } // ? IntentFilter naviBraodFilter = new IntentFilter(); naviBraodFilter.addAction("NAVI"); registerReceiver(naviRecevicer, naviBraodFilter); }