Skip to content

Commit

Permalink
feat(coinjoin): add wallet mixing entry point (#1216)
Browse files Browse the repository at this point in the history
* feat: coinjoin menu item

* feat: coinjoin info fragment

* fix: icons

* fix: back button
  • Loading branch information
Syn-McJ authored Oct 10, 2023
1 parent bca8c24 commit 7f1ca22
Show file tree
Hide file tree
Showing 15 changed files with 382 additions and 2 deletions.
5 changes: 5 additions & 0 deletions wallet/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,11 @@
android:theme="@style/My.Theme.ChildActivity"
android:screenOrientation="portrait" />

<activity
android:name="de.schildbach.wallet.ui.coinjoin.CoinJoinActivity"
android:theme="@style/LockScreenActivity.Child.Theme"
android:screenOrientation="portrait" />

<provider
android:name="de.schildbach.wallet.data.AddressBookProvider"
android:authorities="${applicationId}.address_book"
Expand Down
5 changes: 5 additions & 0 deletions wallet/res/drawable/ic_battery.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:autoMirrored="true" android:height="13dp"
android:viewportHeight="13" android:viewportWidth="28"
android:width="28dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#008DE4" android:pathData="M5.026,9.977C4.751,9.977 4.525,9.953 4.35,9.906C4.18,9.859 4.039,9.78 3.928,9.669C3.816,9.552 3.737,9.408 3.69,9.238C3.644,9.068 3.62,8.846 3.62,8.57V4.756C3.62,4.48 3.644,4.255 3.69,4.079C3.737,3.903 3.816,3.76 3.928,3.648C4.039,3.537 4.18,3.458 4.35,3.411C4.525,3.364 4.757,3.341 5.044,3.341H15.538C15.808,3.341 16.027,3.364 16.197,3.411C16.373,3.458 16.517,3.537 16.628,3.648C16.745,3.76 16.824,3.903 16.865,4.079C16.912,4.249 16.935,4.472 16.935,4.747V8.57C16.935,9.092 16.833,9.458 16.628,9.669C16.517,9.78 16.376,9.859 16.206,9.906C16.036,9.953 15.814,9.977 15.538,9.977H5.026ZM5.606,12.807C4.804,12.807 4.089,12.742 3.462,12.613C2.841,12.479 2.305,12.183 1.854,11.726C1.396,11.28 1.104,10.747 0.975,10.126C0.846,9.499 0.781,8.784 0.781,7.981V5.31C0.781,4.524 0.846,3.821 0.975,3.2C1.109,2.579 1.402,2.04 1.854,1.583C2.305,1.138 2.841,0.848 3.462,0.713C4.089,0.578 4.798,0.511 5.589,0.511H19.388C20.19,0.511 20.905,0.578 21.532,0.713C22.159,0.842 22.698,1.132 23.149,1.583C23.601,2.034 23.891,2.573 24.02,3.2C24.154,3.821 24.222,4.533 24.222,5.336V7.981C24.222,8.784 24.154,9.499 24.02,10.126C23.891,10.747 23.601,11.28 23.149,11.726C22.698,12.183 22.159,12.479 21.532,12.613C20.905,12.742 20.19,12.807 19.388,12.807H5.606ZM5.369,11.075H19.634C20.091,11.075 20.519,11.034 20.917,10.952C21.321,10.87 21.644,10.709 21.884,10.469C22.13,10.223 22.291,9.903 22.367,9.511C22.449,9.112 22.49,8.682 22.49,8.219V5.081C22.49,4.63 22.449,4.208 22.367,3.815C22.291,3.417 22.13,3.095 21.884,2.849C21.644,2.608 21.321,2.447 20.917,2.365C20.519,2.277 20.091,2.233 19.634,2.233H5.387C4.924,2.233 4.487,2.274 4.077,2.356C3.673,2.438 3.351,2.603 3.11,2.849C2.87,3.089 2.709,3.411 2.627,3.815C2.551,4.214 2.513,4.645 2.513,5.107V8.219C2.513,8.682 2.551,9.112 2.627,9.511C2.703,9.903 2.864,10.223 3.11,10.469C3.356,10.709 3.679,10.87 4.077,10.952C4.481,11.034 4.912,11.075 5.369,11.075ZM25.496,9.045V4.272C25.742,4.284 25.997,4.393 26.261,4.598C26.53,4.797 26.756,5.072 26.938,5.424C27.119,5.775 27.21,6.186 27.21,6.654C27.21,7.129 27.119,7.542 26.938,7.894C26.756,8.239 26.53,8.515 26.261,8.72C25.997,8.919 25.742,9.027 25.496,9.045Z"/>
</vector>
5 changes: 5 additions & 0 deletions wallet/res/drawable/ic_coinjoin.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:autoMirrored="true" android:height="20dp"
android:viewportHeight="20" android:viewportWidth="20"
android:width="20dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#008DE4" android:pathData="M10,20C8.634,20 7.346,19.739 6.137,19.216C4.935,18.693 3.873,17.971 2.951,17.049C2.029,16.128 1.307,15.065 0.784,13.863C0.261,12.654 0,11.366 0,10C0,8.634 0.261,7.35 0.784,6.147C1.307,4.938 2.026,3.873 2.941,2.951C3.863,2.029 4.925,1.307 6.127,0.784C7.337,0.261 8.624,0 9.99,0C11.356,0 12.644,0.261 13.853,0.784C15.062,1.307 16.128,2.029 17.049,2.951C17.971,3.873 18.693,4.938 19.216,6.147C19.739,7.35 20,8.634 20,10C20,11.366 19.739,12.654 19.216,13.863C18.693,15.065 17.971,16.128 17.049,17.049C16.128,17.971 15.062,18.693 13.853,19.216C12.65,19.739 11.366,20 10,20ZM7.843,7.892C8.32,7.892 8.732,7.719 9.078,7.373C9.431,7.02 9.608,6.605 9.608,6.127C9.608,5.644 9.431,5.232 9.078,4.892C8.732,4.546 8.32,4.373 7.843,4.373C7.359,4.373 6.944,4.546 6.598,4.892C6.258,5.232 6.088,5.644 6.088,6.127C6.088,6.605 6.258,7.02 6.598,7.373C6.938,7.719 7.353,7.892 7.843,7.892ZM12.167,7.892C12.65,7.892 13.062,7.719 13.402,7.373C13.748,7.02 13.922,6.605 13.922,6.127C13.922,5.644 13.748,5.232 13.402,4.892C13.062,4.546 12.65,4.373 12.167,4.373C11.689,4.373 11.274,4.546 10.922,4.892C10.575,5.232 10.402,5.644 10.402,6.127C10.402,6.605 10.575,7.02 10.922,7.373C11.274,7.719 11.689,7.892 12.167,7.892ZM5.696,11.755C6.173,11.755 6.582,11.582 6.922,11.235C7.268,10.889 7.441,10.477 7.441,10C7.441,9.523 7.268,9.111 6.922,8.765C6.582,8.412 6.173,8.235 5.696,8.235C5.212,8.235 4.794,8.412 4.441,8.765C4.095,9.111 3.922,9.523 3.922,10C3.922,10.477 4.095,10.889 4.441,11.235C4.788,11.582 5.206,11.755 5.696,11.755ZM10.01,11.755C10.487,11.755 10.899,11.582 11.245,11.235C11.592,10.889 11.765,10.477 11.765,10C11.765,9.523 11.592,9.111 11.245,8.765C10.899,8.412 10.487,8.235 10.01,8.235C9.526,8.235 9.111,8.412 8.765,8.765C8.418,9.111 8.245,9.523 8.245,10C8.245,10.477 8.418,10.889 8.765,11.235C9.111,11.582 9.526,11.755 10.01,11.755ZM14.323,11.755C14.801,11.755 15.212,11.582 15.559,11.235C15.912,10.889 16.088,10.477 16.088,10C16.088,9.523 15.912,9.111 15.559,8.765C15.212,8.412 14.801,8.235 14.323,8.235C13.84,8.235 13.425,8.412 13.078,8.765C12.739,9.111 12.569,9.523 12.569,10C12.569,10.477 12.739,10.889 13.078,11.235C13.425,11.582 13.84,11.755 14.323,11.755ZM7.843,15.627C8.32,15.627 8.732,15.458 9.078,15.118C9.431,14.771 9.608,14.356 9.608,13.873C9.608,13.389 9.431,12.974 9.078,12.627C8.732,12.281 8.32,12.108 7.843,12.108C7.359,12.108 6.944,12.281 6.598,12.627C6.258,12.974 6.088,13.389 6.088,13.873C6.088,14.35 6.258,14.761 6.598,15.108C6.938,15.454 7.353,15.627 7.843,15.627ZM12.167,15.627C12.65,15.627 13.062,15.458 13.402,15.118C13.748,14.771 13.922,14.356 13.922,13.873C13.922,13.389 13.748,12.974 13.402,12.627C13.062,12.281 12.65,12.108 12.167,12.108C11.689,12.108 11.274,12.281 10.922,12.627C10.575,12.974 10.402,13.389 10.402,13.873C10.402,14.356 10.575,14.771 10.922,15.118C11.274,15.458 11.689,15.627 12.167,15.627Z"/>
</vector>
6 changes: 6 additions & 0 deletions wallet/res/drawable/ic_coinjoin_big.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<vector android:autoMirrored="true" android:height="80dp"
android:viewportHeight="80" android:viewportWidth="80"
android:width="80dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#78C4F5" android:pathData="M40,0L40,0A40,40 0,0 1,80 40L80,40A40,40 0,0 1,40 80L40,80A40,40 0,0 1,0 40L0,40A40,40 0,0 1,40 0z"/>
<path android:fillColor="#ffffff" android:pathData="M33.745,34.195C32.339,34.195 31.138,33.697 30.142,32.701C29.146,31.685 28.647,30.484 28.647,29.098C28.647,27.691 29.146,26.49 30.142,25.494C31.157,24.498 32.358,24 33.745,24C35.132,24 36.323,24.498 37.319,25.494C38.335,26.49 38.843,27.691 38.843,29.098C38.843,30.484 38.335,31.685 37.319,32.701C36.323,33.697 35.132,34.195 33.745,34.195ZM46.255,34.195C44.868,34.195 43.667,33.697 42.651,32.701C41.655,31.685 41.157,30.484 41.157,29.098C41.157,27.691 41.655,26.49 42.651,25.494C43.667,24.498 44.868,24 46.255,24C47.661,24 48.862,24.498 49.858,25.494C50.854,26.49 51.353,27.691 51.353,29.098C51.353,30.484 50.854,31.685 49.858,32.701C48.862,33.697 47.661,34.195 46.255,34.195ZM27.505,45.416C26.079,45.416 24.868,44.918 23.872,43.922C22.876,42.906 22.378,41.705 22.378,40.318C22.378,38.932 22.876,37.73 23.872,36.715C24.888,35.699 26.099,35.191 27.505,35.191C28.872,35.191 30.054,35.699 31.05,36.715C32.065,37.73 32.573,38.932 32.573,40.318C32.573,41.705 32.065,42.906 31.05,43.922C30.054,44.918 28.872,45.416 27.505,45.416ZM40.015,45.416C38.628,45.416 37.427,44.918 36.411,43.922C35.396,42.906 34.888,41.705 34.888,40.318C34.888,38.932 35.396,37.73 36.411,36.715C37.427,35.699 38.628,35.191 40.015,35.191C41.382,35.191 42.573,35.699 43.589,36.715C44.604,37.73 45.112,38.932 45.112,40.318C45.112,41.705 44.604,42.906 43.589,43.922C42.573,44.918 41.382,45.416 40.015,45.416ZM52.524,45.416C51.138,45.416 49.937,44.918 48.921,43.922C47.925,42.906 47.427,41.705 47.427,40.318C47.427,38.932 47.925,37.73 48.921,36.715C49.937,35.699 51.138,35.191 52.524,35.191C53.911,35.191 55.103,35.699 56.099,36.715C57.114,37.73 57.622,38.932 57.622,40.318C57.622,41.705 57.114,42.906 56.099,43.922C55.103,44.918 53.911,45.416 52.524,45.416ZM33.745,56.637C32.339,56.637 31.138,56.139 30.142,55.143C29.146,54.127 28.647,52.926 28.647,51.539C28.647,50.152 29.146,48.961 30.142,47.965C31.157,46.949 32.358,46.441 33.745,46.441C35.132,46.441 36.323,46.949 37.319,47.965C38.335,48.961 38.843,50.152 38.843,51.539C38.843,52.926 38.335,54.127 37.319,55.143C36.323,56.139 35.132,56.637 33.745,56.637ZM46.255,56.637C44.868,56.637 43.667,56.139 42.651,55.143C41.655,54.127 41.157,52.926 41.157,51.539C41.157,50.152 41.655,48.961 42.651,47.965C43.667,46.949 44.868,46.441 46.255,46.441C47.661,46.441 48.862,46.949 49.858,47.965C50.854,48.961 51.353,50.152 51.353,51.539C51.353,52.926 50.854,54.127 49.858,55.143C48.862,56.139 47.661,56.637 46.255,56.637Z"/>
</vector>
9 changes: 9 additions & 0 deletions wallet/res/drawable/ic_lock_dash.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector android:autoMirrored="true" android:height="28dp"
android:viewportHeight="28" android:viewportWidth="28"
android:width="28dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#008DE4" android:pathData="M9.688,23.296C8.834,23.296 8.186,23.064 7.745,22.6C7.303,22.143 7.082,21.455 7.082,20.534V12.571C7.082,11.658 7.303,10.973 7.745,10.516C8.186,10.059 8.834,9.831 9.688,9.831H20.199C21.053,9.831 21.7,10.059 22.142,10.516C22.584,10.973 22.805,11.658 22.805,12.571V20.534C22.805,21.455 22.584,22.143 22.142,22.6C21.7,23.064 21.053,23.296 20.199,23.296H9.688ZM9.137,10.774V7.203C9.137,5.818 9.407,4.661 9.946,3.733C10.492,2.797 11.207,2.093 12.091,1.622C12.974,1.15 13.925,0.914 14.943,0.914C15.962,0.914 16.912,1.15 17.796,1.622C18.679,2.093 19.391,2.797 19.93,3.733C20.476,4.661 20.75,5.818 20.75,7.203V10.774H18.649V6.99C18.649,6.114 18.477,5.376 18.133,4.777C17.796,4.171 17.347,3.71 16.785,3.396C16.224,3.082 15.61,2.924 14.943,2.924C14.277,2.924 13.663,3.082 13.102,3.396C12.54,3.71 12.091,4.171 11.754,4.777C11.417,5.376 11.248,6.114 11.248,6.99V10.774H9.137Z"/>
<path android:fillColor="#008DE4"
android:pathData="M13.348,24.348L13.348,24.348C13.978,23.715 14.473,22.984 14.831,22.161C15.195,21.323 15.375,20.433 15.375,19.5C15.375,18.567 15.195,17.677 14.831,16.839L14.047,17.179L14.831,16.839C14.473,16.015 13.976,15.284 13.343,14.651C12.71,14.017 11.978,13.521 11.154,13.165C10.316,12.804 9.425,12.625 8.489,12.625C7.557,12.625 6.668,12.804 5.831,13.165C5.006,13.521 4.276,14.018 3.647,14.654C3.02,15.287 2.527,16.017 2.169,16.839L2.169,16.839C1.805,17.677 1.625,18.567 1.625,19.5C1.625,20.433 1.805,21.323 2.169,22.161C2.527,22.984 3.022,23.715 3.652,24.348L3.652,24.348C4.283,24.982 5.014,25.479 5.839,25.835C6.675,26.196 7.564,26.375 8.496,26.375C9.433,26.375 10.324,26.197 11.161,25.835C11.986,25.479 12.717,24.982 13.348,24.348Z"
android:strokeColor="#ffffff" android:strokeWidth="1.75"/>
<path android:fillColor="#ffffff" android:fillType="evenOdd" android:pathData="M6.991,16.572H9.616C11.922,16.572 12.331,17.829 11.999,19.597C11.78,20.785 11.229,21.692 10.308,22.118C9.895,22.312 9.499,22.42 8.579,22.42H5.963L6.182,21.202H8.484C9.869,21.206 10.235,20.604 10.416,20.079C10.485,19.881 10.64,19.274 10.644,18.913C10.653,18.212 10.308,17.79 9.142,17.79L6.776,17.786L6.991,16.572ZM5.014,19.597C5.079,19.326 5.183,18.888 5.864,18.888H8.549C8.549,18.888 8.523,19.034 8.437,19.387C8.436,19.389 8.435,19.392 8.435,19.395C8.37,19.667 8.266,20.105 7.585,20.105H4.9C4.9,20.105 4.926,19.959 5.012,19.606C5.013,19.603 5.013,19.6 5.014,19.597Z"/>
</vector>
5 changes: 5 additions & 0 deletions wallet/res/drawable/ic_shuffle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:autoMirrored="true" android:height="18dp"
android:viewportHeight="18" android:viewportWidth="23"
android:width="23dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#008DE4" android:pathData="M0.366,13.747C0.366,13.481 0.458,13.261 0.644,13.088C0.836,12.908 1.074,12.819 1.358,12.819H3.474C3.987,12.819 4.432,12.72 4.81,12.522C5.187,12.324 5.573,11.987 5.969,11.511L11.573,4.85C12.167,4.145 12.751,3.659 13.326,3.393C13.901,3.121 14.6,2.985 15.423,2.985H17.269V0.786C17.269,0.563 17.331,0.39 17.455,0.267C17.578,0.143 17.755,0.081 17.983,0.081C18.088,0.081 18.188,0.1 18.28,0.137C18.373,0.168 18.456,0.214 18.531,0.276L22.177,3.319C22.344,3.467 22.427,3.64 22.427,3.838C22.427,4.036 22.344,4.209 22.177,4.358L18.531,7.392C18.456,7.453 18.373,7.503 18.28,7.54C18.188,7.577 18.088,7.596 17.983,7.596C17.755,7.596 17.578,7.534 17.455,7.41C17.331,7.28 17.269,7.104 17.269,6.881V4.84H15.414C15.055,4.84 14.733,4.884 14.449,4.97C14.17,5.051 13.905,5.187 13.651,5.378C13.403,5.564 13.144,5.818 12.872,6.139L7.166,12.912C6.616,13.555 6.071,14.009 5.533,14.275C5.001,14.541 4.336,14.674 3.539,14.674H1.358C1.074,14.674 0.836,14.588 0.644,14.415C0.458,14.235 0.366,14.012 0.366,13.747ZM0.366,3.913C0.366,3.64 0.458,3.418 0.644,3.245C0.836,3.071 1.074,2.985 1.358,2.985H3.483C4.281,2.985 4.955,3.118 5.505,3.384C6.062,3.644 6.616,4.098 7.166,4.748L12.862,11.511C13.264,11.987 13.66,12.324 14.05,12.522C14.446,12.72 14.916,12.819 15.46,12.819H17.269V10.815C17.269,10.592 17.331,10.419 17.455,10.295C17.578,10.165 17.755,10.101 17.983,10.101C18.088,10.101 18.188,10.119 18.28,10.156C18.373,10.193 18.456,10.243 18.531,10.305L22.177,13.348C22.344,13.496 22.427,13.669 22.427,13.867C22.427,14.065 22.344,14.238 22.177,14.387L18.531,17.42C18.456,17.482 18.373,17.529 18.28,17.56C18.188,17.597 18.088,17.615 17.983,17.615C17.755,17.615 17.578,17.553 17.455,17.43C17.331,17.306 17.269,17.133 17.269,16.91V14.674H15.414C14.616,14.674 13.926,14.541 13.345,14.275C12.763,14.009 12.191,13.542 11.628,12.875L5.969,6.148C5.573,5.672 5.178,5.335 4.782,5.137C4.386,4.939 3.931,4.84 3.418,4.84H1.358C1.074,4.84 0.836,4.754 0.644,4.581C0.458,4.407 0.366,4.185 0.366,3.913Z"/>
</vector>
32 changes: 32 additions & 0 deletions wallet/res/layout/activity_coinjoin.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2021 Dash Core Group.
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/container"
tools:context="de.schildbach.wallet.ui.coinjoin.CoinJoinActivity">

<androidx.fragment.app.FragmentContainerView
android:id="@+id/nav_host_fragment"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="true"
app:navGraph="@navigation/nav_coinjoin" />
</FrameLayout>
39 changes: 39 additions & 0 deletions wallet/res/layout/activity_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,45 @@
app:srcCompat="@drawable/ic_menu_row_arrow" />
</androidx.constraintlayout.widget.ConstraintLayout>

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/coinjoin"
style="@style/MenuRow.Internal">

<ImageView
android:id="@+id/coinjoin_icon"
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="17dp"
app:srcCompat="@drawable/ic_coinjoin"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />

<TextView
android:id="@+id/coinjoin_title"
style="@style/Body2.Medium"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/coinjoin"
android:layout_marginStart="22dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toEndOf="@id/coinjoin_icon"
app:layout_constraintBottom_toTopOf="@id/coinjoin_subtitle"
app:layout_constraintVertical_chainStyle="packed" />

<TextView
android:id="@+id/coinjoin_subtitle"
style="@style/Overline.Tertiary"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginStart="22dp"
android:text="@string/turned_off"
app:layout_constraintStart_toEndOf="@id/coinjoin_icon"
app:layout_constraintTop_toBottomOf="@id/coinjoin_title"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/voting_dash_pay"
style="@style/MenuRow.Internal">
Expand Down
Loading

0 comments on commit 7f1ca22

Please sign in to comment.