Skip to content

Commit

Permalink
Fixed Issue No openMF#1093 UI enhancement in activity_read_qr.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
Prashant830 committed Sep 4, 2022
1 parent ccbbdf9 commit 99e0165
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ public class ReadQrActivity extends BaseActivity implements QrContract.ReadQrVie
ImageButton mFlashOff;
@BindView(R.id.btn_open_gallery)
ImageButton mOpenGallery;
@BindView(R.id.btn_exit_scan)
ImageButton mExitBtn;

private static final int SELECT_PHOTO = 100;

@Override
Expand All @@ -71,8 +74,15 @@ public void onCreate(@Nullable Bundle savedInstanceState) {
mPresenter.attachView(this);

mScannerView.setAutoFocus(true);

}

@OnClick(R.id.btn_exit_scan)
void onExitButtonClicked(){
onBackPressed();
}


@OnClick(R.id.btn_flash_on)
void turnOnFlash() {
mScannerView.setFlash(true);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="40dp"
android:height="40dp"
android:width="24dp"
android:height="24dp"
android:tint="#fff"
android:viewportWidth="24"
android:viewportHeight="24">
Expand Down
4 changes: 2 additions & 2 deletions mifospay/src/main/res/drawable/ic_flash_off.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="40dp"
android:width="40dp"
android:height="24dp"
android:width="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path android:fillColor="#FFF" android:pathData="M2,5.27L3.28,4L20,20.72L18.73,22L15,18.27V22H9V12.27L2,5.27M18,5L15,10H11.82L6.82,5H18M18,4H6V2H18V4M15,11V13.18L12.82,11H15Z" />
Expand Down
6 changes: 3 additions & 3 deletions mifospay/src/main/res/drawable/ic_flash_on.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="40dp"
android:width="40dp"
android:height="24dp"
android:width="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path android:fillColor="#FFF" android:pathData="M9,10L6,5H18L15,10H9M18,4H6V2H18V4M9,22V11H15V22H9M12,13A1,1 0 0,0 11,14A1,1 0 0,0 12,15A1,1 0 0,0 13,14A1,1 0 0,0 12,13Z" />
<path android:fillColor="#FFF" android:pathData="M9,10L6,5H18L15,10H9M18,4H6V2H18V4M9,22V11H15V22H9M12,13A1,1 0 0,0 11,14A1,1 0 0,0 12,15A1,1 0 0,0 13,14A1,1 0 0,0 12,13Z "/>
</vector>
107 changes: 72 additions & 35 deletions mifospay/src/main/res/layout/activity_read_qr.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_height="match_parent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<include layout="@layout/toolbar"/>


<FrameLayout
android:layout_width="match_parent"
Expand All @@ -16,42 +15,80 @@
android:id="@+id/scannerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center">
android:layout_gravity="center"
app:borderColor="@color/colorAccentBlue"
app:laserColor="@color/colorDebit"
app:cornerRadius="@dimen/value_10dp"
app:borderWidth="@dimen/value_7dp">

</me.dm7.barcodescanner.zxing.ZXingScannerView>

<LinearLayout
android:layout_gravity="center|bottom"
android:layout_width="wrap_content"
android:layout_height="wrap_content">

<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">

<ImageButton
android:layout_width="80dp"
android:layout_height="80dp"
android:background="@null"
android:id="@+id/btn_flash_on"
app:srcCompat="@drawable/ic_flash_on"/>
<ImageButton
android:layout_width="80dp"
android:layout_height="80dp"
android:background="@null"
android:id="@+id/btn_flash_off"
android:visibility="gone"
app:srcCompat="@drawable/ic_flash_off"/>


<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="top"
android:padding="@dimen/value_10dp">

<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:id="@+id/btn_exit_scan"
app:srcCompat="@drawable/ic_close"
android:tint="@color/white"
android:layout_centerVertical="true"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/btn_exit_scan"
android:layout_toEndOf="@id/btn_exit_scan"
android:layout_marginLeft="@dimen/value_10dp"
android:textSize="@dimen/value_20dp"
android:text="@string/scan_code"
android:fontFamily="@font/montserrat"
android:textColor="@color/white"/>

<ImageButton
android:id="@+id/btn_flash_on"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@null"
android:tint="@color/white"
app:srcCompat="@drawable/ic_flash_on" />

<ImageButton
android:id="@+id/btn_open_gallery"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginEnd="@dimen/value_20dp"
android:layout_toStartOf="@+id/btn_flash_on"
android:layout_toLeftOf="@+id/btn_flash_on"
android:background="@null"
app:srcCompat="@drawable/ic_baseline_insert_photo_24" />


<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:id="@+id/btn_flash_off"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:visibility="gone"
app:srcCompat="@drawable/ic_flash_off"
android:tint="@color/white"
android:layout_centerVertical="true"/>
</RelativeLayout>

</FrameLayout>
<ImageButton
android:layout_width="80dp"
android:layout_height="80dp"
android:background="@null"
android:id="@+id/btn_open_gallery"
app:srcCompat="@drawable/ic_baseline_insert_photo_24"/>
</LinearLayout>

</FrameLayout>


</LinearLayout>

0 comments on commit 99e0165

Please sign in to comment.