Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Tenor support #11587

Merged
Merged
Changes from 1 commit
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
06f49e1
Added Tenor library and API key reference
ThomazFB Mar 21, 2020
be9e118
Changed giphy package name to gifs
ThomazFB Mar 22, 2020
47ac89a
Created TenorProvider infrastructure and basic search
ThomazFB Mar 22, 2020
99751e6
Added GifProvider and TenorProvider documentation
ThomazFB Mar 23, 2020
d393dca
GifProvider is now available through injection with Dagger and provid…
ThomazFB Mar 23, 2020
c401c4c
Replaced Giphy name to Gif from all packages and classes
ThomazFB Mar 23, 2020
6554d88
Connected the TenorProvider implementation to the expected GifMediaVi…
ThomazFB Mar 23, 2020
e376715
Improved test suite for TenorProvider with code refactor and more tes…
ThomazFB Mar 23, 2020
b2d093f
Improved code reuse, naming and deprecated assertion methods
ThomazFB Mar 23, 2020
2e06912
Gif data class removed, using the MutableGifMediaViewModel instead. A…
ThomazFB Mar 24, 2020
bddff06
Fixed GiphyPickerActivity reference on AndroidManifest
ThomazFB Mar 24, 2020
a75cd47
Integrated pagination into the Tenor requests
ThomazFB Mar 24, 2020
91a00b2
Reverted Giphy renaming
ThomazFB Mar 24, 2020
7e384e3
Reverted Giphy renaming for packages
ThomazFB Mar 24, 2020
5b1f835
Additional code refactoring and new test for TenorProvider
ThomazFB Mar 24, 2020
0d23a81
Reconnected GIF search with MediaBrowserActivity
ThomazFB Mar 24, 2020
aca0ca2
Initial load changed to 42
ThomazFB Mar 24, 2020
2e46c33
Improved documentation for GifProvider
ThomazFB Mar 25, 2020
14da4b2
Added code refactoring for parameter organization
ThomazFB Mar 25, 2020
d338de2
Removed unwanted Tenor text reference
ThomazFB Mar 25, 2020
f664593
Added code refactoring for TenorProvider
ThomazFB Mar 25, 2020
3289614
Improved documentation over TenorProvider methods
ThomazFB Mar 25, 2020
f267c9a
Added resilience to the initial load fetching
ThomazFB Mar 25, 2020
40f781c
Changed constant to better fit code convention
ThomazFB Mar 25, 2020
64733fc
Changed TenorProviderTestUtils to TenorProviderTestFixtures, also ref…
ThomazFB Mar 25, 2020
6561720
Changed test assertion to use assertThat pattern and improve test rea…
ThomazFB Mar 25, 2020
a69afcc
Moved Tenor API initialization to the outside of TenorProvider
ThomazFB Mar 25, 2020
45e70dd
Extracted magic numbers to constants
ThomazFB Mar 25, 2020
ec760a1
Reconnected EditPostActivity with GIF Picker
ThomazFB Mar 26, 2020
18f0c2e
Added tests for GIF Picker DataSource
ThomazFB Mar 26, 2020
f0f2006
Added thread safety and timeout handling to TenorProvider
ThomazFB Mar 27, 2020
6dbeea0
Restored Analytics tracking
ThomazFB Mar 27, 2020
ffe47e4
Added Tenor attribution icon, removed the Giphy one
ThomazFB Mar 27, 2020
e4c91bb
Fixed Picker ViewModel tests
ThomazFB Mar 27, 2020
c673a53
Formatted tenor image
ThomazFB Mar 27, 2020
e3efa24
Refactored TenorProviderTest boilerplate
ThomazFB Mar 27, 2020
1a62bb1
Removed unnecessary methods for response and error handling
ThomazFB Mar 27, 2020
a854c91
Replaced Tenor callback implementation to the default retrofit one
ThomazFB Mar 27, 2020
4efed5f
Removed custom timeout exception implementation
ThomazFB Mar 27, 2020
ec38306
Removed coroutine scope injection
ThomazFB Mar 27, 2020
bbf6419
Remove unecessary annotation
ThomazFB Mar 31, 2020
40a5873
Renamed all giphy name references inside viewmodel package to only gif
ThomazFB Mar 29, 2020
3a41fcb
Renamed all giphy name references inside ui package to only gif
ThomazFB Mar 29, 2020
b5b0af6
Replaced all Giphy string references to Tenor
ThomazFB Mar 29, 2020
0ed1483
Adjusted all remaining documentation and code referencing Giphy
ThomazFB Mar 29, 2020
af0aaa7
Adjust GifMediaViewModel documentation
ThomazFB Apr 1, 2020
35f8d0a
Removed maven reference for giphy SDK
ThomazFB Apr 1, 2020
93fe31c
Removed translations of gif strings
ThomazFB Apr 1, 2020
a27b47a
Added local tenor feature flag through BuildConfig
ThomazFB Apr 2, 2020
dfc607f
Added Tenor selection availability through BuildConfig inside EditPos…
ThomazFB Apr 2, 2020
4a0cc13
Added Tenor selection availability through BuildConfig inside MediaBr…
ThomazFB Apr 2, 2020
d512243
Added the Tenor availability to the alpha build
ThomazFB Apr 2, 2020
41cdfaf
Added Tenor library license attribution
ThomazFB Apr 3, 2020
f3bf4e3
Fixed checkstyle errors
ThomazFB Apr 4, 2020
2ad832a
Replaced UI string usage for Exception for internal constant string
ThomazFB Apr 4, 2020
ceac897
Removed UI string usage from the exception for empty search result in…
ThomazFB Apr 4, 2020
0c09c88
Revert TenorProvider string usage with lint unused suppression
ThomazFB Apr 7, 2020
13e88ec
Changed the unused resources suppression declaration
ThomazFB Apr 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Restored Analytics tracking
ThomazFB committed Apr 7, 2020

