Commit e525e5f3 authored by Anuththara18's avatar Anuththara18

Parents Signature UI Modification

parent 2836fb74
...@@ -14,9 +14,13 @@ import android.graphics.drawable.BitmapDrawable; ...@@ -14,9 +14,13 @@ import android.graphics.drawable.BitmapDrawable;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Environment; import android.os.Environment;
import android.os.Handler;
import android.view.View; import android.view.View;
import android.view.WindowManager; import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button; import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
...@@ -37,18 +41,22 @@ import java.io.File; ...@@ -37,18 +41,22 @@ import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
import pl.droidsonroids.gif.GifImageView;
import static android.Manifest.permission.MANAGE_EXTERNAL_STORAGE; import static android.Manifest.permission.MANAGE_EXTERNAL_STORAGE;
import static android.Manifest.permission.READ_EXTERNAL_STORAGE; import static android.Manifest.permission.READ_EXTERNAL_STORAGE;
import static android.Manifest.permission.WRITE_EXTERNAL_STORAGE; import static android.Manifest.permission.WRITE_EXTERNAL_STORAGE;
public class GetParentsConsentActivity extends AppCompatActivity { public class GetParentsConsentActivity extends AppCompatActivity {
TextView textView3, next; TextView textView3;
Button btnGetSignature; ImageButton next;
public static Button btnGetSignature;
public static ImageView fingerprintImageView; public static ImageView fingerprintImageView;
static int flag2 = 0; static int flag2 = 0;
public SharedPreferences sharedPreferences; public SharedPreferences sharedPreferences;
public int imageSet = 0; public int imageSet = 0;
public static GifImageView red_circle;
// constant code for runtime permissions // constant code for runtime permissions
private static final int PERMISSION_REQUEST_CODE = 200; private static final int PERMISSION_REQUEST_CODE = 200;
...@@ -69,13 +77,13 @@ public class GetParentsConsentActivity extends AppCompatActivity { ...@@ -69,13 +77,13 @@ public class GetParentsConsentActivity extends AppCompatActivity {
setContentView(R.layout.activity_get_parents_consent); setContentView(R.layout.activity_get_parents_consent);
textView3 = (TextView) findViewById(R.id.textView3); textView3 = (TextView) findViewById(R.id.textView3);
next = (TextView) findViewById(R.id.next); next = findViewById(R.id.next);
btnGetSignature = (Button)findViewById(R.id.btnGetSignature); btnGetSignature = (Button)findViewById(R.id.btnGetSignature);
fingerprintImageView = (ImageView)findViewById(R.id.fingerprintImageView); fingerprintImageView = (ImageView)findViewById(R.id.fingerprintImageView);
sharedPreferences = getSharedPreferences("ImageSet", MODE_PRIVATE); sharedPreferences = getSharedPreferences("ImageSet", MODE_PRIVATE);
red_circle = findViewById(R.id.red_circle);
textView3.setText(LanguageSetter.getresources().getString(R.string.provideconsent)); textView3.setText(LanguageSetter.getresources().getString(R.string.provideconsent));
next.setText(LanguageSetter.getresources().getString(R.string.proceed));
btnGetSignature.setText(LanguageSetter.getresources().getString(R.string.getSignature)); btnGetSignature.setText(LanguageSetter.getresources().getString(R.string.getSignature));
//textView3.setText(LanguageSetter.getresources().getString(R.string.provideConsent)); //textView3.setText(LanguageSetter.getresources().getString(R.string.provideConsent));
...@@ -84,6 +92,22 @@ public class GetParentsConsentActivity extends AppCompatActivity { ...@@ -84,6 +92,22 @@ public class GetParentsConsentActivity extends AppCompatActivity {
/*******************************************************************************************/ /*******************************************************************************************/
final Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
runOnUiThread(new Runnable() {
@Override
public void run() {
Animation animZoomOut = AnimationUtils.loadAnimation(getApplicationContext(),R.anim.zoom_out);
next.startAnimation(animZoomOut);
handler.postDelayed(this, 750);
}
});
}
}, 0);
// below code is used for // below code is used for
// checking our permissions. // checking our permissions.
if (checkPermission()) { if (checkPermission()) {
......
...@@ -89,7 +89,8 @@ public class GetSignatureActivity extends AppCompatActivity { ...@@ -89,7 +89,8 @@ public class GetSignatureActivity extends AppCompatActivity {
//Bitmap bitmap = BitmapFactory.decodeStream(inputStream); //Bitmap bitmap = BitmapFactory.decodeStream(inputStream);
GetParentsConsentActivity.fingerprintImageView.setImageBitmap(bitmap); GetParentsConsentActivity.fingerprintImageView.setImageBitmap(bitmap);
GetParentsConsentActivity.flag2 = 1; GetParentsConsentActivity.flag2 = 1;
GetParentsConsentActivity.btnGetSignature.setText(LanguageSetter.getresources().getString(R.string.changeSignature));
GetParentsConsentActivity.red_circle.setVisibility(View.VISIBLE);
//Toast.makeText(getApplicationContext(), "Signature Recorded", Toast.LENGTH_SHORT).show(); //Toast.makeText(getApplicationContext(), "Signature Recorded", Toast.LENGTH_SHORT).show();
finish(); finish();
......
...@@ -7,20 +7,25 @@ ...@@ -7,20 +7,25 @@
android:background="@color/white" android:background="@color/white"
tools:context=".consentform.GetParentsConsentActivity"> tools:context=".consentform.GetParentsConsentActivity">
<TextView <ImageButton
android:id="@+id/next" android:id="@+id/next"
android:layout_width="match_parent" android:layout_width="50dp"
android:layout_height="wrap_content" android:layout_height="50dp"
android:layout_marginTop="50dp" android:layout_marginRight="20dp"
android:drawableEnd="@drawable/icon_right" android:layout_marginTop="20dp"
android:drawableTint="@color/black" android:background="@drawable/right_btn"
android:gravity="right" app:layout_constraintEnd_toEndOf="parent"
android:paddingRight="30dp" app:layout_constraintTop_toTopOf="parent" />
android:text="@string/proceed"
android:textColor="@color/black" <pl.droidsonroids.gif.GifImageView
android:textSize="16dp" android:id="@+id/red_circle"
android:layout_width="100dp"
android:layout_marginRight="-6dp"
android:layout_marginTop="-5dp"
android:layout_height="100dp"
android:visibility="invisible"
android:src="@drawable/red_circle"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<TextView <TextView
...@@ -33,7 +38,7 @@ ...@@ -33,7 +38,7 @@
android:layout_marginRight="50dp" android:layout_marginRight="50dp"
android:text="@string/provideconsent" android:text="@string/provideconsent"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="17dp" android:textSize="16dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
...@@ -51,7 +56,6 @@ ...@@ -51,7 +56,6 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView3" /> app:layout_constraintTop_toBottomOf="@+id/textView3" />
<Button <Button
android:id="@+id/btnGetSignature" android:id="@+id/btnGetSignature"
android:layout_width="match_parent" android:layout_width="match_parent"
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
<string name="provideconsent">මම මේ කැමති පත්‍රය කියවා ඒ සම්බන්ධව ඇති වූ ගැටළු නිරාකරණය කර ගත්තෙමි. පහත සඳහන් අත්සනින් මම මගේ දරුවා මෙම අධ්‍යයනයට සම්බන්ධ කරවීමට කැමති බව ප්‍රකාශ කර සිටිමි. මා කැමති ඕනෑම අවස්ථාවක කිසිදු ගැටලුවකින් තොරව මෙම අධ්‍යයනයෙන් මගේ දරුවා ඉවත්කරගැනීමේ හැකියාවද ඇති බව මම දනිමි.</string> <string name="provideconsent">මම මේ කැමති පත්‍රය කියවා ඒ සම්බන්ධව ඇති වූ ගැටළු නිරාකරණය කර ගත්තෙමි. පහත සඳහන් අත්සනින් මම මගේ දරුවා මෙම අධ්‍යයනයට සම්බන්ධ කරවීමට කැමති බව ප්‍රකාශ කර සිටිමි. මා කැමති ඕනෑම අවස්ථාවක කිසිදු ගැටලුවකින් තොරව මෙම අධ්‍යයනයෙන් මගේ දරුවා ඉවත්කරගැනීමේ හැකියාවද ඇති බව මම දනිමි.</string>
<string name="getSignature">මෙහි අත්සන් කරන්න</string> <string name="getSignature">මෙහි අත්සන් කරන්න</string>
<string name="changeSignature">අත්සන වෙනස් කරන්න</string>
<string name="proceed">ඉදිරියට</string> <string name="proceed">ඉදිරියට</string>
<string name="consentForm">පර්යේෂණ අධ්‍යයනයකට සහභාගී වීමට කැමැත්ත දක්වන පෝරමය</string> <string name="consentForm">පර්යේෂණ අධ්‍යයනයකට සහභාගී වීමට කැමැත්ත දක්වන පෝරමය</string>
<string name="clear">මකා දමන්න</string> <string name="clear">මකා දමන්න</string>
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
<string name="provideconsent">I have read this consent form and my questions have been answered. My signature below means that I do want my child to be in the study. I know that I can withdraw my child from the study at any time without any problems.</string> <string name="provideconsent">I have read this consent form and my questions have been answered. My signature below means that I do want my child to be in the study. I know that I can withdraw my child from the study at any time without any problems.</string>
<string name="getSignature">Sign Here</string> <string name="getSignature">Sign Here</string>
<string name="changeSignature">Change Signature</string>
<string name="proceed">Proceed</string> <string name="proceed">Proceed</string>
<string name="consentForm">Consent Form To Participate in a Research Study</string> <string name="consentForm">Consent Form To Participate in a Research Study</string>
<string name="clear">Clear</string> <string name="clear">Clear</string>
......
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