Skip to content

Commit

Permalink
🎨 style(activity_encryption.xml): improve layout design
Browse files Browse the repository at this point in the history
This commit adds new files and modifies the existing activity_encryption.xml file to improve the layout design of the EncryptionActivity. The changes include adding a new vector image, changing the background color, adding a white background to the EditText fields, and adding a custom button shape. The ImageView and EditText fields are now centered, and the button is now smaller and has a custom shape.
  • Loading branch information
“rupeshshandilya” committed Apr 5, 2023
1 parent 260f818 commit 6cd81f5
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 28 deletions.
6 changes: 6 additions & 0 deletions .idea/render.experimental 2.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions app/src/main/res/drawable/baseline_enhanced_encryption_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#000000"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M18,8h-1V6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6v2H6c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2V10c0,-1.1 -0.9,-2 -2,-2zM8.9,6c0,-1.71 1.39,-3.1 3.1,-3.1s3.1,1.39 3.1,3.1v2H8.9V6zM16,16h-3v3h-2v-3H8v-2h3v-3h2v3h3v2z"/>
</vector>
4 changes: 4 additions & 0 deletions app/src/main/res/drawable/encrypt_and_decrypt_btn.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">

</shape>
130 changes: 102 additions & 28 deletions app/src/main/res/layout/activity_encryption.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,76 +4,150 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black"
android:background="@drawable/encryption"
android:orientation="vertical"
tools:context=".EncryptionActivity">

<ImageView
android:layout_width="150dp"
android:layout_height="80dp"
android:src="@drawable/baseline_enhanced_encryption_24"
android:layout_gravity="center"
android:layout_marginTop="50dp"
/>

<EditText
android:id="@+id/key"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_width="180dp"
android:layout_height="41dp"
android:hint="Enter 16 digit key"
android:maxLength="16"
android:maxLines="1"
android:textColor="@color/black"
android:textColorHint="@color/black"
android:textSize="15sp"
android:background="@color/white"
android:layout_margin="20dp"
android:background="@drawable/whitebg"
android:layout_gravity="center"
android:layout_marginTop="100dp"
android:padding="10dp"
android:inputType="textPassword"/>
android:inputType="textPassword"
/>

<EditText
android:id="@+id/encryptData"
android:textColor="@color/black"
android:layout_width="180dp"
android:layout_height="41dp"
android:textColorHint="@color/black"
android:layout_width="match_parent"
android:background="@color/white"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:background="@drawable/whitebg"
android:hint="Text to Encrypt"
android:maxLines="1"
android:focusableInTouchMode="false"
android:padding="10dp"
android:textSize="15sp"
/>
android:layout_marginTop="15dp"
android:layout_gravity="center"/>

<TextView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_width="150dp"
android:layout_height="41dp"
android:hint="Add Image"
android:background="@drawable/button_shape"
android:textColor="@color/black"
android:textColorHint="@color/black"
android:background="@color/white"
android:layout_margin="20dp"
android:includeFontPadding="false"
android:textSize="15sp"
android:maxLines="1"
android:textColorHint="@color/white"
android:paddingTop="8dp"
android:paddingLeft="40dp"
android:layout_marginTop="10dp"
android:layout_gravity="center"
/>

<ImageView
android:id="@+id/imageView"
android:layout_width="150dp"
android:layout_height="90dp"
android:layout_margin="20dp"
android:layout_gravity="center"
android:visibility="invisible"
android:layout_marginTop="10dp"
tools:srcCompat = "@tools:sample/avatars"
/>

<Button
android:id="@+id/encryptBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:layout_gravity="center"
android:layout_width="114dp"
android:layout_height="38dp"
android:text="Encrypt"
android:textAllCaps="false"
android:fontFamily="monospace"
android:textColor="@color/white"
android:backgroundTint="@color/colorAccent"
android:layout_marginTop="10dp"
android:layout_gravity="center"
android:background="@drawable/encrypt_and_decrypt_btn"
/>

<!-- <EditText-->
<!-- android:id="@+id/key"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:hint="Enter 16 digit key"-->
<!-- android:maxLength="16"-->
<!-- android:maxLines="1"-->
<!-- android:textColor="@color/black"-->
<!-- android:textColorHint="@color/black"-->
<!-- android:textSize="15sp"-->
<!-- android:background="@color/white"-->
<!-- android:layout_margin="20dp"-->
<!-- android:padding="10dp" -->
<!-- android:layout_marginTop="100dp"-->
<!-- android:inputType="textPassword" />-->

<!-- <EditText-->
<!-- android:id="@+id/encryptData"-->
<!-- android:textColor="@color/black"-->
<!-- android:textColorHint="@color/black"-->
<!-- android:layout_width="match_parent"-->
<!-- android:background="@color/white"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_margin="20dp"-->
<!-- android:hint="Text to Encrypt"-->
<!-- android:maxLines="1"-->
<!-- android:focusableInTouchMode="false"-->
<!-- android:padding="10dp"-->
<!-- android:textSize="15sp"-->
<!-- />-->

<!-- <TextView-->
<!-- android:id="@+id/image"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:hint="Add Image"-->
<!-- android:textColor="@color/black"-->
<!-- android:textColorHint="@color/black"-->
<!-- android:background="@color/white"-->
<!-- android:layout_margin="20dp"-->
<!-- android:includeFontPadding="false"-->
<!-- android:textSize="15sp"-->
<!-- android:maxLines="1"-->
<!-- />-->

<!-- <ImageView-->
<!-- android:id="@+id/imageView"-->
<!-- android:layout_width="150dp"-->
<!-- android:layout_height="90dp"-->
<!-- android:layout_margin="20dp"-->
<!-- android:layout_gravity="center"-->
<!-- android:visibility="invisible"-->
<!-- tools:srcCompat = "@tools:sample/avatars"-->
<!-- />-->

<!-- <Button-->
<!-- android:id="@+id/encryptBtn"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_margin="20dp"-->
<!-- android:layout_gravity="center"-->
<!-- android:text="Encrypt"-->
<!-- android:textAllCaps="false"-->
<!-- android:fontFamily="monospace"-->
<!-- android:textColor="@color/white"-->
<!-- android:backgroundTint="@color/colorAccent"-->
<!-- />-->

</LinearLayout>

0 comments on commit 6cd81f5

Please sign in to comment.