updated strings

This commit is contained in:
Mariotaku Lee 2017-08-30 11:59:57 +08:00
parent e742703bc0
commit bba95d7d04
No known key found for this signature in database
GPG Key ID: 15C10F89D7C33535
4 changed files with 36 additions and 13 deletions

View File

@ -236,6 +236,7 @@ public interface TwidereConstants extends SharedPreferenceConstants, IntentConst
int NOTIFICATION_ID_DIRECT_MESSAGES = 3;
int NOTIFICATION_ID_DRAFTS = 4;
int NOTIFICATION_ID_DATA_PROFILING = 5;
int NOTIFICATION_ID_PROMOTIONS_OFFER = 6;
int NOTIFICATION_ID_USER_NOTIFICATION = 10;
int NOTIFICATION_ID_UPDATE_STATUS = 101;
int NOTIFICATION_ID_SEND_DIRECT_MESSAGE = 102;

View File

@ -22,6 +22,7 @@ package org.mariotaku.twidere.activity
import android.accounts.Account
import android.accounts.AccountManager
import android.accounts.OnAccountsUpdateListener
import android.annotation.SuppressLint
import android.app.Dialog
import android.app.PendingIntent
import android.app.SearchManager
@ -65,6 +66,7 @@ import kotlinx.android.synthetic.main.activity_home_content.*
import kotlinx.android.synthetic.main.layout_empty_tab_hint.*
import nl.komponents.kovenant.task
import org.mariotaku.chameleon.ChameleonUtils
import org.mariotaku.kpreferences.contains
import org.mariotaku.kpreferences.get
import org.mariotaku.kpreferences.set
import org.mariotaku.ktextension.*
@ -98,6 +100,7 @@ import org.mariotaku.twidere.provider.TwidereDataStore.Statuses
import org.mariotaku.twidere.service.StreamingService
import org.mariotaku.twidere.util.*
import org.mariotaku.twidere.util.KeyboardShortcutsHandler.KeyboardShortcutCallback
import org.mariotaku.twidere.util.premium.ExtraFeaturesService
import org.mariotaku.twidere.view.HomeDrawerLayout
import org.mariotaku.twidere.view.TabPagerIndicator
import java.lang.ref.WeakReference
@ -143,6 +146,7 @@ class HomeActivity : BaseActivity(), OnClickListener, OnPageChangeListener, Supp
drawerToggleButton.contentDescription = getString(contentDescRes)
}
@SuppressLint("RestrictedApi")
override fun getThemeUpIndicator(): Drawable {
val a = TintTypedArray.obtainStyledAttributes(actionBarThemedContext, null,
HOME_AS_UP_ATTRS)
@ -261,7 +265,7 @@ class HomeActivity : BaseActivity(), OnClickListener, OnPageChangeListener, Supp
setupSlidingMenu()
setupBars()
showDataProfilingRequest()
showPromotionOffer()
initUnreadCount()
setupHomeTabs()
updateActionsButton()
@ -399,6 +403,7 @@ class HomeActivity : BaseActivity(), OnClickListener, OnPageChangeListener, Supp
return true
}
@SuppressLint("RestrictedApi")
override fun onApplyWindowInsets(v: View, insets: WindowInsetsCompat): WindowInsetsCompat {
super.onApplyWindowInsets(v, insets)
val fragment = leftDrawerFragment
@ -836,21 +841,24 @@ class HomeActivity : BaseActivity(), OnClickListener, OnPageChangeListener, Supp
})
}
private fun showDataProfilingRequest() {
//spice
if (preferences.contains(KEY_USAGE_STATISTICS)) {
private fun showPromotionOffer() {
// Skip if app doesn't support extra features
if (!extraFeaturesService.isSupported()) return
// Skip if already bought enhanced features pack or have set promotions options
if (!extraFeaturesService.isEnabled(ExtraFeaturesService.FEATURE_FEATURES_PACK)
|| promotionsEnabledKey in preferences) {
return
}
val intent = Intent(this, UsageStatisticsActivity::class.java)
val intent = Intent(this, PremiumDashboardActivity::class.java)
val contentIntent = PendingIntent.getActivity(this, 0, intent, 0)
val builder = NotificationChannelSpec.appNotices.notificationBuilder(this)
builder.setAutoCancel(true)
builder.setSmallIcon(R.drawable.ic_stat_info)
builder.setTicker(getString(R.string.usage_statistics))
builder.setContentTitle(getString(R.string.usage_statistics))
builder.setContentText(getString(R.string.usage_statistics_notification_summary))
builder.setSmallIcon(R.drawable.ic_stat_gift)
builder.setTicker(getString(R.string.message_ticker_promotions_reward))
builder.setContentTitle(getString(R.string.title_promotions_reward))
builder.setContentText(getString(R.string.message_promotions_reward))
builder.setContentIntent(contentIntent)
notificationManager.notify(NOTIFICATION_ID_DATA_PROFILING, builder.build())
notificationManager.notify(NOTIFICATION_ID_PROMOTIONS_OFFER, builder.build())
}
private fun triggerActionsClick() {

View File

@ -452,7 +452,7 @@
<string name="hint_message_select_user">Search users</string>
<string name="hint_no_account">No account</string>
<string name="hint_search_gif">Search GIF</string>
<string name="hint_status_reply_to_user_removed">Will be sent as quote because mention to tweet user removed. &lt;a href=\"#dialog\";&gt;Why?&lt;/a&gt;</string>
<string name="hint_status_reply_to_user_removed">Will be sent as quote because mention to tweet author was removed. &lt;a href=\"#dialog\";&gt;Why?&lt;/a&gt;</string>
<string name="hints">Hints</string>
@ -650,7 +650,8 @@
<string name="message_permission_request_share_media">Twidere needs storage permission for sharing media to some apps.</string>
<string name="message_pin_status_confirm">Pin this tweet? This will replace previously pinned tweet.</string>
<string name="message_please_wait">Please wait.</string>
<string name="message_status_reply_to_user_removed_explanation">Twitter makes tweet user always be mentioned in a reply. If tweet user was removed, Twidere will send this reply as a quote to preserve context.</string>
<string name="message_promotions_reward">Enable promotions to use all enhanced features for free, we promise not to disturb you!</string>
<string name="message_status_reply_to_user_removed_explanation">Twitter makes tweet author always be mentioned in a reply. If tweet author was removed, Twidere will send this reply as a quote to preserve context.</string>
<string name="message_status_scheduling_connect_buffer_hint">Connect to Buffer to schedule tweets even in offline</string>
<string name="message_status_scheduling_connected_to_buffer">Twidere is now connected to Buffer</string>
<string name="message_summary_type_sticker">[Sticker]</string>
@ -659,7 +660,7 @@
<string name="message_sync_disconnect_from_name_confirm">Disconnect from <xliff:g example="ownCloud" id="name">%s</xliff:g>?</string>
<string name="message_sync_last_synced_time">Last synced: <xliff:g example="2017/1/1 12:00" id="time">%s</xliff:g></string>
<string name="message_tab_field_is_required">Field \"<xliff:g example="Field" id="name">%s</xliff:g>\" is required</string>
<string name="message_title_promotions_reward">Enable promotions to use all enhanced features for free, we promise not to disturb you!</string>
<string name="message_ticker_promotions_reward">Enable promotions to use all enhanced features for free!</string>
<!--
~ Toast messages, according to https://material.io/guidelines/style/writing.html#writing-capitalization-punctuation ,
~ periods should be omitted

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
<title>ic_stat_gift-mdpi</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Notification-Icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="ic_stat_gift-mdpi">
<path d="M20,6 L17.82,6 C17.93,5.69 18,5.35 18,5 C18,3.34 16.66,2 15,2 C13.95,2 13.04,2.54 12.5,3.35 L12,4.02 L11.5,3.34 C10.96,2.54 10.05,2 9,2 C7.34,2 6,3.34 6,5 C6,5.35 6.07,5.69 6.18,6 L4,6 C2.89,6 2.01,6.89 2.01,8 L2,19 C2,20.11 2.89,21 4,21 L20,21 C21.11,21 22,20.11 22,19 L22,8 C22,6.89 21.11,6 20,6 Z M15,4 C15.55,4 16,4.45 16,5 C16,5.55 15.55,6 15,6 C14.45,6 14,5.55 14,5 C14,4.45 14.45,4 15,4 Z M9,4 C9.55,4 10,4.45 10,5 C10,5.55 9.55,6 9,6 C8.45,6 8,5.55 8,5 C8,4.45 8.45,4 9,4 Z M20,19 L4,19 L4,15 L20,15 L20,19 Z M20,13 L4,13 L4,8 L9.08,8 L7,10.83 L8.62,12 L11,8.76 L12,7.4 L13,8.76 L15.38,12 L17,10.83 L14.92,8 L20,8 L20,13 Z" id="Shape" fill="#FFFFFF" fill-rule="nonzero"></path>
<polygon id="Shape" points="0 0 24 0 24 24 0 24"></polygon>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB