Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
98940eb
Contain RN in retained child Fragment, re-attach on rotate
hypest Jan 20, 2019
d502dc6
Re-wire up the media selection callback
hypest Jan 20, 2019
1a8f5f2
Update the gutenberg-mobile ref
hypest Jan 23, 2019
1f5cb4c
Merge branch 'develop' into gb/contain-and-retain-gb
hypest Jan 23, 2019
62efc23
Remove unused import
hypest Jan 23, 2019
13da084
Merge branch 'develop' into gb/contain-and-retain-gb
hypest Jan 25, 2019
5772623
Fix code issues from merge from develop
hypest Jan 25, 2019
4cf21c8
Don't re-finish GB init if recreating Activity
hypest Jan 25, 2019
22fd283
Merge branch 'develop' into gb/contain-and-retain-gb
hypest Jan 25, 2019
8461ee7
Merge branch 'develop' into gb/contain-and-retain-gb
hypest Jan 26, 2019
f856965
Fix GB container after recent merge from develop
hypest Jan 26, 2019
0935d65
Merge branch 'develop' into gb/contain-and-retain-gb-updated
hypest Jan 30, 2019
031de3f
Use fix for new post backgrounding
hypest Jan 30, 2019
c1beff4
Move callbacks closer to Gutenberg fragment
hypest Jan 30, 2019
9dfbeae
Revert access modifiers to private
hypest Jan 30, 2019
0e2237f
Access the retained container directly
hypest Feb 1, 2019
487fe2b
Merge branch 'develop' into gb/contain-and-retain-gb
hypest Feb 1, 2019
2b852d4
Fix merge conflicts
hypest Feb 1, 2019
53c1fcf
Rename variable and add comment about it
hypest Feb 4, 2019
7013eaa
Update gutenberg-mobile ref
hypest Feb 5, 2019
c6dee6a
Use Aztec with no-autofocus option
hypest Feb 5, 2019
ea19f07
Merge branch 'develop' into gb/contain-and-retain-gb
hypest Feb 5, 2019
251e109
Update gutenberg-mobile ref
hypest Feb 5, 2019
0044147
Update to merged Aztec commit
hypest Feb 5, 2019
ec9f0a8
Update to merged gutenberg-mobile hash
hypest Feb 5, 2019
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
Merge branch 'develop' into gb/contain-and-retain-gb
  • Loading branch information
