Skip to content

Commit

Permalink
UI improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
shivamhatke committed Jun 21, 2020
1 parent 7955c77 commit 4254b2a
Show file tree
Hide file tree
Showing 11 changed files with 102 additions and 30 deletions.
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:icon="@drawable/heart"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:roundIcon="@drawable/heart"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".activities.SurDetailActivity"></activity>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.view.View;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;

Expand Down Expand Up @@ -35,11 +36,15 @@ private void loadDocument(String url) {
.into(ivDoc, new Callback() {
@Override
public void onSuccess() {
Toast.makeText(GetQrDocActivity.this, "Image Document loaded successfully", Toast.LENGTH_SHORT).show();
pb.setVisibility(View.GONE);
}

@Override
public void onError(Exception e) {
Toast.makeText(GetQrDocActivity.this, "QR code must refer to an image", Toast.LENGTH_LONG).show();
Toast.makeText(GetQrDocActivity.this, "Showing dummy document for now", Toast.LENGTH_LONG).show();
ivDoc.setImageResource(R.drawable.wb);
pb.setVisibility(View.GONE);
}
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.example.mask_detector.activities;

import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Toast;

import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;

Expand All @@ -30,6 +32,21 @@ public class HomeActivity extends AppCompatActivity {
selectedFragment = new DocumentsFragment();
break;
case R.id.nav_favorites:
new AlertDialog.Builder(this)
.setTitle("Scanning QR...")
.setMessage("Scan QR code that refer to an image medical document")
// Specifying a listener allows you to take an action before dismissing the dialog.
// The dialog is automatically dismissed when a dialog button is clicked.
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
})

// A null listener allows the button to dismiss the dialog and take no further action.
.setNegativeButton(android.R.string.cancel, null)
.setIcon(android.R.drawable.ic_dialog_alert)
.show();
selectedFragment = new ScanQRFragment();
break;
case R.id.nav_media:
Expand Down
Binary file added app/src/main/res/drawable-v24/heart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 15 additions & 4 deletions app/src/main/res/layout/activity_show_doc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,32 @@
android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
android:id="@+id/tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:text="View your medical documents here. (Long press to delete or share doc QR)"
android:textSize="18dp"
android:textStyle="bold" />

<ProgressBar
android:id="@+id/progress_circle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />

<TextView
android:id="@+id/nodata"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="No Medical Data Uploaded"
android:layout_centerInParent="true"
android:visibility="gone"
/>
android:text="No Medical Data Uploaded"
android:visibility="gone" />

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
android:layout_below="@+id/tv" />
</RelativeLayout>
12 changes: 9 additions & 3 deletions app/src/main/res/layout/activity_sur_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
app:cardElevation="10dp">

<LinearLayout
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="vertical">
Expand Down Expand Up @@ -50,7 +50,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:text="Status: " />
android:text="Camera Status: " />

<TextView
android:id="@+id/status"
Expand All @@ -75,7 +75,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:text="Connection: " />
android:text="Camera Connection: " />

<TextView
android:id="@+id/connection"
Expand All @@ -97,6 +97,12 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Place: " />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="(Realtime) Video frames coming from camera analysed every hour and updated, showing people with or without mask"
android:textStyle="bold"/>
</LinearLayout>
</androidx.cardview.widget.CardView>

Expand Down
16 changes: 14 additions & 2 deletions app/src/main/res/layout/activity_surveillance.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,25 @@
android:layout_height="match_parent"
tools:context=".activities.SurveillanceActivity">

<TextView
android:id="@+id/tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:text="Realtime tracking of 4 Surveillance Camera Videos (Click cards for further details)"
android:textSize="18dp"
android:textStyle="bold" />

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
android:layout_below="@id/tv"
android:layout_marginTop="10dp" />

<ProgressBar
android:id="@+id/pb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"/>
android:layout_centerInParent="true" />
</RelativeLayout>
20 changes: 16 additions & 4 deletions app/src/main/res/layout/fragment_documents.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,33 @@
android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
android:id="@+id/tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:text="View your medical documents here. (Long press to delete or share doc QR)"
android:textSize="18dp"
android:textStyle="bold" />

<ProgressBar
android:id="@+id/progress_circle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />

<TextView
android:id="@+id/nodata"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="No Medical Data Uploaded"
android:layout_centerInParent="true"
android:visibility="gone"
/>
android:text="No Medical Data Uploaded"
android:visibility="gone" />

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
android:layout_below="@id/tv"
android:layout_marginTop="10dp" />
</RelativeLayout>
27 changes: 13 additions & 14 deletions app/src/main/res/layout/fragment_home.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#66b39ddb">
android:background="#66b39ddb">

<TextView
android:id="@+id/tvReadArticle"
android:layout_width="wrap_content"
android:layout_height="64dp"
android:layout_height="70dp"
android:layout_marginTop="48dp"
android:drawableStart="@drawable/document"
android:drawablePadding="15dp"
Expand Down Expand Up @@ -102,17 +102,17 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#6680cbc4"
>
android:background="#6680cbc4">

<TextView
android:id="@+id/paytm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="64dp"
android:layout_marginTop="56dp"
android:layout_height="50dp"
android:layout_marginTop="48dp"
android:drawableStart="@drawable/ic_tick"
android:drawablePadding="15sp"
android:drawablePadding="15dp"
android:paddingLeft="19dp"
android:paddingRight="12dp"
android:text="Pay Your Medical Bills"
android:textSize="18sp"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -127,10 +127,8 @@
android:layout_marginStart="20dp"
android:layout_marginTop="25dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="20dp"
app:cardBackgroundColor="#6680cbc4"

app:cardCornerRadius="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -143,11 +141,12 @@

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="60dp"
android:layout_marginTop="56dp"
android:layout_height="45dp"
android:layout_marginTop="48dp"
android:drawableStart="@drawable/ic_warning"
android:drawablePadding="15dp"
android:paddingLeft="19dp"
android:paddingRight="12dp"
android:text="Contact / Call Helpline"
android:textSize="18sp"
app:layout_constraintStart_toStartOf="parent"
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/res/layout/fragment_media.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,21 @@
android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
android:id="@+id/tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:text="realtime video and articles updates regarding health issues and their cure(Click to see further)"
android:textSize="18dp"
android:textStyle="bold" />

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
class="androidx.appcompat.app.AlertController$RecycleListView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/tv"
android:padding="4dp"
android:scrollbars="vertical" />
</RelativeLayout>
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<resources>
<string name="app_name">Mask_Detector</string>
<string name="app_name">Sehatmandh</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
<string name="enter_report_type">Enter Report Type...</string>
Expand Down

0 comments on commit 4254b2a

Please sign in to comment.