diff --git a/app/build.gradle b/app/build.gradle
index b08d2c9..740b6ef 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -33,6 +33,7 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
+ implementation project(path: ':CustomToastLib')
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
diff --git a/app/src/main/java/com/sadadnan/customtoastproject/MainActivity.java b/app/src/main/java/com/sadadnan/customtoastproject/MainActivity.java
index 4d1a88f..d8b374b 100644
--- a/app/src/main/java/com/sadadnan/customtoastproject/MainActivity.java
+++ b/app/src/main/java/com/sadadnan/customtoastproject/MainActivity.java
@@ -3,16 +3,64 @@
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
import com.sadadnan.customtoastlib.CustomToast;
public class MainActivity extends AppCompatActivity {
+ private Button btn1,btn2,btn3,btn4,btn5;
+
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
+ getSupportActionBar().hide();
+
+ initializeIDs();
+
+ clickListeners();
+ }
+
+ private void clickListeners() {
+ btn1.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ CustomToast.ShowSuccessToast(MainActivity.this,false,"Congratulations");
+ }
+ });
+ btn2.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ CustomToast.ShowErrorToast(MainActivity.this,false,"We are extremely sorry.");
+ }
+ });
+ btn3.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ CustomToast.ShowInfoToast(MainActivity.this,false,"We have updated your status.");
+ }
+ });
+ btn4.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ CustomToast.showToastWithCustomDrawableAndBG(MainActivity.this,false,"Custom Icon",R.drawable.ic_baseline_auto_delete_24,R.color.toastColor);
+ }
+ });
+ btn5.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ CustomToast.showToastWithoutIcon(MainActivity.this,false,"Without icon",R.color.toastColor2);
+ }
+ });
+ }
- CustomToast.ShowSuccessToast(this,false,"Congratulations");
+ private void initializeIDs() {
+ btn1 = findViewById(R.id.btn1);
+ btn2 = findViewById(R.id.btn2);
+ btn3 = findViewById(R.id.btn3);
+ btn4 = findViewById(R.id.btn4);
+ btn5 = findViewById(R.id.btn5);
}
}
\ No newline at end of file
diff --git a/app/src/main/res/drawable-v24/ic_baseline_auto_delete_24.xml b/app/src/main/res/drawable-v24/ic_baseline_auto_delete_24.xml
new file mode 100644
index 0000000..26de5dc
--- /dev/null
+++ b/app/src/main/res/drawable-v24/ic_baseline_auto_delete_24.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index 4fc2444..cd40c48 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -1,18 +1,79 @@
-
+
-
+
+
+
+
+
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index f8c6127..949eddb 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -7,4 +7,6 @@
#FF018786
#FF000000
#FFFFFFFF
+ #FF5722
+ #6D1A7B
\ No newline at end of file