Skip to content

Commit

Permalink
some minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
amar committed Sep 7, 2017
1 parent a6a22f5 commit ab2dd8d
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/src/main/java/amar/im/cryptoapp/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import android.widget.EditText;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {
public static final String TAG = "CryptoTest";
Expand Down Expand Up @@ -87,7 +88,9 @@ public boolean onCreateOptionsMenu(Menu menu) {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
// case R.id.action_settings:
case R.id.action_settings:
showToast("Yet to be done!!");
return true;

case R.id.action_about:
// popup for some info
Expand All @@ -104,4 +107,10 @@ public boolean onOptionsItemSelected(MenuItem item) {

return super.onOptionsItemSelected(item);
}

private void showToast(String msg) {
if (!isFinishing() && null != this) {
Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
}
}
}
21 changes: 21 additions & 0 deletions app/src/main/res/layout/dialog_layout.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="30dp"
android:orientation="vertical">

<TextView
android:layout_gravity="center_horizontal"
android:textSize="17sp"
android:text="@string/about_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

<Button
android:layout_gravity="center_horizontal"
android:text="Dismiss"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

</LinearLayout>
4 changes: 4 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@
<string name="app_name">Simple Crypto</string>
<string name="response_text">Output is shown below: </string>
<string name="action_settings">Settings</string>
<string name="about_desc">A simple crypto app that just uses Base64 encoding and AES to demonstrate encryption
and decryption using a key.\n\n\nIt\'s essentially a work not in progress. The code can be found below:
\n\n\n<a href="https://github.com/amarendra/CryptoApp">github.com/amarendra/CryptoApp</a>\n\n\n
Use this app in any way way you want. There are no restrictions.</string>
</resources>

0 comments on commit ab2dd8d

Please sign in to comment.