diff --git a/README.md b/README.md index 103f2ad..fc8bb8f 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ Custom AlertView Dialogue provides many customization methods to display the ale **Simple Alert - a simple popup message.** -![Screenshots](screenshots/Custom-Permissions-Dialogue-All_540x.jpg) +![Screenshots](screenshots/Simple-Alert_480x.png) ```java CustomAlertDialogue.Builder alert = new CustomAlertDialogue.Builder(MainActivity.this) @@ -78,7 +78,7 @@ alert.show(); **Confirmation Alert - a popup dialogue with two customizable choices.** -![Screenshots](screenshots/Custom-Permissions-Dialogue-Required_540x.jpg) +![Screenshots](screenshots/Confirmation-Alert_540x.png) ```java CustomAlertDialogue.Builder alert = new CustomAlertDialogue.Builder(MainActivity.this) @@ -110,7 +110,7 @@ alert.show(); **Selector - a scrollable list of options.** -![Screenshots](screenshots/Custom-Permissions-Dialogue-Optional_540x.jpg) +![Screenshots](screenshots/Selector_500x.png) ```java ArrayList destructive = new ArrayList<>(); @@ -154,7 +154,7 @@ alert.show(); **Action Sheet - a highly customizable bottom menu.** -![Screenshots](screenshots/Custom-Permissions-Dialogue-Single_540x.jpg) +![Screenshots](screenshots/Action-Sheet_540x.png) ```java ArrayList other = new ArrayList(); @@ -207,7 +207,7 @@ alert.show(); **Input Box - helps collect user input. Can be used as a contact/feedback form.** -![Screenshots](screenshots/Custom-Permissions-Dialogue-Combined_540x.jpg) +![Screenshots](screenshots/Input-Box_540x.png) ```java ArrayList lineHint = new ArrayList<>(); diff --git a/app/build.gradle b/app/build.gradle index 4dd0669..4e3dede 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -30,4 +30,5 @@ dependencies { implementation 'com.android.support:appcompat-v7:27.0.2' implementation 'com.android.support:design:27.0.2' + implementation 'com.android.support:cardview-v7:27.0.2' } \ No newline at end of file diff --git a/app/src/main/java/stream/customalertapp/MainActivity.java b/app/src/main/java/stream/customalertapp/MainActivity.java index 4b930fe..d46c4b6 100644 --- a/app/src/main/java/stream/customalertapp/MainActivity.java +++ b/app/src/main/java/stream/customalertapp/MainActivity.java @@ -8,10 +8,12 @@ import android.os.Handler; import android.os.Vibrator; import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.CardView; import android.util.Log; import android.view.View; import android.view.Window; import android.widget.AdapterView; +import android.widget.ImageView; import android.widget.Toast; import java.util.ArrayList; @@ -21,6 +23,9 @@ public class MainActivity extends AppCompatActivity{ + ImageView mBackground; + CardView mCardView; + private Context mContext; @Override @@ -36,6 +41,9 @@ protected void onCreate(Bundle savedInstanceState) { setContentView(R.layout.activity_main); mContext = getApplicationContext(); + mBackground = findViewById(R.id.background); + mCardView = findViewById(R.id.cardview); + //Simple Alert - a simple popup message. CustomButton btn1 = findViewById(R.id.btn1); btn1.setOnClickListener(new View.OnClickListener() { @@ -288,6 +296,27 @@ public void onItemClick(AdapterView adapterView, View view, int i, long l) { alert.show(); } + //Hide background for screenshots. + public void HideBackground(boolean hide) + { + if (hide) + { + mBackground.setVisibility(View.GONE); + mCardView.setVisibility(View.GONE); + Handler handler = new Handler(); + handler.postDelayed(new Runnable() { + @Override + public void run() { + HideBackground(false); + } + }, 5000); + } + else + { + mBackground.setVisibility(View.VISIBLE); + mCardView.setVisibility(View.VISIBLE); + } + } @Override protected void onPause() { diff --git a/customalert/build.gradle b/customalert/build.gradle index 692d88b..2fab93b 100644 --- a/customalert/build.gradle +++ b/customalert/build.gradle @@ -26,6 +26,5 @@ dependencies { } implementation fileTree(include: ['*.jar'], dir: 'libs') implementation 'com.android.support:design:27.0.2' - implementation 'com.android.support:cardview-v7:27.0.2' } diff --git a/screenshots/Action-Sheet_540x.png b/screenshots/Action-Sheet_540x.png new file mode 100644 index 0000000..619f938 Binary files /dev/null and b/screenshots/Action-Sheet_540x.png differ diff --git a/screenshots/Confirmation-Alert_540x.png b/screenshots/Confirmation-Alert_540x.png new file mode 100644 index 0000000..38db54c Binary files /dev/null and b/screenshots/Confirmation-Alert_540x.png differ diff --git a/screenshots/Input-Box_540x.png b/screenshots/Input-Box_540x.png new file mode 100644 index 0000000..66ceed0 Binary files /dev/null and b/screenshots/Input-Box_540x.png differ diff --git a/screenshots/Selector_500x.png b/screenshots/Selector_500x.png new file mode 100644 index 0000000..7c4c078 Binary files /dev/null and b/screenshots/Selector_500x.png differ diff --git a/screenshots/Simple-Alert_480x.png b/screenshots/Simple-Alert_480x.png new file mode 100644 index 0000000..fc1c73e Binary files /dev/null and b/screenshots/Simple-Alert_480x.png differ