From 7f371a95320a1d8aae29f8ca15f7fd972367b60e Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Mon, 22 Apr 2019 03:21:30 -0400 Subject: Update parsers and add widget items --- .../main/res/layout/widget_notification_item.xml | 53 ++++++++++++++++++++++ app/src/main/res/layout/widget_notifications.xml | 22 +++++++++ app/src/main/res/values/dimens.xml | 2 + app/src/main/res/xml/notification_widget_info.xml | 4 ++ 4 files changed, 81 insertions(+) create mode 100644 app/src/main/res/layout/widget_notification_item.xml create mode 100644 app/src/main/res/layout/widget_notifications.xml create mode 100644 app/src/main/res/xml/notification_widget_info.xml (limited to 'app/src/main/res') diff --git a/app/src/main/res/layout/widget_notification_item.xml b/app/src/main/res/layout/widget_notification_item.xml new file mode 100644 index 00000000..d02e2611 --- /dev/null +++ b/app/src/main/res/layout/widget_notification_item.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/widget_notifications.xml b/app/src/main/res/layout/widget_notifications.xml new file mode 100644 index 00000000..fd68e20a --- /dev/null +++ b/app/src/main/res/layout/widget_notifications.xml @@ -0,0 +1,22 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 713bd1b4..53dad5ef 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -9,4 +9,6 @@ 50dp 64dp 20dp + + 18dp diff --git a/app/src/main/res/xml/notification_widget_info.xml b/app/src/main/res/xml/notification_widget_info.xml new file mode 100644 index 00000000..3cb97ed7 --- /dev/null +++ b/app/src/main/res/xml/notification_widget_info.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file -- cgit v1.2.3 From ba0b4e70d93f91497a7bc157fe7f3838942dfb15 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Mon, 22 Apr 2019 04:42:52 -0400 Subject: Fix icon loading --- .../com/pitchedapps/frost/db/NotificationDb.kt | 5 +- .../frost/widgets/NotificationWidget.kt | 60 +++++++++------------- app/src/main/res/drawable/ic_refresh_24dp.xml | 5 ++ app/src/main/res/layout/widget_notifications.xml | 20 +++++--- app/src/main/res/values/dimens.xml | 2 +- app/src/main/res/xml/notification_widget_info.xml | 8 +-- 6 files changed, 54 insertions(+), 46 deletions(-) create mode 100644 app/src/main/res/drawable/ic_refresh_24dp.xml (limited to 'app/src/main/res') diff --git a/app/src/main/kotlin/com/pitchedapps/frost/db/NotificationDb.kt b/app/src/main/kotlin/com/pitchedapps/frost/db/NotificationDb.kt index 532bb435..d4b51c1e 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/db/NotificationDb.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/db/NotificationDb.kt @@ -137,8 +137,11 @@ interface NotificationDao { suspend fun NotificationDao.deleteAll() = dao { _deleteAll() } -suspend fun NotificationDao.selectNotifications(userId: Long, type: String): List = dao { +fun NotificationDao.selectNotificationsSync(userId: Long, type: String): List = _selectNotifications(userId, type).map { it.toNotifContent() } + +suspend fun NotificationDao.selectNotifications(userId: Long, type: String): List = dao { + selectNotificationsSync(userId, type) } /** diff --git a/app/src/main/kotlin/com/pitchedapps/frost/widgets/NotificationWidget.kt b/app/src/main/kotlin/com/pitchedapps/frost/widgets/NotificationWidget.kt index e7a17c8e..6ba0a3d6 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/widgets/NotificationWidget.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/widgets/NotificationWidget.kt @@ -22,37 +22,34 @@ import android.content.Context import android.content.Intent import android.widget.RemoteViews import android.widget.RemoteViewsService -import androidx.annotation.ColorRes -import ca.allanwang.kau.utils.ContextHelper +import androidx.annotation.ColorInt +import ca.allanwang.kau.utils.dimenPixelSize import ca.allanwang.kau.utils.withAlpha -import com.bumptech.glide.request.target.AppWidgetTarget import com.pitchedapps.frost.R import com.pitchedapps.frost.db.NotificationDao -import com.pitchedapps.frost.db.selectNotifications +import com.pitchedapps.frost.db.selectNotificationsSync import com.pitchedapps.frost.glide.FrostGlide import com.pitchedapps.frost.glide.GlideApp import com.pitchedapps.frost.services.NOTIF_CHANNEL_GENERAL import com.pitchedapps.frost.services.NotificationContent +import com.pitchedapps.frost.utils.L import com.pitchedapps.frost.utils.Prefs import com.pitchedapps.frost.widgets.NotificationWidget.Companion.NOTIF_WIDGET_IDS import com.pitchedapps.frost.widgets.NotificationWidget.Companion.NOTIF_WIDGET_TYPE -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Job -import kotlinx.coroutines.SupervisorJob -import kotlinx.coroutines.runBlocking import org.koin.standalone.KoinComponent import org.koin.standalone.inject -import kotlin.coroutines.CoroutineContext class NotificationWidget : AppWidgetProvider() { override fun onUpdate(context: Context, appWidgetManager: AppWidgetManager, appWidgetIds: IntArray) { super.onUpdate(context, appWidgetManager, appWidgetIds) - val views = RemoteViews(context.packageName, com.pitchedapps.frost.R.layout.widget_notifications) val intent = NotificationWidgetService.createIntent(context, NOTIF_CHANNEL_GENERAL, appWidgetIds) for (id in appWidgetIds) { + val views = RemoteViews(context.packageName, R.layout.widget_notifications) + views.setBackgroundColor(R.id.widget_layout_container, Prefs.bgColor) views.setRemoteAdapter(R.id.widget_notification_list, intent) appWidgetManager.updateAppWidget(id, views) } + appWidgetManager.notifyAppWidgetViewDataChanged(appWidgetIds, R.id.widget_notification_list) } companion object { @@ -61,6 +58,10 @@ class NotificationWidget : AppWidgetProvider() { } } +private fun RemoteViews.setBackgroundColor(viewId: Int, @ColorInt color: Int) { + setInt(viewId, "setBackgroundColor", color) +} + class NotificationWidgetService : RemoteViewsService() { override fun onGetViewFactory(intent: Intent): RemoteViewsFactory = NotificationWidgetDataProvider(this, intent) @@ -73,7 +74,7 @@ class NotificationWidgetService : RemoteViewsService() { } class NotificationWidgetDataProvider(val context: Context, val intent: Intent) : RemoteViewsService.RemoteViewsFactory, - CoroutineScope, KoinComponent { + KoinComponent { private val notifDao: NotificationDao by inject() @Volatile @@ -83,25 +84,20 @@ class NotificationWidgetDataProvider(val context: Context, val intent: Intent) : private val widgetIds = intent.getIntArrayExtra(NOTIF_WIDGET_IDS) - private lateinit var job: Job - override val coroutineContext: CoroutineContext - get() = ContextHelper.dispatcher + job + private val avatarSize = context.dimenPixelSize(R.dimen.avatar_image_size) + + private val glide = GlideApp.with(context).asBitmap() - private suspend fun loadNotifications() { - content = notifDao.selectNotifications(Prefs.userId, type) + private fun loadNotifications() { + content = notifDao.selectNotificationsSync(Prefs.userId, type) + L._d { "Updated notif widget with ${content.size} items" } } override fun onCreate() { - job = SupervisorJob() - runBlocking { - loadNotifications() - } } override fun onDataSetChanged() { - runBlocking { - loadNotifications() - } + loadNotifications() } override fun getLoadingView(): RemoteViews? = null @@ -112,29 +108,23 @@ class NotificationWidgetDataProvider(val context: Context, val intent: Intent) : override fun getViewAt(position: Int): RemoteViews { val views = RemoteViews(context.packageName, R.layout.widget_notification_item) - val glide = GlideApp.with(context).asBitmap() val notif = content[position] + L._d { "View $position $notif" } views.setBackgroundColor(R.id.item_frame, Prefs.nativeBgColor(notif.unread)) views.setTextColor(R.id.item_content, Prefs.textColor) views.setTextViewText(R.id.item_content, notif.text) views.setTextColor(R.id.item_date, Prefs.textColor.withAlpha(150)) views.setTextViewText(R.id.item_date, notif.timestamp.toString()) // TODO - glide.load(notif.profileUrl).transform(FrostGlide.circleCrop) - .into(AppWidgetTarget(context, R.id.item_avatar, views)) +// views.setOnClickPendingIntent() + val avatar = glide.load(notif.profileUrl).transform(FrostGlide.circleCrop).submit(avatarSize, avatarSize).get() + views.setImageViewBitmap(R.id.item_avatar, avatar) return views } - private fun RemoteViews.setBackgroundColor(viewId: Int, @ColorRes color: Int) { - setInt(viewId, "setBackgroundColor", color) - } - override fun getCount(): Int = content.size - override fun getViewTypeCount(): Int { - TODO("not implemented") - } + override fun getViewTypeCount(): Int = 1 override fun onDestroy() { - job.cancel() } -} +} \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_refresh_24dp.xml b/app/src/main/res/drawable/ic_refresh_24dp.xml new file mode 100644 index 00000000..cc2d1e04 --- /dev/null +++ b/app/src/main/res/drawable/ic_refresh_24dp.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/layout/widget_notifications.xml b/app/src/main/res/layout/widget_notifications.xml index fd68e20a..098bb9eb 100644 --- a/app/src/main/res/layout/widget_notifications.xml +++ b/app/src/main/res/layout/widget_notifications.xml @@ -1,22 +1,30 @@ - + + + + android:layout_gravity="center_vertical" + android:src="@drawable/ic_refresh_24dp" /> + - + android:layout_height="0dp" + android:layout_weight="1" /> \ No newline at end of file diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 53dad5ef..847e74cb 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -10,5 +10,5 @@ 64dp 20dp - 18dp + 24dp diff --git a/app/src/main/res/xml/notification_widget_info.xml b/app/src/main/res/xml/notification_widget_info.xml index 3cb97ed7..2b8b4fb5 100644 --- a/app/src/main/res/xml/notification_widget_info.xml +++ b/app/src/main/res/xml/notification_widget_info.xml @@ -1,4 +1,6 @@ - - - \ No newline at end of file + -- cgit v1.2.3 From 7e227078373adf0ef8c243b7e1e05804524cd3ea Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Wed, 24 Apr 2019 19:12:25 -0700 Subject: Add click events to notifications --- .../com/pitchedapps/frost/db/NotificationDbTest.kt | 3 +- .../frost/services/FrostNotifications.kt | 36 +++++++--- .../com/pitchedapps/frost/utils/TimeUtils.kt | 2 + .../kotlin/com/pitchedapps/frost/utils/Utils.kt | 2 +- .../frost/widgets/NotificationWidget.kt | 81 +++++++++++++++++++--- .../main/res/layout/widget_notification_item.xml | 15 ++-- app/src/main/res/layout/widget_notifications.xml | 9 +-- app/src/main/res/values/strings.xml | 10 +++ 8 files changed, 122 insertions(+), 36 deletions(-) create mode 100644 app/src/main/kotlin/com/pitchedapps/frost/utils/TimeUtils.kt (limited to 'app/src/main/res') diff --git a/app/src/androidTest/kotlin/com/pitchedapps/frost/db/NotificationDbTest.kt b/app/src/androidTest/kotlin/com/pitchedapps/frost/db/NotificationDbTest.kt index 9167c7bf..45a09cbe 100644 --- a/app/src/androidTest/kotlin/com/pitchedapps/frost/db/NotificationDbTest.kt +++ b/app/src/androidTest/kotlin/com/pitchedapps/frost/db/NotificationDbTest.kt @@ -38,7 +38,8 @@ class NotificationDbTest : BaseDbTest() { title = null, text = "", timestamp = time, - profileUrl = null + profileUrl = null, + unread = true ) @Test diff --git a/app/src/main/kotlin/com/pitchedapps/frost/services/FrostNotifications.kt b/app/src/main/kotlin/com/pitchedapps/frost/services/FrostNotifications.kt index 68ed859c..1c37bc29 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/services/FrostNotifications.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/services/FrostNotifications.kt @@ -61,7 +61,7 @@ private val _40_DP = 40.dpToPx * Enum to handle notification creations */ enum class NotificationType( - private val channelId: String, + val channelId: String, private val overlayContext: OverlayContext, private val fbItem: FbItem, private val parser: FrostParser, @@ -95,8 +95,8 @@ enum class NotificationType( */ internal open fun bindRequest(content: NotificationContent, cookie: String): (BaseBundle.() -> Unit)? = null - private fun bindRequest(intent: Intent, content: NotificationContent, cookie: String?) { - cookie ?: return + private fun bindRequest(intent: Intent, content: NotificationContent) { + val cookie = content.data.cookie ?: return val binder = bindRequest(content, cookie) ?: return val bundle = Bundle() bundle.binder() @@ -187,18 +187,34 @@ enum class NotificationType( createNotification(context, content).notify(context) } + /** + * Attach content related data to an intent + */ + fun putContentExtra(intent: Intent, content: NotificationContent): Intent { + // We will show the notification page for dependent urls. We can trigger a click next time + intent.data = Uri.parse(if (content.href.isIndependent) content.href else FbItem.NOTIFICATIONS.url) + bindRequest(intent, content) + return intent + } + + /** + * Create a generic content for the provided type and user id. + * No content related data is added + */ + fun createCommonIntent(context: Context, userId: Long): Intent { + val intent = Intent(context, FrostWebActivity::class.java) + intent.putExtra(ARG_USER_ID, userId) + overlayContext.put(intent) + return intent + } + /** * Create and submit a new notification with the given [content] */ private fun createNotification(context: Context, content: NotificationContent): FrostNotification = with(content) { - val intent = Intent(context, FrostWebActivity::class.java) - // TODO temp fix; we will show notification page for dependent urls. We can trigger a click next time - intent.data = Uri.parse(if (href.isIndependent) href else FbItem.NOTIFICATIONS.url) - intent.putExtra(ARG_USER_ID, data.id) - overlayContext.put(intent) - bindRequest(intent, content, data.cookie) - + val intent = createCommonIntent(context, content.data.id) + putContentExtra(intent, content) val group = "${groupPrefix}_${data.id}" val pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT) val notifBuilder = context.frostNotification(channelId) diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/TimeUtils.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/TimeUtils.kt new file mode 100644 index 00000000..1ca6333b --- /dev/null +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/TimeUtils.kt @@ -0,0 +1,2 @@ +package com.pitchedapps.frost.utils + diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt index 711d7e18..76ffd8cd 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt @@ -186,7 +186,7 @@ fun MaterialDialog.Builder.theme(): MaterialDialog.Builder { } fun Activity.setFrostTheme(forceTransparent: Boolean = false) { - val isTransparent = (Color.alpha(Prefs.bgColor) != 255) || forceTransparent + val isTransparent = (Color.alpha(Prefs.bgColor) != 255) || (Color.alpha(Prefs.headerColor) != 255) || forceTransparent if (Prefs.bgColor.isColorDark) setTheme(if (isTransparent) R.style.FrostTheme_Transparent else R.style.FrostTheme) else diff --git a/app/src/main/kotlin/com/pitchedapps/frost/widgets/NotificationWidget.kt b/app/src/main/kotlin/com/pitchedapps/frost/widgets/NotificationWidget.kt index 4ddd7225..ae45fa7b 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/widgets/NotificationWidget.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/widgets/NotificationWidget.kt @@ -16,35 +16,69 @@ */ package com.pitchedapps.frost.widgets +import android.app.PendingIntent import android.appwidget.AppWidgetManager import android.appwidget.AppWidgetProvider import android.content.Context import android.content.Intent +import android.graphics.Bitmap +import android.graphics.BitmapFactory +import android.graphics.Canvas +import android.graphics.Paint +import android.graphics.PorterDuff +import android.graphics.PorterDuffColorFilter +import android.graphics.drawable.Icon +import android.os.Build import android.widget.RemoteViews import android.widget.RemoteViewsService import androidx.annotation.ColorInt +import androidx.annotation.DrawableRes +import androidx.annotation.IdRes import ca.allanwang.kau.utils.dimenPixelSize +import ca.allanwang.kau.utils.string import ca.allanwang.kau.utils.withAlpha import com.pitchedapps.frost.R +import com.pitchedapps.frost.activities.MainActivity import com.pitchedapps.frost.db.NotificationDao import com.pitchedapps.frost.db.selectNotificationsSync import com.pitchedapps.frost.glide.FrostGlide import com.pitchedapps.frost.glide.GlideApp -import com.pitchedapps.frost.services.NOTIF_CHANNEL_GENERAL import com.pitchedapps.frost.services.NotificationContent +import com.pitchedapps.frost.services.NotificationType import com.pitchedapps.frost.utils.L import com.pitchedapps.frost.utils.Prefs import org.koin.standalone.KoinComponent import org.koin.standalone.inject +import java.text.DateFormat class NotificationWidget : AppWidgetProvider() { override fun onUpdate(context: Context, appWidgetManager: AppWidgetManager, appWidgetIds: IntArray) { super.onUpdate(context, appWidgetManager, appWidgetIds) - val intent = NotificationWidgetService.createIntent(context, NOTIF_CHANNEL_GENERAL) + val type = NotificationType.GENERAL + val userId = Prefs.userId + val intent = NotificationWidgetService.createIntent(context, type, userId) for (id in appWidgetIds) { val views = RemoteViews(context.packageName, R.layout.widget_notifications) - views.setBackgroundColor(R.id.widget_layout_container, Prefs.bgColor) + + views.setBackgroundColor(R.id.widget_layout_toolbar, Prefs.headerColor) + views.setIcon(R.id.img_frost, context, R.drawable.frost_f_24, Prefs.iconColor) + views.setOnClickPendingIntent( + R.id.img_frost, + PendingIntent.getActivity(context, 0, Intent(context, MainActivity::class.java), 0) + ) + + views.setBackgroundColor(R.id.widget_notification_list, Prefs.bgColor) views.setRemoteAdapter(R.id.widget_notification_list, intent) + + val pendingIntentTemplate = PendingIntent.getActivity( + context, + 0, + type.createCommonIntent(context, userId), + PendingIntent.FLAG_UPDATE_CURRENT + ) + + views.setPendingIntentTemplate(R.id.widget_notification_list, pendingIntentTemplate) + appWidgetManager.updateAppWidget(id, views) } appWidgetManager.notifyAppWidgetViewDataChanged(appWidgetIds, R.id.widget_notification_list) @@ -52,18 +86,44 @@ class NotificationWidget : AppWidgetProvider() { } private const val NOTIF_WIDGET_TYPE = "notif_widget_type" +private const val NOTIF_WIDGET_USER_ID = "notif_widget_user_id" +private const val NOTIF_WIDGET_USER_COOKIE = "notif_widget_user_id" -private fun RemoteViews.setBackgroundColor(viewId: Int, @ColorInt color: Int) { +private fun RemoteViews.setBackgroundColor(@IdRes viewId: Int, @ColorInt color: Int) { setInt(viewId, "setBackgroundColor", color) } +/** + * Adds backward compatibility to setting tinted icons + */ +private fun RemoteViews.setIcon(@IdRes viewId: Int, context: Context, @DrawableRes res: Int, @ColorInt color: Int) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + val icon = Icon.createWithResource(context, res).setTint(color).setTintMode(PorterDuff.Mode.SRC_IN) + setImageViewIcon(viewId, icon) + } else { + val bitmap = BitmapFactory.decodeResource(context.resources, res) + if (bitmap != null) { + val paint = Paint() + paint.colorFilter = PorterDuffColorFilter(color, PorterDuff.Mode.SRC_IN) + val result = Bitmap.createBitmap(bitmap.width, bitmap.height, Bitmap.Config.ARGB_8888) + val canvas = Canvas(result) + canvas.drawBitmap(bitmap, 0f, 0f, paint) + setImageViewBitmap(viewId, result) + } else { + // Fallback to just icon + setImageViewResource(viewId, res) + } + } +} + class NotificationWidgetService : RemoteViewsService() { override fun onGetViewFactory(intent: Intent): RemoteViewsFactory = NotificationWidgetDataProvider(this, intent) companion object { - fun createIntent(context: Context, type: String): Intent = + fun createIntent(context: Context, type: NotificationType, userId: Long): Intent = Intent(context, NotificationWidgetService::class.java) - .putExtra(NOTIF_WIDGET_TYPE, type) + .putExtra(NOTIF_WIDGET_TYPE, type.name) + .putExtra(NOTIF_WIDGET_USER_ID, userId) } } @@ -74,14 +134,16 @@ class NotificationWidgetDataProvider(val context: Context, val intent: Intent) : @Volatile private var content: List = emptyList() - private val type = intent.getStringExtra(NOTIF_WIDGET_TYPE) + private val type = NotificationType.valueOf(intent.getStringExtra(NOTIF_WIDGET_TYPE)) + + private val userId = intent.getLongExtra(NOTIF_WIDGET_USER_ID, -1) private val avatarSize = context.dimenPixelSize(R.dimen.avatar_image_size) private val glide = GlideApp.with(context).asBitmap() private fun loadNotifications() { - content = notifDao.selectNotificationsSync(Prefs.userId, type) + content = notifDao.selectNotificationsSync(userId, type.channelId) L._d { "Updated notif widget with ${content.size} items" } } @@ -107,9 +169,10 @@ class NotificationWidgetDataProvider(val context: Context, val intent: Intent) : views.setTextViewText(R.id.item_content, notif.text) views.setTextColor(R.id.item_date, Prefs.textColor.withAlpha(150)) views.setTextViewText(R.id.item_date, notif.timestamp.toString()) // TODO -// views.setOnClickPendingIntent() + val avatar = glide.load(notif.profileUrl).transform(FrostGlide.circleCrop).submit(avatarSize, avatarSize).get() views.setImageViewBitmap(R.id.item_avatar, avatar) + views.setOnClickFillInIntent(R.id.item_frame, type.putContentExtra(Intent(), notif)) return views } diff --git a/app/src/main/res/layout/widget_notification_item.xml b/app/src/main/res/layout/widget_notification_item.xml index d02e2611..f36f2766 100644 --- a/app/src/main/res/layout/widget_notification_item.xml +++ b/app/src/main/res/layout/widget_notification_item.xml @@ -1,22 +1,19 @@ + android:layout_height="@dimen/avatar_image_size" /> + %s at %s + -- cgit v1.2.3 From 27d1b98330c25e8833279ed48a4d9bd7d7566d10 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Wed, 24 Apr 2019 19:38:54 -0700 Subject: Create readable time converter --- .../com/pitchedapps/frost/utils/TimeUtils.kt | 48 ++++++++++++++++++++++ .../frost/widgets/NotificationWidget.kt | 7 ++-- app/src/main/res/values/strings.xml | 4 +- 3 files changed, 54 insertions(+), 5 deletions(-) (limited to 'app/src/main/res') diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/TimeUtils.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/TimeUtils.kt index 1ca6333b..c0feab1e 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/TimeUtils.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/TimeUtils.kt @@ -1,2 +1,50 @@ +/* + * Copyright 2019 Allan Wang + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package com.pitchedapps.frost.utils +import android.content.Context +import ca.allanwang.kau.utils.string +import com.pitchedapps.frost.R +import java.text.DateFormat +import java.text.SimpleDateFormat +import java.util.Calendar +import java.util.Date +import java.util.Locale + +/** + * Converts time in millis to readable date, + * eg Apr 24 at 7:32 PM + * + * With regards to date modifications in calendars, + * it appears to respect calendar rules; + * see https://stackoverflow.com/a/43227817/4407321 + */ +fun Long.toReadableTime(context: Context): String { + val cal = Calendar.getInstance() + cal.timeInMillis = this + val timeFormatter = SimpleDateFormat.getTimeInstance(DateFormat.SHORT) + val time = timeFormatter.format(Date(this)) + val day = when { + cal >= Calendar.getInstance().apply { add(Calendar.DAY_OF_MONTH, -1) } -> context.string(R.string.today) + cal >= Calendar.getInstance().apply { add(Calendar.DAY_OF_MONTH, -2) } -> context.string(R.string.yesterday) + else -> { + val dayFormatter = SimpleDateFormat("MMM dd", Locale.getDefault()) + dayFormatter.format(Date(this)) + } + } + return context.getString(R.string.time_template, day, time) +} diff --git a/app/src/main/kotlin/com/pitchedapps/frost/widgets/NotificationWidget.kt b/app/src/main/kotlin/com/pitchedapps/frost/widgets/NotificationWidget.kt index ae45fa7b..1897b042 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/widgets/NotificationWidget.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/widgets/NotificationWidget.kt @@ -35,7 +35,6 @@ import androidx.annotation.ColorInt import androidx.annotation.DrawableRes import androidx.annotation.IdRes import ca.allanwang.kau.utils.dimenPixelSize -import ca.allanwang.kau.utils.string import ca.allanwang.kau.utils.withAlpha import com.pitchedapps.frost.R import com.pitchedapps.frost.activities.MainActivity @@ -47,9 +46,9 @@ import com.pitchedapps.frost.services.NotificationContent import com.pitchedapps.frost.services.NotificationType import com.pitchedapps.frost.utils.L import com.pitchedapps.frost.utils.Prefs +import com.pitchedapps.frost.utils.toReadableTime import org.koin.standalone.KoinComponent import org.koin.standalone.inject -import java.text.DateFormat class NotificationWidget : AppWidgetProvider() { override fun onUpdate(context: Context, appWidgetManager: AppWidgetManager, appWidgetIds: IntArray) { @@ -168,7 +167,7 @@ class NotificationWidgetDataProvider(val context: Context, val intent: Intent) : views.setTextColor(R.id.item_content, Prefs.textColor) views.setTextViewText(R.id.item_content, notif.text) views.setTextColor(R.id.item_date, Prefs.textColor.withAlpha(150)) - views.setTextViewText(R.id.item_date, notif.timestamp.toString()) // TODO + views.setTextViewText(R.id.item_date, notif.timestamp.toReadableTime(context)) val avatar = glide.load(notif.profileUrl).transform(FrostGlide.circleCrop).submit(avatarSize, avatarSize).get() views.setImageViewBitmap(R.id.item_avatar, avatar) @@ -182,4 +181,4 @@ class NotificationWidgetDataProvider(val context: Context, val intent: Intent) : override fun onDestroy() { } -} \ 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 2b6a2ba6..0c2e625c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -69,7 +69,9 @@ For instance: Today at 1:23 PM Mar 13 at 9:00 AM + + The first element is the day, and the second element is the time --> - %s at %s + %1s at %2s -- cgit v1.2.3 From e627bc4f1fbf50216f74c53c6a4812beb6d2d055 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Wed, 24 Apr 2019 23:54:27 -0700 Subject: Remove unnecessary components --- .../frost/widgets/NotificationWidget.kt | 4 -- app/src/main/res/drawable/ic_refresh_24dp.xml | 5 --- .../res/drawable/notification_widget_preview.xml | 49 ++++++++++++++++++++++ app/src/main/res/xml/notification_widget_info.xml | 10 +++-- 4 files changed, 56 insertions(+), 12 deletions(-) delete mode 100644 app/src/main/res/drawable/ic_refresh_24dp.xml create mode 100644 app/src/main/res/drawable/notification_widget_preview.xml (limited to 'app/src/main/res') diff --git a/app/src/main/kotlin/com/pitchedapps/frost/widgets/NotificationWidget.kt b/app/src/main/kotlin/com/pitchedapps/frost/widgets/NotificationWidget.kt index 57cc4fe1..594da00a 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/widgets/NotificationWidget.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/widgets/NotificationWidget.kt @@ -45,7 +45,6 @@ import com.pitchedapps.frost.glide.FrostGlide import com.pitchedapps.frost.glide.GlideApp import com.pitchedapps.frost.services.NotificationContent import com.pitchedapps.frost.services.NotificationType -import com.pitchedapps.frost.utils.L import com.pitchedapps.frost.utils.Prefs import com.pitchedapps.frost.utils.toReadableTime import org.koin.standalone.KoinComponent @@ -100,7 +99,6 @@ class NotificationWidget : AppWidgetProvider() { private const val NOTIF_WIDGET_TYPE = "notif_widget_type" private const val NOTIF_WIDGET_USER_ID = "notif_widget_user_id" -private const val NOTIF_WIDGET_USER_COOKIE = "notif_widget_user_id" private fun RemoteViews.setBackgroundColor(@IdRes viewId: Int, @ColorInt color: Int) { setInt(viewId, "setBackgroundColor", color) @@ -157,7 +155,6 @@ class NotificationWidgetDataProvider(val context: Context, val intent: Intent) : private fun loadNotifications() { content = notifDao.selectNotificationsSync(userId, type.channelId) - L._d { "Updated notif widget with ${content.size} items" } } override fun onCreate() { @@ -176,7 +173,6 @@ class NotificationWidgetDataProvider(val context: Context, val intent: Intent) : override fun getViewAt(position: Int): RemoteViews { val views = RemoteViews(context.packageName, R.layout.widget_notification_item) val notif = content[position] - L._d { "View $position $notif" } views.setBackgroundColor(R.id.item_frame, Prefs.nativeBgColor(notif.unread)) views.setTextColor(R.id.item_content, Prefs.textColor) views.setTextViewText(R.id.item_content, notif.text) diff --git a/app/src/main/res/drawable/ic_refresh_24dp.xml b/app/src/main/res/drawable/ic_refresh_24dp.xml deleted file mode 100644 index cc2d1e04..00000000 --- a/app/src/main/res/drawable/ic_refresh_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/notification_widget_preview.xml b/app/src/main/res/drawable/notification_widget_preview.xml new file mode 100644 index 00000000..a4ead7d0 --- /dev/null +++ b/app/src/main/res/drawable/notification_widget_preview.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/xml/notification_widget_info.xml b/app/src/main/res/xml/notification_widget_info.xml index 2b8b4fb5..c14bbfb2 100644 --- a/app/src/main/res/xml/notification_widget_info.xml +++ b/app/src/main/res/xml/notification_widget_info.xml @@ -1,6 +1,10 @@ - + + android:minWidth="180dp" + android:minHeight="250dp" + android:previewImage="@drawable/notification_widget_preview" /> -- cgit v1.2.3 From 2fb01ffb24b0a80560bb7bbc89d2fa6f6bdb65fb Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Thu, 25 Apr 2019 13:05:02 -0700 Subject: Add widget preview --- .../res/drawable/notification_widget_preview.xml | 97 +++++++++++----------- 1 file changed, 48 insertions(+), 49 deletions(-) (limited to 'app/src/main/res') diff --git a/app/src/main/res/drawable/notification_widget_preview.xml b/app/src/main/res/drawable/notification_widget_preview.xml index a4ead7d0..a03fd362 100644 --- a/app/src/main/res/drawable/notification_widget_preview.xml +++ b/app/src/main/res/drawable/notification_widget_preview.xml @@ -1,49 +1,48 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + -- cgit v1.2.3 From cf152584b544425e0ee3ae28d765dc7e55a196af Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Thu, 25 Apr 2019 13:06:37 -0700 Subject: Update changelog --- app/src/main/res/xml/frost_changelog.xml | 12 +++++++++++- docs/Changelog.md | 4 ++++ 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'app/src/main/res') diff --git a/app/src/main/res/xml/frost_changelog.xml b/app/src/main/res/xml/frost_changelog.xml index 1895e46f..560b1111 100644 --- a/app/src/main/res/xml/frost_changelog.xml +++ b/app/src/main/res/xml/frost_changelog.xml @@ -6,12 +6,22 @@ --> + + + + + + + + + + + - diff --git a/docs/Changelog.md b/docs/Changelog.md index 7a6bbfab..39e7fa82 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -1,5 +1,9 @@ # Changelog +## v2.3.0 +* Converted internals of Facebook data storage; auto migration will only work from 2.2.x to 2.3.x +* Added notification widget + ## v2.2.4 * Show top bar to allow sharing posts * Fix unmuting videos when autoplay is enabled -- cgit v1.2.3 From 43a7e4b8e0f0a97f21514c5910b7e89d8b0bd814 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Wed, 1 May 2019 11:54:31 -0700 Subject: Delete duplicate translations --- app/src/main/res/values-es/strings_pref_feed.xml | 15 --------------- app/src/main/res/values-it/strings_pref_feed.xml | 15 --------------- 2 files changed, 30 deletions(-) delete mode 100644 app/src/main/res/values-es/strings_pref_feed.xml delete mode 100644 app/src/main/res/values-it/strings_pref_feed.xml (limited to 'app/src/main/res') diff --git a/app/src/main/res/values-es/strings_pref_feed.xml b/app/src/main/res/values-es/strings_pref_feed.xml deleted file mode 100644 index 646c87e2..00000000 --- a/app/src/main/res/values-es/strings_pref_feed.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - Orden de las Publicaciones - Define el orden en que aparecen las publicaciones - Modo \"Más Recientes\" agresivo - Filtra de manera adicional las publicaciones más antiguas de Facebook de las noticias recientes. Deshabilita esta opción si el feed se encuentra vacio. - Escritor de Estado - Mostrar escritor de estado en el feed - Sugerencias de Amigos - Mostrar \"Gente que quizá conozcas\" en el feed - Grupos sugeridos - Mostrar \"grupos sugeridos\" en el feed - Publicidad de Facebook - Mostrar Publicidad Nativa de Facebook - diff --git a/app/src/main/res/values-it/strings_pref_feed.xml b/app/src/main/res/values-it/strings_pref_feed.xml deleted file mode 100644 index e04dc077..00000000 --- a/app/src/main/res/values-it/strings_pref_feed.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - Ordine della Sezione Notizie - Definisce l\'ordine in cui sono mostrati i post - Recenti Aggressivi - Filtra ulteriori post vecchi dalla sezione originale più recenti di Facebook. Disabilita se il tuo feed è vuoto. - Compositore di Stato - Mostra la casella per comporre uno stato nelle Notizie - Amici Suggeriti - Mostra \"Persone Che Potresti Conoscere\" nel feed - Gruppi Suggeriti - Mostra \"Gruppi Suggeriti\" nel feed - Pubblicità Facebook - Mostra le pubblicità native di Facebook - -- cgit v1.2.3 From 58850fca392e458383d2546eeb83106bd54121e2 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Wed, 1 May 2019 13:17:59 -0700 Subject: Fix translation for yesterday --- app/src/main/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/src/main/res') diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0c2e625c..db9b30d5 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -63,7 +63,7 @@ No new notifications found Today - Today + Yesterday diff --git a/app/src/main/res/values-da-rDK/strings.xml b/app/src/main/res/values-da-rDK/strings.xml index 4d154d06..fc7a0f44 100644 --- a/app/src/main/res/values-da-rDK/strings.xml +++ b/app/src/main/res/values-da-rDK/strings.xml @@ -45,4 +45,12 @@ Valgmuligheder Hold nede og træk for at flytte de øverste ikoner. Ingen nye notifikationer + diff --git a/app/src/main/res/values-de-rDE/strings.xml b/app/src/main/res/values-de-rDE/strings.xml index f87447c4..84b9ae8d 100644 --- a/app/src/main/res/values-de-rDE/strings.xml +++ b/app/src/main/res/values-de-rDE/strings.xml @@ -17,6 +17,7 @@ Geburtstage Chat Fotos + Marktplatz Notizen An diesem Tag Alles wird vorbereitet… @@ -45,4 +46,12 @@ Optionen Durch langes Drücken und Ziehen können Sie die oberen Symbole neu anordnen. Keine neue Benachrichtigungen gefunden + diff --git a/app/src/main/res/values-de-rDE/strings_pref_feed.xml b/app/src/main/res/values-de-rDE/strings_pref_feed.xml index 07844d89..8877de04 100644 --- a/app/src/main/res/values-de-rDE/strings_pref_feed.xml +++ b/app/src/main/res/values-de-rDE/strings_pref_feed.xml @@ -11,6 +11,8 @@ Zeige \"Leute die du vielleicht kennst\" im Feed Empfohlene Gruppen Zeige \"Empfohlene Gruppen\" im Feed + Story\'s anzeigen + Story\'s in den Feed anzeigen Facebook Werbung Zeige native Facebook Werbung diff --git a/app/src/main/res/values-es-rES/strings.xml b/app/src/main/res/values-es-rES/strings.xml index 6b96de27..200b923b 100644 --- a/app/src/main/res/values-es-rES/strings.xml +++ b/app/src/main/res/values-es-rES/strings.xml @@ -17,6 +17,7 @@ Cumpleaños Chat Fotos + Marketplace Notas En este día Preparando todo… @@ -45,4 +46,14 @@ Opciones Mantén pulsado y arrastra para reorganizar los iconos superiores. No se han encontrado Notificaciones + Hoy + Ayer + diff --git a/app/src/main/res/values-es-rES/strings_pref_behaviour.xml b/app/src/main/res/values-es-rES/strings_pref_behaviour.xml index dd64c6d1..925f058c 100644 --- a/app/src/main/res/values-es-rES/strings_pref_behaviour.xml +++ b/app/src/main/res/values-es-rES/strings_pref_behaviour.xml @@ -17,6 +17,8 @@ Al cargar un hilo de mensaje, activa un desplazamiento hacia la parte inferior de la página en lugar de cargar la página tal como es. Activar PIP Activar función de video en miniatura + Configuración de jugadas automáticas + Abra configuración de juego de auto de Facebook. Tenga en cuenta que debe estar desactivada para que PIP trabajar. Confirmar salida Muestra un diálogo de confirmación antes de salir de la app Analytics diff --git a/app/src/main/res/values-es-rES/strings_pref_feed.xml b/app/src/main/res/values-es-rES/strings_pref_feed.xml index b5b3451d..2ebbdf87 100644 --- a/app/src/main/res/values-es-rES/strings_pref_feed.xml +++ b/app/src/main/res/values-es-rES/strings_pref_feed.xml @@ -11,6 +11,8 @@ Mostrar \"Gente que quizá conozcas\" en el feed Grupos sugeridos Mostrar \"grupos sugeridos\" en el feed + Historias destacadas + Mostrar historias en el feed Anuncios de Facebook Mostrar anuncios nativos de Facebook diff --git a/app/src/main/res/values-fr-rFR/strings.xml b/app/src/main/res/values-fr-rFR/strings.xml index 16b14ac2..b0e179e9 100644 --- a/app/src/main/res/values-fr-rFR/strings.xml +++ b/app/src/main/res/values-fr-rFR/strings.xml @@ -17,6 +17,7 @@ Anniversaires Conversations Photos + Marketplace Notes Aujourd\'hui Tout se prépare… @@ -45,4 +46,15 @@ Options Appuyez longuement et faites glisser pour réorganiser les icônes du haut. Pas de nouvelles notifications trouvées + Aujourd\'hui + Hier + + %1s à %2s diff --git a/app/src/main/res/values-fr-rFR/strings_pref_behaviour.xml b/app/src/main/res/values-fr-rFR/strings_pref_behaviour.xml index 9c819308..7dec9c46 100644 --- a/app/src/main/res/values-fr-rFR/strings_pref_behaviour.xml +++ b/app/src/main/res/values-fr-rFR/strings_pref_behaviour.xml @@ -17,6 +17,8 @@ Lors du chargement d’un fil de message, déclencher un défilement vers le bas de la page au lieu de charger la page telle quelle. Activer le PIP Activer les vidéos Picture In Picture + Paramètres de lecture automatique + Ouvrir les paramètres de lecture automatique de Facebook. Notez qu\'il doit être désactivé pour que PIP fonctionne. Confirmation de la sortie Afficher la boîte de dialogue de confirmation avant de quitter l’application Analytics diff --git a/app/src/main/res/values-fr-rFR/strings_pref_feed.xml b/app/src/main/res/values-fr-rFR/strings_pref_feed.xml index 581d869a..1de2ab0c 100644 --- a/app/src/main/res/values-fr-rFR/strings_pref_feed.xml +++ b/app/src/main/res/values-fr-rFR/strings_pref_feed.xml @@ -4,13 +4,15 @@ Ordre du fil d\'actualité Définit l’ordre dans lequel les messages sont affichés Récents agressifs - Filtrer les vieilles publications additionnelles du fil d\'actualité les plus récentes de Facebook. Désactivez cette option si votre fil d\'actualités est vide. + Éliminer les anciennes publications additionnelles du fil d\'actualité récentes de Facebook. Désactivez cette option si votre fil d\'actualités est vide. Compositeur de statut Montrer le compositeur de statut dans le fil d\'actualité Amis suggérés Afficher les «Personnes que vous pouvez connaître» dans le fil d\'actualité Groupes Suggérés Afficher les «Groupes Suggérés» dans le fil d\'actualité + Montrer les Top Stories + Montrer les stories dans le fil d\'actualité Publicités Facebook Afficher les publicités Facebook diff --git a/app/src/main/res/values-gl-rES/strings.xml b/app/src/main/res/values-gl-rES/strings.xml index 9d9c8e50..48547a6c 100644 --- a/app/src/main/res/values-gl-rES/strings.xml +++ b/app/src/main/res/values-gl-rES/strings.xml @@ -48,4 +48,12 @@ Opcións Toque longo e arrastra para reorganizar as iconas superiores. Non se atopou ningunha nova notificación + diff --git a/app/src/main/res/values-hu-rHU/strings.xml b/app/src/main/res/values-hu-rHU/strings.xml index 1978cacf..6b62f285 100644 --- a/app/src/main/res/values-hu-rHU/strings.xml +++ b/app/src/main/res/values-hu-rHU/strings.xml @@ -17,6 +17,7 @@ Születésnapok Chat Fényképek + Piactér Jegyzetek Ezen a napon Előkészítés… @@ -45,4 +46,12 @@ Beállítások Tartsd nyomva és húzd a felső ikonokat az átrendezéshez. Nem találhatók új értesítések + diff --git a/app/src/main/res/values-hu-rHU/strings_pref_feed.xml b/app/src/main/res/values-hu-rHU/strings_pref_feed.xml index fa85b06e..a784c376 100644 --- a/app/src/main/res/values-hu-rHU/strings_pref_feed.xml +++ b/app/src/main/res/values-hu-rHU/strings_pref_feed.xml @@ -11,6 +11,8 @@ \"Emberek, akiket ismerhetsz\" megjelenítése a hírcsatornában Javasolt csoportok \"Javasolt csoportok\" megjelenítése a hírcsatornában + Történetek megjelenítése + Történetek megjelenítése a hírfolyamban Facebook hirdetések Natív Facebook-hirdetések megjelenítése diff --git a/app/src/main/res/values-in-rID/strings.xml b/app/src/main/res/values-in-rID/strings.xml index fd6c3abe..73c6c61d 100644 --- a/app/src/main/res/values-in-rID/strings.xml +++ b/app/src/main/res/values-in-rID/strings.xml @@ -45,4 +45,12 @@ Pratinjau Pilihan Tekan lama dan tarik untuk mengatur ulang ikon atas. + diff --git a/app/src/main/res/values-it-rIT/strings.xml b/app/src/main/res/values-it-rIT/strings.xml index 5a5acbd6..be8c04f4 100644 --- a/app/src/main/res/values-it-rIT/strings.xml +++ b/app/src/main/res/values-it-rIT/strings.xml @@ -46,4 +46,12 @@ Opzioni Per riordinare un\'icona tienila premuta e trascinala. Nessuna nuova notifica trovata + diff --git a/app/src/main/res/values-ko-rKR/strings.xml b/app/src/main/res/values-ko-rKR/strings.xml index df91e3e0..ef490091 100644 --- a/app/src/main/res/values-ko-rKR/strings.xml +++ b/app/src/main/res/values-ko-rKR/strings.xml @@ -42,4 +42,12 @@ 파일 선택기를 찾을 수 없습니다. 상단 바 하단 바 + diff --git a/app/src/main/res/values-nl-rNL/strings.xml b/app/src/main/res/values-nl-rNL/strings.xml index 5a0373f7..0c506137 100644 --- a/app/src/main/res/values-nl-rNL/strings.xml +++ b/app/src/main/res/values-nl-rNL/strings.xml @@ -46,4 +46,12 @@ Opties Klik en houd vast om de iconen in de gewenste volgorde te slepen. Geen nieuwe notificaties + diff --git a/app/src/main/res/values-no-rNO/strings.xml b/app/src/main/res/values-no-rNO/strings.xml index 08aab533..770ee6d8 100644 --- a/app/src/main/res/values-no-rNO/strings.xml +++ b/app/src/main/res/values-no-rNO/strings.xml @@ -44,4 +44,12 @@ Forhåndsvisning Alternativer Langt trykk og dra for å endre topp ikonene. + diff --git a/app/src/main/res/values-pl-rPL/strings.xml b/app/src/main/res/values-pl-rPL/strings.xml index 35b3c991..8d8dca94 100644 --- a/app/src/main/res/values-pl-rPL/strings.xml +++ b/app/src/main/res/values-pl-rPL/strings.xml @@ -45,4 +45,12 @@ Opcje Długie naciśnięcie i przeciągnięcie, aby zmienić kolejność ikon. Brak nowych powiadomień + diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 9525dec8..cca038df 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -17,6 +17,7 @@ Aniversários Amigos online Fotos + Marketplace Notas Neste Dia Preparando tudo… @@ -46,4 +47,15 @@ Opções Mantenha pressionado e arraste para reorganizar os ícones superiores. Nenhuma nova notificação encontrada + Hoje + Ontem + + %1s às %2s diff --git a/app/src/main/res/values-pt-rBR/strings_pref_behaviour.xml b/app/src/main/res/values-pt-rBR/strings_pref_behaviour.xml index db06b1e8..7355c3d5 100644 --- a/app/src/main/res/values-pt-rBR/strings_pref_behaviour.xml +++ b/app/src/main/res/values-pt-rBR/strings_pref_behaviour.xml @@ -17,6 +17,8 @@ Ao carregar um tópico de mensagem, aciona uma rolagem para a parte inferior da página em vez de carregar a página como está. Habilitar o PIP Habilita o Picture in Picture (janelas flutuantes de vídeos) + Configurações de reprodução automática + Abra as configurações de reprodução automática do Facebook. Observe que ele deve ser desativado para que o PIP funcione. Confirmação de Saída Mostrar caixa de diálogo de confirmação antes de sair do aplicativo Telemetria diff --git a/app/src/main/res/values-pt-rBR/strings_pref_feed.xml b/app/src/main/res/values-pt-rBR/strings_pref_feed.xml index e03b132e..1a37345f 100644 --- a/app/src/main/res/values-pt-rBR/strings_pref_feed.xml +++ b/app/src/main/res/values-pt-rBR/strings_pref_feed.xml @@ -11,6 +11,8 @@ Mostra \"Pessoas Que Talvez Você Conheça\" no Feed Grupos Sugeridos Mostra \"Grupos Sugeridos\" no Feed + Mostrar Histórias + Mostrar histórias no feed Anúncios do Facebook Mostrar anúncios nativos do Facebook diff --git a/app/src/main/res/values-pt-rPT/strings.xml b/app/src/main/res/values-pt-rPT/strings.xml index 471abe90..0bbdc5ad 100644 --- a/app/src/main/res/values-pt-rPT/strings.xml +++ b/app/src/main/res/values-pt-rPT/strings.xml @@ -45,4 +45,12 @@ Opções Toque longo e arraste para dispor os ícones superiores. Sem notificações novas + diff --git a/app/src/main/res/values-ro-rRO/strings.xml b/app/src/main/res/values-ro-rRO/strings.xml index a1f53622..1fcfce92 100644 --- a/app/src/main/res/values-ro-rRO/strings.xml +++ b/app/src/main/res/values-ro-rRO/strings.xml @@ -46,4 +46,12 @@ Opțiuni Apasă lung și trage să rearanjezi. Nu s-au găsit notificări + diff --git a/app/src/main/res/values-ru-rRU/strings.xml b/app/src/main/res/values-ru-rRU/strings.xml index 3ac25564..3a0c30af 100644 --- a/app/src/main/res/values-ru-rRU/strings.xml +++ b/app/src/main/res/values-ru-rRU/strings.xml @@ -17,6 +17,7 @@ Дни рождения Написать Фотографии + Marketplace Заметки В этот день Почти готово… @@ -45,4 +46,14 @@ Опции Долго нажмите и перетащите чтобы переставить иконки Новые уведомления отсутствуют + Сегодня + Вчера + diff --git a/app/src/main/res/values-ru-rRU/strings_pref_feed.xml b/app/src/main/res/values-ru-rRU/strings_pref_feed.xml index 61718079..d48a56f1 100644 --- a/app/src/main/res/values-ru-rRU/strings_pref_feed.xml +++ b/app/src/main/res/values-ru-rRU/strings_pref_feed.xml @@ -11,6 +11,8 @@ Смотреть «Люди которых вы можете знать» в канале Предлагаемые группы Смотреть «Предложения групп» в канале + Показывать Истории + Показывать Истории в ленте - Реклама в Facebook Показать родной Facebook объявления diff --git a/app/src/main/res/values-sr-rSP/strings.xml b/app/src/main/res/values-sr-rSP/strings.xml index f526edcf..9cb3ef9c 100644 --- a/app/src/main/res/values-sr-rSP/strings.xml +++ b/app/src/main/res/values-sr-rSP/strings.xml @@ -45,4 +45,12 @@ Опције Задржите и превуците да би прерасподелили горње иконице. Нема нових обавештења + diff --git a/app/src/main/res/values-sv-rSE/strings.xml b/app/src/main/res/values-sv-rSE/strings.xml index aeabdbb4..456bcae1 100644 --- a/app/src/main/res/values-sv-rSE/strings.xml +++ b/app/src/main/res/values-sv-rSE/strings.xml @@ -46,4 +46,12 @@ Inställningar Tryck och håll kvar för att arrangera om topp-ikonerna. Inga nya notifikationer hittades + diff --git a/app/src/main/res/values-th-rTH/strings.xml b/app/src/main/res/values-th-rTH/strings.xml index 5c1e63ec..4f2c4734 100644 --- a/app/src/main/res/values-th-rTH/strings.xml +++ b/app/src/main/res/values-th-rTH/strings.xml @@ -44,4 +44,12 @@ แสดงตัวอย่าง ตัวเลือก กดค้างและลากเพื่อจัดเรียงไอคอนด้านบน + diff --git a/app/src/main/res/values-tl-rPH/strings.xml b/app/src/main/res/values-tl-rPH/strings.xml index e9139373..6880e40e 100644 --- a/app/src/main/res/values-tl-rPH/strings.xml +++ b/app/src/main/res/values-tl-rPH/strings.xml @@ -45,4 +45,12 @@ Pribyu Ang mga opsyon Pindutin ng matagal at hilahin para mabago ang ayos ng pangunahing imahe. + diff --git a/app/src/main/res/values-tr-rTR/strings.xml b/app/src/main/res/values-tr-rTR/strings.xml index 828a2abb..f2dc54b2 100644 --- a/app/src/main/res/values-tr-rTR/strings.xml +++ b/app/src/main/res/values-tr-rTR/strings.xml @@ -17,6 +17,7 @@ Doğum Günleri Sohbet Fotoğraflar + Pazar yeri Notlar Bu günde Her şey hazır alınıyor… @@ -45,4 +46,14 @@ Seçenekler Üstteki simgeleri yeniden düzenlemek için uzun basın ve sonra sürükleyin. Yeni bildirim bulunmadı + Bugün + Dün + diff --git a/app/src/main/res/values-tr-rTR/strings_pref_behaviour.xml b/app/src/main/res/values-tr-rTR/strings_pref_behaviour.xml index 9c60e461..58f3ca43 100644 --- a/app/src/main/res/values-tr-rTR/strings_pref_behaviour.xml +++ b/app/src/main/res/values-tr-rTR/strings_pref_behaviour.xml @@ -21,6 +21,7 @@ Birileti dizisi yüklerken, sayfayı olduğu gibi yüklemek yerine, sayfanın altına kaydırma yapın. PIP\'i etkinleştir PIP (Picture in Picture) videolarını etkinleştir + Otomatik oynatma ayarları Çıkış Onayı Uygulamadan çıkmadanönce onay iletişim kutusunu göster Analiz diff --git a/app/src/main/res/values-tr-rTR/strings_pref_feed.xml b/app/src/main/res/values-tr-rTR/strings_pref_feed.xml index 30963338..e70e96cf 100644 --- a/app/src/main/res/values-tr-rTR/strings_pref_feed.xml +++ b/app/src/main/res/values-tr-rTR/strings_pref_feed.xml @@ -11,6 +11,8 @@ Özet akışında \"Tanıdığınız İnsanları\" gösterin Önerilen gruplar Özet akışında \"önerilen grup\" ları göster + Hikayeleri göster + Akışda ki hikayeleri göster Facebook reklamları Yerli Facebook reklamlarını göster diff --git a/app/src/main/res/values-uk-rUA/strings.xml b/app/src/main/res/values-uk-rUA/strings.xml index 7d051a3f..1abb84d5 100644 --- a/app/src/main/res/values-uk-rUA/strings.xml +++ b/app/src/main/res/values-uk-rUA/strings.xml @@ -17,6 +17,7 @@ Дні народження Чат Фотографії + Магазин Замітки Цього дня Отримання всього готове… @@ -45,4 +46,12 @@ Опції Довге натискання та перетягніть, щоб переставити верхній значок. Нових повідомлень не знайдено + diff --git a/app/src/main/res/values-uk-rUA/strings_pref_feed.xml b/app/src/main/res/values-uk-rUA/strings_pref_feed.xml index 1b4176e0..29ecc9d6 100644 --- a/app/src/main/res/values-uk-rUA/strings_pref_feed.xml +++ b/app/src/main/res/values-uk-rUA/strings_pref_feed.xml @@ -11,6 +11,8 @@ Показати \"Люди, яких ви можете знати\" у новинній стрічці Пропоновані групи Показати \"Пропоновані групи\" у новинній стрічці + Показати Історії + Показувати історії у стрічці Реклама у Facebook Показувати вбудовану рекламу Facebook diff --git a/app/src/main/res/values-vi-rVN/strings.xml b/app/src/main/res/values-vi-rVN/strings.xml index f65193bc..9b7c39e6 100644 --- a/app/src/main/res/values-vi-rVN/strings.xml +++ b/app/src/main/res/values-vi-rVN/strings.xml @@ -46,4 +46,12 @@ Tuỳ chọn Bấm giữ và kéo để sắp xếp biểu tượng trên cùng. Không có thông báo mới + diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 76105ca1..bf5ced6a 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -40,4 +40,12 @@ 未找到文件选择程序 顶栏 底栏 + diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 5ee8d7bd..3d22540b 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -45,4 +45,12 @@ 選項 長按及拖曳頂部圖標可重新排列位置 沒有新通知。 + diff --git a/files/translation_migration.sh b/files/translation_migration.sh index 174d568a..03e3592a 100644 --- a/files/translation_migration.sh +++ b/files/translation_migration.sh @@ -6,11 +6,11 @@ cd .. current=${PWD##*/} -if [ "$current" != "$MODULE" ]; then +if [[ "$current" != "$MODULE" ]]; then echo "Not in $MODULE"; else # DANGEROUS! Removes all files matching regex - egrep -lir --include="*.xml" "" "./" | tr '\n' '\0' | xargs -0 -n1 rm + grep -Lir "" --include="strings*.xml" "app/src/main/res" | tr '\n' '\0' | xargs -0 -n1 rm # Delete empty directories find . -type d -empty -delete fi -- cgit v1.2.3