Start supporting custom font
This commit is contained in:
parent
c8dd8f711e
commit
9318a99d1f
@ -16,6 +16,7 @@ object Constants {
|
||||
val WEATHER_APP_REQUEST_CODE = 4
|
||||
val EVENT_APP_REQUEST_CODE = 6
|
||||
val WEATHER_PROVIDER_REQUEST_CODE = 5
|
||||
val CLOCK_APP_REQUEST_CODE = 7
|
||||
|
||||
|
||||
val RESULT_CODE_CUSTOM_LOCATION = 45
|
||||
@ -56,6 +57,10 @@ object Constants {
|
||||
val PREF_TEXT_COLOR = "PREF_TEXT_COLOR"
|
||||
val PREF_TEXT_MAIN_SIZE = "PREF_TEXT_MAIN_SIZE"
|
||||
val PREF_TEXT_SECOND_SIZE = "PREF_TEXT_SECOND_SIZE"
|
||||
val PREF_WEATHER_PROVIDER = "PREF_WEATHER_PROVIDER"
|
||||
val PREF_SHOW_CLOCK = "PREF_SHOW_CLOCK"
|
||||
val PREF_CLOCK_APP_NAME = "PREF_CLOCK_APP_NAME"
|
||||
val PREF_CLOCK_APP_PACKAGE = "PREF_CLOCK_APP_PACKAGE"
|
||||
|
||||
val ACTION_EXTRA_OPEN_WEATHER_PROVIDER = "ACTION_EXTRA_OPEN_WEATHER_PROVIDER"
|
||||
|
||||
@ -68,4 +73,7 @@ object Constants {
|
||||
val ACTION_CALENDAR_UPDATE = "com.tommasoberlose.anotherwidget.action.ACTION_CALENDAR_UPDATE"
|
||||
val ACTION_WEATHER_UPDATE = "com.tommasoberlose.anotherwidget.action.ACTION_WEATHER_UPDATE"
|
||||
val ACTION_SOMETHING_APPENED = "com.tommasoberlose.anotherwidget.action.ACTION_SOMETHING_APPENED"
|
||||
|
||||
val WEATHER_PROVIDER_GOOGLE_AWARENESS = 1
|
||||
val WEATHER_PROVIDER_OPEN_WEATHER = 2
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ class UpdatesReceiver : BroadcastReceiver() {
|
||||
setUpdates(context)
|
||||
} else if (intent.action.equals(Constants.ACTION_TIME_UPDATE)) {
|
||||
val e: Event = CalendarUtil.getNextEvent(context)
|
||||
if (e.id == 0 || e.endDate < Calendar.getInstance().timeInMillis) {
|
||||
if (e.id == 0 || e.endDate <= Calendar.getInstance().timeInMillis) {
|
||||
CalendarUtil.updateEventList(context)
|
||||
} else {
|
||||
Util.updateWidget(context)
|
||||
@ -36,12 +36,15 @@ class UpdatesReceiver : BroadcastReceiver() {
|
||||
fun setUpdates(context: Context) {
|
||||
removeUpdates(context)
|
||||
CalendarUtil.updateEventList(context)
|
||||
val now = Calendar.getInstance()
|
||||
now.set(Calendar.MILLISECOND, 0)
|
||||
now.set(Calendar.SECOND, 0)
|
||||
|
||||
val am = context.getSystemService(Context.ALARM_SERVICE) as AlarmManager
|
||||
val i = Intent(context, UpdatesReceiver::class.java)
|
||||
i.action = Constants.ACTION_TIME_UPDATE
|
||||
val pi = PendingIntent.getBroadcast(context, 0, i, 0)
|
||||
am.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis(), (1000 * 60).toLong(), pi)
|
||||
am.setRepeating(AlarmManager.RTC_WAKEUP, now.timeInMillis, (1000 * 60).toLong(), pi)
|
||||
}
|
||||
|
||||
fun removeUpdates(context: Context) {
|
||||
|
@ -10,8 +10,10 @@ import android.content.SharedPreferences
|
||||
import android.preference.PreferenceManager
|
||||
import android.util.Log
|
||||
import com.tommasoberlose.anotherwidget.`object`.Constants
|
||||
import com.tommasoberlose.anotherwidget.util.CalendarUtil
|
||||
import com.tommasoberlose.anotherwidget.util.Util
|
||||
import com.tommasoberlose.anotherwidget.util.WeatherUtil
|
||||
import java.util.*
|
||||
|
||||
class WeatherReceiver : BroadcastReceiver() {
|
||||
|
||||
@ -41,7 +43,10 @@ class WeatherReceiver : BroadcastReceiver() {
|
||||
5 -> 60 * 24
|
||||
else -> 60
|
||||
}
|
||||
am.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis(), 1000 * 60 * refresh, pi)
|
||||
val now = Calendar.getInstance()
|
||||
now.set(Calendar.MILLISECOND, 0)
|
||||
now.set(Calendar.SECOND, 0)
|
||||
am.setRepeating(AlarmManager.RTC_WAKEUP, now.timeInMillis, 1000 * 60 * refresh, pi)
|
||||
}
|
||||
|
||||
fun setOneTimeUpdate(context: Context) {
|
||||
@ -49,9 +54,13 @@ class WeatherReceiver : BroadcastReceiver() {
|
||||
val i = Intent(context, WeatherReceiver::class.java)
|
||||
i.action = Constants.ACTION_WEATHER_UPDATE
|
||||
val pi = PendingIntent.getBroadcast(context, 1, i, 0)
|
||||
am.setExact(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + 1000 * 60 * 10, pi)
|
||||
am.setExact(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + 1000 * 60 * 15, pi)
|
||||
am.setExact(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + 1000 * 60 * 20, pi)
|
||||
|
||||
val now = Calendar.getInstance()
|
||||
now.set(Calendar.MILLISECOND, 0)
|
||||
now.set(Calendar.SECOND, 0)
|
||||
am.setExact(AlarmManager.RTC_WAKEUP, now.timeInMillis + 1000 * 60 * 10, pi)
|
||||
am.setExact(AlarmManager.RTC_WAKEUP, now.timeInMillis + 1000 * 60 * 15, pi)
|
||||
am.setExact(AlarmManager.RTC_WAKEUP, now.timeInMillis + 1000 * 60 * 20, pi)
|
||||
}
|
||||
|
||||
fun removeUpdates(context: Context) {
|
||||
|
@ -24,6 +24,7 @@ import com.tommasoberlose.anotherwidget.util.CalendarUtil
|
||||
import com.tommasoberlose.anotherwidget.util.WeatherUtil
|
||||
import android.content.DialogInterface
|
||||
import android.graphics.Color
|
||||
import android.graphics.Typeface
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.os.Build
|
||||
import android.support.annotation.ColorInt
|
||||
@ -41,6 +42,7 @@ import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.key_time_wait_layout.view.*
|
||||
import kotlinx.android.synthetic.main.main_menu_layout.view.*
|
||||
import kotlinx.android.synthetic.main.the_widget.*
|
||||
import kotlinx.android.synthetic.main.the_widget.view.*
|
||||
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
@ -171,6 +173,8 @@ class MainActivity : AppCompatActivity() {
|
||||
fun updateUI() {
|
||||
updateSettings()
|
||||
updateAppWidget()
|
||||
updateClockView()
|
||||
widget_bitmap.setImageBitmap(Util.getBitmapFromView(main_layout))
|
||||
}
|
||||
|
||||
|
||||
@ -180,6 +184,7 @@ class MainActivity : AppCompatActivity() {
|
||||
widget_bg.setImageDrawable(wallpaper)
|
||||
updateCalendarView()
|
||||
updateLocationView()
|
||||
updateClockView()
|
||||
}
|
||||
}
|
||||
|
||||
@ -210,6 +215,13 @@ class MainActivity : AppCompatActivity() {
|
||||
.commit()
|
||||
Util.updateWidget(this)
|
||||
updateSettings()
|
||||
} else if (requestCode == Constants.CLOCK_APP_REQUEST_CODE && resultCode == Activity.RESULT_OK && data != null) {
|
||||
SP.edit()
|
||||
.putString(Constants.PREF_CLOCK_APP_NAME, data.getStringExtra(Constants.RESULT_APP_NAME))
|
||||
.putString(Constants.PREF_CLOCK_APP_PACKAGE, data.getStringExtra(Constants.RESULT_APP_PACKAGE))
|
||||
.commit()
|
||||
Util.updateWidget(this)
|
||||
updateSettings()
|
||||
} else if (requestCode == Constants.WEATHER_PROVIDER_REQUEST_CODE && resultCode == Activity.RESULT_OK) {
|
||||
WeatherReceiver().setOneTimeUpdate(this)
|
||||
sendBroadcast(Intent(Constants.ACTION_WEATHER_UPDATE))
|
||||
@ -231,6 +243,17 @@ class MainActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
fun updateClockView() {
|
||||
val SP = PreferenceManager.getDefaultSharedPreferences(this)
|
||||
if (!SP.getBoolean(Constants.PREF_SHOW_CLOCK, false)) {
|
||||
time.visibility = View.GONE
|
||||
} else {
|
||||
time.visibility = View.VISIBLE
|
||||
}
|
||||
val now = Calendar.getInstance()
|
||||
time.text = if (SP.getString(Constants.PREF_HOUR_FORMAT, "12").equals("12")) Constants.badHourFormat.format(now.timeInMillis) else Constants.goodHourFormat.format(now.timeInMillis)
|
||||
}
|
||||
|
||||
fun updateCalendarView() {
|
||||
val SP = PreferenceManager.getDefaultSharedPreferences(this)
|
||||
val now = Calendar.getInstance()
|
||||
@ -307,6 +330,17 @@ class MainActivity : AppCompatActivity() {
|
||||
next_event_date.setTextSize(TypedValue.COMPLEX_UNIT_SP, SP.getFloat(Constants.PREF_TEXT_SECOND_SIZE, 16f))
|
||||
divider2.setTextSize(TypedValue.COMPLEX_UNIT_SP, SP.getFloat(Constants.PREF_TEXT_SECOND_SIZE, 16f))
|
||||
calendar_temp.setTextSize(TypedValue.COMPLEX_UNIT_SP, SP.getFloat(Constants.PREF_TEXT_SECOND_SIZE, 16f))
|
||||
|
||||
|
||||
val product_sans: Typeface = Typeface.createFromAsset(assets, "fonts/product_sans_regular.ttf")
|
||||
empty_date.typeface = product_sans
|
||||
divider1.typeface = product_sans
|
||||
temp.typeface = product_sans
|
||||
next_event.typeface = product_sans
|
||||
next_event_difference_time.typeface = product_sans
|
||||
next_event_date.typeface = product_sans
|
||||
divider2.typeface = product_sans
|
||||
calendar_temp.typeface = product_sans
|
||||
}
|
||||
|
||||
fun updateLocationView() {
|
||||
@ -342,6 +376,31 @@ class MainActivity : AppCompatActivity() {
|
||||
fun updateSettings() {
|
||||
val SP = PreferenceManager.getDefaultSharedPreferences(this)
|
||||
|
||||
if (SP.getBoolean(Constants.PREF_SHOW_CLOCK, false)) {
|
||||
clock_settings.visibility = View.VISIBLE
|
||||
action_show_clock.setOnClickListener {
|
||||
SP.edit()
|
||||
.putBoolean(Constants.PREF_SHOW_CLOCK, false)
|
||||
.commit()
|
||||
sendBroadcast(Intent(Constants.ACTION_TIME_UPDATE))
|
||||
updateSettings()
|
||||
updateAppWidget()
|
||||
}
|
||||
show_clock_label.text = getString(R.string.show_clock_visible)
|
||||
} else {
|
||||
clock_settings.visibility= View.GONE
|
||||
action_show_clock.setOnClickListener {
|
||||
SP.edit()
|
||||
.putBoolean(Constants.PREF_SHOW_CLOCK, true)
|
||||
.commit()
|
||||
sendBroadcast(Intent(Constants.ACTION_TIME_UPDATE))
|
||||
updateSettings()
|
||||
updateAppWidget()
|
||||
}
|
||||
show_clock_label.text = getString(R.string.show_clock_not_visible)
|
||||
}
|
||||
|
||||
|
||||
if (SP.getBoolean(Constants.PREF_SHOW_EVENTS, true) && Util.checkGrantedPermission(this, Manifest.permission.READ_CALENDAR)) {
|
||||
calendar_settings.visibility = View.VISIBLE
|
||||
action_show_events.setOnClickListener {
|
||||
@ -352,7 +411,7 @@ class MainActivity : AppCompatActivity() {
|
||||
updateSettings()
|
||||
updateAppWidget()
|
||||
}
|
||||
show_events_label.text = getString(R.string.show_events_visible)
|
||||
show_clock_label.text = getString(R.string.show_events_visible)
|
||||
} else {
|
||||
calendar_settings.visibility= View.GONE
|
||||
action_show_events.setOnClickListener {
|
||||
@ -459,7 +518,6 @@ class MainActivity : AppCompatActivity() {
|
||||
SP.edit().remove(Constants.PREF_TEXT_COLOR).commit()
|
||||
Color.parseColor(SP.getString(Constants.PREF_TEXT_COLOR, "#FFFFFF"))
|
||||
}
|
||||
text_color_icon.setCardBackgroundColor(textColor)
|
||||
font_color_label.text = SP.getString(Constants.PREF_TEXT_COLOR, "#FFFFFF").toUpperCase()
|
||||
action_font_color.setOnClickListener {
|
||||
val cp: ColorPicker = ColorPicker(this@MainActivity, Color.red(textColor), Color.green(textColor), Color.blue(textColor))
|
||||
@ -521,20 +579,15 @@ class MainActivity : AppCompatActivity() {
|
||||
startActivityForResult(Intent(this, CustomLocationActivity::class.java), Constants.RESULT_CODE_CUSTOM_LOCATION)
|
||||
}
|
||||
|
||||
if (SP.getString(Constants.PREF_CUSTOM_LOCATION_ADD, getString(R.string.custom_location_gps)) == getString(R.string.custom_location_gps)) {
|
||||
action_weather_provider_api_key.visibility= View.GONE
|
||||
if (!SP.getString(Constants.PREF_WEATHER_PROVIDER_API_KEY, "").equals("")) {
|
||||
label_weather_provider_api_key.text = getString(R.string.settings_weather_provider_api_key_subtitle_all_set)
|
||||
alert_icon.visibility = View.GONE
|
||||
} else {
|
||||
action_weather_provider_api_key.visibility= View.VISIBLE
|
||||
if (!SP.getString(Constants.PREF_WEATHER_PROVIDER_API_KEY, "").equals("")) {
|
||||
label_weather_provider_api_key.text = getString(R.string.settings_weather_provider_api_key_subtitle_all_set)
|
||||
alert_icon.visibility = View.GONE
|
||||
} else {
|
||||
label_weather_provider_api_key.text = getString(R.string.settings_weather_provider_api_key_subtitle_not_set)
|
||||
alert_icon.visibility = View.VISIBLE
|
||||
}
|
||||
action_weather_provider_api_key.setOnClickListener {
|
||||
startActivityForResult(Intent(this, WeatherProviderActivity::class.java), Constants.WEATHER_PROVIDER_REQUEST_CODE)
|
||||
}
|
||||
label_weather_provider_api_key.text = getString(R.string.settings_weather_provider_api_key_subtitle_not_set)
|
||||
alert_icon.visibility = View.VISIBLE
|
||||
}
|
||||
action_weather_provider_api_key.setOnClickListener {
|
||||
startActivityForResult(Intent(this, WeatherProviderActivity::class.java), Constants.WEATHER_PROVIDER_REQUEST_CODE)
|
||||
}
|
||||
|
||||
calendar_app_label.text = SP.getString(Constants.PREF_CALENDAR_APP_NAME, getString(R.string.default_name))
|
||||
@ -547,6 +600,11 @@ class MainActivity : AppCompatActivity() {
|
||||
startActivityForResult(Intent(this, ChooseApplicationActivity::class.java), Constants.WEATHER_APP_REQUEST_CODE)
|
||||
}
|
||||
|
||||
clock_app_label.text = SP.getString(Constants.PREF_CLOCK_APP_NAME, getString(R.string.default_name))
|
||||
action_clock_app.setOnClickListener {
|
||||
startActivityForResult(Intent(this, ChooseApplicationActivity::class.java), Constants.CLOCK_APP_REQUEST_CODE)
|
||||
}
|
||||
|
||||
event_app_label.text = SP.getString(Constants.PREF_EVENT_APP_NAME, getString(R.string.default_name))
|
||||
action_event_app.setOnClickListener {
|
||||
startActivityForResult(Intent(this, ChooseApplicationActivity::class.java), Constants.EVENT_APP_REQUEST_CODE)
|
||||
|
@ -6,6 +6,7 @@ import android.app.AlertDialog
|
||||
import android.content.ClipboardManager
|
||||
import android.content.Context
|
||||
import android.content.DialogInterface
|
||||
import android.content.SharedPreferences
|
||||
import android.os.Build
|
||||
import android.support.v7.app.AppCompatActivity
|
||||
import android.os.Bundle
|
||||
@ -26,12 +27,14 @@ import kotlinx.android.synthetic.main.provider_info_layout.view.*
|
||||
|
||||
class WeatherProviderActivity : AppCompatActivity() {
|
||||
|
||||
lateinit var SP: SharedPreferences
|
||||
|
||||
@SuppressLint("ApplySharedPref")
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_weather_provider)
|
||||
|
||||
val SP = PreferenceManager.getDefaultSharedPreferences(this)
|
||||
SP = PreferenceManager.getDefaultSharedPreferences(this)
|
||||
action_paste.setOnClickListener {
|
||||
val clipboard = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
||||
if (clipboard.primaryClip != null && clipboard.primaryClip.itemCount > 0) {
|
||||
@ -39,8 +42,7 @@ class WeatherProviderActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
Util.collapse(button_container)
|
||||
api_key.setText(SP.getString(Constants.PREF_WEATHER_PROVIDER_API_KEY, ""))
|
||||
updateUI()
|
||||
|
||||
action_save.setOnClickListener {
|
||||
SP.edit()
|
||||
@ -83,9 +85,34 @@ class WeatherProviderActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("ApplySharedPref")
|
||||
fun updateUI() {
|
||||
val currentProvider = SP.getInt(Constants.PREF_WEATHER_PROVIDER, Constants.WEATHER_PROVIDER_GOOGLE_AWARENESS)
|
||||
if (currentProvider == Constants.WEATHER_PROVIDER_GOOGLE_AWARENESS) {
|
||||
api_key.visibility = View.GONE
|
||||
} else {
|
||||
api_key.visibility = View.VISIBLE
|
||||
}
|
||||
label_weather_provider.text = when (currentProvider) {
|
||||
Constants.WEATHER_PROVIDER_OPEN_WEATHER -> getString(R.string.provider_open_weather)
|
||||
else -> getString(R.string.provider_google_awareness)
|
||||
}
|
||||
action_change_provider.setOnClickListener {
|
||||
SP.edit()
|
||||
.putInt(Constants.PREF_WEATHER_PROVIDER, when (currentProvider) {
|
||||
Constants.WEATHER_PROVIDER_GOOGLE_AWARENESS -> Constants.WEATHER_PROVIDER_OPEN_WEATHER
|
||||
else -> Constants.WEATHER_PROVIDER_GOOGLE_AWARENESS
|
||||
}).commit()
|
||||
updateUI()
|
||||
}
|
||||
|
||||
Util.collapse(button_container)
|
||||
api_key.setText(SP.getString(Constants.PREF_WEATHER_PROVIDER_API_KEY, ""))
|
||||
}
|
||||
|
||||
override fun onBackPressed() {
|
||||
val SP = PreferenceManager.getDefaultSharedPreferences(this)
|
||||
if (api_key.text.toString().equals("") || !api_key.text.toString().equals(SP.getString(Constants.PREF_WEATHER_PROVIDER_API_KEY, ""))) {
|
||||
if (!SP.getInt(Constants.PREF_WEATHER_PROVIDER, Constants.WEATHER_PROVIDER_GOOGLE_AWARENESS).equals(Constants.WEATHER_PROVIDER_GOOGLE_AWARENESS) && (api_key.text.toString().equals("") || !api_key.text.toString().equals(SP.getString(Constants.PREF_WEATHER_PROVIDER_API_KEY, "")))) {
|
||||
AlertDialog.Builder(this)
|
||||
.setMessage(getString(R.string.error_weather_api_key))
|
||||
.setNegativeButton(android.R.string.cancel, null)
|
||||
|
@ -34,7 +34,10 @@ import android.graphics.BitmapFactory
|
||||
import android.graphics.drawable.BitmapDrawable
|
||||
import android.support.v4.content.ContextCompat.startActivity
|
||||
import android.provider.CalendarContract.Events
|
||||
import android.support.v4.content.ContextCompat
|
||||
import android.util.TypedValue
|
||||
import kotlinx.android.synthetic.main.the_widget.*
|
||||
import kotlinx.android.synthetic.main.the_widget.view.*
|
||||
|
||||
|
||||
/**
|
||||
@ -64,8 +67,13 @@ class TheWidget : AppWidgetProvider() {
|
||||
internal fun updateAppWidget(context: Context, appWidgetManager: AppWidgetManager,
|
||||
appWidgetId: Int) {
|
||||
|
||||
var views = RemoteViews(context.packageName, R.layout.the_widget)
|
||||
|
||||
val views = RemoteViews(context.packageName, R.layout.the_widget_sans)
|
||||
var v = View.inflate(context, R.layout.the_widget, null)
|
||||
v = updateCalendarViewByLayout(context, v)
|
||||
v = updateLocationViewByLayout(context, v)
|
||||
v = updateClockViewByLayout(context, v)
|
||||
views.setImageViewBitmap(R.id.bitmap_container, Util.getBitmapFromView(v))
|
||||
/*
|
||||
views = updateCalendarView(context, views, appWidgetId)
|
||||
|
||||
views = updateLocationView(context, views, appWidgetId)
|
||||
@ -88,7 +96,7 @@ class TheWidget : AppWidgetProvider() {
|
||||
views.setTextViewTextSize(R.id.next_event_date, TypedValue.COMPLEX_UNIT_SP, SP.getFloat(Constants.PREF_TEXT_SECOND_SIZE, 16f))
|
||||
views.setTextViewTextSize(R.id.divider2, TypedValue.COMPLEX_UNIT_SP, SP.getFloat(Constants.PREF_TEXT_SECOND_SIZE, 16f))
|
||||
views.setTextViewTextSize(R.id.calendar_temp, TypedValue.COMPLEX_UNIT_SP, SP.getFloat(Constants.PREF_TEXT_SECOND_SIZE, 16f))
|
||||
|
||||
*/
|
||||
appWidgetManager.updateAppWidget(appWidgetId, views)
|
||||
}
|
||||
|
||||
@ -207,6 +215,150 @@ class TheWidget : AppWidgetProvider() {
|
||||
}
|
||||
return views
|
||||
}
|
||||
|
||||
fun updateClockView(context: Context, views: RemoteViews, widgetID: Int) {
|
||||
val SP = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
if (!SP.getBoolean(Constants.PREF_SHOW_CLOCK, false)) {
|
||||
views.setViewVisibility(R.id.time, View.GONE)
|
||||
} else {
|
||||
views.setViewVisibility(R.id.time, View.VISIBLE)
|
||||
}
|
||||
val now = Calendar.getInstance()
|
||||
views.setTextViewText(R.id.time, if (SP.getString(Constants.PREF_HOUR_FORMAT, "12").equals("12")) Constants.badHourFormat.format(now.timeInMillis) else Constants.goodHourFormat.format(now.timeInMillis))
|
||||
}
|
||||
|
||||
fun updateCalendarViewByLayout(context: Context, v: View): View {
|
||||
val SP = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
val now = Calendar.getInstance()
|
||||
val calendarLayout = SP.getBoolean(Constants.PREF_SHOW_EVENTS, true) && Util.checkGrantedPermission(context, Manifest.permission.READ_CALENDAR)
|
||||
|
||||
v.empty_layout.visibility = View.VISIBLE
|
||||
v.calendar_layout.visibility = View.GONE
|
||||
var dateStringValue: String = Util.getCapWordString(Constants.engDateFormat.format(now.time))
|
||||
if (SP.getBoolean(Constants.PREF_ITA_FORMAT_DATE, false)) {
|
||||
dateStringValue = Util.getCapWordString(Constants.itDateFormat.format(now.time))
|
||||
}
|
||||
v.empty_date.text = dateStringValue
|
||||
//empty_date.setImageBitmap(Util.buildUpdate(this, String.format("%s%s", Constants.dateFormat.format(now.time)[0].toUpperCase(), Constants.dateFormat.format(now.time).substring(1)), "fonts/product_sans_regular.ttf"))
|
||||
|
||||
if (calendarLayout) {
|
||||
val e = CalendarUtil.getNextEvent(context)
|
||||
|
||||
if (e.id != 0) {
|
||||
v.next_event.text = e.title
|
||||
v.next_event_difference_time.text = Util.getDifferenceText(context, now.timeInMillis, e.startDate)
|
||||
|
||||
if (!e.address.equals("") && SP.getBoolean(Constants.PREF_SHOW_EVENT_LOCATION, false)) {
|
||||
v.second_row_icon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_action_location))
|
||||
v.next_event_date.text = e.address
|
||||
} else {
|
||||
v.second_row_icon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_action_calendar))
|
||||
if (!e.allDay) {
|
||||
val startHour: String = if (SP.getString(Constants.PREF_HOUR_FORMAT, "12").equals("12")) Constants.badHourFormat.format(e.startDate) else Constants.goodHourFormat.format(e.startDate)
|
||||
val endHour: String = if (SP.getString(Constants.PREF_HOUR_FORMAT, "12").equals("12")) Constants.badHourFormat.format(e.endDate) else Constants.goodHourFormat.format(e.endDate)
|
||||
var dayDiff = TimeUnit.MILLISECONDS.toDays(e.endDate - e.startDate)
|
||||
|
||||
val startCal = Calendar.getInstance()
|
||||
startCal.timeInMillis = e.startDate
|
||||
|
||||
val endCal = Calendar.getInstance()
|
||||
endCal.timeInMillis = e.endDate
|
||||
|
||||
if (startCal.get(Calendar.HOUR_OF_DAY) > endCal.get(Calendar.HOUR_OF_DAY)) {
|
||||
dayDiff++
|
||||
} else if (startCal.get(Calendar.HOUR_OF_DAY) == endCal.get(Calendar.HOUR_OF_DAY) && startCal.get(Calendar.MINUTE) >= endCal.get(Calendar.MINUTE)) {
|
||||
dayDiff++
|
||||
}
|
||||
var multipleDay: String = ""
|
||||
if (dayDiff > 0) {
|
||||
multipleDay = String.format(" (+%s%s)", dayDiff, context.getString(R.string.day_char))
|
||||
}
|
||||
v.next_event_date.text = String.format("%s - %s%s", startHour, endHour, multipleDay)
|
||||
} else {
|
||||
v.next_event_date.text = dateStringValue
|
||||
}
|
||||
}
|
||||
|
||||
v.empty_layout.visibility = View.GONE
|
||||
v.calendar_layout.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
v.empty_date.setTextColor(Util.getFontColor(SP))
|
||||
v.divider1.setTextColor(Util.getFontColor(SP))
|
||||
v.temp.setTextColor(Util.getFontColor(SP))
|
||||
v.next_event.setTextColor(Util.getFontColor(SP))
|
||||
v.next_event_difference_time.setTextColor(Util.getFontColor(SP))
|
||||
v.next_event_date.setTextColor(Util.getFontColor(SP))
|
||||
v.divider2.setTextColor(Util.getFontColor(SP))
|
||||
v.calendar_temp.setTextColor(Util.getFontColor(SP))
|
||||
v.second_row_icon.setColorFilter(Util.getFontColor(SP))
|
||||
|
||||
|
||||
v.empty_date.setTextSize(TypedValue.COMPLEX_UNIT_SP, SP.getFloat(Constants.PREF_TEXT_MAIN_SIZE, 24f))
|
||||
v.divider1.setTextSize(TypedValue.COMPLEX_UNIT_SP, SP.getFloat(Constants.PREF_TEXT_SECOND_SIZE, 16f))
|
||||
v.temp.setTextSize(TypedValue.COMPLEX_UNIT_SP, SP.getFloat(Constants.PREF_TEXT_MAIN_SIZE, 24f))
|
||||
v.next_event.setTextSize(TypedValue.COMPLEX_UNIT_SP, SP.getFloat(Constants.PREF_TEXT_MAIN_SIZE, 24f))
|
||||
v.next_event_difference_time.setTextSize(TypedValue.COMPLEX_UNIT_SP, SP.getFloat(Constants.PREF_TEXT_MAIN_SIZE, 24f))
|
||||
v.next_event_date.setTextSize(TypedValue.COMPLEX_UNIT_SP, SP.getFloat(Constants.PREF_TEXT_SECOND_SIZE, 16f))
|
||||
v.divider2.setTextSize(TypedValue.COMPLEX_UNIT_SP, SP.getFloat(Constants.PREF_TEXT_SECOND_SIZE, 16f))
|
||||
v.calendar_temp.setTextSize(TypedValue.COMPLEX_UNIT_SP, SP.getFloat(Constants.PREF_TEXT_SECOND_SIZE, 16f))
|
||||
|
||||
|
||||
val product_sans: Typeface = Typeface.createFromAsset(context.assets, "fonts/product_sans_regular.ttf")
|
||||
v.empty_date.typeface = product_sans
|
||||
v.divider1.typeface = product_sans
|
||||
v.temp.typeface = product_sans
|
||||
v.next_event.typeface = product_sans
|
||||
v.next_event_difference_time.typeface = product_sans
|
||||
v.next_event_date.typeface = product_sans
|
||||
v.divider2.typeface = product_sans
|
||||
v.calendar_temp.typeface = product_sans
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
fun updateLocationViewByLayout(context: Context, v: View): View {
|
||||
val SP = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
val locationLayout = SP.getBoolean(Constants.PREF_SHOW_WEATHER, true)
|
||||
|
||||
if (locationLayout && SP.contains(Constants.PREF_WEATHER_TEMP) && SP.contains(Constants.PREF_WEATHER_ICON)) {
|
||||
v.weather.visibility = View.VISIBLE
|
||||
v.calendar_weather.visibility = View.VISIBLE
|
||||
val currentTemp = String.format(Locale.getDefault(), "%.0f °%s", SP.getFloat(Constants.PREF_WEATHER_TEMP, 0f), SP.getString(Constants.PREF_WEATHER_REAL_TEMP_UNIT, "F"))
|
||||
|
||||
|
||||
v.weather_icon.visibility = View.VISIBLE
|
||||
v.empty_weather_icon.visibility = View.VISIBLE
|
||||
val icon: String = SP.getString(Constants.PREF_WEATHER_ICON, "")
|
||||
if (icon.equals("")) {
|
||||
v.weather_icon.visibility = View.GONE
|
||||
v.empty_weather_icon.visibility = View.GONE
|
||||
} else {
|
||||
v.weather_icon.setImageResource(WeatherUtil.getWeatherIconResource(icon))
|
||||
v.empty_weather_icon.setImageResource(WeatherUtil.getWeatherIconResource(icon))
|
||||
}
|
||||
|
||||
v.temp.text = currentTemp
|
||||
v.calendar_temp.text = currentTemp
|
||||
} else {
|
||||
v.weather.visibility = View.GONE
|
||||
v.calendar_weather.visibility = View.GONE
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
||||
fun updateClockViewByLayout(context: Context, v: View): View {
|
||||
val SP = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
if (!SP.getBoolean(Constants.PREF_SHOW_CLOCK, false)) {
|
||||
v.time.visibility = View.GONE
|
||||
} else {
|
||||
v.time.visibility = View.VISIBLE
|
||||
}
|
||||
val now = Calendar.getInstance()
|
||||
v.time.text = if (SP.getString(Constants.PREF_HOUR_FORMAT, "12").equals("12")) Constants.badHourFormat.format(now.timeInMillis) else Constants.goodHourFormat.format(now.timeInMillis)
|
||||
return v
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,7 @@ import android.view.View
|
||||
import android.view.animation.Animation
|
||||
import android.view.animation.Transformation
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.RemoteViews
|
||||
import android.widget.Toast
|
||||
import com.tommasoberlose.anotherwidget.`object`.Constants
|
||||
import com.tommasoberlose.anotherwidget.`object`.Event
|
||||
@ -160,6 +161,21 @@ object Util {
|
||||
return myBitmap;
|
||||
}
|
||||
|
||||
fun getBitmapFromView(view: View): Bitmap {
|
||||
//Define a bitmap with the same size as the view
|
||||
val measuredWidth = View.MeasureSpec.makeMeasureSpec(view.width, View.MeasureSpec.UNSPECIFIED)
|
||||
val measuredHeight = View.MeasureSpec.makeMeasureSpec(view.height, View.MeasureSpec.UNSPECIFIED)
|
||||
view.measure(measuredWidth, measuredHeight)
|
||||
view.layout(0,0, measuredWidth, measuredHeight)
|
||||
val returnedBitmap = Bitmap.createBitmap(view.measuredWidth, view.measuredHeight, Bitmap.Config.ARGB_8888)
|
||||
//Bind a canvas to it
|
||||
val canvas = Canvas(returnedBitmap)
|
||||
// draw the view on the canvas
|
||||
view.draw(canvas)
|
||||
//return the bitmap
|
||||
return returnedBitmap
|
||||
}
|
||||
|
||||
fun convertDpToPixel(dp: Float, context: Context): Float {
|
||||
val resources: Resources = context.resources
|
||||
val metrics: DisplayMetrics = resources.displayMetrics
|
||||
|
@ -37,7 +37,7 @@
|
||||
</LinearLayout>
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="128dp"
|
||||
android:layout_height="200dp"
|
||||
android:id="@+id/widget">
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
@ -47,7 +47,13 @@
|
||||
<include
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone"
|
||||
layout="@layout/the_widget"/>
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:id="@+id/widget_bitmap"/>
|
||||
</RelativeLayout>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
@ -88,38 +94,17 @@
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:id="@+id/action_font_color"
|
||||
android:orientation="horizontal">
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="2"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Settings.Title"
|
||||
android:text="@string/settings_font_color_title"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/font_color_label"
|
||||
style="@style/AnotherWidget.Settings.Subtitle"/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:padding="3dp"
|
||||
android:orientation="horizontal"
|
||||
android:background="@drawable/circle_background">
|
||||
<android.support.v7.widget.CardView
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
app:cardCornerRadius="9dp"
|
||||
app:cardElevation="0dp"
|
||||
android:id="@+id/text_color_icon"
|
||||
android:orientation="horizontal"
|
||||
android:background="@android:color/white"/>
|
||||
</LinearLayout>
|
||||
style="@style/AnotherWidget.Settings.Title"
|
||||
android:text="@string/settings_font_color_title"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/font_color_label"
|
||||
style="@style/AnotherWidget.Settings.Subtitle"/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@ -169,6 +154,81 @@
|
||||
android:id="@+id/second_text_size_label"
|
||||
style="@style/AnotherWidget.Settings.Subtitle"/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:background="@color/black_10"
|
||||
android:alpha="0.5"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/settings_clock_title"
|
||||
style="@style/AnotherWidget.Settings.Header"/>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:paddingLeft="32dp"
|
||||
android:paddingRight="32dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:id="@+id/action_show_clock"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Settings.Title"
|
||||
android:text="@string/title_show_clock"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/show_clock_label"
|
||||
android:text="@string/description_show_clock"
|
||||
style="@style/AnotherWidget.Settings.Subtitle"/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/clock_settings"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:paddingLeft="32dp"
|
||||
android:paddingRight="32dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:id="@+id/action_clock_app"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Settings.Title"
|
||||
android:text="@string/settings_clock_app_title"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/clock_app_label"
|
||||
style="@style/AnotherWidget.Settings.Subtitle"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:background="@color/black_10"
|
||||
android:alpha="0.5"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@ -442,30 +502,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/weather_settings"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:paddingLeft="32dp"
|
||||
android:paddingRight="32dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:id="@+id/action_custom_location"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Settings.Title"
|
||||
android:text="@string/settings_custom_location_title"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/label_custom_location"
|
||||
style="@style/AnotherWidget.Settings.Subtitle"/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@ -502,6 +538,30 @@
|
||||
android:visibility="gone"
|
||||
android:src="@drawable/ic_action_alert"/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:paddingLeft="32dp"
|
||||
android:paddingRight="32dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:id="@+id/action_custom_location"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Settings.Title"
|
||||
android:text="@string/settings_custom_location_title"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/label_custom_location"
|
||||
style="@style/AnotherWidget.Settings.Subtitle"/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -46,6 +46,32 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?android:attr/actionBarSize"
|
||||
android:orientation="vertical"
|
||||
android:descendantFocusability="beforeDescendants"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:id="@+id/action_change_provider"
|
||||
android:background="@android:color/white"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:gravity="center_vertical">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Settings.Title"
|
||||
android:text="@string/settings_weather_provider_api_key_title"
|
||||
android:textColor="@android:color/black"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/label_weather_provider"
|
||||
style="@style/AnotherWidget.Settings.Subtitle"
|
||||
android:textColor="@android:color/black"/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?android:attr/actionBarSize"
|
||||
|
@ -3,11 +3,26 @@
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/main_layout">
|
||||
<TextView
|
||||
android:id="@+id/time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="20:16"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:gravity="center"
|
||||
android:lineSpacingMultiplier="1"
|
||||
android:lineSpacingExtra="0dp"
|
||||
android:includeFontPadding="false"
|
||||
android:padding="0dp"
|
||||
android:visibility="gone"
|
||||
style="@style/AnotherWidget.Title"
|
||||
android:textSize="90sp"/>
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:gravity="center"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_below="@+id/time"
|
||||
android:orientation="horizontal"
|
||||
android:id="@+id/empty_layout">
|
||||
<TextView
|
||||
@ -46,7 +61,6 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Date.Big"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"
|
||||
android:id="@+id/temp"/>
|
||||
</LinearLayout>
|
||||
@ -55,9 +69,10 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_below="@+id/time"
|
||||
android:id="@+id/calendar_layout"
|
||||
android:gravity="center">
|
||||
<LinearLayout
|
||||
@ -95,7 +110,6 @@
|
||||
<ImageView
|
||||
android:layout_width="14dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginTop="1dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:id="@+id/second_row_icon"
|
||||
|
11
app/src/main/res/layout/the_widget_sans.xml
Normal file
11
app/src/main/res/layout/the_widget_sans.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/main_layout">
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:id="@+id/bitmap_container"/>
|
||||
</RelativeLayout>
|
@ -104,4 +104,10 @@
|
||||
<string name="settings_font_color_title">Colore Testo</string>
|
||||
<string name="title_main_text_size">Dimensione Testo Prima Riga</string>
|
||||
<string name="title_second_text_size">Dimensione Testo Seconda Riga</string>
|
||||
<string name="settings_clock_title">Impostazioni Orologio</string>
|
||||
<string name="settings_clock_app_title">L\'orologio apre</string>
|
||||
<string name="title_show_clock">Mostra Orologio</string>
|
||||
<string name="description_show_clock">Mostra l\'ora sopra eventi e meteo</string>
|
||||
<string name="show_clock_visible">Orologio visibile</string>
|
||||
<string name="show_clock_not_visible">Orologio non visibile</string>
|
||||
</resources>
|
@ -52,8 +52,8 @@
|
||||
<string name="action_refresh_widget">Refresh Widget</string>
|
||||
<string name="show_events_visible">Events are Visible</string>
|
||||
<string name="show_events_not_visible">Events are not Visible</string>
|
||||
<string name="show_weather_visible">Weather Info are Visible</string>
|
||||
<string name="show_weather_not_visible">Weather Info are not Visible</string>
|
||||
<string name="show_weather_visible">Weather Info is Visible</string>
|
||||
<string name="show_weather_not_visible">Weather Info is not Visible</string>
|
||||
<string name="settings_show_until_subtitle_0">3 Hours later</string>
|
||||
<string name="settings_show_until_subtitle_1">6 Hours later</string>
|
||||
<string name="settings_show_until_subtitle_2">12 Hours later</string>
|
||||
@ -106,4 +106,12 @@
|
||||
<string name="settings_font_color_title">Text Color</string>
|
||||
<string name="title_main_text_size">First Row Text Size</string>
|
||||
<string name="title_second_text_size">Second Row Text Size</string>
|
||||
<string name="provider_open_weather" translatable="false">OpenWeather</string>
|
||||
<string name="provider_google_awareness" translatable="false">Google Awareness</string>
|
||||
<string name="settings_clock_title">Clock Settings</string>
|
||||
<string name="settings_clock_app_title">Tap on clock opens</string>
|
||||
<string name="title_show_clock">Show Clock</string>
|
||||
<string name="description_show_clock">View the time over events and weather</string>
|
||||
<string name="show_clock_visible">Clock is visible</string>
|
||||
<string name="show_clock_not_visible">Clock is not visible</string>
|
||||
</resources>
|
||||
|
Loading…
x
Reference in New Issue
Block a user