add a couple more list widget things

This commit is contained in:
tibbi 2016-11-27 21:48:16 +01:00
parent 785131a79f
commit 2691ac7f41
3 changed files with 65 additions and 16 deletions

View File

@ -30,6 +30,15 @@
</intent-filter>
</activity>
<activity
android:name=".activities.WidgetListConfigureActivity"
android:screenOrientation="portrait"
android:theme="@style/MyWidgetConfigTheme">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE"/>
</intent-filter>
</activity>
<activity
android:name=".activities.AboutActivity"
android:label="@string/about"
@ -57,8 +66,8 @@
<receiver
android:name=".helpers.MyWidgetMonthlyProvider"
android:label="@string/widget_monthly"
android:icon="@mipmap/widget_preview">
android:icon="@mipmap/widget_preview"
android:label="@string/widget_monthly">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
</intent-filter>
@ -70,8 +79,8 @@
<receiver
android:name=".helpers.MyWidgetListProvider"
android:label="@string/widget_list"
android:icon="@mipmap/widget_preview">
android:icon="@mipmap/widget_preview"
android:label="@string/widget_list">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
</intent-filter>

View File

@ -6,22 +6,13 @@ import android.content.Context
import android.content.Intent
import android.content.res.Resources
import android.graphics.Color
import android.graphics.PorterDuff
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.view.View
import android.widget.SeekBar
import android.widget.TextView
import com.simplemobiletools.calendar.MonthlyCalendarImpl
import com.simplemobiletools.calendar.R
import com.simplemobiletools.calendar.extensions.adjustAlpha
import com.simplemobiletools.calendar.helpers.*
import com.simplemobiletools.calendar.interfaces.MonthlyCalendar
import com.simplemobiletools.calendar.models.Day
import kotlinx.android.synthetic.main.first_row.*
import kotlinx.android.synthetic.main.top_navigation.*
import kotlinx.android.synthetic.main.widget_config_monthly.*
import org.joda.time.DateTime
import kotlinx.android.synthetic.main.widget_config_list.*
import yuku.ambilwarna.AmbilWarnaDialog
class WidgetListConfigureActivity : AppCompatActivity() {
@ -38,7 +29,7 @@ class WidgetListConfigureActivity : AppCompatActivity() {
public override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setResult(Activity.RESULT_CANCELED)
setContentView(R.layout.widget_config_monthly)
setContentView(R.layout.widget_config_list)
mPackageName = packageName
initVariables()
@ -138,7 +129,6 @@ class WidgetListConfigureActivity : AppCompatActivity() {
private fun updateBgColor() {
mBgColor = mBgColorWithoutTransparency.adjustAlpha(mBgAlpha)
config_calendar.setBackgroundColor(mBgColor)
config_bg_color.setBackgroundColor(mBgColor)
config_save.setBackgroundColor(mBgColor)
}

View File

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_margin="@dimen/activity_margin">
<Button
android:id="@+id/config_bg_color"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_above="@+id/config_text_color" />
<RelativeLayout
android:id="@+id/config_bg_seekbar_holder"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignBottom="@+id/config_bg_color"
android:layout_alignTop="@+id/config_bg_color"
android:layout_toRightOf="@+id/config_bg_color"
android:background="@android:color/white">
<SeekBar
android:id="@+id/config_bg_seekbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingLeft="@dimen/activity_margin"
android:paddingRight="@dimen/activity_margin" />
</RelativeLayout>
<Button
android:id="@+id/config_text_color"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentBottom="true" />
<Button
android:id="@+id/config_save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:fontFamily="sans-serif-light"
android:paddingLeft="@dimen/activity_margin"
android:paddingRight="@dimen/activity_margin"
android:text="@android:string/ok"
android:textColor="@android:color/white"
android:textSize="@dimen/config_text_size" />
</RelativeLayout>