From 85cfe1976f4fc6620b5befbae73b3c93314e343a Mon Sep 17 00:00:00 2001 From: the-dagger Date: Sun, 9 Jul 2017 15:43:27 +0530 Subject: [PATCH 1/2] Add files for harshit's projects --- .DS_Store | Bin 10244 -> 10244 bytes Harshit/.DS_Store | Bin 0 -> 6148 bytes Harshit/BroadcastReceivers/.gitignore | 9 + Harshit/BroadcastReceivers/app/.gitignore | 1 + Harshit/BroadcastReceivers/app/build.gradle | 30 ++++ .../BroadcastReceivers/app/proguard-rules.pro | 25 +++ .../ExampleInstrumentedTest.java | 26 +++ .../app/src/main/AndroidManifest.xml | 22 +++ .../broadcastreceivers/MainActivity.java | 160 ++++++++++++++++++ .../app/src/main/res/layout/activity_main.xml | 26 +++ .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 3418 bytes .../res/mipmap-hdpi/ic_launcher_round.png | Bin 0 -> 4208 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 2206 bytes .../res/mipmap-mdpi/ic_launcher_round.png | Bin 0 -> 2555 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 4842 bytes .../res/mipmap-xhdpi/ic_launcher_round.png | Bin 0 -> 6114 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 7718 bytes .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin 0 -> 10056 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 10486 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 0 -> 14696 bytes .../app/src/main/res/values/colors.xml | 6 + .../app/src/main/res/values/strings.xml | 3 + .../app/src/main/res/values/styles.xml | 11 ++ .../broadcastreceivers/ExampleUnitTest.java | 17 ++ Harshit/BroadcastReceivers/build.gradle | 23 +++ Harshit/BroadcastReceivers/gradle.properties | 17 ++ Harshit/BroadcastReceivers/gradlew | 160 ++++++++++++++++++ Harshit/BroadcastReceivers/gradlew.bat | 90 ++++++++++ Harshit/BroadcastReceivers/settings.gradle | 1 + Harshit/FirebaseSample/.gitignore | 9 + Harshit/FirebaseSample/app/.gitignore | 1 + Harshit/FirebaseSample/app/build.gradle | 36 ++++ .../FirebaseSample/app/google-services.json | 55 ++++++ Harshit/FirebaseSample/app/proguard-rules.pro | 25 +++ .../ExampleInstrumentedTest.java | 26 +++ .../app/src/main/AndroidManifest.xml | 21 +++ .../firebasesample/MainActivity.java | 43 +++++ .../app/src/main/res/drawable-hdpi/back.png | Bin 0 -> 298 bytes .../app/src/main/res/drawable-mdpi/back.png | Bin 0 -> 200 bytes .../app/src/main/res/drawable-xhdpi/back.png | Bin 0 -> 300 bytes .../app/src/main/res/drawable-xxhdpi/back.png | Bin 0 -> 518 bytes .../app/src/main/res/layout/activity_main.xml | 43 +++++ .../app/src/main/res/layout/custom_dialog.xml | 53 ++++++ .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 3418 bytes .../res/mipmap-hdpi/ic_launcher_round.png | Bin 0 -> 4208 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 2206 bytes .../res/mipmap-mdpi/ic_launcher_round.png | Bin 0 -> 2555 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 4842 bytes .../res/mipmap-xhdpi/ic_launcher_round.png | Bin 0 -> 6114 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 7718 bytes .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin 0 -> 10056 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 10486 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 0 -> 14696 bytes .../app/src/main/res/values/colors.xml | 6 + .../app/src/main/res/values/strings.xml | 3 + .../app/src/main/res/values/styles.xml | 11 ++ .../firebasesample/ExampleUnitTest.java | 17 ++ Harshit/FirebaseSample/build.gradle | 24 +++ Harshit/FirebaseSample/gradle.properties | 17 ++ Harshit/FirebaseSample/gradlew | 160 ++++++++++++++++++ Harshit/FirebaseSample/gradlew.bat | 90 ++++++++++ Harshit/FirebaseSample/settings.gradle | 1 + Harshit/InterFragment/.gitignore | 9 + Harshit/InterFragment/app/.gitignore | 1 + Harshit/InterFragment/app/build.gradle | 30 ++++ Harshit/InterFragment/app/proguard-rules.pro | 25 +++ .../ExampleInstrumentedTest.java | 26 +++ .../app/src/main/AndroidManifest.xml | 22 +++ .../codingblocks/interfragment/AFragment.java | 31 ++++ .../codingblocks/interfragment/BFragment.java | 32 ++++ .../codingblocks/interfragment/CFragment.java | 31 ++++ .../interfragment/Communicator.java | 11 ++ .../interfragment/DetailActivity.java | 19 +++ .../interfragment/MainActivity.java | 29 ++++ .../src/main/res/layout/activity_detail.xml | 27 +++ .../app/src/main/res/layout/activity_main.xml | 32 ++++ .../app/src/main/res/layout/fragment_a.xml | 15 ++ .../app/src/main/res/layout/fragment_b.xml | 15 ++ .../app/src/main/res/layout/fragment_c.xml | 16 ++ .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 3418 bytes .../res/mipmap-hdpi/ic_launcher_round.png | Bin 0 -> 4208 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 2206 bytes .../res/mipmap-mdpi/ic_launcher_round.png | Bin 0 -> 2555 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 4842 bytes .../res/mipmap-xhdpi/ic_launcher_round.png | Bin 0 -> 6114 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 7718 bytes .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin 0 -> 10056 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 10486 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 0 -> 14696 bytes .../app/src/main/res/values/colors.xml | 6 + .../app/src/main/res/values/strings.xml | 3 + .../app/src/main/res/values/styles.xml | 11 ++ .../interfragment/ExampleUnitTest.java | 17 ++ Harshit/InterFragment/build.gradle | 23 +++ Harshit/InterFragment/gradle.properties | 17 ++ Harshit/InterFragment/gradlew | 160 ++++++++++++++++++ Harshit/InterFragment/gradlew.bat | 90 ++++++++++ Harshit/InterFragment/settings.gradle | 1 + Harshit/Whatsapp/.gitignore | 9 + Harshit/Whatsapp/app/.gitignore | 1 + Harshit/Whatsapp/app/build.gradle | 32 ++++ Harshit/Whatsapp/app/local.properties | 11 ++ Harshit/Whatsapp/app/proguard-rules.pro | 25 +++ .../whatsapp/ExampleInstrumentedTest.java | 26 +++ .../Whatsapp/app/src/main/AndroidManifest.xml | 22 +++ .../whatsapp/activity/MainActivity.java | 133 +++++++++++++++ .../whatsapp/adapter/CallAdapter.java | 47 +++++ .../whatsapp/adapter/ChatAdapter.java | 48 ++++++ .../whatsapp/adapter/StatusAdapter.java | 47 +++++ .../whatsapp/fragment/CallFragment.kt | 47 +++++ .../whatsapp/fragment/CameraFragment.java | 55 ++++++ .../whatsapp/fragment/ChatFragment.java | 33 ++++ .../whatsapp/fragment/StatusFragment.java | 33 ++++ .../com/codingblocks/whatsapp/model/Call.java | 30 ++++ .../com/codingblocks/whatsapp/model/Chat.java | 30 ++++ .../whatsapp/model/Main2Activity.java | 15 ++ .../codingblocks/whatsapp/model/Status.java | 12 ++ .../codingblocks/whatsapp/model/TestModel.kt | 7 + .../app/src/main/res/layout/activity_main.xml | 25 +++ .../src/main/res/layout/activity_main2.xml | 9 + .../app/src/main/res/layout/fragment_call.xml | 10 ++ .../src/main/res/layout/fragment_camera.xml | 11 ++ .../app/src/main/res/layout/fragment_chat.xml | 10 ++ .../src/main/res/layout/fragment_status.xml | 10 ++ .../src/main/res/layout/single_item_call.xml | 35 ++++ .../src/main/res/layout/single_item_chat.xml | 36 ++++ .../main/res/layout/single_item_status.xml | 23 +++ .../app/src/main/res/menu/menu_main2.xml | 10 ++ .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 3418 bytes .../res/mipmap-hdpi/ic_launcher_round.png | Bin 0 -> 4208 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 2206 bytes .../res/mipmap-mdpi/ic_launcher_round.png | Bin 0 -> 2555 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 4842 bytes .../res/mipmap-xhdpi/ic_launcher_round.png | Bin 0 -> 6114 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 7718 bytes .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin 0 -> 10056 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 10486 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 0 -> 14696 bytes .../app/src/main/res/values-w820dp/dimens.xml | 6 + .../app/src/main/res/values/colors.xml | 6 + .../app/src/main/res/values/dimens.xml | 7 + .../app/src/main/res/values/strings.xml | 6 + .../app/src/main/res/values/styles.xml | 20 +++ .../whatsapp/ExampleUnitTest.java | 17 ++ Harshit/Whatsapp/build.gradle | 23 +++ Harshit/Whatsapp/gradle.properties | 17 ++ Harshit/Whatsapp/gradlew | 160 ++++++++++++++++++ Harshit/Whatsapp/gradlew.bat | 90 ++++++++++ Harshit/Whatsapp/settings.gradle | 1 + 149 files changed, 3162 insertions(+) create mode 100644 Harshit/.DS_Store create mode 100644 Harshit/BroadcastReceivers/.gitignore create mode 100644 Harshit/BroadcastReceivers/app/.gitignore create mode 100644 Harshit/BroadcastReceivers/app/build.gradle create mode 100644 Harshit/BroadcastReceivers/app/proguard-rules.pro create mode 100644 Harshit/BroadcastReceivers/app/src/androidTest/java/com/codingblocks/broadcastreceivers/ExampleInstrumentedTest.java create mode 100644 Harshit/BroadcastReceivers/app/src/main/AndroidManifest.xml create mode 100644 Harshit/BroadcastReceivers/app/src/main/java/com/codingblocks/broadcastreceivers/MainActivity.java create mode 100644 Harshit/BroadcastReceivers/app/src/main/res/layout/activity_main.xml create mode 100644 Harshit/BroadcastReceivers/app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 Harshit/BroadcastReceivers/app/src/main/res/mipmap-hdpi/ic_launcher_round.png create mode 100644 Harshit/BroadcastReceivers/app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 Harshit/BroadcastReceivers/app/src/main/res/mipmap-mdpi/ic_launcher_round.png create mode 100644 Harshit/BroadcastReceivers/app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 Harshit/BroadcastReceivers/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png create mode 100644 Harshit/BroadcastReceivers/app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 Harshit/BroadcastReceivers/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png create mode 100644 Harshit/BroadcastReceivers/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 Harshit/BroadcastReceivers/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png create mode 100644 Harshit/BroadcastReceivers/app/src/main/res/values/colors.xml create mode 100644 Harshit/BroadcastReceivers/app/src/main/res/values/strings.xml create mode 100644 Harshit/BroadcastReceivers/app/src/main/res/values/styles.xml create mode 100644 Harshit/BroadcastReceivers/app/src/test/java/com/codingblocks/broadcastreceivers/ExampleUnitTest.java create mode 100644 Harshit/BroadcastReceivers/build.gradle create mode 100644 Harshit/BroadcastReceivers/gradle.properties create mode 100755 Harshit/BroadcastReceivers/gradlew create mode 100644 Harshit/BroadcastReceivers/gradlew.bat create mode 100644 Harshit/BroadcastReceivers/settings.gradle create mode 100644 Harshit/FirebaseSample/.gitignore create mode 100644 Harshit/FirebaseSample/app/.gitignore create mode 100644 Harshit/FirebaseSample/app/build.gradle create mode 100644 Harshit/FirebaseSample/app/google-services.json create mode 100644 Harshit/FirebaseSample/app/proguard-rules.pro create mode 100644 Harshit/FirebaseSample/app/src/androidTest/java/com/codingblocks/firebasesample/ExampleInstrumentedTest.java create mode 100644 Harshit/FirebaseSample/app/src/main/AndroidManifest.xml create mode 100644 Harshit/FirebaseSample/app/src/main/java/com/codingblocks/firebasesample/MainActivity.java create mode 100644 Harshit/FirebaseSample/app/src/main/res/drawable-hdpi/back.png create mode 100644 Harshit/FirebaseSample/app/src/main/res/drawable-mdpi/back.png create mode 100644 Harshit/FirebaseSample/app/src/main/res/drawable-xhdpi/back.png create mode 100644 Harshit/FirebaseSample/app/src/main/res/drawable-xxhdpi/back.png create mode 100644 Harshit/FirebaseSample/app/src/main/res/layout/activity_main.xml create mode 100644 Harshit/FirebaseSample/app/src/main/res/layout/custom_dialog.xml create mode 100644 Harshit/FirebaseSample/app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 Harshit/FirebaseSample/app/src/main/res/mipmap-hdpi/ic_launcher_round.png create mode 100644 Harshit/FirebaseSample/app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 Harshit/FirebaseSample/app/src/main/res/mipmap-mdpi/ic_launcher_round.png create mode 100644 Harshit/FirebaseSample/app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 Harshit/FirebaseSample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png create mode 100644 Harshit/FirebaseSample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 Harshit/FirebaseSample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png create mode 100644 Harshit/FirebaseSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 Harshit/FirebaseSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png create mode 100644 Harshit/FirebaseSample/app/src/main/res/values/colors.xml create mode 100644 Harshit/FirebaseSample/app/src/main/res/values/strings.xml create mode 100644 Harshit/FirebaseSample/app/src/main/res/values/styles.xml create mode 100644 Harshit/FirebaseSample/app/src/test/java/com/codingblocks/firebasesample/ExampleUnitTest.java create mode 100644 Harshit/FirebaseSample/build.gradle create mode 100644 Harshit/FirebaseSample/gradle.properties create mode 100755 Harshit/FirebaseSample/gradlew create mode 100644 Harshit/FirebaseSample/gradlew.bat create mode 100644 Harshit/FirebaseSample/settings.gradle create mode 100644 Harshit/InterFragment/.gitignore create mode 100644 Harshit/InterFragment/app/.gitignore create mode 100644 Harshit/InterFragment/app/build.gradle create mode 100644 Harshit/InterFragment/app/proguard-rules.pro create mode 100644 Harshit/InterFragment/app/src/androidTest/java/com/codingblocks/interfragment/ExampleInstrumentedTest.java create mode 100644 Harshit/InterFragment/app/src/main/AndroidManifest.xml create mode 100644 Harshit/InterFragment/app/src/main/java/com/codingblocks/interfragment/AFragment.java create mode 100644 Harshit/InterFragment/app/src/main/java/com/codingblocks/interfragment/BFragment.java create mode 100644 Harshit/InterFragment/app/src/main/java/com/codingblocks/interfragment/CFragment.java create mode 100644 Harshit/InterFragment/app/src/main/java/com/codingblocks/interfragment/Communicator.java create mode 100644 Harshit/InterFragment/app/src/main/java/com/codingblocks/interfragment/DetailActivity.java create mode 100644 Harshit/InterFragment/app/src/main/java/com/codingblocks/interfragment/MainActivity.java create mode 100644 Harshit/InterFragment/app/src/main/res/layout/activity_detail.xml create mode 100644 Harshit/InterFragment/app/src/main/res/layout/activity_main.xml create mode 100644 Harshit/InterFragment/app/src/main/res/layout/fragment_a.xml create mode 100644 Harshit/InterFragment/app/src/main/res/layout/fragment_b.xml create mode 100644 Harshit/InterFragment/app/src/main/res/layout/fragment_c.xml create mode 100644 Harshit/InterFragment/app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 Harshit/InterFragment/app/src/main/res/mipmap-hdpi/ic_launcher_round.png create mode 100644 Harshit/InterFragment/app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 Harshit/InterFragment/app/src/main/res/mipmap-mdpi/ic_launcher_round.png create mode 100644 Harshit/InterFragment/app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 Harshit/InterFragment/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png create mode 100644 Harshit/InterFragment/app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 Harshit/InterFragment/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png create mode 100644 Harshit/InterFragment/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 Harshit/InterFragment/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png create mode 100644 Harshit/InterFragment/app/src/main/res/values/colors.xml create mode 100644 Harshit/InterFragment/app/src/main/res/values/strings.xml create mode 100644 Harshit/InterFragment/app/src/main/res/values/styles.xml create mode 100644 Harshit/InterFragment/app/src/test/java/com/codingblocks/interfragment/ExampleUnitTest.java create mode 100644 Harshit/InterFragment/build.gradle create mode 100644 Harshit/InterFragment/gradle.properties create mode 100755 Harshit/InterFragment/gradlew create mode 100644 Harshit/InterFragment/gradlew.bat create mode 100644 Harshit/InterFragment/settings.gradle create mode 100644 Harshit/Whatsapp/.gitignore create mode 100644 Harshit/Whatsapp/app/.gitignore create mode 100644 Harshit/Whatsapp/app/build.gradle create mode 100644 Harshit/Whatsapp/app/local.properties create mode 100644 Harshit/Whatsapp/app/proguard-rules.pro create mode 100644 Harshit/Whatsapp/app/src/androidTest/java/com/codingblocks/whatsapp/ExampleInstrumentedTest.java create mode 100644 Harshit/Whatsapp/app/src/main/AndroidManifest.xml create mode 100644 Harshit/Whatsapp/app/src/main/java/com/codingblocks/whatsapp/activity/MainActivity.java create mode 100644 Harshit/Whatsapp/app/src/main/java/com/codingblocks/whatsapp/adapter/CallAdapter.java create mode 100644 Harshit/Whatsapp/app/src/main/java/com/codingblocks/whatsapp/adapter/ChatAdapter.java create mode 100644 Harshit/Whatsapp/app/src/main/java/com/codingblocks/whatsapp/adapter/StatusAdapter.java create mode 100644 Harshit/Whatsapp/app/src/main/java/com/codingblocks/whatsapp/fragment/CallFragment.kt create mode 100644 Harshit/Whatsapp/app/src/main/java/com/codingblocks/whatsapp/fragment/CameraFragment.java create mode 100644 Harshit/Whatsapp/app/src/main/java/com/codingblocks/whatsapp/fragment/ChatFragment.java create mode 100644 Harshit/Whatsapp/app/src/main/java/com/codingblocks/whatsapp/fragment/StatusFragment.java create mode 100644 Harshit/Whatsapp/app/src/main/java/com/codingblocks/whatsapp/model/Call.java create mode 100644 Harshit/Whatsapp/app/src/main/java/com/codingblocks/whatsapp/model/Chat.java create mode 100644 Harshit/Whatsapp/app/src/main/java/com/codingblocks/whatsapp/model/Main2Activity.java create mode 100644 Harshit/Whatsapp/app/src/main/java/com/codingblocks/whatsapp/model/Status.java create mode 100644 Harshit/Whatsapp/app/src/main/java/com/codingblocks/whatsapp/model/TestModel.kt create mode 100644 Harshit/Whatsapp/app/src/main/res/layout/activity_main.xml create mode 100644 Harshit/Whatsapp/app/src/main/res/layout/activity_main2.xml create mode 100644 Harshit/Whatsapp/app/src/main/res/layout/fragment_call.xml create mode 100644 Harshit/Whatsapp/app/src/main/res/layout/fragment_camera.xml create mode 100644 Harshit/Whatsapp/app/src/main/res/layout/fragment_chat.xml create mode 100644 Harshit/Whatsapp/app/src/main/res/layout/fragment_status.xml create mode 100644 Harshit/Whatsapp/app/src/main/res/layout/single_item_call.xml create mode 100644 Harshit/Whatsapp/app/src/main/res/layout/single_item_chat.xml create mode 100644 Harshit/Whatsapp/app/src/main/res/layout/single_item_status.xml create mode 100644 Harshit/Whatsapp/app/src/main/res/menu/menu_main2.xml create mode 100644 Harshit/Whatsapp/app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 Harshit/Whatsapp/app/src/main/res/mipmap-hdpi/ic_launcher_round.png create mode 100644 Harshit/Whatsapp/app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 Harshit/Whatsapp/app/src/main/res/mipmap-mdpi/ic_launcher_round.png create mode 100644 Harshit/Whatsapp/app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 Harshit/Whatsapp/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png create mode 100644 Harshit/Whatsapp/app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 Harshit/Whatsapp/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png create mode 100644 Harshit/Whatsapp/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 Harshit/Whatsapp/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png create mode 100644 Harshit/Whatsapp/app/src/main/res/values-w820dp/dimens.xml create mode 100644 Harshit/Whatsapp/app/src/main/res/values/colors.xml create mode 100644 Harshit/Whatsapp/app/src/main/res/values/dimens.xml create mode 100644 Harshit/Whatsapp/app/src/main/res/values/strings.xml create mode 100644 Harshit/Whatsapp/app/src/main/res/values/styles.xml create mode 100644 Harshit/Whatsapp/app/src/test/java/com/codingblocks/whatsapp/ExampleUnitTest.java create mode 100644 Harshit/Whatsapp/build.gradle create mode 100644 Harshit/Whatsapp/gradle.properties create mode 100755 Harshit/Whatsapp/gradlew create mode 100644 Harshit/Whatsapp/gradlew.bat create mode 100644 Harshit/Whatsapp/settings.gradle diff --git a/.DS_Store b/.DS_Store index 3310573a94e452416c384c665c647564518c8231..d58c7403c41363df594d76f3997d1dcaf4a8542b 100644 GIT binary patch delta 285 zcmZn(XbG6$FKWraz`)4BAi%(o!H~&N;+d15oRqV%a2or>2Hwr=94s7;AQkKk9t?>L zMGVErs`8V7GC+-tZ-MmR|6l-QVW^&*DA_;xu%IVDnkkbTC4}qI#B%dpTvAF)k{KAT zwr_ld&9vP76ap#=G7N*0^K%Qpx*-IbEoH$)c{%xc=?n~$r6ol-%M0l8ZDv>a#WI;) LNPKgw@EaxojpIlE delta 65 zcmV-H0KWf(P=rvBPZcr%0003101yBGbpUbzWdJcrY;R++ah3;>fDN+;2m}ZLGL!Ke X6SLY8Ee^4Oy8*KYAo>KeycPokC)pC6 diff --git a/Harshit/.DS_Store b/Harshit/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..8ceb8d234dbe5407ea2c9eac9c98d46070742caa GIT binary patch literal 6148 zcmeHKO-sW-5PhRP6vR?IdEB!%|3L_Cp;z+~=N{9RcIOJX0)3X75G#@ z?}xyqm?i8Y+SNg4B>-{4uo?SWODHEK%o27HIYN_2B}S^G5i|F1Ja0P}6Xzfdz>-)dtUuLw(w-k4-fGhA{6_ClISmZoidRxDp zQ{URacFm@yd7XA>><>Ny_(SiJa~q7~LHo?h5_S=F7L6O7=pOTesting documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() throws Exception { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getTargetContext(); + + assertEquals("com.codingblocks.broadcastreceivers", appContext.getPackageName()); + } +} diff --git a/Harshit/BroadcastReceivers/app/src/main/AndroidManifest.xml b/Harshit/BroadcastReceivers/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..bcefc17 --- /dev/null +++ b/Harshit/BroadcastReceivers/app/src/main/AndroidManifest.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Harshit/BroadcastReceivers/app/src/main/java/com/codingblocks/broadcastreceivers/MainActivity.java b/Harshit/BroadcastReceivers/app/src/main/java/com/codingblocks/broadcastreceivers/MainActivity.java new file mode 100644 index 0000000..70b4bc7 --- /dev/null +++ b/Harshit/BroadcastReceivers/app/src/main/java/com/codingblocks/broadcastreceivers/MainActivity.java @@ -0,0 +1,160 @@ +package com.codingblocks.broadcastreceivers; + +import android.app.Notification; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; +import android.graphics.Color; +import android.os.Handler; +import android.os.HandlerThread; +import android.os.Message; +import android.support.constraint.ConstraintLayout; +import android.support.v4.app.NotificationCompat; +import android.support.v4.content.ContextCompat; +import android.support.v4.content.LocalBroadcastManager; +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; +import android.util.Log; +import android.view.View; +import android.widget.Button; +import android.widget.LinearLayout; +import android.widget.TextView; +import android.widget.Toast; + +public class MainActivity extends AppCompatActivity { + + TextView textView; + LinearLayout constraintLayout; + Button b; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + textView = (TextView) findViewById(R.id.tView); + constraintLayout = (LinearLayout) findViewById(R.id.constraintLayout); + b = (Button) findViewById(R.id.button); + b.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { +// startAnewThread(5); +// buildNotification(); + Intent intent = new Intent(); + intent.setAction("MY_Action"); + intent.putExtra("key", "Notice me Senpai"); + + LocalBroadcastManager.getInstance(getBaseContext()).sendBroadcast(intent); + } + } + ); + MyReceiver myReceiver = new MyReceiver(); + IntentFilter intentFilter = new IntentFilter(); + intentFilter.addAction(Intent.ACTION_POWER_CONNECTED); + intentFilter.addAction(Intent.ACTION_POWER_DISCONNECTED); + registerReceiver(myReceiver, intentFilter); + + MyOtherReceiver myOtherReceiver = new MyOtherReceiver(); + IntentFilter intentFilter1 = new IntentFilter("MY_Action"); + + LocalBroadcastManager.getInstance(this).registerReceiver(myOtherReceiver, intentFilter1); + + } + + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { +// super.onActivityResult(requestCode, resultCode, data); + Log.e("TAG", "onActivityResult: " + requestCode); + if (requestCode == 111) { + Toast.makeText(this, "Launched Via pendingIntent", Toast.LENGTH_SHORT).show(); + } + } + + private void buildNotification() { + + Intent intent = new Intent(this, MainActivity.class); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, 111, intent, PendingIntent.FLAG_CANCEL_CURRENT); + + Notification notification = new NotificationCompat.Builder(this) + .setContentTitle("This is a title") + .setContentText("Hi, I'm the description") + .setSmallIcon(R.mipmap.ic_launcher_round) + .setContentIntent(pendingIntent) + .addAction(android.R.drawable.ic_menu_send, "Send", pendingIntent) + .build(); + + ((NotificationManager) getSystemService(NOTIFICATION_SERVICE)).notify(1, notification); + } + + private void startAnewThread(final int timer) { + + Handler h = new Handler() { + + @Override + public void handleMessage(Message msg) { + super.handleMessage(msg); + } + }; +// +// HandlerThread handlerThread = new HandlerThread("thread"); +// handlerThread.start(); +// +// Handler h = new Handler(handlerThread.getLooper()); +// +// h.post(new Runnable() { +// @Override +// public void run() { +// for (int i = 0; i < timer;i++){ +// long currtime = System.currentTimeMillis(); +// while (System.currentTimeMillis() - currtime < 1000); +// } +// textView.setText("Work Done"); +// } +// }); + +// Thread thread = new Thread(new Runnable() { +// @Override +// public void run() { +// for (int i = 0; i < timer;i++){ +// long currtime = System.currentTimeMillis(); +// while (System.currentTimeMillis() - currtime < 1000); +// } +// textView.setText("Work Done"); +// } +// }); +// thread.start(); + } + + class MyOtherReceiver extends BroadcastReceiver { + + @Override + public void onReceive(Context context, Intent intent) { + textView.setText(intent.getStringExtra("key")); + } + } + + class MyReceiver extends BroadcastReceiver { + + public MyReceiver() { + } + + @Override + public void onReceive(Context context, Intent intent) { + Intent i = new Intent(context, MainActivity.class); + i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + context.startActivity(i); + if (intent.getAction().equals(Intent.ACTION_POWER_CONNECTED)) { + textView.setText("Power Connected"); + constraintLayout.setBackgroundColor(Color.GREEN); + } else if (intent.getAction().equals(Intent.ACTION_POWER_DISCONNECTED)) { + textView.setText("Power Disconnected"); + constraintLayout.setBackgroundColor(Color.RED); + } + } + } + +} diff --git a/Harshit/BroadcastReceivers/app/src/main/res/layout/activity_main.xml b/Harshit/BroadcastReceivers/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..f4a0c51 --- /dev/null +++ b/Harshit/BroadcastReceivers/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,26 @@ + + + + + +