Advertisement
Guest User

Untitled

a guest
May 25th, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.53 KB | None | 0 0
  1.     public static void teken(Coupe coupe, ViewGroup container, Context context, Nsbeacon beacon) {
  2. //      LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  3. //      RelativeLayout coupeDrukteLayout = (RelativeLayout)inflater.inflate(R.layout.coupe_drukte_layout, null);
  4. //      container.addView(coupeDrukteLayout, 0 , new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 1000));
  5.         RelativeLayout coupeDrukteLayout = (RelativeLayout) container.findViewById(R.id.drukte_balk);
  6.         coupeDrukteLayout.setBackgroundColor(getKleurCoupeOpBasisVanBezetting(coupe.getCapaciteit(), coupe.getBezetting()));
  7.         if(beacon != null) {
  8.             if(beacon.getCoupeId().getCoupeId() == coupe.getCoupeId()) {
  9.                 Log.d("You are in coupe:", String.valueOf(beacon.getCoupeId().getCoupeId()));
  10.                 RelativeLayout plaatsInCoupe = new RelativeLayout(context);
  11.                 container.addView(plaatsInCoupe);
  12.                 RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT);
  13.                 params.addRule(RelativeLayout.BELOW, coupeDrukteLayout.getId());
  14.                 params.addRule(RelativeLayout.ALIGN_BASELINE, coupeDrukteLayout.getId());
  15.                 plaatsInCoupe.setLayoutParams(params);
  16.                 TextView tv = new TextView(context);
  17.                 tv.setText("U bent hier");
  18.                 plaatsInCoupe.addView(tv);
  19.             }
  20.         }
  21.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement