├── .gitignore
├── .idea
├── codeStyles
│ ├── Project.xml
│ └── codeStyleConfig.xml
├── encodings.xml
├── gradle.xml
├── misc.xml
├── runConfigurations.xml
└── vcs.xml
├── README.md
├── app
├── .gitignore
├── build.gradle
├── google-services.json
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── aayushf
│ │ └── watchdog
│ │ └── ExampleInstrumentedTest.kt
│ ├── main
│ ├── AndroidManifest.xml
│ ├── ic_launcher-web.png
│ ├── java
│ │ └── com
│ │ │ └── aayushf
│ │ │ └── watchdog
│ │ │ ├── DriveActivity.kt
│ │ │ ├── HomeActivity.kt
│ │ │ ├── LiveFeedActivity.kt
│ │ │ ├── MainActivity.kt
│ │ │ └── SplashScreen.kt
│ └── res
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable
│ │ ├── ic_launcher_background.xml
│ │ ├── ic_menu_camera.xml
│ │ ├── ic_menu_gallery.xml
│ │ ├── ic_menu_manage.xml
│ │ ├── ic_menu_send.xml
│ │ ├── ic_menu_share.xml
│ │ ├── ic_menu_slideshow.xml
│ │ └── side_nav_bar.xml
│ │ ├── layout
│ │ ├── activity_drive.xml
│ │ ├── activity_home.xml
│ │ ├── activity_live_feed.xml
│ │ ├── activity_main.xml
│ │ ├── activity_scrolling.xml
│ │ ├── activity_splash_screen.xml
│ │ ├── app_bar_home.xml
│ │ ├── content_drive.xml
│ │ ├── content_live_feed.xml
│ │ ├── content_main.xml
│ │ ├── content_scrolling.xml
│ │ ├── home_rv_card.xml
│ │ ├── main_rv_card.xml
│ │ └── nav_header_home.xml
│ │ ├── menu
│ │ ├── activity_home_drawer.xml
│ │ ├── home.xml
│ │ ├── menu_main.xml
│ │ └── menu_scrolling.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ ├── ic_launcher_foreground.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ ├── ic_launcher_foreground.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ ├── ic_launcher_foreground.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ ├── ic_launcher_foreground.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ ├── ic_launcher_foreground.png
│ │ └── ic_launcher_round.png
│ │ ├── raw
│ │ └── wbm3.mp4
│ │ ├── values-v21
│ │ └── styles.xml
│ │ └── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── aayushf
│ └── watchdog
│ └── ExampleUnitTest.kt
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 |
--------------------------------------------------------------------------------
/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
18 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # WatchDog
2 | IVLabs summer intern project app code
3 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | apply plugin: 'kotlin-android'
4 |
5 | apply plugin: 'kotlin-android-extensions'
6 | apply plugin: 'com.google.gms.google-services'
7 |
8 | android {
9 | compileSdkVersion 28
10 | defaultConfig {
11 | applicationId "com.aayushf.watchdog"
12 | minSdkVersion 21
13 | targetSdkVersion 28
14 | versionCode 1
15 | versionName "1.0"
16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17 | }
18 | buildTypes {
19 | release {
20 | minifyEnabled false
21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
22 | }
23 | }
24 | }
25 |
26 | dependencies {
27 | implementation fileTree(dir: 'libs', include: ['*.jar'])
28 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
29 | implementation 'androidx.appcompat:appcompat:1.0.2'
30 | implementation 'androidx.core:core-ktx:1.0.2'
31 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
32 | implementation 'androidx.legacy:legacy-support-v4:1.0.0'
33 | implementation 'com.google.firebase:firebase-database:16.0.4'
34 | implementation 'com.google.firebase:firebase-storage:16.0.4'
35 | implementation 'com.google.firebase:firebase-auth:16.0.5'
36 | testImplementation 'junit:junit:4.12'
37 | implementation 'com.android.volley:volley:1.1.1'
38 | androidTestImplementation 'androidx.test:runner:1.2.0'
39 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
40 | implementation 'androidx.recyclerview:recyclerview:1.0.0'
41 | implementation 'com.mikepenz:fastadapter:4.0.0'
42 | implementation 'com.afollestad.material-dialogs:core:3.0.0-rc3'
43 | implementation 'com.afollestad.material-dialogs:bottomsheets:3.0.0-rc3'
44 | implementation 'com.afollestad.material-dialogs:input:3.0.0-rc3'
45 | implementation 'com.google.android.material:material:1.1.0-alpha07'
46 | implementation 'com.github.bumptech.glide:glide:4.9.0'
47 | annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
48 |
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/app/google-services.json:
--------------------------------------------------------------------------------
1 | {
2 | "project_info": {
3 | "project_number": "470367929175",
4 | "firebase_url": "https://evilwatchdog.firebaseio.com",
5 | "project_id": "evilwatchdog",
6 | "storage_bucket": "evilwatchdog.appspot.com"
7 | },
8 | "client": [
9 | {
10 | "client_info": {
11 | "mobilesdk_app_id": "1:470367929175:android:14b8ee7287001eea",
12 | "android_client_info": {
13 | "package_name": "com.aayushf.watchdog"
14 | }
15 | },
16 | "oauth_client": [
17 | {
18 | "client_id": "470367929175-tddf98q26hqr75g58192uul8amacomoc.apps.googleusercontent.com",
19 | "client_type": 1,
20 | "android_info": {
21 | "package_name": "com.aayushf.watchdog",
22 | "certificate_hash": "0ee3691689954afa0c32681d9358fc489c7b765e"
23 | }
24 | },
25 | {
26 | "client_id": "470367929175-jk32o96s5l0rmnddf47t3r8id969q47b.apps.googleusercontent.com",
27 | "client_type": 3
28 | }
29 | ],
30 | "api_key": [
31 | {
32 | "current_key": "AIzaSyBbZ36Wj6WAIo9WEyWtuM-jgj3K4K6hSqc"
33 | }
34 | ],
35 | "services": {
36 | "appinvite_service": {
37 | "other_platform_oauth_client": [
38 | {
39 | "client_id": "470367929175-jk32o96s5l0rmnddf47t3r8id969q47b.apps.googleusercontent.com",
40 | "client_type": 3
41 | }
42 | ]
43 | }
44 | }
45 | }
46 | ],
47 | "configuration_version": "1"
48 | }
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/aayushf/watchdog/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package com.aayushf.watchdog
2 |
3 | import androidx.test.InstrumentationRegistry
4 | import androidx.test.runner.AndroidJUnit4
5 |
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | import org.junit.Assert.*
10 |
11 | /**
12 | * Instrumented test, which will execute on an Android device.
13 | *
14 | * See [testing documentation](http://d.android.com/tools/testing).
15 | */
16 | @RunWith(AndroidJUnit4::class)
17 | class ExampleInstrumentedTest {
18 | @Test
19 | fun useAppContext() {
20 | // Context of the app under test.
21 | val appContext = InstrumentationRegistry.getTargetContext()
22 | assertEquals("com.aayushf.watchdog", appContext.packageName)
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
15 |
19 |
20 |
25 |
28 |
29 |
33 |
34 |
38 |
39 |
43 |
44 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/app/src/main/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aditya-shirwatkar/WatchDogAndroidApp/48f8171a7d6e2021674d5ca1a9177d3627693a4a/app/src/main/ic_launcher-web.png
--------------------------------------------------------------------------------
/app/src/main/java/com/aayushf/watchdog/DriveActivity.kt:
--------------------------------------------------------------------------------
1 | package com.aayushf.watchdog
2 |
3 | import android.os.Bundle
4 | import android.view.MotionEvent
5 | import com.google.android.material.snackbar.Snackbar
6 | import androidx.appcompat.app.AppCompatActivity;
7 | import com.google.firebase.database.FirebaseDatabase
8 |
9 | import kotlinx.android.synthetic.main.activity_drive.*
10 | import kotlinx.android.synthetic.main.content_drive.*
11 |
12 | class DriveActivity : AppCompatActivity() {
13 |
14 | override fun onCreate(savedInstanceState: Bundle?) {
15 | super.onCreate(savedInstanceState)
16 | setContentView(R.layout.activity_drive)
17 | setSupportActionBar(toolbar)
18 |
19 | fab.setOnClickListener { view ->
20 | Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
21 | .setAction("Action", null).show()
22 | }
23 | supportActionBar?.setDisplayHomeAsUpEnabled(true)
24 | val db = FirebaseDatabase.getInstance()
25 | val directionref = db.getReference("direction")
26 | drive_right.setOnTouchListener { v, event ->
27 | if(event.action == MotionEvent.ACTION_DOWN){
28 | directionref.setValue("r")
29 | }else if (event.action == MotionEvent.ACTION_UP){
30 | directionref.setValue("s")
31 | }
32 | true
33 | }
34 | drive_left.setOnTouchListener { v, event ->
35 | if(event.action == MotionEvent.ACTION_DOWN){
36 | directionref.setValue("l")
37 | }else if (event.action == MotionEvent.ACTION_UP){
38 | directionref.setValue("s")
39 | }
40 | true
41 | }
42 | drive_fwd.setOnTouchListener { v, event ->
43 | if(event.action == MotionEvent.ACTION_DOWN){
44 | directionref.setValue("f")
45 | }else if (event.action == MotionEvent.ACTION_UP){
46 | directionref.setValue("s")
47 | }
48 | true
49 | }
50 | drive_back.setOnTouchListener { v, event ->
51 | if(event.action == MotionEvent.ACTION_DOWN){
52 | directionref.setValue("b")
53 | }else if (event.action == MotionEvent.ACTION_UP){
54 | directionref.setValue("s")
55 | }
56 | true
57 | }
58 | }
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aayushf/watchdog/HomeActivity.kt:
--------------------------------------------------------------------------------
1 | package com.aayushf.watchdog
2 |
3 | import android.content.Intent
4 | import android.net.Uri
5 | import android.os.Bundle
6 | import android.util.Log
7 | import android.view.Menu
8 | import android.view.MenuItem
9 | import android.view.View
10 | import android.widget.ImageView
11 | import android.widget.TextView
12 | import androidx.appcompat.app.ActionBarDrawerToggle
13 | import androidx.appcompat.app.AppCompatActivity
14 | import androidx.core.view.GravityCompat
15 | import androidx.drawerlayout.widget.DrawerLayout
16 | import androidx.recyclerview.widget.LinearLayoutManager
17 | import androidx.recyclerview.widget.RecyclerView
18 | import com.bumptech.glide.Glide
19 | import com.google.android.material.floatingactionbutton.FloatingActionButton
20 | import com.google.android.material.navigation.NavigationView
21 | import com.google.android.material.snackbar.Snackbar
22 | import com.google.firebase.database.DataSnapshot
23 | import com.google.firebase.database.DatabaseError
24 | import com.google.firebase.database.FirebaseDatabase
25 | import com.google.firebase.database.ValueEventListener
26 | import com.google.firebase.storage.FirebaseStorage
27 | import com.mikepenz.fastadapter.FastAdapter
28 | import com.mikepenz.fastadapter.adapters.ItemAdapter
29 | import com.mikepenz.fastadapter.items.AbstractItem
30 | import kotlinx.android.synthetic.main.content_scrolling.*
31 |
32 | class HomeActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelectedListener {
33 |
34 |
35 | override fun onCreate(savedInstanceState: Bundle?) {
36 | super.onCreate(savedInstanceState)
37 | setContentView(R.layout.activity_home)
38 | val toolbar: androidx.appcompat.widget.Toolbar = findViewById(R.id.toolbar)
39 | setSupportActionBar(toolbar)
40 | val db = FirebaseDatabase.getInstance()
41 | val logs_ref = db.getReference("logs").child("log_images")
42 | val logs_ref_cloud = FirebaseStorage.getInstance().getReference().child("logs")
43 | val logitems = mutableListOf()
44 | val postListener = object : ValueEventListener {
45 | override fun onDataChange(dataSnapshot: DataSnapshot) {
46 | dataSnapshot.children.forEach {
47 | val fname = it.key!! + ".jpeg"
48 | logs_ref_cloud.child(fname).downloadUrl.addOnSuccessListener {uri:Uri->
49 | logitems.add(LogItem(uri.toString(), fname))
50 | val itemAdapter = ItemAdapter()
51 | val fastAdapter = FastAdapter.with(itemAdapter)
52 | home_rv.layoutManager = LinearLayoutManager(this@HomeActivity, RecyclerView.VERTICAL, false)
53 | home_rv.adapter = fastAdapter
54 | itemAdapter.add(logitems)
55 | home_rv.adapter = fastAdapter
56 | }.addOnFailureListener {
57 | }
58 | }
59 | }
60 |
61 | override fun onCancelled(databaseError: DatabaseError) {
62 |
63 | }
64 | }
65 | logs_ref.addValueEventListener(postListener)
66 |
67 | val fab: FloatingActionButton = findViewById(R.id.fab)
68 | fab.setOnClickListener { view ->
69 | Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
70 | .setAction("Action", null).show()
71 | }
72 | val drawerLayout: DrawerLayout = findViewById(R.id.drawer_layout)
73 | val navView: NavigationView = findViewById(R.id.nav_view)
74 | val toggle = ActionBarDrawerToggle(
75 | this, drawerLayout, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close
76 | )
77 | drawerLayout.addDrawerListener(toggle)
78 | toggle.syncState()
79 | navView.setNavigationItemSelectedListener(this)
80 | }
81 |
82 | override fun onBackPressed() {
83 | val drawerLayout: DrawerLayout = findViewById(R.id.drawer_layout)
84 | if (drawerLayout.isDrawerOpen(GravityCompat.START)) {
85 | drawerLayout.closeDrawer(GravityCompat.START)
86 | } else {
87 | super.onBackPressed()
88 | }
89 | }
90 |
91 | override fun onCreateOptionsMenu(menu: Menu): Boolean {
92 | // Inflate the menu; this adds items to the action bar if it is present.
93 | menuInflater.inflate(R.menu.home, menu)
94 | return true
95 | }
96 |
97 | override fun onOptionsItemSelected(item: MenuItem): Boolean {
98 | // Handle action bar item clicks here. The action bar will
99 | // automatically handle clicks on the Home/Up button, so long
100 | // as you specify a parent activity in AndroidManifest.xml.
101 | return when (item.itemId) {
102 | R.id.action_settings -> true
103 | else -> super.onOptionsItemSelected(item)
104 | }
105 | }
106 |
107 | override fun onNavigationItemSelected(item: MenuItem): Boolean {
108 | // Handle navigation view item clicks here.
109 | when (item.itemId) {
110 | R.id.nav_drive -> {
111 | val i = Intent(this@HomeActivity, DriveActivity::class.java)
112 | startActivity(i)
113 | }
114 | R.id.nav_live_feed -> {
115 | val i = Intent(this@HomeActivity, LiveFeedActivity::class.java)
116 | startActivity(i)
117 | }
118 | R.id.nav_slideshow -> {
119 |
120 | }
121 | R.id.nav_tools -> {
122 |
123 | }
124 | R.id.nav_share -> {
125 |
126 | }
127 | R.id.nav_send -> {
128 |
129 | }
130 | }
131 | val drawerLayout: DrawerLayout = findViewById(R.id.drawer_layout)
132 | drawerLayout.closeDrawer(GravityCompat.START)
133 | return true
134 | }
135 |
136 | class LogItem(val url: String = "URL_NOT_GIVEN", val name: String = "NAME_NOT_GIVEN") :
137 | AbstractItem() {
138 | init {
139 | Log.d("HomeActivity", "LogItem Made")
140 | }
141 | override val layoutRes: Int
142 | get() = R.layout.home_rv_card
143 | override val type: Int
144 | get() = 0
145 |
146 | override fun getViewHolder(v: View): ViewHolder {
147 | return ViewHolder(v)
148 | }
149 |
150 | class ViewHolder(val v: View) : FastAdapter.ViewHolder(v) {
151 | override fun bindView(item: LogItem, payloads: MutableList) {
152 | val iv = v.findViewById(R.id.rv_item_image)
153 | Glide.with(iv).load(item.url).into(iv)
154 | v.findViewById(R.id.rv_item_text).text = item.name
155 | }
156 |
157 | override fun unbindView(item: LogItem) {
158 |
159 | }
160 |
161 | }
162 | }
163 | }
164 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aayushf/watchdog/LiveFeedActivity.kt:
--------------------------------------------------------------------------------
1 | package com.aayushf.watchdog
2 |
3 | import android.os.Bundle
4 | import com.google.android.material.snackbar.Snackbar
5 | import androidx.appcompat.app.AppCompatActivity;
6 |
7 | import kotlinx.android.synthetic.main.activity_live_feed.*
8 | import kotlinx.android.synthetic.main.content_live_feed.*
9 | import android.webkit.WebViewClient
10 |
11 |
12 |
13 | class LiveFeedActivity : AppCompatActivity() {
14 |
15 | override fun onCreate(savedInstanceState: Bundle?) {
16 | super.onCreate(savedInstanceState)
17 | setContentView(R.layout.activity_live_feed)
18 | setSupportActionBar(toolbar)
19 |
20 | fab.setOnClickListener { view ->
21 | Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
22 | .setAction("Action", null).show()
23 | }
24 | live_web_view.setWebViewClient(WebViewClient())
25 | live_web_view.loadUrl("http://192.168.43.42:8000/")
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aayushf/watchdog/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.aayushf.watchdog
2 |
3 | import android.os.Bundle
4 | import android.util.Log
5 | import android.view.Menu
6 | import android.view.MenuItem
7 | import android.view.View
8 | import android.widget.TextView
9 | import androidx.appcompat.app.AppCompatActivity
10 | import androidx.recyclerview.widget.LinearLayoutManager
11 | import androidx.recyclerview.widget.RecyclerView
12 | import com.afollestad.materialdialogs.MaterialDialog
13 | import com.afollestad.materialdialogs.input.input
14 | import com.android.volley.Request
15 | import com.android.volley.RequestQueue
16 | import com.android.volley.Response
17 | import com.android.volley.toolbox.StringRequest
18 | import com.android.volley.toolbox.Volley
19 | import com.google.android.material.snackbar.Snackbar
20 | import com.mikepenz.fastadapter.FastAdapter
21 | import com.mikepenz.fastadapter.adapters.ItemAdapter
22 | import com.mikepenz.fastadapter.items.AbstractItem
23 | import kotlinx.android.synthetic.main.activity_main.*
24 | import kotlinx.android.synthetic.main.content_main.*
25 |
26 | class MainActivity : AppCompatActivity() {
27 | var queue: RequestQueue? = null
28 | override fun onCreate(savedInstanceState: Bundle?) {
29 | super.onCreate(savedInstanceState)
30 | setContentView(R.layout.activity_main)
31 | setSupportActionBar(toolbar)
32 | val url = "http://192.168.4.1:9890/wifi/"
33 | main_rv.layoutManager = LinearLayoutManager(this@MainActivity, RecyclerView.VERTICAL, false)
34 |
35 | queue = Volley.newRequestQueue(this@MainActivity)
36 | val stringRequest = StringRequest(
37 | Request.Method.GET, url,
38 | Response.Listener { response ->
39 | var resp = response.substringAfter('\'')
40 | resp = resp.substringBeforeLast('\'')
41 | main_text.text = "Response is: ${resp}"
42 | val list = resp.split("', '")
43 | Log.d("MainActivity", list[0])
44 | val ia = ItemAdapter()
45 | val fa = FastAdapter.with(ia)
46 | main_rv.adapter = fa
47 | var items = mutableListOf()
48 | list.forEach {
49 | items.add(WiFiItem(it))
50 | }
51 | ia.add(items)
52 | fa.onClickListener = { view, adapter, item, position ->
53 | var ssid = item.ssid
54 | MaterialDialog(this).show {
55 | input { materialDialog, charSequence ->
56 | connectToWifi(ssid, charSequence.toString())
57 | }
58 | }
59 | true
60 | }
61 |
62 | },
63 | Response.ErrorListener { main_text.text = "That didn't work!" })
64 | fab.setOnClickListener { view ->
65 | Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
66 | .setAction("Action", null).show()
67 | queue!!.add(stringRequest)
68 | }
69 | }
70 |
71 | override fun onCreateOptionsMenu(menu: Menu): Boolean {
72 | // Inflate the menu; this adds items to the action bar if it is present.
73 | menuInflater.inflate(R.menu.menu_main, menu)
74 | return true
75 | }
76 |
77 | override fun onOptionsItemSelected(item: MenuItem): Boolean {
78 | // Handle action bar item clicks here. The action bar will
79 | // automatically handle clicks on the Home/Up button, so long
80 | // as you specify a parent activity in AndroidManifest.xml.
81 | return when (item.itemId) {
82 | R.id.action_settings -> true
83 | else -> super.onOptionsItemSelected(item)
84 | }
85 | }
86 | fun connectToWifi(ssid:String, passwd:String){
87 | var newurl = "http://192.168.4.1:9890/wifi/connect/?ssid=${ssid}&passwd=${passwd}"
88 | val srq = StringRequest(Request.Method.GET, newurl, Response.Listener { }, Response.ErrorListener { })
89 | queue!!.add(srq)
90 |
91 | }
92 |
93 | class WiFiItem(var ssid: String = "Not Put") : AbstractItem() {
94 | override val layoutRes: Int
95 | get() = R.layout.main_rv_card
96 | override val type: Int
97 |
98 |
99 | get() = 0
100 |
101 | override fun getViewHolder(v: View): WiFiItem.ViewHolder {
102 | return ViewHolder(v)
103 | }
104 |
105 | class ViewHolder(var iv: View) : FastAdapter.ViewHolder(iv) {
106 | override fun bindView(item: WiFiItem, payloads: MutableList) {
107 | iv.findViewById(R.id.main_rv_card_text).text = item.ssid
108 | }
109 |
110 | override fun unbindView(item: WiFiItem) {
111 |
112 | }
113 | }
114 | }
115 | }
116 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aayushf/watchdog/SplashScreen.kt:
--------------------------------------------------------------------------------
1 | package com.aayushf.watchdog
2 |
3 | import android.content.Intent
4 | import android.media.MediaPlayer
5 | import android.net.Uri
6 | import android.widget.VideoView
7 | import androidx.appcompat.app.AppCompatActivity
8 | import android.os.Bundle
9 | import android.view.View
10 |
11 | class SplashScreen : AppCompatActivity() {
12 |
13 |
14 | override fun onCreate(savedInstanceState: Bundle?) {
15 | super.onCreate(savedInstanceState)
16 | setContentView(R.layout.activity_splash_screen)
17 | val uri = Uri.parse("android.resource://" + packageName + "/" + R.raw.wbm3)
18 | val vv = findViewById(R.id.splash_video) as VideoView
19 | vv.setVideoURI(uri)
20 | vv.start()
21 | vv.setOnCompletionListener {
22 | val i = Intent(this@SplashScreen, HomeActivity::class.java)
23 | startActivity(i)
24 | }
25 |
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
10 |
12 |
14 |
16 |
18 |
20 |
22 |
24 |
26 |
28 |
30 |
32 |
34 |
36 |
38 |
40 |
42 |
44 |
46 |
48 |
50 |
52 |
54 |
56 |
58 |
60 |
62 |
64 |
66 |
68 |
70 |
72 |
74 |
75 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_menu_camera.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_menu_gallery.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_menu_manage.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_menu_send.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_menu_share.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_menu_slideshow.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/side_nav_bar.xml:
--------------------------------------------------------------------------------
1 |
3 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_drive.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
21 |
22 |
23 |
24 |
25 |
26 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_home.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
16 |
17 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_live_feed.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
21 |
22 |
23 |
24 |
25 |
26 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
21 |
22 |
23 |
24 |
25 |
26 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_scrolling.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
17 |
18 |
26 |
27 |
33 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
51 |
52 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_splash_screen.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/app_bar_home.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/content_drive.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
17 |
24 |
25 |
32 |
39 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/content_live_feed.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/content_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
21 |
26 |
27 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/content_scrolling.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/home_rv_card.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
12 |
18 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/main_rv_card.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/nav_header_home.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 |
16 |
23 |
24 |
30 |
31 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/activity_home_drawer.xml:
--------------------------------------------------------------------------------
1 |
2 |
39 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/home.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
5 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_scrolling.xml:
--------------------------------------------------------------------------------
1 |
5 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aditya-shirwatkar/WatchDogAndroidApp/48f8171a7d6e2021674d5ca1a9177d3627693a4a/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aditya-shirwatkar/WatchDogAndroidApp/48f8171a7d6e2021674d5ca1a9177d3627693a4a/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aditya-shirwatkar/WatchDogAndroidApp/48f8171a7d6e2021674d5ca1a9177d3627693a4a/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aditya-shirwatkar/WatchDogAndroidApp/48f8171a7d6e2021674d5ca1a9177d3627693a4a/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aditya-shirwatkar/WatchDogAndroidApp/48f8171a7d6e2021674d5ca1a9177d3627693a4a/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aditya-shirwatkar/WatchDogAndroidApp/48f8171a7d6e2021674d5ca1a9177d3627693a4a/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aditya-shirwatkar/WatchDogAndroidApp/48f8171a7d6e2021674d5ca1a9177d3627693a4a/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aditya-shirwatkar/WatchDogAndroidApp/48f8171a7d6e2021674d5ca1a9177d3627693a4a/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aditya-shirwatkar/WatchDogAndroidApp/48f8171a7d6e2021674d5ca1a9177d3627693a4a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aditya-shirwatkar/WatchDogAndroidApp/48f8171a7d6e2021674d5ca1a9177d3627693a4a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aditya-shirwatkar/WatchDogAndroidApp/48f8171a7d6e2021674d5ca1a9177d3627693a4a/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aditya-shirwatkar/WatchDogAndroidApp/48f8171a7d6e2021674d5ca1a9177d3627693a4a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aditya-shirwatkar/WatchDogAndroidApp/48f8171a7d6e2021674d5ca1a9177d3627693a4a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aditya-shirwatkar/WatchDogAndroidApp/48f8171a7d6e2021674d5ca1a9177d3627693a4a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aditya-shirwatkar/WatchDogAndroidApp/48f8171a7d6e2021674d5ca1a9177d3627693a4a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/raw/wbm3.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aditya-shirwatkar/WatchDogAndroidApp/48f8171a7d6e2021674d5ca1a9177d3627693a4a/app/src/main/res/raw/wbm3.mp4
--------------------------------------------------------------------------------
/app/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #D81B60
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 | 16dp
3 |
4 | 16dp
5 | 16dp
6 | 8dp
7 | 176dp
8 | 180dp
9 | 16dp
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | WatchDog
3 | Settings
4 | HomeActivity
5 | Open navigation drawer
6 | Close navigation drawer
7 | Android Studio
8 | android.studio@android.com
9 | Navigation header
10 |
11 | Home
12 | Gallery
13 | Slideshow
14 | Tools
15 | Share
16 | Send
17 | ScrollingActivity
18 |
19 | "Material is the metaphor.\n\n"
20 |
21 | "A material metaphor is the unifying theory of a rationalized space and a system of motion."
22 | "The material is grounded in tactile reality, inspired by the study of paper and ink, yet "
23 | "technologically advanced and open to imagination and magic.\n"
24 | "Surfaces and edges of the material provide visual cues that are grounded in reality. The "
25 | "use of familiar tactile attributes helps users quickly understand affordances. Yet the "
26 | "flexibility of the material creates new affordances that supercede those in the physical "
27 | "world, without breaking the rules of physics.\n"
28 | "The fundamentals of light, surface, and movement are key to conveying how objects move, "
29 | "interact, and exist in space and in relation to each other. Realistic lighting shows "
30 | "seams, divides space, and indicates moving parts.\n\n"
31 |
32 | "Bold, graphic, intentional.\n\n"
33 |
34 | "The foundational elements of print based design typography, grids, space, scale, color, "
35 | "and use of imagery guide visual treatments. These elements do far more than please the "
36 | "eye. They create hierarchy, meaning, and focus. Deliberate color choices, edge to edge "
37 | "imagery, large scale typography, and intentional white space create a bold and graphic "
38 | "interface that immerse the user in the experience.\n"
39 | "An emphasis on user actions makes core functionality immediately apparent and provides "
40 | "waypoints for the user.\n\n"
41 |
42 | "Motion provides meaning.\n\n"
43 |
44 | "Motion respects and reinforces the user as the prime mover. Primary user actions are "
45 | "inflection points that initiate motion, transforming the whole design.\n"
46 | "All action takes place in a single environment. Objects are presented to the user without "
47 | "breaking the continuity of experience even as they transform and reorganize.\n"
48 | "Motion is meaningful and appropriate, serving to focus attention and maintain continuity. "
49 | "Feedback is subtle yet clear. Transitions are efficient yet coherent.\n\n"
50 |
51 | "3D world.\n\n"
52 |
53 | "The material environment is a 3D space, which means all objects have x, y, and z "
54 | "dimensions. The z-axis is perpendicularly aligned to the plane of the display, with the "
55 | "positive z-axis extending towards the viewer. Every sheet of material occupies a single "
56 | "position along the z-axis and has a standard 1dp thickness.\n"
57 | "On the web, the z-axis is used for layering and not for perspective. The 3D world is "
58 | "emulated by manipulating the y-axis.\n\n"
59 |
60 | "Light and shadow.\n\n"
61 |
62 | "Within the material environment, virtual lights illuminate the scene. Key lights create "
63 | "directional shadows, while ambient light creates soft shadows from all angles.\n"
64 | "Shadows in the material environment are cast by these two light sources. In Android "
65 | "development, shadows occur when light sources are blocked by sheets of material at "
66 | "various positions along the z-axis. On the web, shadows are depicted by manipulating the "
67 | "y-axis only. The following example shows the card with a height of 6dp.\n\n"
68 |
69 | "Resting elevation.\n\n"
70 |
71 | "All material objects, regardless of size, have a resting elevation, or default elevation "
72 | "that does not change. If an object changes elevation, it should return to its resting "
73 | "elevation as soon as possible.\n\n"
74 |
75 | "Component elevations.\n\n"
76 |
77 | "The resting elevation for a component type is consistent across apps (e.g., FAB elevation "
78 | "does not vary from 6dp in one app to 16dp in another app).\n"
79 | "Components may have different resting elevations across platforms, depending on the depth "
80 | "of the environment (e.g., TV has a greater depth than mobile or desktop).\n\n"
81 |
82 | "Responsive elevation and dynamic elevation offsets.\n\n"
83 |
84 | "Some component types have responsive elevation, meaning they change elevation in response "
85 | "to user input (e.g., normal, focused, and pressed) or system events. These elevation "
86 | "changes are consistently implemented using dynamic elevation offsets.\n"
87 | "Dynamic elevation offsets are the goal elevation that a component moves towards, relative "
88 | "to the component’s resting state. They ensure that elevation changes are consistent "
89 | "across actions and component types. For example, all components that lift on press have "
90 | "the same elevation change relative to their resting elevation.\n"
91 | "Once the input event is completed or cancelled, the component will return to its resting "
92 | "elevation.\n\n"
93 |
94 | "Avoiding elevation interference.\n\n"
95 |
96 | "Components with responsive elevations may encounter other components as they move between "
97 | "their resting elevations and dynamic elevation offsets. Because material cannot pass "
98 | "through other material, components avoid interfering with one another any number of ways, "
99 | "whether on a per component basis or using the entire app layout.\n"
100 | "On a component level, components can move or be removed before they cause interference. "
101 | "For example, a floating action button (FAB) can disappear or move off screen before a "
102 | "user picks up a card, or it can move if a snackbar appears.\n"
103 | "On the layout level, design your app layout to minimize opportunities for interference. "
104 | "For example, position the FAB to one side of stream of a cards so the FAB won’t interfere "
105 | "when a user tries to pick up one of cards.\n\n"
106 |
107 | DriveActivity
108 | LiveFeedActivity
109 |
110 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
14 |
15 |
16 |
22 |
23 |
--------------------------------------------------------------------------------
/app/src/test/java/com/aayushf/watchdog/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package com.aayushf.watchdog
2 |
3 | import org.junit.Test
4 |
5 | import org.junit.Assert.*
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | class ExampleUnitTest {
13 | @Test
14 | fun addition_isCorrect() {
15 | assertEquals(4, 2 + 2)
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | ext.kotlin_version = '1.3.21'
5 | repositories {
6 | google()
7 | jcenter()
8 |
9 | }
10 | dependencies {
11 | classpath 'com.android.tools.build:gradle:3.4.0'
12 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
13 | classpath 'com.google.gms:google-services:4.2.0'
14 | // NOTE: Do not place your application dependencies here; they belong
15 | // in the individual module build.gradle files
16 | }
17 | }
18 |
19 | allprojects {
20 | repositories {
21 | google()
22 | jcenter()
23 |
24 | }
25 | }
26 |
27 | task clean(type: Delete) {
28 | delete rootProject.buildDir
29 | }
30 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app's APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
20 | # Kotlin code style for this project: "official" or "obsolete":
21 | kotlin.code.style=official
22 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aditya-shirwatkar/WatchDogAndroidApp/48f8171a7d6e2021674d5ca1a9177d3627693a4a/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sun Jun 09 16:59:14 IST 2019
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------