Skip to content

Commit

Permalink
Fixed widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
wilco375 committed May 13, 2018
1 parent 9e9ca09 commit 7117705
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class MainActivity : CAppCompatActivity() {
*/
private fun checkInit() {
if (sp.getString("token", "") == "" || sp.getString("website", "") == "") {
if(sp.getString("token", "") != null) {
if(sp.getString("token", "") != "") {
// Coming from old app version
sp.edit().putString("website", "jfc.zportal.nl").apply()
syncSchedule()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import com.wilco375.roosternotification.R
import com.wilco375.roosternotification.`object`.Schedule
import com.wilco375.roosternotification.activity.MainActivity
import com.wilco375.roosternotification.general.Utils
import io.multimoon.colorful.Colorful
import java.util.*

class LesdagWidgetProvider : AppWidgetProvider() {
Expand All @@ -28,6 +29,7 @@ class LesdagWidgetProvider : AppWidgetProvider() {
val views = RemoteViews(context.packageName, R.layout.app_widget_lesdag)
views.setOnClickPendingIntent(R.id.app_widget_lesdag_layout, pendingIntent)
views.setTextViewText(R.id.app_widget_lesdag_dag, Utils.currentDay())
views.setInt(R.id.app_widget_lesdag_dag, "setBackgroundColor", Colorful().getPrimaryColor().getColorPack().normal().asInt())

var widgetText = ""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import com.wilco375.roosternotification.R
import com.wilco375.roosternotification.`object`.Schedule
import com.wilco375.roosternotification.activity.MainActivity
import com.wilco375.roosternotification.general.Utils
import io.multimoon.colorful.Colorful
import java.util.*

class LesuurWidgetProvider : AppWidgetProvider() {
Expand Down Expand Up @@ -48,6 +49,7 @@ class LesuurWidgetProvider : AppWidgetProvider() {

val views = RemoteViews(context.packageName, R.layout.app_widget_lesuur)
views.setOnClickPendingIntent(R.id.app_widget_lesuur_layout, pendingIntent)
views.setInt(R.id.app_widget_lesuur_layout, "setBackgroundColor", Colorful().getPrimaryColor().getColorPack().normal().asInt())

if (!(subject == "" && location == "") && !cancelled) {
if (timeslot != 0)
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/app_widget_lesdag.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:theme="@style/AppTheme"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFFFF"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/app_widget_lesuur.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:theme="@style/AppTheme"
android:padding="5dp"
android:background="?colorPrimary"
android:orientation="vertical"
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/values/color.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="themeColorPrimary">#0085ad</color>
<color name="themeColorPrimaryDark">#00455A</color>
<color name="themeColorPrimaryAlpha">#800085ad</color>
<color name="themeColorPrimary">#00ff00</color>
<color name="themeColorPrimaryDark">#1976D2</color>
<color name="themeColorPrimaryAlpha">#802196F3</color>
</resources>

0 comments on commit 7117705

Please sign in to comment.