From 5e3650bcd982a5293e4c4b8dbc087aa259e0d582 Mon Sep 17 00:00:00 2001 From: Felix Prahl-Kamps Date: Thu, 11 Jul 2019 16:22:58 +0200 Subject: [PATCH 1/3] add new exchange activity --- .idea/misc.xml | 2 +- app/src/main/AndroidManifest.xml | 6 + .../activities/ExchangeActivity2.java | 117 ++++++++ .../mispbump/activities/StartUpActivity.java | 17 +- .../FixedAspectRatioFrameLayout.java | 59 ++++ .../main/res/drawable/ic_camera_border.xml | 7 + .../main/res/drawable/ic_verified_user.xml | 2 +- .../res/drawable/rect_rounded_inverse.xml | 13 + app/src/main/res/layout/activity_exchange.xml | 12 +- .../main/res/layout/activity_exchange_2.xml | 264 ++++++++++++++++++ app/src/main/res/values/attrs.xml | 5 + app/src/main/res/values/colors.xml | 1 + build.gradle | 2 +- 13 files changed, 491 insertions(+), 16 deletions(-) create mode 100644 app/src/main/java/lu/circl/mispbump/activities/ExchangeActivity2.java create mode 100644 app/src/main/java/lu/circl/mispbump/customViews/FixedAspectRatioFrameLayout.java create mode 100644 app/src/main/res/drawable/ic_camera_border.xml create mode 100644 app/src/main/res/drawable/rect_rounded_inverse.xml create mode 100644 app/src/main/res/layout/activity_exchange_2.xml diff --git a/.idea/misc.xml b/.idea/misc.xml index da7759f..93a9df2 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -38,7 +38,7 @@ - + diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 9dde01d..8e65ec5 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -28,6 +28,12 @@ + originalHeight) { + finalWidth = originalHeight * mAspectRatioWidth / mAspectRatioHeight; + finalHeight = originalHeight; + } else { + finalWidth = originalWidth; + finalHeight = calculatedHeight; + } + + super.onMeasure( + MeasureSpec.makeMeasureSpec(finalWidth, MeasureSpec.EXACTLY), + MeasureSpec.makeMeasureSpec(finalHeight, MeasureSpec.EXACTLY)); + } +} \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_camera_border.xml b/app/src/main/res/drawable/ic_camera_border.xml new file mode 100644 index 0000000..440c1d2 --- /dev/null +++ b/app/src/main/res/drawable/ic_camera_border.xml @@ -0,0 +1,7 @@ + + + diff --git a/app/src/main/res/drawable/ic_verified_user.xml b/app/src/main/res/drawable/ic_verified_user.xml index d42b282..baa8aa7 100644 --- a/app/src/main/res/drawable/ic_verified_user.xml +++ b/app/src/main/res/drawable/ic_verified_user.xml @@ -4,6 +4,6 @@ android:viewportWidth="24" android:viewportHeight="24"> diff --git a/app/src/main/res/drawable/rect_rounded_inverse.xml b/app/src/main/res/drawable/rect_rounded_inverse.xml new file mode 100644 index 0000000..b60c00b --- /dev/null +++ b/app/src/main/res/drawable/rect_rounded_inverse.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_exchange.xml b/app/src/main/res/layout/activity_exchange.xml index 3ed9bbd..4c21d25 100644 --- a/app/src/main/res/layout/activity_exchange.xml +++ b/app/src/main/res/layout/activity_exchange.xml @@ -21,14 +21,14 @@ android:backgroundTint="#99FFFFFF" android:gravity="center_vertical" android:orientation="vertical" - android:padding="8dp" - tools:layout_height="256dp" - tools:layout_width="256dp"> + android:padding="8dp"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index d9cf405..26e9864 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -24,4 +24,9 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 34b2256..8d311f4 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -10,6 +10,7 @@ #33000000 #FFFFFF + #CCFFFFFF #80FFFFFF #BDBDBD diff --git a/build.gradle b/build.gradle index e0e9fa2..76d59b3 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.4.1' + classpath 'com.android.tools.build:gradle:3.4.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong From 66d586a5469b9dbbff682bedc46319ca8476351b Mon Sep 17 00:00:00 2001 From: Felix Prahl-Kamps Date: Sun, 14 Jul 2019 18:18:54 +0200 Subject: [PATCH 2/3] improve login url and authkey handling --- .idea/inspectionProfiles/Project_Default.xml | 1 + .../mispbump/activities/ExchangeActivity.java | 35 +++- .../activities/ExchangeActivity2.java | 22 ++- .../mispbump/activities/LoginActivity.java | 5 +- .../mispbump/activities/ProfileActivity.java | 2 +- .../mispbump/activities/StartUpActivity.java | 22 +-- .../mispbump/activities/UploadActivity.java | 2 +- .../mispbump/auxiliary/MispRestClient.java | 176 ++++++++---------- .../mispbump/auxiliary/PreferenceManager.java | 8 +- .../main/res/layout/activity_exchange_2.xml | 145 +++------------ 10 files changed, 165 insertions(+), 253 deletions(-) diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index 25c2334..d13e225 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -1,6 +1,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Date: Sun, 14 Jul 2019 19:17:32 +0200 Subject: [PATCH 3/3] improve exchange activity layout and functionality --- .idea/misc.xml | 2 +- app/build.gradle | 2 +- app/src/main/AndroidManifest.xml | 6 - .../mispbump/activities/ExchangeActivity.java | 67 ++++--- .../activities/ExchangeActivity2.java | 129 ------------ app/src/main/res/layout/activity_exchange.xml | 184 +++++++++++++----- .../main/res/layout/activity_exchange_2.xml | 177 ----------------- app/src/main/res/values-de/strings.xml | 5 + app/src/main/res/values/strings.xml | 5 + 9 files changed, 179 insertions(+), 398 deletions(-) delete mode 100644 app/src/main/java/lu/circl/mispbump/activities/ExchangeActivity2.java delete mode 100644 app/src/main/res/layout/activity_exchange_2.xml diff --git a/.idea/misc.xml b/.idea/misc.xml index 93a9df2..da7759f 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -38,7 +38,7 @@ - + diff --git a/app/build.gradle b/app/build.gradle index ad28876..631627d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -25,7 +25,7 @@ dependencies { // android implementation 'com.google.android.material:material:1.0.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0' - implementation 'androidx.appcompat:appcompat:1.1.0-beta01' + implementation 'androidx.appcompat:appcompat:1.1.0-rc01' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation 'androidx.cardview:cardview:1.0.0' implementation 'androidx.recyclerview:recyclerview:1.0.0' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 8e65ec5..9dde01d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -28,12 +28,6 @@ - - + android:layout_height="match_parent" + android:background="@color/colorPrimaryDark"> + android:layout_height="match_parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + android:layout_width="0dp" + android:layout_height="0dp" + android:layout_marginTop="25dp" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="parent" + android:gravity="center" + app:layout_constraintBottom_toTopOf="@id/navbar_bottom"> - - - + android:layout_marginStart="32dp" + android:layout_marginEnd="32dp" + android:layout_marginBottom="16dp" + android:background="@drawable/rect_rounded" + android:backgroundTint="@color/white_80" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toTopOf="@id/navbar_bottom"> - + + + + + + + + android:layout_marginStart="32dp" + android:layout_marginEnd="32dp" + android:layout_marginBottom="16dp" + android:background="@drawable/rect_rounded" + android:backgroundTint="@color/white_80"> + + + + + + + + + android:orientation="horizontal" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent"> + app:srcCompat="@drawable/ic_arrow_back" /> - + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:layout_marginStart="8dp" + android:layout_marginEnd="8dp" + android:layout_weight="1" + android:text="Scan each others QR codes" + android:textAlignment="center" + android:textAppearance="@style/TextAppearance.MaterialComponents.Body1" + android:textColor="@color/white" /> - + app:srcCompat="@drawable/ic_arrow_forward" /> - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_exchange_2.xml b/app/src/main/res/layout/activity_exchange_2.xml deleted file mode 100644 index 05583ff..0000000 --- a/app/src/main/res/layout/activity_exchange_2.xml +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index bf0e8df..dfe9f9a 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -39,4 +39,9 @@ Organisation hinzufügen Server hinzufügen Benutzer hinzufügen + Öffentlicher Schlüssel + Scannen Sie den QR code ihres Partners + Öffentlicher Schlüssel empfangen + Synchronisations-Informationen empfangen + Synchronisations-Informationen \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 5688842..f3ff326 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -45,4 +45,9 @@ Add organisation Add sync user Add sync server + Public Key + Scan your partners QR code + Received public key + Received sync information + Sync Information