hypest committed Jan 23, 2019
commit 1f5cb4c7f2b7ab2cfa41f2c4717bbd72214938f8
1 change: 1 addition & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* Fixed a bug causing disappearance of old saved posts
* Add Importing from Giphy in Editor and Media Library
* Add support for .blog subdomains on new sites.
* First version of the refreshed stats project - all tabs and all the blocks are completely rewritten in new design
Expand Down
4 changes: 2 additions & 2 deletions WordPress/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ android {

defaultConfig {
applicationId "org.wordpress.android"
versionName "alpha-148"
versionCode 669
versionName "alpha-149"
versionCode 671
minSdkVersion 21
targetSdkVersion 26

Expand Down
2 changes: 1 addition & 1 deletion WordPress/metadata/PlayStoreStrings.po
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ msgid ""
"* The Notifications list layout is more readable, as is the Me tab on tablets and large devices.\n"
"* New privacy settings let you remove of geolocation from uploaded images.\n"
"* Better messaging when there is no data to show in the stats screen adds clarity.\n"
"* There was an issue where only admins of self-hosted sites could update their password. Now all users can.\n"
"* There was an issue where some users of self-hosted sites couldn’t update their password. Now all users can.\n"
msgstr ""

msgctxt "release_note_115"
Expand Down
2 changes: 1 addition & 1 deletion WordPress/metadata/release_notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
* The Notifications list layout is more readable, as is the Me tab on tablets and large devices.
* New privacy settings let you remove of geolocation from uploaded images.
* Better messaging when there is no data to show in the stats screen adds clarity.
* There was an issue where only admins of self-hosted sites could update their password. Now all users can.
* There was an issue where some users of self-hosted sites couldn’t update their password. Now all users can.
4 changes: 3 additions & 1 deletion WordPress/src/main/java/org/wordpress/android/WordPress.java
Original file line number Diff line number Diff line change
Expand Up @@ -591,11 +591,13 @@ public static String getDefaultUserAgent() {
if (mDefaultUserAgent == null) {
try {
mDefaultUserAgent = WebSettings.getDefaultUserAgent(getContext());
} catch (AndroidRuntimeException | NullPointerException e) {
} catch (AndroidRuntimeException | NullPointerException | IllegalArgumentException e) {
// Catch AndroidRuntimeException that could be raised by the WebView() constructor.
// See https://github.com/wordpress-mobile/WordPress-Android/issues/3594
// Catch NullPointerException that could be raised by WebSettings.getDefaultUserAgent()
// See https://github.com/wordpress-mobile/WordPress-Android/issues/3838
// Catch IllegalArgumentException that could be raised by WebSettings.getDefaultUserAgent()
// See https://github.com/wordpress-mobile/WordPress-Android/issues/9015

// init with the empty string, it's a rare issue
mDefaultUserAgent = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,11 @@ private static int purgePostsForTag(SQLiteDatabase db, ReaderTag tag) {
if (numPosts <= MAX_POSTS_PER_TAG) {
return 0;
}

String[] args = {tag.getTagSlug(), Integer.toString(tag.tagType.toInt()), Integer.toString(MAX_POSTS_PER_TAG)};
String where = "pseudo_id NOT IN (SELECT DISTINCT pseudo_id FROM tbl_posts WHERE tag_name=? AND "
+ "tag_type=? ORDER BY " + getSortColumnForTag(tag) + " DESC LIMIT ?)";
String tagName = tag.getTagSlug();
String tagType = Integer.toString(tag.tagType.toInt());
String[] args = {tagName, tagType, tagName, tagType, Integer.toString(MAX_POSTS_PER_TAG)};
String where = "tag_name=? AND tag_type=? AND pseudo_id NOT IN (SELECT DISTINCT pseudo_id FROM tbl_posts WHERE "
+ "tag_name=? AND tag_type=? ORDER BY " + getSortColumnForTag(tag) + " DESC LIMIT ?)";
int numDeleted = db.delete("tbl_posts", where, args);
AppLog.d(AppLog.T.READER,
String.format(Locale.ENGLISH, "reader post table > purged %d posts in tag %s", numDeleted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,18 @@ import org.wordpress.android.ui.stats.refresh.lists.sections.granular.MonthsList
import org.wordpress.android.ui.stats.refresh.lists.sections.granular.WeeksListViewModel
import org.wordpress.android.ui.stats.refresh.lists.sections.granular.YearsListViewModel
import org.wordpress.android.ui.stats.refresh.lists.sections.insights.InsightsListViewModel
import org.wordpress.android.ui.stats.refresh.utils.StatsDateFormatter
import org.wordpress.android.util.Event
import org.wordpress.android.util.ToastUtils
import org.wordpress.android.util.image.ImageManager
import org.wordpress.android.util.observeEvent
import java.util.Date
import javax.inject.Inject

class StatsListFragment : DaggerFragment() {
@Inject lateinit var viewModelFactory: ViewModelProvider.Factory
@Inject lateinit var imageManager: ImageManager
@Inject lateinit var statsDateFormatter: StatsDateFormatter
private lateinit var viewModel: StatsListViewModel

private var layoutManager: LayoutManager? = null
Expand Down Expand Up @@ -186,7 +189,7 @@ class StatsListFragment : DaggerFragment() {
is ViewPostDetailStats -> {
val postModel = StatsPostModel(
site.siteId,
it.postId.toString(),
it.postId,
it.postTitle,
it.postUrl,
it.postType
Expand All @@ -213,55 +216,55 @@ class StatsListFragment : DaggerFragment() {
activity,
site,
it.statsGranularity.toStatsTimeFrame(),
it.selectedDate
statsDateFormatter.printStatsDate(it.selectedDate)
)
}
is ViewReferrers -> {
ActivityLauncher.viewReferrersStats(
activity,
site,
it.statsGranularity.toStatsTimeFrame(),
it.selectedDate
statsDateFormatter.printStatsDate(it.selectedDate)
)
}
is ViewClicks -> {
ActivityLauncher.viewClicksStats(
activity,
site,
it.statsGranularity.toStatsTimeFrame(),
it.selectedDate
statsDateFormatter.printStatsDate(it.selectedDate)
)
}
is ViewCountries -> {
ActivityLauncher.viewCountriesStats(
activity,
site,
it.statsGranularity.toStatsTimeFrame(),
it.selectedDate
statsDateFormatter.printStatsDate(it.selectedDate)
)
}
is ViewVideoPlays -> {
ActivityLauncher.viewVideoPlays(
activity,
site,
it.statsGranularity.toStatsTimeFrame(),
it.selectedDate
statsDateFormatter.printStatsDate(it.selectedDate)
)
}
is ViewSearchTerms -> {
ActivityLauncher.viewSearchTerms(
activity,
site,
it.statsGranularity.toStatsTimeFrame(),
it.selectedDate
statsDateFormatter.printStatsDate(it.selectedDate)
)
}
is ViewAuthors -> {
ActivityLauncher.viewAuthorsStats(
activity,
site,
it.statsGranularity.toStatsTimeFrame(),
it.selectedDate
statsDateFormatter.printStatsDate(it.selectedDate)
)
}
is ViewUrl -> {
Expand Down Expand Up @@ -294,9 +297,9 @@ sealed class NavigationTarget : Event() {

data class SharePost(val url: String, val title: String) : NavigationTarget()
data class ViewPostDetailStats(
val postId: Long,
val postId: String,
val postTitle: String,
val postUrl: String,
val postUrl: String?,
val postType: String = StatsConstants.ITEM_TYPE_POST
) : NavigationTarget()

Expand All @@ -305,13 +308,13 @@ sealed class NavigationTarget : Event() {
class ViewTagsAndCategoriesStats : NavigationTarget()
class ViewPublicizeStats : NavigationTarget()
data class ViewTag(val link: String) : NavigationTarget()
data class ViewPostsAndPages(val statsGranularity: StatsGranularity, val selectedDate: String) : NavigationTarget()
data class ViewReferrers(val statsGranularity: StatsGranularity, val selectedDate: String) : NavigationTarget()
data class ViewClicks(val statsGranularity: StatsGranularity, val selectedDate: String) : NavigationTarget()
data class ViewCountries(val statsGranularity: StatsGranularity, val selectedDate: String) : NavigationTarget()
data class ViewVideoPlays(val statsGranularity: StatsGranularity, val selectedDate: String) : NavigationTarget()
data class ViewSearchTerms(val statsGranularity: StatsGranularity, val selectedDate: String) : NavigationTarget()
data class ViewAuthors(val statsGranularity: StatsGranularity, val selectedDate: String) : NavigationTarget()
data class ViewPostsAndPages(val statsGranularity: StatsGranularity, val selectedDate: Date) : NavigationTarget()
data class ViewReferrers(val statsGranularity: StatsGranularity, val selectedDate: Date) : NavigationTarget()
data class ViewClicks(val statsGranularity: StatsGranularity, val selectedDate: Date) : NavigationTarget()
data class ViewCountries(val statsGranularity: StatsGranularity, val selectedDate: Date) : NavigationTarget()
data class ViewVideoPlays(val statsGranularity: StatsGranularity, val selectedDate: Date) : NavigationTarget()
data class ViewSearchTerms(val statsGranularity: StatsGranularity, val selectedDate: Date) : NavigationTarget()
data class ViewAuthors(val statsGranularity: StatsGranularity, val selectedDate: Date) : NavigationTarget()
data class ViewUrl(val url: String) : NavigationTarget()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ import org.wordpress.android.fluxc.network.utils.StatsGranularity
import org.wordpress.android.fluxc.store.StatsStore.TimeStatsTypes.AUTHORS
import org.wordpress.android.fluxc.store.stats.time.AuthorsStore
import org.wordpress.android.modules.UI_THREAD
import org.wordpress.android.ui.stats.StatsConstants
import org.wordpress.android.ui.stats.refresh.lists.NavigationTarget.ViewAuthors
import org.wordpress.android.ui.stats.refresh.lists.NavigationTarget.ViewUrl
import org.wordpress.android.ui.stats.refresh.lists.NavigationTarget.ViewPostDetailStats
import org.wordpress.android.ui.stats.refresh.lists.sections.BlockListItem
import org.wordpress.android.ui.stats.refresh.lists.sections.BlockListItem.Divider
import org.wordpress.android.ui.stats.refresh.lists.sections.BlockListItem.Empty
Expand All @@ -26,11 +27,10 @@ import org.wordpress.android.ui.stats.refresh.lists.sections.granular.GranularSt
import org.wordpress.android.ui.stats.refresh.lists.sections.granular.SelectedDateProvider
import org.wordpress.android.ui.stats.refresh.lists.sections.granular.UseCaseFactory
import org.wordpress.android.ui.stats.refresh.lists.sections.granular.usecases.AuthorsUseCase.SelectedAuthor
import org.wordpress.android.ui.stats.refresh.utils.StatsDateFormatter
import org.wordpress.android.ui.stats.refresh.utils.toFormattedString
import java.util.Date
import org.wordpress.android.ui.stats.refresh.utils.trackGranular
import org.wordpress.android.util.analytics.AnalyticsTrackerWrapper
import java.util.Date
import javax.inject.Inject
import javax.inject.Named

Expand All @@ -42,7 +42,6 @@ constructor(
@Named(UI_THREAD) private val mainDispatcher: CoroutineDispatcher,
private val authorsStore: AuthorsStore,
selectedDateProvider: SelectedDateProvider,
private val statsDateFormatter: StatsDateFormatter,
private val analyticsTracker: AnalyticsTrackerWrapper
) : GranularStatefulUseCase<AuthorsModel, SelectedAuthor>(
AUTHORS,
Expand Down Expand Up @@ -110,7 +109,10 @@ constructor(
text = post.title,
value = post.views.toFormattedString(),
showDivider = false,
navigationAction = post.url?.let { create(it, this::onPostClicked) }
navigationAction = create(
PostClickParams(post.id, post.url, post.title),
this::onPostClicked
)
)
})
items.add(Divider)
Expand All @@ -132,22 +134,34 @@ constructor(

private fun onViewMoreClicked(statsGranularity: StatsGranularity) {
analyticsTracker.trackGranular(AnalyticsTracker.Stat.STATS_AUTHORS_VIEW_MORE_TAPPED, statsGranularity)
navigateTo(ViewAuthors(statsGranularity, statsDateFormatter.todaysDateInStatsFormat()))
navigateTo(ViewAuthors(statsGranularity, selectedDateProvider.getSelectedDate(statsGranularity) ?: Date()))
}

private fun onPostClicked(url: String) {
private fun onPostClicked(params: PostClickParams) {
analyticsTracker.trackGranular(AnalyticsTracker.Stat.STATS_AUTHORS_VIEW_POST_TAPPED, statsGranularity)
navigateTo(ViewUrl(url))
navigateTo(
ViewPostDetailStats(
postId = params.postId,
postTitle = params.postTitle,
postUrl = params.postUrl,
postType = StatsConstants.ITEM_TYPE_POST
)
)
}

data class SelectedAuthor(val author: AuthorsModel.Author? = null)

private data class PostClickParams(
val postId: String,
val postUrl: String?,
val postTitle: String
)

class AuthorsUseCaseFactory
@Inject constructor(
@Named(UI_THREAD) private val mainDispatcher: CoroutineDispatcher,
private val authorsStore: AuthorsStore,
private val selectedDateProvider: SelectedDateProvider,
private val statsDateFormatter: StatsDateFormatter,
private val analyticsTracker: AnalyticsTrackerWrapper
) : UseCaseFactory {
override fun build(granularity: StatsGranularity) =
Expand All @@ -156,7 +170,6 @@ constructor(
mainDispatcher,
authorsStore,
selectedDateProvider,
statsDateFormatter,
analyticsTracker
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ import org.wordpress.android.ui.stats.refresh.lists.sections.granular.GranularSt
import org.wordpress.android.ui.stats.refresh.lists.sections.granular.SelectedDateProvider
import org.wordpress.android.ui.stats.refresh.lists.sections.granular.UseCaseFactory
import org.wordpress.android.ui.stats.refresh.lists.sections.granular.usecases.ClicksUseCase.SelectedClicksGroup
import org.wordpress.android.ui.stats.refresh.utils.StatsDateFormatter
import org.wordpress.android.ui.stats.refresh.utils.toFormattedString
import java.util.Date
import org.wordpress.android.ui.stats.refresh.utils.trackGranular
import org.wordpress.android.util.analytics.AnalyticsTrackerWrapper
import java.util.Date
import javax.inject.Inject
import javax.inject.Named

Expand All @@ -42,7 +41,6 @@ constructor(
@Named(UI_THREAD) private val mainDispatcher: CoroutineDispatcher,
private val store: ClicksStore,
selectedDateProvider: SelectedDateProvider,
private val statsDateFormatter: StatsDateFormatter,
private val analyticsTracker: AnalyticsTrackerWrapper
) : GranularStatefulUseCase<ClicksModel, SelectedClicksGroup>(
CLICKS,
Expand Down Expand Up @@ -133,7 +131,7 @@ constructor(

private fun onViewMoreClick(statsGranularity: StatsGranularity) {
analyticsTracker.trackGranular(AnalyticsTracker.Stat.STATS_CLICKS_VIEW_MORE_TAPPED, statsGranularity)
navigateTo(ViewClicks(statsGranularity, statsDateFormatter.todaysDateInStatsFormat()))
navigateTo(ViewClicks(statsGranularity, selectedDateProvider.getSelectedDate(statsGranularity) ?: Date()))
}

private fun onItemClick(url: String) {
Expand All @@ -148,7 +146,6 @@ constructor(
@Named(UI_THREAD) private val mainDispatcher: CoroutineDispatcher,
private val store: ClicksStore,
private val selectedDateProvider: SelectedDateProvider,
private val statsDateFormatter: StatsDateFormatter,
private val analyticsTracker: AnalyticsTrackerWrapper
) : UseCaseFactory {
override fun build(granularity: StatsGranularity) =
Expand All @@ -157,7 +154,6 @@ constructor(
mainDispatcher,
store,
selectedDateProvider,
statsDateFormatter,
analyticsTracker
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ import org.wordpress.android.ui.stats.refresh.lists.sections.BlockListItem.Title
import org.wordpress.android.ui.stats.refresh.lists.sections.granular.GranularStatelessUseCase
import org.wordpress.android.ui.stats.refresh.lists.sections.granular.SelectedDateProvider
import org.wordpress.android.ui.stats.refresh.lists.sections.granular.UseCaseFactory
import org.wordpress.android.ui.stats.refresh.utils.StatsDateFormatter
import org.wordpress.android.ui.stats.refresh.utils.toFormattedString
import java.util.Date
import org.wordpress.android.ui.stats.refresh.utils.trackGranular
import org.wordpress.android.util.analytics.AnalyticsTrackerWrapper
import java.util.Date
import javax.inject.Inject
import javax.inject.Named

Expand All @@ -38,7 +37,6 @@ constructor(
@Named(UI_THREAD) private val mainDispatcher: CoroutineDispatcher,
private val store: CountryViewsStore,
selectedDateProvider: SelectedDateProvider,
private val statsDateFormatter: StatsDateFormatter,
private val analyticsTracker: AnalyticsTrackerWrapper
) : GranularStatelessUseCase<CountryViewsModel>(COUNTRIES, mainDispatcher, selectedDateProvider, statsGranularity) {
override fun buildLoadingItem(): List<BlockListItem> = listOf(Title(R.string.stats_countries))
Expand Down Expand Up @@ -109,15 +107,14 @@ constructor(

private fun onViewMoreClick(statsGranularity: StatsGranularity) {
analyticsTracker.trackGranular(AnalyticsTracker.Stat.STATS_COUNTRIES_VIEW_MORE_TAPPED, statsGranularity)
navigateTo(ViewCountries(statsGranularity, statsDateFormatter.todaysDateInStatsFormat()))
navigateTo(ViewCountries(statsGranularity, selectedDateProvider.getSelectedDate(statsGranularity) ?: Date()))
}

class CountryViewsUseCaseFactory
@Inject constructor(
@Named(UI_THREAD) private val mainDispatcher: CoroutineDispatcher,
private val store: CountryViewsStore,
private val selectedDateProvider: SelectedDateProvider,
private val statsDateFormatter: StatsDateFormatter,
private val analyticsTracker: AnalyticsTrackerWrapper
) : UseCaseFactory {
override fun build(granularity: StatsGranularity) =
Expand All @@ -126,7 +123,6 @@ constructor(
mainDispatcher,
store,
selectedDateProvider,
statsDateFormatter,
analyticsTracker
)
}
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.