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> </set>
</option> </option>
<option name="resolveModulePerSourceSet" value="false" /> <option name="resolveModulePerSourceSet" value="false" />
<option name="useQualifiedModuleNames" value="true" />
</GradleProjectSettings> </GradleProjectSettings>
</option> </option>
</component> </component>

2
.idea/misc.xml generated
View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <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" /> <output url="file://$PROJECT_DIR$/build/classes" />
</component> </component>
<component name="ProjectType"> <component name="ProjectType">

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?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:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -7,314 +7,327 @@
android:background="@color/background" android:background="@color/background"
tools:context=".MainActivity"> tools:context=".MainActivity">
<androidx.cardview.widget.CardView <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cardView_male"
android:layout_width="185dp"
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_constraintEnd_toStartOf="@+id/cardView_female"
app:layout_constraintHorizontal_chainStyle="spread"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/male"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center|bottom"
android:drawablePadding="5sp"
android:padding="20dp"
android:text="@string/male"
android:textAlignment="center"
android:textColor="@color/tint"
android:textSize="20sp"
android:textStyle="bold"
app:drawableTopCompat="@drawable/male" />
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="@+id/cardView_female"
android:layout_width="185dp"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
app:cardBackgroundColor="@color/card_background"
app:cardCornerRadius="10dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/cardView_male"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/female"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center|bottom"
android:drawablePadding="5sp"
android:padding="20dp"
android:text="@string/female"
android:textAlignment="center"
android:textColor="@color/tint"
android:textSize="20sp"
android:textStyle="bold"
app:drawableTopCompat="@drawable/female" />
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="@+id/cardView5"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
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">
<LinearLayout <androidx.cardview.widget.CardView
android:id="@+id/cardView_male"
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: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"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/male"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center|bottom"
android:drawablePadding="5sp"
android:padding="20dp"
android:text="@string/male"
android:textAlignment="center"
android:textColor="@color/tint"
android:textSize="20sp"
android:textStyle="bold"
app:drawableTopCompat="@drawable/male" />
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="@+id/cardView_female"
android:layout_width="0dp"
android:layout_height="wrap_content"
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="@+id/cardView_male">
<TextView
android:id="@+id/female"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center|bottom"
android:drawablePadding="5sp"
android:padding="20dp"
android:text="@string/female"
android:textAlignment="center"
android:textColor="@color/tint"
android:textSize="20sp"
android:textStyle="bold"
app:drawableTopCompat="@drawable/female" />
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="@+id/cardView5"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:layout_margin="16dp"
android:orientation="vertical" app:cardBackgroundColor="@color/card_background"
android:padding="20dp"> app:cardCornerRadius="10dp"
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">
<TextView <LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/height"
android:textColor="#8D8E99"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="@+id/height_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/_0cm"
android:textColor="@android:color/white"
android:textSize="50sp"
android:textStyle="bold" />
<SeekBar
android:id="@+id/Seekbar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:max="200"
android:progressBackgroundTint="#888994"
android:progressTint="@android:color/white"
tools:targetApi="lollipop" />
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="@+id/cardView3"
android:layout_width="185dp"
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"
app:cardBackgroundColor="@color/card_background"
app:cardCornerRadius="10dp"
app:layout_constraintEnd_toStartOf="@+id/cardView4"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/cardView5">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical"
android:padding="15dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/weight"
android:textColor="#8D8E99"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="@+id/weight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/_50"
android:textColor="@android:color/white"
android:textSize="50sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:baselineAligned="false"
android:gravity="center_horizontal"
android:weightSum="2">
<RelativeLayout
android:id="@+id/weight_minus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="5dp"
android:layout_marginRight="5dp"
android:layout_weight="1"
android:background="@drawable/stepper_background">
<ImageView
android:layout_width="60dp"
android:layout_height="60dp"
android:contentDescription="@string/minus"
android:padding="14dp"
app:srcCompat="@drawable/substract" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/weight_plus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:background="@drawable/stepper_background">
<ImageView
android:layout_width="60dp"
android:layout_height="60dp"
android:contentDescription="@string/plus"
android:padding="3dp"
app:srcCompat="@drawable/ic_add" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="@+id/cardView4"
android:layout_width="185dp"
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_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/cardView3"
app:layout_constraintTop_toBottomOf="@+id/cardView5">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical"
android:padding="15dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
android:text="@string/age" android:orientation="vertical"
android:textColor="#8D8E99" android:padding="20dp">
android:textSize="20sp"
android:textStyle="bold" />
<TextView <TextView
android:id="@+id/age"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/_19"
android:textColor="@android:color/white"
android:textSize="50sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:baselineAligned="false"
android:gravity="center_horizontal"
android:weightSum="2">
<RelativeLayout
android:id="@+id/age_minus"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="5dp" android:text="@string/height"
android:layout_marginRight="5dp" android:textColor="#8D8E99"
android:layout_weight="1" android:textSize="20sp"
android:background="@drawable/stepper_background"> android:textStyle="bold" />
<ImageView <TextView
android:layout_width="60dp" android:id="@+id/height_txt"
android:layout_height="60dp"
android:contentDescription="@string/minus"
android:padding="14dp"
app:srcCompat="@drawable/substract" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/age_plus"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="5dp" android:text="@string/_0cm"
android:layout_marginLeft="5dp" android:textColor="@android:color/white"
android:layout_weight="1" android:textSize="50sp"
android:background="@drawable/stepper_background"> android:textStyle="bold" />
<ImageView <SeekBar
android:layout_width="60dp" android:id="@+id/Seekbar"
android:layout_height="60dp" style="?android:attr/progressBarStyleHorizontal"
android:contentDescription="@string/plus" android:layout_width="match_parent"
android:padding="3dp" android:layout_height="wrap_content"
app:srcCompat="@drawable/ic_add" /> android:layout_marginTop="10dp"
android:max="200"
</RelativeLayout> android:progressBackgroundTint="#888994"
android:progressTint="@android:color/white"
tools:targetApi="lollipop" />
</LinearLayout> </LinearLayout>
</LinearLayout> </androidx.cardview.widget.CardView>
</androidx.cardview.widget.CardView> <androidx.cardview.widget.CardView
android:id="@+id/cardView3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
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">
<Button <LinearLayout
android:id="@+id/calculate" android:layout_width="match_parent"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_height="55dp" android:gravity="center_horizontal"
android:layout_marginLeft="16dp" android:orientation="vertical"
android:layout_marginTop="16dp" android:padding="15dp">
android:layout_marginRight="16dp"
android:background="@drawable/calculate_btn"
android:text="@string/calculate"
android:textColor="@android:color/white"
android:textSize="17sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/cardView3" />
</androidx.constraintlayout.widget.ConstraintLayout> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/weight"
android:textColor="#8D8E99"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="@+id/weight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/_50"
android:textColor="@android:color/white"
android:textSize="50sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:baselineAligned="false"
android:gravity="center_horizontal"
android:weightSum="2">
<RelativeLayout
android:id="@+id/weight_minus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="5dp"
android:layout_marginRight="5dp"
android:layout_weight="1"
android:background="@drawable/stepper_background">
<ImageView
android:layout_width="60dp"
android:layout_height="60dp"
android:contentDescription="@string/minus"
android:padding="14dp"
app:srcCompat="@drawable/substract" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/weight_plus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:background="@drawable/stepper_background">
<ImageView
android:layout_width="60dp"
android:layout_height="60dp"
android:contentDescription="@string/plus"
android:padding="3dp"
app:srcCompat="@drawable/ic_add" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="@+id/cardView4"
android:layout_width="0dp"
android:layout_height="wrap_content"
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_constraintStart_toEndOf="@+id/cardView3"
app:layout_constraintTop_toTopOf="@+id/cardView3">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical"
android:padding="15dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/age"
android:textColor="#8D8E99"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="@+id/age"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/_19"
android:textColor="@android:color/white"
android:textSize="50sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:baselineAligned="false"
android:gravity="center_horizontal"
android:weightSum="2">
<RelativeLayout
android:id="@+id/age_minus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="5dp"
android:layout_marginRight="5dp"
android:layout_weight="1"
android:background="@drawable/stepper_background">
<ImageView
android:layout_width="60dp"
android:layout_height="60dp"
android:contentDescription="@string/minus"
android:padding="14dp"
app:srcCompat="@drawable/substract" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/age_plus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:background="@drawable/stepper_background">
<ImageView
android:layout_width="60dp"
android:layout_height="60dp"
android:contentDescription="@string/plus"
android:padding="3dp"
app:srcCompat="@drawable/ic_add" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<Button
android:id="@+id/calculate"
android:layout_width="match_parent"
android:layout_height="55dp"
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"
android:textSize="17sp"
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>
</ScrollView>

View File

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