Skip to content

Commit

Permalink
* updated crash reporting library
Browse files Browse the repository at this point in the history
* merged pull request to fix camera preferences
* reordered screensavers to show clock on top of image
  • Loading branch information
thanksmister committed Aug 30, 2021
1 parent 31010d0 commit 65719f3
Show file tree
Hide file tree
Showing 16 changed files with 199 additions and 143 deletions.
15 changes: 11 additions & 4 deletions WallPanelApp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ apply plugin: 'com.google.firebase.crashlytics'
def versionMajor = 0
def versionMinor = 9
def versionPatch = 5
def versionBuild = 6 // bump for dog food builds, public betas, etc.
def versionBuild = 9 // bump for dog food builds, public betas, etc.

def CODE() {
Properties properties = new Properties()
Expand Down Expand Up @@ -148,6 +148,7 @@ dependencies {

// LiveData + ViewModel
implementation "androidx.lifecycle:lifecycle-extensions:$versions.lifecycle"
implementation 'com.google.firebase:firebase-analytics:17.2.2'
annotationProcessor "androidx.lifecycle:lifecycle-compiler:$versions.lifecycle"
implementation "androidx.lifecycle:lifecycle-reactivestreams:$versions.lifecycle"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$versions.lifecycle"
Expand Down Expand Up @@ -179,10 +180,16 @@ dependencies {
// Logging
implementation 'com.jakewharton.timber:timber:4.5.1'

// Import the BoM for the Firebase platform
implementation platform('com.google.firebase:firebase-bom:28.4.0')

// Declare the dependencies for the Crashlytics and Analytics libraries
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.google.firebase:firebase-crashlytics-ktx'

// Firebase
implementation 'com.google.firebase:firebase-core:19.0.0'
implementation 'com.google.firebase:firebase-crashlytics:18.0.1'
implementation 'com.google.firebase:firebase-analytics:19.0.0'
implementation 'com.google.firebase:firebase-core:19.0.1'

// Picasso image loading
implementation 'com.squareup.picasso:picasso:2.71828'
Expand Down
60 changes: 17 additions & 43 deletions WallPanelApp/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,46 +1,22 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (c) 2019 ThanksMister LLC
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software distributed
~ under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.thanksmister.iot.wallpanel">

<!-- Permissions the Application Requires -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

<!-- Permission to record video -->
<uses-permission android:name="android.permission.CAMERA" />

<!-- Permissions to record audio from web page -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <!-- Permission to record video -->
<uses-permission android:name="android.permission.CAMERA" /> <!-- Permissions to record audio from web page -->
<uses-permission android:name="android.permission.MICROPHONE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

<!-- Permission to change the screen brightness -->
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> <!-- Permission to change the screen brightness -->
<uses-permission
android:name="android.permission.WRITE_SETTINGS"
tools:ignore="ProtectedPermissions" />

<!-- Optional supported features -->
tools:ignore="ProtectedPermissions" /> <!-- Optional supported features -->
<uses-feature
android:name="android.hardware.audio.low_latency"
android:required="false" />
Expand All @@ -61,7 +37,7 @@
android:required="false" />

<application
android:name="com.thanksmister.iot.wallpanel.WallPanel"
android:name=".WallPanel"
android:allowBackup="true"
android:fullBackupContent="true"
android:icon="@mipmap/ic_launcher"
Expand All @@ -72,9 +48,15 @@
android:usesCleartextTraffic="true"
tools:ignore="GoogleAppIndexingWarning"
tools:targetApi="m">
<!--<activity android:name=".ui.activities.TestActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>-->
<activity
android:name="com.thanksmister.iot.wallpanel.ui.activities.BrowserActivityNative"
android:name=".ui.activities.BrowserActivityNative"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:enabled="true"
android:exported="true"
Expand All @@ -89,24 +71,22 @@
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

<activity
android:name="com.thanksmister.iot.wallpanel.ui.activities.LiveCameraActivity"
android:name=".ui.activities.LiveCameraActivity"
android:label="@string/title_camera_test" />

<activity
android:name="com.thanksmister.iot.wallpanel.ui.activities.SettingsActivity"
android:name=".ui.activities.SettingsActivity"
android:label="@string/title_settings" />

<service android:name="org.eclipse.paho.android.service.MqttService" />
<service
android:name="com.thanksmister.iot.wallpanel.network.WallPanelService"
android:name=".network.WallPanelService"
android:enabled="true"
android:exported="false"
android:stopWithTask="true" />

<receiver
android:name="com.thanksmister.iot.wallpanel.BootUpReceiver"
android:name=".BootUpReceiver"
android:enabled="true"
android:exported="true">
<intent-filter>
Expand All @@ -121,15 +101,9 @@
<meta-data
android:name="com.google.android.gms.vision.DEPENDENCIES"
android:value="face,barcode" />

<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />

<meta-data
android:name="io.fabric.ApiKey"
android:value="d328872540a331f2245f3d7b842d06bbb7ac1c60" />

</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@ package com.thanksmister.iot.wallpanel
import android.content.Context
import androidx.multidex.MultiDex
import com.google.firebase.FirebaseApp
import com.google.firebase.analytics.FirebaseAnalytics
import com.thanksmister.iot.wallpanel.di.DaggerApplicationComponent
import com.thanksmister.iot.wallpanel.utils.CrashlyticsTree
import com.thanksmister.iot.wallpanel.utils.LauncherShortcuts
import dagger.android.AndroidInjector
import dagger.android.support.DaggerApplication
import timber.log.Timber

class WallPanel : DaggerApplication() {


override fun applicationInjector(): AndroidInjector<out DaggerApplication> {
return DaggerApplicationComponent.builder().create(this);
}
Expand All @@ -37,7 +40,8 @@ class WallPanel : DaggerApplication() {
Timber.plant(Timber.DebugTree())
}
LauncherShortcuts.createShortcuts(this)
FirebaseApp.initializeApp(applicationContext)
//FirebaseApp.initializeApp(applicationContext)
//FirebaseAnalytics.getInstance(applicationContext)
}

override fun attachBaseContext(base: Context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ import android.os.Build
import android.os.Bundle
import android.os.Handler
import android.view.View
import android.view.ViewGroup
import android.view.ViewTreeObserver
import android.view.WindowManager
import android.widget.Button
import android.widget.Toast
import androidx.appcompat.app.AppCompatDelegate
import androidx.localbroadcastmanager.content.LocalBroadcastManager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import android.os.Bundle
import android.os.Handler
import android.view.*
import android.webkit.*
import android.widget.Button
import android.widget.Toast
import androidx.annotation.RequiresApi
import androidx.appcompat.app.AlertDialog
Expand Down Expand Up @@ -180,6 +181,8 @@ class BrowserActivityNative : BaseBrowserActivity(), LifecycleObserver {
}
return true
}


}

mWebView.webViewClient = object : WebViewClient() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright (c) 2021 ThanksMister LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed
* under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.thanksmister.iot.wallpanel.ui.activities

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.ViewGroup
import android.widget.Button
import com.thanksmister.iot.wallpanel.R

class TestActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_test)

val crashButton = Button(this)
crashButton.text = "Test Crash"
crashButton.setOnClickListener {
throw RuntimeException("Test Crash") // Force a crash
}

addContentView(crashButton, ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,8 @@ class SettingsFragment : BaseSettingsFragment() {
}
PREF_SETTINGS_USER_AGENT -> {
val value = userAgentPreference.text.orEmpty()
if (value.isNotEmpty()) {
configuration.browserUserAgent = value
userAgentPreference.summary = value
}
configuration.browserUserAgent = value
userAgentPreference.summary = value
}
PREF_SETTINGS_WEB_SCREENSAVER_URL -> {
val value = webScreenSaverUrl.text.orEmpty()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,19 +129,21 @@ class ScreenSaverView : RelativeLayout {
setClockViews()
timeHandler = Handler()
timeHandler?.postDelayed(timeRunnable, 10)
screenSaverImageLayout.visibility = View.INVISIBLE
screenSaverWebViewLayout.visibility = View.GONE
screenSaverClockLayout.visibility = View.VISIBLE
//screenSaverWebViewLayout.visibility = View.GONE
} else {
screenSaverClockLayout.visibility = View.GONE
}

// show optional screensaver layers
if (showWallpaper) {
wallPaperHandler = Handler()
wallPaperHandler?.postDelayed(wallPaperRunnable, 10)
screenSaverClockLayout.visibility = View.INVISIBLE
screenSaverImageLayout.visibility = View.VISIBLE
screenSaverWebViewLayout.visibility = View.GONE
} else if (showWebPage) {
screenSaverClockLayout.visibility = View.INVISIBLE
screenSaverImageLayout.visibility = View.INVISIBLE
//c
screenSaverImageLayout.visibility = View.GONE
screenSaverWebViewLayout.visibility = View.VISIBLE
startWebScreenSaver(webUrl)
}
Expand Down
29 changes: 15 additions & 14 deletions WallPanelApp/src/main/res/layout-land/dialog_screen_saver.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,21 @@
android:layout_gravity="center"
tools:ignore="HardcodedText" />


<RelativeLayout
android:id="@+id/screenSaverWebViewLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
tools:visibility="visible">

<WebView
android:id="@+id/screenSaverWebView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

</RelativeLayout>

<LinearLayout
android:id="@+id/screenSaverClockLayout"
android:layout_width="wrap_content"
Expand Down Expand Up @@ -61,18 +76,4 @@

</LinearLayout>

<RelativeLayout
android:id="@+id/screenSaverWebViewLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
tools:visibility="visible">

<WebView
android:id="@+id/screenSaverWebView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

</RelativeLayout>

</com.thanksmister.iot.wallpanel.ui.views.ScreenSaverView>
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,20 @@
android:layout_gravity="center"
tools:ignore="HardcodedText"/>

<RelativeLayout
android:id="@+id/screenSaverWebViewLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
tools:visibility="visible">

<WebView
android:id="@+id/screenSaverWebView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

</RelativeLayout>

<LinearLayout
android:id="@+id/screenSaverClockLayout"
android:layout_width="wrap_content"
Expand Down Expand Up @@ -61,18 +75,4 @@

</LinearLayout>

<RelativeLayout
android:id="@+id/screenSaverWebViewLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
tools:visibility="visible">

<WebView
android:id="@+id/screenSaverWebView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

</RelativeLayout>

</com.thanksmister.iot.wallpanel.ui.views.ScreenSaverView>
Loading

0 comments on commit 65719f3

Please sign in to comment.