Skip to content

Commit

Permalink
Save should be enabled without nfc.
Browse files Browse the repository at this point in the history
Set main activity buttons as disabled by default.
  • Loading branch information
North101 committed Sep 2, 2017
1 parent 713ad52 commit 648c267
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,10 @@ public void onDismissed(Snackbar snackbar, int event) {
btnScanTag.setEnabled(nfcEnabled);
btnWriteTagAuto.setEnabled(nfcEnabled && hasKeys && hasTag);
btnRestoreTag.setEnabled(nfcEnabled && hasTag);
btnSaveTag.setEnabled(nfcEnabled && hasTag);
btnSaveTag.setEnabled(hasTag);
btnShowQRCode.setEnabled(hasTag);
btnEditDataSSB.setEnabled(hasKeys && hasTag);
btnEditDataTP.setEnabled(hasKeys && hasTag);
btnViewHex.setEnabled(hasKeys && hasTag);

int ssbVisibility = View.GONE;
Expand Down
33 changes: 22 additions & 11 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
android:layout_width="@dimen/main_buttons_width"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="Scan Tag"/>
android:text="Scan Tag"
android:enabled="false"/>

<Button
android:id="@+id/btnSaveTag"
Expand All @@ -49,7 +50,8 @@
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/btnLoadTag"
android:text="Save Tag"/>
android:text="Save Tag"
android:enabled="false"/>

<Button
android:id="@+id/btnWriteTagAuto"
Expand All @@ -58,15 +60,17 @@
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/btnScanTag"
android:text="Write Tag"/>
android:text="Write Tag"
android:enabled="false"/>

<Button
android:id="@+id/btnViewHex"
android:layout_width="@dimen/main_buttons_width"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@id/btnSaveTag"
android:text="View Hex"/>
android:text="View Hex"
android:enabled="false"/>

<Button
android:id="@+id/btnRestoreTag"
Expand All @@ -75,15 +79,17 @@
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/btnWriteTagAuto"
android:text="Restore Tag"/>
android:text="Restore Tag"
android:enabled="false"/>

<Button
android:id="@+id/btnShowQRCode"
android:layout_width="@dimen/main_buttons_width"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@id/btnViewHex"
android:text="Show QR Code"/>
android:text="Show QR Code"
android:enabled="false"/>

<Button
android:id="@+id/btnScanQRCode"
Expand All @@ -98,7 +104,8 @@
android:layout_width="@dimen/main_buttons_width"
android:layout_height="wrap_content"
android:text="Create Tag*"
android:visibility="gone"/>
android:visibility="gone"
android:enabled="false"/>

<Button
android:id="@+id/btnWriteTagRaw"
Expand All @@ -107,7 +114,8 @@
android:layout_alignParentLeft="true"
android:layout_below="@+id/btnWriteTagAuto"
android:text="Write Tag (Raw)"
android:visibility="gone"/>
android:visibility="gone"
android:enabled="false"/>

<CheckBox
android:id="@+id/cbAutoSaveOnScan"
Expand Down Expand Up @@ -136,23 +144,26 @@
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="@string/edit_mii_data"
android:visibility="gone"/>
android:visibility="gone"
android:enabled="false"/>

<Button
android:id="@+id/btnEditDataSSB"
android:layout_width="@dimen/main_buttons_width"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="@string/edit_ssb_data"
android:visibility="gone"/>
android:visibility="gone"
android:enabled="false"/>

<Button
android:id="@+id/btnEditDataTP"
android:layout_width="@dimen/main_buttons_width"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="@string/edit_tp_data"
android:visibility="gone"/>
android:visibility="gone"
android:enabled="false"/>
</LinearLayout>

<Button
Expand Down

0 comments on commit 648c267

Please sign in to comment.