Guest User

Untitled

a guest
May 20th, 2018
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.51 KB | None | 0 0
  1. public void setInitialScreenDesign() {
  2. switch (LaunchPadConstants.loginnDetails.getLoginType()) {
  3. case LoginDetailsMgr.LOGINTYPE_STUDENT:
  4. StudentLeftFragment studentLeftFragment = (StudentLeftFragment) LaunchPadUtilities.getFragment(this, R.id.home_left_frag);
  5. if (studentLeftFragment != null) {
  6. if (studentLeftFragment.pollLinearLayout.setVisibility(GONE))
  7. {
  8. if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
  9. leftStudentLayout.getLayoutParams().width = (int) LaunchPadUtilities.convertDpToPixel(256, this);
  10. rightStudentLayout.getLayoutParams().width = (int) LaunchPadUtilities.convertDpToPixel(1024, this);
  11. int height = 550 - (Build.VERSION.SDK_INT >= 17 ? res.getInteger(R.integer.API_17_ASSIGNMENT_VIEW_DECREMENT_LAND) : 0);
  12. studentLeftFragment.leftLinearLayout.getLayoutParams().height = (int) LaunchPadUtilities.convertDpToPixel(height, this);
  13. } else if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
  14. leftStudentLayout.getLayoutParams().width = (int) LaunchPadUtilities.convertDpToPixel(256, this);
  15. rightStudentLayout.getLayoutParams().width = ((int) LaunchPadUtilities.convertDpToPixel(800, this) - (int) LaunchPadUtilities.convertDpToPixel(256, this));
  16. int height = res.getInteger(R.integer.assignmentlayoutheight)
  17. - (Build.VERSION.SDK_INT == 17 ? res.getInteger(R.integer.API_17_ASSIGNMENT_VIEW_DECREMENT_PORT) : 0);
  18. studentLeftFragment.leftLinearLayout.getLayoutParams().height = (int) LaunchPadUtilities.convertDpToPixel(height, this);
  19. // studentLeftFragment.leftLinearLayout.getLayoutParams().height
  20. // = 820;
  21. }
  22. }
  23. else
  24. {
  25. if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
  26. leftStudentLayout.getLayoutParams().width = (int) LaunchPadUtilities.convertDpToPixel(256, this);
  27. rightStudentLayout.getLayoutParams().width = (int) LaunchPadUtilities.convertDpToPixel(1024, this);
  28. int height = 340 - (Build.VERSION.SDK_INT >= 17 ? res.getInteger(R.integer.API_17_ASSIGNMENT_VIEW_DECREMENT_LAND) : 0);
  29. studentLeftFragment.leftLinearLayout.getLayoutParams().height = (int) LaunchPadUtilities.convertDpToPixel(height, this);
  30. } else if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
  31. leftStudentLayout.getLayoutParams().width = (int) LaunchPadUtilities.convertDpToPixel(256, this);
  32. rightStudentLayout.getLayoutParams().width = ((int) LaunchPadUtilities.convertDpToPixel(800, this) - (int) LaunchPadUtilities.convertDpToPixel(256, this));
  33. int height =800 - (Build.VERSION.SDK_INT == 17 ? res.getInteger(R.integer.API_17_ASSIGNMENT_VIEW_DECREMENT_PORT) : 0);
  34. studentLeftFragment.leftLinearLayout.getLayoutParams().height = (int) LaunchPadUtilities.convertDpToPixel(height, this);
  35. // studentLeftFragment.leftLinearLayout.getLayoutParams().height
  36. // = 820;
  37. }
  38. }
  39. }
  40. break;
  41. default:
  42. break;
  43. }
  44. }
  45.  
  46. if(studentLeftFragment.pollLinearLayout.getVisibility() == View.VISIBLE)
  47. {
  48. studentLeftFragment.pollLinearLayout.setVisibility(GONE);
  49. ...
  50. ...
  51. }
Add Comment
Please, Sign In to add comment