Verified

This commit was signed with the committer’s verified signature.
EspenAlbert Espen Albert
commit 6dbeea08a73fb21820075709afd1c0f093d985cc
Original file line number Diff line number Diff line change
@@ -175,9 +175,12 @@ public static void showStockMediaPickerForResult(Activity activity,
}

public static void showGifPickerForResult(Activity activity, @NonNull SiteModel site, int requestCode) {
Map<String, String> properties = new HashMap<>();
properties.put("from", activity.getClass().getSimpleName());
AnalyticsTracker.track(Stat.GIF_PICKER_ACCESSED, properties);

Intent intent = new Intent(activity, GiphyPickerActivity.class);
intent.putExtra(WordPress.SITE, site);

activity.startActivityForResult(intent, requestCode);
}

Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@ import org.wordpress.android.ui.media.MediaPreviewActivity
import org.wordpress.android.util.AniUtils
import org.wordpress.android.util.DisplayUtils
import org.wordpress.android.util.ToastUtils
import org.wordpress.android.util.analytics.AnalyticsTrackerWrapper
import org.wordpress.android.util.getDistinct
import org.wordpress.android.util.image.ImageManager
import org.wordpress.android.viewmodel.ViewModelFactory
@@ -45,6 +46,7 @@ class GiphyPickerActivity : LocaleAwareActivity() {
*/
@Inject lateinit var imageManager: ImageManager
@Inject lateinit var viewModelFactory: ViewModelFactory
@Inject lateinit var analyticsTrackerWrapper: AnalyticsTrackerWrapper

private lateinit var viewModel: GiphyPickerViewModel

@@ -346,7 +348,7 @@ class GiphyPickerActivity : LocaleAwareActivity() {
}

val properties = mapOf("number_of_media_selected" to mediaLocalIds.size)
AnalyticsTracker.track(AnalyticsTracker.Stat.GIPHY_PICKER_DOWNLOADED, properties)
analyticsTrackerWrapper.track(AnalyticsTracker.Stat.GIF_PICKER_DOWNLOADED, properties)
}

/**
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@ import org.wordpress.android.analytics.AnalyticsTracker
import org.wordpress.android.fluxc.model.MediaModel
import org.wordpress.android.fluxc.model.SiteModel
import org.wordpress.android.util.NetworkUtilsWrapper
import org.wordpress.android.util.analytics.AnalyticsTrackerWrapper
import org.wordpress.android.util.getDistinct
import org.wordpress.android.viewmodel.SingleLiveEvent
import javax.inject.Inject
@@ -33,6 +34,7 @@ import javax.inject.Inject
*/
class GiphyPickerViewModel @Inject constructor(
private val networkUtils: NetworkUtilsWrapper,
private val analyticsTrackerWrapper: AnalyticsTrackerWrapper,
private val mediaFetcher: GiphyMediaFetcher,
/**
* The [GiphyPickerDataSourceFactory] to use
@@ -231,7 +233,7 @@ class GiphyPickerViewModel @Inject constructor(

dataSourceFactory.searchQuery = query

AnalyticsTracker.track(AnalyticsTracker.Stat.GIPHY_PICKER_SEARCHED)
analyticsTrackerWrapper.track(AnalyticsTracker.Stat.GIF_PICKER_SEARCHED)
} else {
searchQueryChannel.send(query)
}
Original file line number Diff line number Diff line change
@@ -483,9 +483,9 @@ public enum Stat {
STOCK_MEDIA_ACCESSED,
STOCK_MEDIA_SEARCHED,
STOCK_MEDIA_UPLOADED,
GIPHY_PICKER_SEARCHED,
GIPHY_PICKER_ACCESSED,
GIPHY_PICKER_DOWNLOADED,
GIF_PICKER_SEARCHED,
GIF_PICKER_ACCESSED,
GIF_PICKER_DOWNLOADED,
SHORTCUT_STATS_CLICKED,
SHORTCUT_NOTIFICATIONS_CLICKED,
SHORTCUT_NEW_POST_CLICKED,
Original file line number Diff line number Diff line change
@@ -1502,12 +1502,12 @@ public static String getEventNameForStat(AnalyticsTracker.Stat stat) {
return "stock_media_searched";
case STOCK_MEDIA_UPLOADED:
return "stock_media_uploaded";
case GIPHY_PICKER_SEARCHED:
return "giphy_picker_searched";
case GIPHY_PICKER_ACCESSED:
return "giphy_picker_accessed";
case GIPHY_PICKER_DOWNLOADED:
return "giphy_picker_downloaded";
case GIF_PICKER_SEARCHED:
return "gif_picker_searched";
case GIF_PICKER_ACCESSED:
return "gif_picker_accessed";
case GIF_PICKER_DOWNLOADED:
return "gif_picker_downloaded";
case SHORTCUT_STATS_CLICKED:
return "shortcut_stats_clicked";
case SHORTCUT_NOTIFICATIONS_CLICKED: