Advertisement
Guest User

Untitled

a guest
May 29th, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. public void greyView(View v){
  2. grey = (Button) findViewById(R.id.greyButton);
  3. relativeLayout = (RelativeLayout) findViewById(R.id.contentmainactivity2);
  4. relativeLayout.setBackgroundColor(Color.parseColor("#383838"));
  5. }
  6.  
  7. RelativeLayout popupwindow = (RelativeLayout) findViewById(R.id.popupwindow);
  8. relativeLayout = (RelativeLayout) findViewById(R.id.contentmainactivity2);
  9. settings = (Button) findViewById(R.id.settingsbutton);
  10. settings.setOnClickListener(new View.OnClickListener() {
  11. @Override
  12. public void onClick(View view) {
  13.  
  14. layoutInflater = (LayoutInflater) getApplicationContext().getSystemService(LAYOUT_INFLATER_SERVICE);
  15. ViewGroup container = (ViewGroup) layoutInflater.inflate(R.layout.popupwindow, null);
  16.  
  17. popupWindow = new PopupWindow(container, 600, 100, true);
  18. popupWindow.showAtLocation(relativeLayout, Gravity.NO_GRAVITY, 10, 975);
  19.  
  20. container.setOnTouchListener(new View.OnTouchListener(){
  21. @Override
  22. public boolean onTouch(View view, MotionEvent motionEvent){
  23. popupWindow.dismiss();
  24. return true;
  25. }
  26. });
  27. }
  28. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement