diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..99202cc --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Screenshots/Screenshot_20180605-072316.png b/Screenshots/main-screen.png similarity index 100% rename from Screenshots/Screenshot_20180605-072316.png rename to Screenshots/main-screen.png diff --git a/Screenshots/Screenshot_20180605-083529.png b/Screenshots/my-org-screen.png similarity index 100% rename from Screenshots/Screenshot_20180605-083529.png rename to Screenshots/my-org-screen.png diff --git a/Screenshots/scan-screen.png b/Screenshots/scan-screen.png new file mode 100755 index 0000000..43043ab Binary files /dev/null and b/Screenshots/scan-screen.png differ diff --git a/Screenshots/share-screen.png b/Screenshots/share-screen.png new file mode 100755 index 0000000..50fa435 Binary files /dev/null and b/Screenshots/share-screen.png differ diff --git a/app/build.gradle b/app/build.gradle index 085f2a4..2a41bc3 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -29,4 +29,6 @@ dependencies { implementation 'com.android.support:design:27.1.1' implementation 'com.android.volley:volley:1.1.0' + implementation 'com.github.kenglxn.QRGen:android:2.4.0' + implementation 'com.kofigyan.stateprogressbar:stateprogressbar:0.0.9' } diff --git a/app/src/main/java/de/overview/wg/its/misp_authentificator/activity/SyncActivity.java b/app/src/main/java/de/overview/wg/its/misp_authentificator/activity/SyncActivity.java index 849c22a..5db81c3 100644 --- a/app/src/main/java/de/overview/wg/its/misp_authentificator/activity/SyncActivity.java +++ b/app/src/main/java/de/overview/wg/its/misp_authentificator/activity/SyncActivity.java @@ -1,11 +1,22 @@ package de.overview.wg.its.misp_authentificator.activity; +import android.graphics.Bitmap; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.View; +import android.view.ViewTreeObserver; +import android.widget.Button; +import android.widget.ImageView; +import android.widget.ProgressBar; +import android.widget.TextView; + +import net.glxn.qrgen.android.QRCode; + +import java.lang.reflect.Field; + import de.overview.wg.its.misp_authentificator.R; public class SyncActivity extends AppCompatActivity { @@ -20,5 +31,18 @@ public class SyncActivity extends AppCompatActivity { getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true); + + generateMyQR(); + } + + private void generateMyQR() { + ImageView qrImageView = findViewById(R.id.sync_my_qr); + + Bitmap myBitmap = QRCode.from("This is my organisation information!") + .withColor(0xFF000000, 0x00000000) + .withSize(512,512) + .bitmap(); + + qrImageView.setImageBitmap(myBitmap); } } diff --git a/app/src/main/res/drawable/ic_qr_aim.xml b/app/src/main/res/drawable/ic_qr_aim.xml new file mode 100644 index 0000000..3a353b0 --- /dev/null +++ b/app/src/main/res/drawable/ic_qr_aim.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/test_image.jpg b/app/src/main/res/drawable/test_image.jpg new file mode 100644 index 0000000..22c1196 Binary files /dev/null and b/app/src/main/res/drawable/test_image.jpg differ diff --git a/app/src/main/res/drawable/test_image_1.jpg b/app/src/main/res/drawable/test_image_1.jpg new file mode 100644 index 0000000..84f38c3 Binary files /dev/null and b/app/src/main/res/drawable/test_image_1.jpg differ diff --git a/app/src/main/res/drawable/test_image_2.jpg b/app/src/main/res/drawable/test_image_2.jpg new file mode 100755 index 0000000..7c91d8d Binary files /dev/null and b/app/src/main/res/drawable/test_image_2.jpg differ diff --git a/app/src/main/res/drawable/test_image_low_res.jpg b/app/src/main/res/drawable/test_image_low_res.jpg new file mode 100644 index 0000000..4b7e275 Binary files /dev/null and b/app/src/main/res/drawable/test_image_low_res.jpg differ diff --git a/app/src/main/res/drawable/test_image_no_meta.jpg b/app/src/main/res/drawable/test_image_no_meta.jpg new file mode 100644 index 0000000..a4e46d0 Binary files /dev/null and b/app/src/main/res/drawable/test_image_no_meta.jpg differ diff --git a/app/src/main/res/layout/activity_sync.xml b/app/src/main/res/layout/activity_sync.xml index 2c9c8ff..284dd64 100644 --- a/app/src/main/res/layout/activity_sync.xml +++ b/app/src/main/res/layout/activity_sync.xml @@ -27,46 +27,92 @@ android:background="@drawable/background_rounded_main" app:popupTheme="@style/AppTheme.PopupOverlay" /> - + - + + + + + + - - + android:background="@color/colorPrimary" + android:indeterminate="false" + android:max="100" + android:paddingBottom="8dp" + android:paddingEnd="60dp" + android:paddingStart="60dp" + android:paddingTop="8dp" + android:progress="2" + android:progressTint="@color/colorAccent" + android:visibility="visible" /> + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + android:layout_height="match_parent" + android:adjustViewBounds="false" + android:cropToPadding="false" + android:scaleType="center"/> + \ No newline at end of file diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 87e5892..b14e75c 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -26,5 +26,4 @@