Guest User

Untitled

a guest
Feb 22nd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.52 KB | None | 0 0
  1. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  2. xmlns:app="http://schemas.android.com/apk/res-auto"
  3. xmlns:tools="http://schemas.android.com/tools"
  4. android:layout_width="match_parent"
  5. android:layout_height="match_parent"
  6. android:fitsSystemWindows="true"
  7. android:id="@+id/maintoolbar">
  8.  
  9. <android.support.design.widget.AppBarLayout
  10. android:layout_width="match_parent"
  11. android:layout_height="wrap_content"
  12. android:theme="@style/AppBarOverlay">
  13.  
  14. <android.support.v7.widget.Toolbar
  15. android:id="@+id/toolbar"
  16. android:layout_width="match_parent"
  17. android:layout_height="?attr/actionBarSize"
  18. android:background="@color/colorPrimary"
  19. app:popupTheme="@style/PopupOverlay"
  20. app:title="H20 Droid App " />
  21.  
  22. </android.support.design.widget.AppBarLayout>
  23.  
  24. <FrameLayout
  25. android:id="@+id/frame"
  26. android:layout_width="match_parent"
  27. android:layout_height="match_parent"
  28. app:layout_behavior="@string/appbar_scrolling_view_behavior"></FrameLayout>
  29.  
  30. <LinearLayout
  31. android:layout_width="wrap_content"
  32. android:layout_height="wrap_content"
  33. android:id="@+id/buttonlayout">
  34. <include
  35. layout="@layout/buttons"/>
  36. </LinearLayout>
  37.  
  38. <LinearLayout
  39. android:layout_width="wrap_content"
  40. android:layout_height="wrap_content"
  41. android:id="@+id/newlayout"
  42. android:visibility="gone">
  43. <include
  44. layout="@layout/buttons" />
  45. </LinearLayout>
  46.  
  47. cb6.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
  48. @Override
  49. public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
  50. if (cb6.isChecked()) {
  51.  
  52. editor.putBoolean("alt_layout",true);
  53. editor.putBoolean("checkbox6state", true);
  54. editor.commit();
  55. Log.i("Alt_Layout: ", "Activated");
  56.  
  57. }else{
  58. editor.putBoolean("alt_layout",false);
  59. editor.putBoolean("checkbox6state", false);
  60. editor.commit();
  61.  
  62. Log.i("Alt_Layout: ","Deactivated");
  63. }
  64. }
  65. });
  66.  
  67. Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
  68. sharedpreferences = PreferenceManager.getDefaultSharedPreferences(this);
  69. boolean layout_alt = sharedpreferences.getBoolean("alt_layout",false);
  70. if (layout_alt==true){
  71. LinearLayout llnew= (LinearLayout)findViewById(R.id.newlayout);
  72. LinearLayout llnorm = (LinearLayout)findViewById(R.id.buttonlayout);
  73. llnew.setVisibility(View.VISIBLE);
  74. llnorm.setVisibility(View.GONE);
  75. }
Add Comment
Please, Sign In to add comment