Now App supports Multiple Screens

This commit is contained in:
adpth 2020-11-03 23:00:34 +05:30
parent 71a929a27e
commit e6ad5ad8f8
5 changed files with 320 additions and 298 deletions

6
.idea/compiler.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="1.8" />
</component>
</project>

1
.idea/gradle.xml generated
View File

@ -15,6 +15,7 @@
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
<option name="useQualifiedModuleNames" value="true" />
</GradleProjectSettings>
</option>
</component>

2
.idea/misc.xml generated
View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
@ -7,17 +7,23 @@
android:background="@color/background"
tools:context=".MainActivity">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.cardview.widget.CardView
android:id="@+id/cardView_male"
android:layout_width="185dp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
app:cardBackgroundColor="@color/card_background"
app:cardCornerRadius="10dp"
app:layout_constraintHorizontal_weight="1"
app:cardBackgroundColor="@color/card_background"
app:layout_constraintBottom_toTopOf="@+id/cardView5"
app:layout_constraintEnd_toStartOf="@+id/cardView_female"
app:layout_constraintHorizontal_chainStyle="spread"
app:layout_constraintStart_toStartOf="parent"
@ -41,16 +47,17 @@
<androidx.cardview.widget.CardView
android:id="@+id/cardView_female"
android:layout_width="185dp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
app:layout_constraintHorizontal_weight="1"
app:cardBackgroundColor="@color/card_background"
app:cardCornerRadius="10dp"
app:layout_constraintBottom_toBottomOf="@+id/cardView_male"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/cardView_male"
app:layout_constraintTop_toTopOf="parent">
app:layout_constraintTop_toTopOf="@+id/cardView_male">
<TextView
android:id="@+id/female"
@ -75,10 +82,11 @@
android:layout_margin="16dp"
app:cardBackgroundColor="@color/card_background"
app:cardCornerRadius="10dp"
app:layout_constraintLeft_toLeftOf="@id/cardView_male"
app:layout_constraintRight_toRightOf="@id/cardView_female"
app:layout_constraintTop_toBottomOf="@+id/cardView_male"
tools:layout_editor_absoluteX="16dp">
app:layout_constraintBottom_toTopOf="@+id/cardView3"
app:layout_constraintHorizontal_chainStyle="spread"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/cardView_male">
<LinearLayout
android:layout_width="match_parent"
@ -121,15 +129,16 @@
<androidx.cardview.widget.CardView
android:id="@+id/cardView3"
android:layout_width="185dp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="16dp"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
app:layout_constraintHorizontal_weight="1"
app:cardBackgroundColor="@color/card_background"
app:cardCornerRadius="10dp"
app:layout_constraintBottom_toTopOf="@+id/calculate"
app:layout_constraintEnd_toStartOf="@+id/cardView4"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/cardView5">
@ -212,17 +221,17 @@
<androidx.cardview.widget.CardView
android:id="@+id/cardView4"
android:layout_width="185dp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
app:cardBackgroundColor="@color/card_background"
app:cardCornerRadius="10dp"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintBottom_toBottomOf="@+id/cardView3"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/cardView3"
app:layout_constraintTop_toBottomOf="@+id/cardView5">
app:layout_constraintTop_toTopOf="@+id/cardView3">
<LinearLayout
android:layout_width="match_parent"
@ -307,6 +316,7 @@
android:layout_marginLeft="16dp"
android:layout_marginTop="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="24dp"
android:background="@drawable/calculate_btn"
android:text="@string/calculate"
android:textColor="@android:color/white"
@ -314,7 +324,10 @@
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/cardView3" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>

View File

@ -11,13 +11,13 @@
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:text="@string/your_result"
android:textColor="@android:color/white"
android:textSize="40sp"
android:layout_margin="16dp"
android:textStyle="bold"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
app:layout_constraintBottom_toTopOf="@+id/result_card"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@ -32,7 +32,6 @@
app:cardBackgroundColor="@color/card_background"
app:cardCornerRadius="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView">
@ -112,7 +111,10 @@
android:id="@+id/recalculate"
android:layout_width="match_parent"
android:layout_height="55dp"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="32dp"
android:background="@drawable/calculate_btn"
@ -122,7 +124,7 @@
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent" />
app:layout_constraintStart_toStartOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>