From 66838ed4a2ec7813123b64ef767d0448699d0f1c Mon Sep 17 00:00:00 2001 From: William Brawner Date: Wed, 5 Feb 2020 08:18:01 -0600 Subject: [PATCH] Fix lint warnings --- .idea/dictionaries/wbrawner.xml | 14 ++++ app/google-services.json | 48 -------------- .../pihelper/ExampleInstrumentedTest.kt | 24 ------- app/src/main/AndroidManifest.xml | 7 -- .../wbrawner/pihelper/AddPiHoleFragment.kt | 1 - .../wbrawner/pihelper/PiHelperApplication.kt | 1 + .../drawable-anydpi-v24/ic_notification.xml | 22 +++---- .../res/drawable-hdpi/ic_notification.png | Bin 610 -> 561 bytes .../res/drawable-mdpi/ic_notification.png | Bin 403 -> 395 bytes .../res/drawable-xhdpi/ic_notification.png | Bin 791 -> 741 bytes .../res/drawable-xxhdpi/ic_notification.png | Bin 1149 -> 1096 bytes app/src/main/res/layout/activity_main.xml | 4 +- .../res/layout/dialog_disable_custom_time.xml | 6 +- .../main/res/layout/fragment_add_pi_hole.xml | 11 ++-- app/src/main/res/layout/fragment_main.xml | 1 + .../res/layout/fragment_retrieve_api_key.xml | 12 ++-- app/src/main/res/layout/or_divider.xml | 6 +- app/src/main/res/values/strings.xml | 18 +++-- app/src/main/res/xml-v25/shortcuts.xml | 62 ++++++++++++++++++ app/src/main/res/xml/shortcuts.xml | 20 ++---- .../com/wbrawner/pihelper/ExampleUnitTest.kt | 17 ----- build.gradle | 2 +- .../piholeclient/ExampleInstrumentedTest.kt | 24 ------- .../wbrawner/piholeclient/ExampleUnitTest.kt | 17 ----- 24 files changed, 127 insertions(+), 190 deletions(-) create mode 100644 .idea/dictionaries/wbrawner.xml delete mode 100644 app/google-services.json delete mode 100644 app/src/androidTest/java/com/wbrawner/pihelper/ExampleInstrumentedTest.kt create mode 100644 app/src/main/res/xml-v25/shortcuts.xml delete mode 100644 app/src/test/java/com/wbrawner/pihelper/ExampleUnitTest.kt delete mode 100644 piholeclient/src/androidTest/java/com/wbrawner/piholeclient/ExampleInstrumentedTest.kt delete mode 100644 piholeclient/src/test/java/com/wbrawner/piholeclient/ExampleUnitTest.kt diff --git a/.idea/dictionaries/wbrawner.xml b/.idea/dictionaries/wbrawner.xml new file mode 100644 index 0000000..3c49923 --- /dev/null +++ b/.idea/dictionaries/wbrawner.xml @@ -0,0 +1,14 @@ + + + + acra + brawner + mins + moshi + pihelper + pihole + piholeclient + wbrawner + + + \ No newline at end of file diff --git a/app/google-services.json b/app/google-services.json deleted file mode 100644 index 2a61ab2..0000000 --- a/app/google-services.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "project_info": { - "project_number": "511023365625", - "firebase_url": "https://pi-helper-d3885.firebaseio.com", - "project_id": "pi-helper-d3885", - "storage_bucket": "pi-helper-d3885.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:511023365625:android:f8d76275e55f6db4efd128", - "android_client_info": { - "package_name": "com.wbrawner.pihelper" - } - }, - "oauth_client": [ - { - "client_id": "511023365625-d5fi76hu5mu838tblaahrfdudjdlels8.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "com.wbrawner.pihelper", - "certificate_hash": "e705f9dfdbd6ab7a79c902bc94c8448030f52c89" - } - }, - { - "client_id": "511023365625-k0t6fbagmsgdveg6e673detjf75fmi2l.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyDv9-WRa4xWFswXr5qBWVaAzA-UOraAsHc" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [ - { - "client_id": "511023365625-k0t6fbagmsgdveg6e673detjf75fmi2l.apps.googleusercontent.com", - "client_type": 3 - } - ] - } - } - } - ], - "configuration_version": "1" -} \ No newline at end of file diff --git a/app/src/androidTest/java/com/wbrawner/pihelper/ExampleInstrumentedTest.kt b/app/src/androidTest/java/com/wbrawner/pihelper/ExampleInstrumentedTest.kt deleted file mode 100644 index aea9a83..0000000 --- a/app/src/androidTest/java/com/wbrawner/pihelper/ExampleInstrumentedTest.kt +++ /dev/null @@ -1,24 +0,0 @@ -package com.wbrawner.pihelper - -import androidx.test.platform.app.InstrumentationRegistry -import androidx.test.ext.junit.runners.AndroidJUnit4 - -import org.junit.Test -import org.junit.runner.RunWith - -import org.junit.Assert.* - -/** - * Instrumented test, which will execute on an Android device. - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -@RunWith(AndroidJUnit4::class) -class ExampleInstrumentedTest { - @Test - fun useAppContext() { - // Context of the app under test. - val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("com.wbrawner.pihelper", appContext.packageName) - } -} diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index fb11a14..a0fe58a 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -48,13 +48,6 @@ android:name="android.app.shortcuts" android:resource="@xml/shortcuts" /> - - - \ No newline at end of file diff --git a/app/src/main/java/com/wbrawner/pihelper/AddPiHoleFragment.kt b/app/src/main/java/com/wbrawner/pihelper/AddPiHoleFragment.kt index 1c703c8..22bc6f4 100644 --- a/app/src/main/java/com/wbrawner/pihelper/AddPiHoleFragment.kt +++ b/app/src/main/java/com/wbrawner/pihelper/AddPiHoleFragment.kt @@ -7,7 +7,6 @@ import android.view.View import android.view.ViewGroup import androidx.appcompat.app.AlertDialog import androidx.fragment.app.Fragment -import androidx.navigation.NavOptionsBuilder import androidx.navigation.fragment.FragmentNavigatorExtras import androidx.navigation.fragment.findNavController import kotlinx.android.synthetic.main.fragment_add_pi_hole.* diff --git a/app/src/main/java/com/wbrawner/pihelper/PiHelperApplication.kt b/app/src/main/java/com/wbrawner/pihelper/PiHelperApplication.kt index efb4cea..1c3ce7b 100644 --- a/app/src/main/java/com/wbrawner/pihelper/PiHelperApplication.kt +++ b/app/src/main/java/com/wbrawner/pihelper/PiHelperApplication.kt @@ -11,6 +11,7 @@ import org.koin.android.ext.koin.androidContext import org.koin.android.ext.koin.androidLogger import org.koin.core.context.startKoin +@Suppress("unused") @AcraCore(buildConfigClass = BuildConfig::class) @AcraMailSender(mailTo = "pihelper@wbrawner.com") @AcraNotification( diff --git a/app/src/main/res/drawable-anydpi-v24/ic_notification.xml b/app/src/main/res/drawable-anydpi-v24/ic_notification.xml index 387fdb5..3ce20ca 100644 --- a/app/src/main/res/drawable-anydpi-v24/ic_notification.xml +++ b/app/src/main/res/drawable-anydpi-v24/ic_notification.xml @@ -1,19 +1,15 @@ - - + + diff --git a/app/src/main/res/drawable-hdpi/ic_notification.png b/app/src/main/res/drawable-hdpi/ic_notification.png index d7b4a7aa6790b95eb5a86c86b23c2c425a3db886..8fb56a4590cae89dc760f64d30cec9913edea745 100644 GIT binary patch delta 537 zcmV+!0_OeV1hE8=BYy$-NklRRq!1o44+@NOlqcYhk|OIMh7@Mtq}3>*_N zo9jx`E*&NUe%K^YFbGO)#+J~vC>yV|5ved?X8Z|;L6!qu7LEO2`f#dY8o?KtJ%a`V zk9yKt`(NM5Rrbj8K& z7H6 z=yl$}kfz@N)6bd&YIe|s%{cTb0}rHm0tLEZJk*jVtAB4$m&7X{oH5O)Y1`qn))V+t zf-5$5M=jPQ(3nP`QyYCLSc+@T)M4#4-JX*gfnI3$Db~P=&6rJ)lgj&|(~_x6&?@l) z^U`iGse7=Yf*5s%2}1QdnEU_~feIo!-5-YItWk@veTh!e^n_le4?)$S?}84|$KjS+ bg7phW#u5W74r*yv00000NkvXXu0mjf9xCu1NO!Ur4_3%xnf_>&UYidvgUP$}^3Vc|L1>~j3yU0X5&#q?7 z$K5*0eCMU20Drh5(KAT%F;E(LDw-o85e3;*tXXKVYs^0=5p*y?zlA`3%)dh-7-oVN z3xS%M|FA?b!vxh90#z~pX^CLM@;B7P{6{2$0n2NshxvC&1ocd?Vj<89^RJNz5?M#p zJtGs8fd+a_@(?DOdEbCosc@NH#gpS0aStZ7xr;!9%ztOeL>LsD2K5a$+whQgPuf>d zViIUdctqWl98WPO0qio}qDh#1cBhwA-8X*eVBK-Z%QgwrtITRHf>$LtWMdyesp-O- zG7Plo&?iyzTXl@nyQt6LU?*IS*07*qoM6N<$f`)b%RR910 diff --git a/app/src/main/res/drawable-mdpi/ic_notification.png b/app/src/main/res/drawable-mdpi/ic_notification.png index e6c7273b004b6ef21349d4aaa95f15a37f9c5a84..3ede048bb13facbfbd15e9605882bc8376fa3f72 100644 GIT binary patch delta 368 zcmV-$0gwKZ1B(NYB!5y#L_t(|+U1lxOG7~rg_A-;AVf%GK&&kDfIw=0Ku{7CEd)EU zRWO}~bQX4sjfj>O7D~Xz#(!X!QVBw;fDceXFgiI4r_y_OXBWF1_?o-t%ytGaUEe1x&ciM-k7$4aiwC zYxEs!j(RK6x@n5>7r-lT^R%mYN#gYbW`6mXz%%#;i<;dx#I9Yi3U|$(KI4x zE4Cqj$tED8rDzjLB{pIq8Z3fEECdxllkq;d;uN$Zkn7C+5$QW1Fjhm*#tSEZy@V2Jmf37*QEXLO$HNS8e|*;me{+eNh_2-VxNLL zu;mbNOn+UI=5dX^HkG~|Iu~F>3piB*WPe8c^lWp*FJM+1p5+E>HAOcA7Qqp(%jT}R ze1{$f1l)kD9`90p@}7_b<5m)I2sZk?HZ5S%vWj=G0LH;s(%<9^SMtD9c>?Bwe_LO# Wjl(+A#gkb80000Bv&OP@w z!TZ2(GraeC&f)#IACpMLiWMssR}ci%pb2z=b3_;YR$Z(`*MEVFU^d9FS-Q5a7z$5< z+h8q-t~DB){1=6nfL^c?*lUHnN_-Vx0q$*3%oETDT0jbHAyV{PA6=76#;5Q3c z1P2uT_mk(kOn+8`W&`8m^Vi|v4tI#p@wk@pQE_{R9eyN+MOKT3X_guO1hozusHKc` zWo-@1z*lBC>S3N4WqBsM%*L!)+|q6j4RnjlW*f5}VYbsl13N@!kBwPBpR_!#wU$|K zzt#)<+G7K+R9<8Z9^vbFj}1I#xp!@hZZV^`9vhfvxqsJfj4m^yU!dGW@tehreBQ>a zQ+yH99vWy8nHd|iq%gbWp@FL`Zxw8_HJlSmXtU_L0q%o4rYUep@$unH>jxU9XF~36 zr@=nutkYWC$iVnbGCyo%nCIpMSGjg);ND0?&HPoUto}|5h*|#?Gr9cERY1#er34o`bRD;Jq000~~g_#fzc~ zIsA5mlN+3&E~soFMc_?~1|HFPv!0p+FaL7w3$WM4tk@g4)e@alS0-Et#s?i0{t;X= zyDuM0+sOh7d=4Ihci;_q4AHWq(f3h$ie9j=dPe5#k+5ju2>2YL_@`h`q8LU0eGSpK zTIw4Zbbh|C)QDMh9Rp{P)i3jJJ?00000NkvXXu0mjf78X+J delta 767 zcmVsD*-Mkc-lVf*~l9_5lM*H2V5qIMCzpX2$#Z zMwkP?#SHKM&$%D(-gD3Myu9Ttcg^?x3c+p(wi(<639tw@{eS14GPrTt#GxiPSml zKppcvr6RHt5Lk&IVO&=BPbXw5nCC>$fndIrk~;D6aDNS(!j}T}qE z0p|OzipWJK@&=TEHgFkS1?Ry*3mtgNe7CBWOxD>wAQ^H6`~x0?lZJvn%k)>3Ghj5l zEm0m3FMoZ%g+wl{Bi5-<=ZR_fyT-J>E0+fXSTqRj=Cz6cxC8T~l#*n6{&=v-@y#(7QTXgloB5YjpDZ#g;803Mk4qh;Dnb;MxT_P?jZP&;Fy=I xhTzVDN8mSm5nqE#PS&*HS*h^ymbcw+{{V{k*gHSBGQ9u*002ovPDHLkV1j#xZ!iD= diff --git a/app/src/main/res/drawable-xxhdpi/ic_notification.png b/app/src/main/res/drawable-xxhdpi/ic_notification.png index d722b14bf041678f481f54c086f1f3b71cdd0631..b3286964274e6379099deeb53b7358133bd77f6e 100644 GIT binary patch delta 1075 zcmV-31kC&W2*?PKB!3S{L_t(|+U;9iNEA^NUJEf-NQ?}GeDFae2nsg{RQw}KgNS|z zF^a^<)Q}*E?8UVwD=0NIdx(O}C@hE|f{*8_tt#te#MyTo^$(5!1X zoesud0qdgqVSg1r_;q3|J9O$6PK(2Bgjd!g5A_xS!w$D!i!R~R+L(L+%w^Qh6&fDhxD8{zIi2)nz3Tj}0os2MOUv8dmlX37>=9q8Y$hLbyi5fc6nS(R&7`XeA-~ z8@NQ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~imu2XIuk7@|u4971qvxDfT>F1+e5`fdACN5T!kTwyS* z`UqB)Nu2`BVY}}5{01IP+C^MPTm4*ektg1P*FD#xoP8RFU$LR?InGK;TsK^}aN)v*RQv`bbs?Y|lgE$%0000 - - + diff --git a/app/src/main/res/layout/dialog_disable_custom_time.xml b/app/src/main/res/layout/dialog_disable_custom_time.xml index 240d4a5..5f6b7e9 100644 --- a/app/src/main/res/layout/dialog_disable_custom_time.xml +++ b/app/src/main/res/layout/dialog_disable_custom_time.xml @@ -12,7 +12,7 @@ style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" android:layout_width="match_parent" android:layout_height="wrap_content" - android:hint="Time to disable"> + android:hint="@string/hint_disable_duration"> + android:text="@string/duration_seconds" /> + android:text="@string/duration_minutes" /> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_add_pi_hole.xml b/app/src/main/res/layout/fragment_add_pi_hole.xml index 731f381..37ea695 100644 --- a/app/src/main/res/layout/fragment_add_pi_hole.xml +++ b/app/src/main/res/layout/fragment_add_pi_hole.xml @@ -19,6 +19,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" + android:contentDescription="@string/app_name" android:src="@drawable/ic_app_logo" android:tint="@color/colorOnSurface" android:transitionName="piHelperLogo" /> @@ -26,28 +27,28 @@ + android:text="@string/action_scan_network" /> + android:hint="@string/prompt_ip_address"> + android:text="@string/action_connect_pihole" /> diff --git a/app/src/main/res/layout/fragment_main.xml b/app/src/main/res/layout/fragment_main.xml index 897e9c7..fdf3abc 100644 --- a/app/src/main/res/layout/fragment_main.xml +++ b/app/src/main/res/layout/fragment_main.xml @@ -86,6 +86,7 @@ android:id="@+id/progressBar" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:contentDescription="@string/app_name" android:src="@drawable/ic_app_logo" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" diff --git a/app/src/main/res/layout/fragment_retrieve_api_key.xml b/app/src/main/res/layout/fragment_retrieve_api_key.xml index 5a496db..7117088 100644 --- a/app/src/main/res/layout/fragment_retrieve_api_key.xml +++ b/app/src/main/res/layout/fragment_retrieve_api_key.xml @@ -27,21 +27,21 @@ + android:hint="@string/prompt_password"> + android:text="@string/action_authenticate_password" /> @@ -62,7 +62,7 @@ style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" android:layout_width="match_parent" android:layout_height="wrap_content" - android:hint="Pi-Hole API Key"> + android:hint="@string/prompt_api_key"> + android:text="@string/action_authenticate_api_key" /> diff --git a/app/src/main/res/layout/or_divider.xml b/app/src/main/res/layout/or_divider.xml index 3c066f7..fd429ef 100644 --- a/app/src/main/res/layout/or_divider.xml +++ b/app/src/main/res/layout/or_divider.xml @@ -12,7 +12,8 @@ android:layout_gravity="center" android:layout_weight="1" android:scaleType="fitXY" - android:src="@drawable/horizontal_rule" /> + android:src="@drawable/horizontal_rule" + tools:ignore="ContentDescription" /> + android:src="@drawable/horizontal_rule" + tools:ignore="ContentDescription" /> \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index cb1c2ab..13d731c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -18,10 +18,6 @@ Pi-Helper failed to connect to your Pi-Hole Please configure Pi-Helper before using shortcuts or - Sorry, but no - Yes, I\'ll help! - Would you like to help me make Pi-Helper better by automatically sending crash reports and usage details via Firebase? These are immensely helpful in tracking down issues that may arise or optimizing the app for only the features that are used. You can change your mind at any time from the settings. - Help make Pi-Helper better Settings Forget Pi-hole William Brawner. You can find the source code or report issues on the GitHub page for the project.]]> @@ -31,4 +27,18 @@ Would you please consider sending the crash report to me? Crash Reports Unknown + Secs + Mins + Time to disable + If you\'re not sure what the IP address for your Pi-Hole is, Pi-Helper can attempt to find it for you by scanning your network. + Scan Network + If you already know the IP address or host of your Pi-Hole, you can also enter it below: + Pi-Hole IP Address/Host + Connect to Pi-Hole + Pi-Helper has successfully connected to your Pi-Hole! + You\'ll need to authenticate in order to enable and disable the Pi-hole. + Pi-Hole Web Password + Authenticate with Password + Pi-Hole API Key + Authenticate with API Key diff --git a/app/src/main/res/xml-v25/shortcuts.xml b/app/src/main/res/xml-v25/shortcuts.xml new file mode 100644 index 0000000..a8ff49e --- /dev/null +++ b/app/src/main/res/xml-v25/shortcuts.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/xml/shortcuts.xml b/app/src/main/res/xml/shortcuts.xml index a8ff49e..9b7a7c4 100644 --- a/app/src/main/res/xml/shortcuts.xml +++ b/app/src/main/res/xml/shortcuts.xml @@ -2,10 +2,7 @@ + android:icon="@drawable/ic_shortcut_pause"> + android:icon="@drawable/ic_shortcut_pause"> + android:icon="@drawable/ic_shortcut_pause"> + android:icon="@drawable/ic_shortcut_enable">