Commit 3b2f43fe authored by ranthilina99's avatar ranthilina99

add splash screen and button change

parent 6a536b6f
......@@ -21,15 +21,7 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.EKetha">
<activity android:name=".GrowthHeight"></activity>
<activity android:name=".GrowthThreatment" />
<activity android:name=".GrowthDetect" />
<activity android:name=".Admin" />
<activity android:name=".growthHome" />
<activity android:name=".Growth" />
<activity android:name=".Register" />
<activity
android:name=".Login"
<activity android:name=".SplashScreen"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
......@@ -37,6 +29,14 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".GrowthHeight" />
<activity android:name=".GrowthThreatment" />
<activity android:name=".GrowthDetect" />
<activity android:name=".Admin" />
<activity android:name=".growthHome" />
<activity android:name=".Growth" />
<activity android:name=".Register" />
<activity android:name=".Login"/>
<activity android:name=".MainActivity" />
<provider
......
......@@ -101,6 +101,8 @@ public class Growth extends AppCompatActivity {
btnConfirm = findViewById(R.id.btnConfirm);
classitext = findViewById(R.id.classitext);
btnConfirm.setVisibility(View.INVISIBLE);
if (Build.VERSION.SDK_INT >= 23) {
requestPermissions(new String[] {Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE}, 2);
}
......@@ -209,35 +211,7 @@ public class Growth extends AppCompatActivity {
e.printStackTrace();
}
}
private void openGallery() {
Intent gallery = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.INTERNAL_CONTENT_URI);
startActivityForResult(gallery, PICK_IMAGE);
}
private void uploadImage() {
File file = new File(filepath);
Retrofit retrofit = NetworkClient.getRetrofit();
RequestBody requestBody = RequestBody.create(MediaType.parse("image/"), file);
MultipartBody.Part parts = MultipartBody.Part.createFormData("newimage", file.getName(), requestBody);
RequestBody someData = RequestBody.create(MediaType.parse("text/plain"), "This is a new Image");
UploadApis uploadApis = retrofit.create(UploadApis.class);
Call call = uploadApis.uploadImage(parts, someData);
call.enqueue(new Callback() {
@Override
public void onResponse(Call call, Response response) {
}
@Override
public void onFailure(Call call, Throwable t) {
}
}
);
}
private TensorImage loadImage(Bitmap bitmap) {
// Loads bitmap into a TensorImage.
bitmap = ((BitmapDrawable)imageView.getDrawable()).getBitmap();
......@@ -298,6 +272,7 @@ public class Growth extends AppCompatActivity {
int dimension = Math.min(image.getWidth(), image.getHeight());
image = ThumbnailUtils.extractThumbnail(image, dimension, dimension);
imageView.setImageBitmap(image);
btnConfirm.setVisibility(View.VISIBLE);
}else{
Uri dat = data.getData();
......@@ -308,6 +283,7 @@ public class Growth extends AppCompatActivity {
e.printStackTrace();
}
imageView.setImageBitmap(image);
btnConfirm.setVisibility(View.VISIBLE);
}
}
super.onActivityResult(requestCode, resultCode, data);
......
package com.example.eketha;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.TextView;
import com.google.firebase.auth.FirebaseAuth;
public class SplashScreen extends AppCompatActivity {
private static int SPLASH_TIME = 3000;
private ImageView image;
private TextView hi,welcome;
private Animation topanim,bottomanim;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash_screen);
image = findViewById(R.id.imageView);
hi = findViewById(R.id.txthi);
welcome = findViewById(R.id.txtwelcm);
//Animations
topanim = AnimationUtils.loadAnimation(this, R.anim.top_animation);
bottomanim = AnimationUtils.loadAnimation(this, R.anim.botton_animation);
image.setAnimation(topanim);
hi.setAnimation(bottomanim);
welcome.setAnimation(bottomanim);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
FirebaseAuth.getInstance().signOut();
Intent n = new Intent(SplashScreen.this, Login.class);
startActivity(n);
finish();
}
},SPLASH_TIME);
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="1500"
android:fromXDelta="0%"
android:fromYDelta="100%" />
<alpha
android:duration="1500"
android:fromAlpha="0.1"
android:toAlpha="1.0" />
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="2000"
android:fromXDelta="0%"
android:fromYDelta="-50%" />
<alpha
android:duration="1500"
android:fromAlpha="0.1"
android:toAlpha="1.0" />
</set>
\ No newline at end of file
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="700"
android:viewportHeight="700">
<path
android:fillColor="#FF000000"
android:pathData="m416.64,383.04c-6.719,0.559 -12.879,-2.801 -19.039,-6.16 -56.562,-33.039 -104.72,-80.078 -138.32,-136.08 -6.16,-9.519 -11.762,-20.719 -9.519,-31.922 3.922,-21.281 30.801,-29.68 38.641,-49.84 7.281,-17.359 -2.238,-36.961 -13.441,-52.078 -18.48,-25.199 -42,-47.039 -68.879,-63.281 -12.883,-7.84 -26.883,-14.559 -42.004,-15.68 -67.758,-3.359 -71.68,109.76 -62.719,154 9.519,45.922 32.48,88.48 59.359,127.12 63.281,91.84 150.08,169.68 255.36,206.64 36.961,12.879 76.719,20.719 114.8,11.762 19.039,-4.481 36.961,-12.879 50.398,-27.441 13.441,-14 20.719,-34.16 17.359,-53.199 -3.359,-19.602 -16.801,-35.281 -30.238,-49.281 -19.602,-20.16 -41.441,-38.078 -64.961,-53.762 -4.481,-2.801 -8.961,-5.602 -14,-6.16 -5.602,-0.559 -10.641,2.238 -15.68,5.039 -14,7.84 -26.879,17.359 -38.078,28 -5.039,5.039 -10.641,10.078 -17.359,11.199 -0.559,0.563 -1.121,1.121 -1.68,1.121z"/>
</vector>
<vector android:height="40dp" android:viewportHeight="700"
android:viewportWidth="700" android:width="40dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="m254.27,170.59c0,-25.391 10.086,-49.742 28.039,-67.695 17.953,-17.953 42.305,-28.043 67.695,-28.043s49.742,10.09 67.695,28.043c17.953,17.953 28.039,42.305 28.039,67.695s-10.086,49.738 -28.039,67.695c-17.953,17.953 -42.305,28.039 -67.695,28.039 -25.383,-0.027 -49.715,-10.125 -67.664,-28.07 -17.949,-17.949 -28.043,-42.285 -28.07,-67.664zM377.36,293.68h-54.703c-32.637,0.039 -63.922,13.02 -86.996,36.094 -23.074,23.074 -36.055,54.363 -36.094,86.996 0.023,18.129 7.234,35.508 20.051,48.328 12.82,12.82 30.203,20.031 48.332,20.055h164.12c18.129,-0.023 35.512,-7.234 48.332,-20.055 12.816,-12.82 20.027,-30.199 20.051,-48.328 -0.039,-32.633 -13.02,-63.922 -36.094,-86.996 -23.074,-23.074 -54.359,-36.055 -86.996,-36.094z"/>
</vector>
......@@ -29,40 +29,39 @@
<Button
android:id="@+id/btnTakePic"
android:layout_marginTop="10dp"
android:layout_marginTop="200dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="@drawable/round_bg"
android:textAllCaps="false"
android:layout_height="68dp"
android:layout_above="@id/button2"
android:textSize="21sp"
android:textStyle="bold"
android:text="Open Camera"/>
android:layout_margin="10dp"
android:text="Open Camera"
android:textColor="#EDE8E8"
android:textSize="18sp"
android:textStyle="bold" />
<Button
android:id="@+id/btnOpenCam"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="68dp"
android:layout_alignParentBottom="true"
android:layout_centerInParent="true"
android:background="@drawable/round_bg"
android:layout_margin="10dp"
android:text="Launch Gallery"
android:textAllCaps="false"
android:layout_marginBottom="20dp"
android:layout_marginTop="20dp"
android:layout_alignParentBottom="true"
android:textSize="21sp"
android:textStyle="bold"/>
android:textColor="#EDE8E8"
android:textSize="18sp"
android:textStyle="bold" />
<Button
android:id="@+id/btnConfirm"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:textColor="#FFFFFF"
android:background="@drawable/round_bg"
android:layout_width="wrap_content"
android:layout_height="68dp"
android:layout_margin="10dp"
android:allowClickWhenDisabled="true"
android:text="Rice Identification"
/>
android:textColor="#EDE8E8"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:id="@+id/classitext"
......@@ -73,14 +72,14 @@
android:textColor="#FFFFFF"
android:textSize="20dp" />
<!-- <TextView-->
<!-- android:id="@+id/treattext"-->
<!-- android:layout_marginTop="5dp"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="Result"-->
<!-- android:textAlignment="center"-->
<!-- android:textColor="#D32F2F"-->
<!-- android:textSize="20dp" />-->
<TextView
android:id="@+id/treattext"
android:layout_marginTop="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Result"
android:textAlignment="center"
android:textColor="#D32F2F"
android:textSize="20dp" />
</LinearLayout>
\ No newline at end of file
......@@ -15,7 +15,7 @@
android:text="RICE PLANT RESULT"
android:textAlignment="center"
android:textColor="#009688"
android:textSize="20dp" />
android:textSize="30dp" />
<TextView
android:id="@+id/resulttext"
......@@ -25,7 +25,7 @@
android:text="Result"
android:textAlignment="center"
android:textColor="#D32F2F"
android:textSize="20dp" />
android:textSize="30dp" />
<ImageView
android:id="@+id/image2"
......@@ -48,10 +48,12 @@
<Button
android:id="@+id/btnTreatment"
android:layout_width="200dp"
android:background="@drawable/round_bg"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_height="68dp"
android:layout_margin="10dp"
android:layout_marginTop="10dp"
android:textColor="#FFFFFF"
android:textSize="18sp"
android:textStyle="bold"
android:text="TREATMENTS"/>
</LinearLayout>
\ No newline at end of file
......@@ -4,18 +4,18 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp"
tools:context=".GrowthHeight">
<Button
android:id="@+id/button3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="68dp"
android:layout_alignParentBottom="true"
android:layout_centerVertical="true"
android:layout_marginTop="20dp"
android:layout_marginBottom="116dp"
android:background="@drawable/round_bg"
android:layout_marginTop="10dp"
android:layout_marginBottom="108dp"
android:onClick="heightImage"
android:text="Height Measurement"
android:textAllCaps="false"
......@@ -25,12 +25,11 @@
<Button
android:id="@+id/button2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="68dp"
android:layout_alignParentBottom="true"
android:layout_centerVertical="true"
android:layout_marginTop="20dp"
android:layout_marginBottom="42dp"
android:background="@drawable/round_bg"
android:layout_marginTop="10dp"
android:layout_marginBottom="24dp"
android:text="Growth Threatment"
android:textAllCaps="false"
android:textSize="21sp"
......
......@@ -35,16 +35,17 @@
android:layout_width="match_parent"
android:layout_height="173dp"
android:layout_marginRight="30dp"
app:cardCornerRadius="8dp"
android:layout_marginTop="30dp"
android:layout_marginLeft="30dp">
<LinearLayout
android:id="@+id/layer2"
android:background="@color/gray"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/black">
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
......
......@@ -9,7 +9,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFFFF">
android:background="@drawable/back6">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
......@@ -30,7 +30,7 @@
android:layout_marginLeft="16dp"
android:layout_marginTop="24dp"
android:text="My Dashboard"
android:textColor="@color/green"
android:textColor="@color/limegreen"
android:textSize="25sp"
app:layout_constraintEnd_toStartOf="@+id/imageView"
app:layout_constraintStart_toStartOf="parent"
......@@ -43,6 +43,7 @@
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:text="E-Ketha"
android:textColor="@color/white"
app:layout_constraintEnd_toStartOf="@+id/imageView"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView" />
......@@ -71,8 +72,9 @@
<androidx.cardview.widget.CardView
android:id="@+id/card1"
android:layout_width="0dp"
android:layout_height="match_parent"
app:cardCornerRadius="15dp"
android:layout_width="10dp"
android:layout_height="145dp"
android:layout_margin="10dp"
android:layout_weight="1">
......@@ -103,8 +105,9 @@
<androidx.cardview.widget.CardView
android:id="@+id/card2"
android:layout_width="0dp"
android:layout_height="match_parent"
app:cardCornerRadius="15dp"
android:layout_width="10dp"
android:layout_height="145dp"
android:layout_margin="10dp"
android:layout_weight="1">
......@@ -147,14 +150,15 @@
<androidx.cardview.widget.CardView
android:id="@+id/card3"
android:layout_width="0dp"
android:layout_height="match_parent"
app:cardCornerRadius="15dp"
android:layout_width="10dp"
android:layout_height="145dp"
android:layout_margin="10dp"
android:layout_weight="1">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="wrap_content">
<TextView
android:id="@+id/textView6"
......@@ -179,14 +183,15 @@
<androidx.cardview.widget.CardView
android:id="@+id/card4"
android:layout_width="0dp"
android:layout_height="match_parent"
app:cardCornerRadius="15dp"
android:layout_width="10dp"
android:layout_height="145dp"
android:layout_margin="10dp"
android:layout_weight="1">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="wrap_content">
<TextView
android:id="@+id/textView7"
......@@ -233,7 +238,7 @@
android:layout_height="match_parent"
android:layout_marginLeft="120dp"
android:textSize="20dp"
android:textColor="@color/black"
android:textColor="@color/white"
android:layout_marginTop="750dp"
android:text="copyright@2022"/>
</LinearLayout>
......
......@@ -50,7 +50,7 @@
android:inputType="textPersonName"
android:padding="16dp"
android:textColor="#100E0E"
android:textColorHint="#817B7B"/>
android:textColorHint="#817B7B" />
<EditText
android:id="@+id/registeremail"
......@@ -69,7 +69,8 @@
android:layout_width="match_parent"
android:layout_height="68dp"
android:layout_marginTop="10dp"
android:drawableLeft="@drawable/black_phone"
android:backgroundTint="#120F0F"
android:drawableLeft="@drawable/ic_call"
android:hint="@string/mobile"
android:inputType="phone"
android:padding="16dp"
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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"
android:layout_height="match_parent"
android:background="@drawable/back3"
tools:context=".SplashScreen">
<ImageView
android:id="@+id/imageView"
android:layout_width="213dp"
android:layout_height="199dp"
android:layout_marginStart="10dp"
android:layout_marginTop="36dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="32dp"
android:src="@drawable/logo"
android:transitionName="logo_image"
app:layout_constraintBottom_toTopOf="@+id/txthi"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.55"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/txthi"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="304dp"
android:layout_marginBottom="38dp"
android:text="WELCOME"
android:textAlignment="center"
android:textColor="@color/yellowgreen"
android:textSize="70sp"
android:transitionName="logo_text"
app:layout_constraintBottom_toTopOf="@+id/txtwelcm"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView" />
<TextView
android:id="@+id/txtwelcm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:fontFamily="sans-serif-condensed-medium"
android:text="E-KETHA"
android:textAlignment="center"
android:textColor="@color/yellowgreen"
android:textSize="34sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txthi" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -21,4 +21,5 @@
<color name="mediumseagreen">#3CB371</color>
<color name="seagreen">#2E8B57</color>
<color name="white">#FFFFFF</color>
<color name="gray">#484848</color>
</resources>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment