Skip to content

Commit

Permalink
fixed merge conflicts with base branch
Browse files Browse the repository at this point in the history
  • Loading branch information
mzorz committed Oct 17, 2020
2 parents 27feee8 + 1a0933a commit 0a382ad
Show file tree
Hide file tree
Showing 145 changed files with 4,236 additions and 2,400 deletions.
5 changes: 5 additions & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
16.0
-----
* [*] Stats: Added the possibility to report and unreport a referrer as spam. [https://github.com/wordpress-mobile/WordPress-Android/pull/13047]
* [***] Block Editor: Full-width and wide alignment support for Video, Latest-posts, Gallery, Media & text, and Pullquote block. [https://github.com/wordpress-mobile/gutenberg-mobile/pull/2605]
* [***] Block Editor: Fix unsupported block bottom sheet is triggered when device is rotated. [https://github.com/wordpress-mobile/gutenberg-mobile/pull/2710]
* [***] Block Editor: Unsupported Block Editor: Fixed issue when cannot view or interact with the classic block on Jetpack site. [https://github.com/wordpress-mobile/gutenberg-mobile/pull/2709]
* [**] Reader: Allow users to access Reader even when they do not follow any tags/topics.
* [***] Reader: The new redesigned Reader detail shows your post as beautiful as ever. And if you add a featured image it would be twice as beautiful! [https://github.com/wordpress-mobile/WordPress-Android/pull/13151]

15.9
-----
Expand Down
3 changes: 1 addition & 2 deletions WordPress/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,7 @@
<activity
android:name=".ui.reader.ReaderPostPagerActivity"
android:excludeFromRecents="true"
android:label="@string/reader_title_deeplink"
android:theme="@style/WordPress.NoActionBar"
android:theme="@style/WordPress.NoActionBar.TranslucentStatus"
android:windowSoftInputMode="adjustResize" >
</activity>
<activity-alias
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
import org.wordpress.android.ui.reader.services.update.ReaderUpdateLogic;
import org.wordpress.android.ui.reader.views.ReaderExpandableTagsView;
import org.wordpress.android.ui.reader.views.ReaderLikingUsersView;
import org.wordpress.android.ui.reader.views.ReaderPostDetailHeaderView;
import org.wordpress.android.ui.reader.views.ReaderSiteHeaderView;
import org.wordpress.android.ui.reader.views.ReaderTagHeaderView;
import org.wordpress.android.ui.reader.views.ReaderWebView;
Expand All @@ -178,6 +179,7 @@
import org.wordpress.android.ui.stats.refresh.lists.widget.views.ViewsWidgetListProvider;
import org.wordpress.android.ui.stockmedia.StockMediaPickerActivity;
import org.wordpress.android.ui.stories.StoryComposerActivity;
import org.wordpress.android.ui.stories.intro.StoriesIntroDialogFragment;
import org.wordpress.android.ui.suggestion.adapters.SuggestionAdapter;
import org.wordpress.android.ui.themes.ThemeBrowserActivity;
import org.wordpress.android.ui.themes.ThemeBrowserFragment;
Expand Down Expand Up @@ -405,6 +407,8 @@ public interface AppComponent extends AndroidInjector<WordPress> {

void inject(ReaderTagHeaderView object);

void inject(ReaderPostDetailHeaderView object);

void inject(ReaderExpandableTagsView object);

void inject(ReaderLikingUsersView object);
Expand Down Expand Up @@ -555,6 +559,8 @@ public interface AppComponent extends AndroidInjector<WordPress> {

void inject(StoryComposerActivity object);

void inject(StoriesIntroDialogFragment object);

void inject(ReaderFragment object);

void inject(ReaderDiscoverFragment object);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.wordpress.android.ui.accounts.signup.UsernameChangerFullScreenDialogFragment;
import org.wordpress.android.ui.domains.DomainRegistrationDetailsFragment.CountryPickerDialogFragment;
import org.wordpress.android.ui.domains.DomainRegistrationDetailsFragment.StatePickerDialogFragment;
import org.wordpress.android.ui.mediapicker.loader.TenorGifClient;
import org.wordpress.android.ui.reader.ReaderPostWebViewCachingFragment;
import org.wordpress.android.ui.reader.subfilter.SubfilterPageFragment;
import org.wordpress.android.ui.sitecreation.SiteCreationStep;
Expand Down Expand Up @@ -121,10 +122,10 @@ static GifProvider provideGifProvider(Context context) {
}

@Provides
static IApiClient provideTenorClient(Context context) {
static TenorGifClient provideTenorGifClient(Context context) {
ApiService.IBuilder<IApiClient> builder = new ApiService.Builder<>(context, IApiClient.class);
builder.apiKey(BuildConfig.TENOR_API_KEY);
ApiClient.init(context, builder);
return ApiClient.getInstance(context);
return new TenorGifClient(context, ApiClient.getInstance(context));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.wordpress.android.ui.reader.discover.ReaderDiscoverViewModel;
import org.wordpress.android.ui.reader.discover.interests.ReaderInterestsViewModel;
import org.wordpress.android.ui.reader.subfilter.SubFilterViewModel;
import org.wordpress.android.ui.reader.viewmodels.ReaderPostDetailViewModel;
import org.wordpress.android.ui.reader.viewmodels.ReaderPostListViewModel;
import org.wordpress.android.ui.reader.viewmodels.ReaderViewModel;
import org.wordpress.android.ui.reader.viewmodels.SubfilterPageViewModel;
Expand All @@ -43,6 +44,7 @@
import org.wordpress.android.ui.stats.refresh.lists.widget.configuration.StatsWidgetConfigureViewModel;
import org.wordpress.android.ui.stats.refresh.lists.widget.minified.StatsMinifiedWidgetConfigureViewModel;
import org.wordpress.android.ui.stories.StoryComposerViewModel;
import org.wordpress.android.ui.stories.intro.StoriesIntroViewModel;
import org.wordpress.android.ui.whatsnew.FeatureAnnouncementViewModel;
import org.wordpress.android.util.config.manual.ManualFeatureConfigViewModel;
import org.wordpress.android.viewmodel.ViewModelFactory;
Expand Down Expand Up @@ -114,6 +116,11 @@ abstract class ViewModelModule {
@ViewModelKey(ReaderPostListViewModel.class)
abstract ViewModel readerPostListViewModel(ReaderPostListViewModel viewModel);

@Binds
@IntoMap
@ViewModelKey(ReaderPostDetailViewModel.class)
abstract ViewModel readerPostDetailViewModel(ReaderPostDetailViewModel viewModel);

@Binds
@IntoMap
@ViewModelKey(SubFilterViewModel.class)
Expand Down Expand Up @@ -369,6 +376,11 @@ abstract class ViewModelModule {
@ViewModelKey(StoryComposerViewModel.class)
abstract ViewModel storyComposerViewModel(StoryComposerViewModel viewModel);

@Binds
@IntoMap
@ViewModelKey(StoriesIntroViewModel.class)
abstract ViewModel storiesIntroViewModel(StoriesIntroViewModel viewModel);

@Binds
@IntoMap
@ViewModelKey(PhotoPickerViewModel.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -821,32 +821,57 @@ public static void editPageForResult(Intent intent, @NonNull Fragment fragment,
public static void addNewPageForResult(
@NonNull Activity activity,
@NonNull SiteModel site,
@NonNull String title,
@NonNull String content,
@Nullable String template,
@NonNull PagePostCreationSourcesDetail source
) {
Intent intent = new Intent(activity, EditPostActivity.class);
intent.putExtra(WordPress.SITE, site);
intent.putExtra(EditPostActivity.EXTRA_IS_PAGE, true);
intent.putExtra(EditPostActivity.EXTRA_IS_PREVIEW, false);
intent.putExtra(EditPostActivity.EXTRA_IS_PROMO, false);
intent.putExtra(EditPostActivity.EXTRA_PAGE_TITLE, title);
intent.putExtra(EditPostActivity.EXTRA_PAGE_CONTENT, content);
intent.putExtra(EditPostActivity.EXTRA_PAGE_TEMPLATE, template);
intent.putExtra(AnalyticsUtils.EXTRA_CREATION_SOURCE_DETAIL, source);
activity.startActivityForResult(intent, RequestCodes.EDIT_POST);
}

public static void addNewPageForResult(
@NonNull Fragment fragment,
@NonNull SiteModel site,
@NonNull String title,
@NonNull String content,
@Nullable String template,
@NonNull PagePostCreationSourcesDetail source) {
Intent intent = new Intent(fragment.getContext(), EditPostActivity.class);
intent.putExtra(WordPress.SITE, site);
intent.putExtra(EditPostActivity.EXTRA_IS_PAGE, true);
intent.putExtra(EditPostActivity.EXTRA_IS_PREVIEW, false);
intent.putExtra(EditPostActivity.EXTRA_IS_PROMO, false);
intent.putExtra(EditPostActivity.EXTRA_PAGE_TITLE, title);
intent.putExtra(EditPostActivity.EXTRA_PAGE_CONTENT, content);
intent.putExtra(EditPostActivity.EXTRA_PAGE_TEMPLATE, template);
intent.putExtra(AnalyticsUtils.EXTRA_CREATION_SOURCE_DETAIL, source);
fragment.startActivityForResult(intent, RequestCodes.EDIT_POST);
}

public static void previewPageForResult(
@NonNull Fragment fragment,
@NonNull SiteModel site,
@NonNull String content,
@Nullable String template) {
Intent intent = new Intent(fragment.getContext(), EditPostActivity.class);
intent.putExtra(WordPress.SITE, site);
intent.putExtra(EditPostActivity.EXTRA_IS_PAGE, true);
intent.putExtra(EditPostActivity.EXTRA_IS_PREVIEW, true);
intent.putExtra(EditPostActivity.EXTRA_IS_PROMO, false);
intent.putExtra(EditPostActivity.EXTRA_PAGE_CONTENT, content);
intent.putExtra(EditPostActivity.EXTRA_PAGE_TEMPLATE, template);
fragment.startActivityForResult(intent, RequestCodes.PREVIEW_POST);
}

public static void viewHistoryDetailForResult(Activity activity, Revision revision, List<Revision> revisions) {
Intent intent = new Intent(activity, HistoryDetailActivity.class);
intent.putExtra(HistoryDetailContainerFragment.EXTRA_REVISION, revision);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ private void showPost() {
AnalyticsUtils.trackWithBlogPostDetails(AnalyticsTracker.Stat.READER_VIEWPOST_INTERCEPTED,
blogId, postId);

ReaderActivityLauncher.showReaderPostDetail(this, false, blogId, postId, null, 0, false,
ReaderActivityLauncher.showReaderPostDetail(this, false, blogId, postId, null, 0,
mInterceptedUri);
} catch (NumberFormatException e) {
AppLog.e(T.READER, e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class RequestCodes {
public static final int STOCK_MEDIA_PICKER_SINGLE_SELECT = 1202;
public static final int STOCK_MEDIA_PICKER_SINGLE_SELECT_FOR_GUTENBERG_BLOCK = 1203;
public static final int STORIES_PHOTO_PICKER = 1204;
public static final int GIF_PICKER = 1205;
public static final int SHOW_LOGIN_EPILOGUE_AND_RETURN = 1300;
public static final int SHOW_SIGNUP_EPILOGUE_AND_RETURN = 1301;
public static final int SMART_LOCK_SAVE = 1400;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import org.wordpress.android.ui.RequestCodes
import org.wordpress.android.ui.accounts.HelpActivity.Origin.ME_SCREEN_HELP
import org.wordpress.android.ui.main.WPMainActivity.OnScrollToTopListener
import org.wordpress.android.ui.main.utils.MeGravatarLoader
import org.wordpress.android.ui.media.MediaBrowserType.GRAVATAR_IMAGE_PICKER
import org.wordpress.android.ui.photopicker.MediaPickerConstants
import org.wordpress.android.ui.photopicker.MediaPickerLauncher
import org.wordpress.android.ui.photopicker.PhotoPickerActivity.PhotoPickerMediaSource
Expand Down Expand Up @@ -375,7 +374,7 @@ class MeFragment : Fragment(), OnScrollToTopListener {
}

private fun showPhotoPickerForGravatar() {
mediaPickerLauncher.showPhotoPickerForResult(this, GRAVATAR_IMAGE_PICKER, null, null)
mediaPickerLauncher.showGravatarPicker(this)
}

private fun startCropActivity(uri: Uri) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ import org.wordpress.android.ui.domains.DomainRegistrationActivity.DomainRegistr
import org.wordpress.android.ui.domains.DomainRegistrationResultFragment
import org.wordpress.android.ui.main.WPMainActivity.OnScrollToTopListener
import org.wordpress.android.ui.main.utils.MeGravatarLoader
import org.wordpress.android.ui.media.MediaBrowserType.SITE_ICON_PICKER
import org.wordpress.android.ui.photopicker.MediaPickerConstants
import org.wordpress.android.ui.photopicker.MediaPickerLauncher
import org.wordpress.android.ui.photopicker.PhotoPickerActivity.PhotoPickerMediaSource
Expand Down Expand Up @@ -1227,9 +1226,9 @@ class MySiteFragment : Fragment(),

override fun onPositiveClicked(instanceTag: String) {
when (instanceTag) {
TAG_ADD_SITE_ICON_DIALOG, TAG_CHANGE_SITE_ICON_DIALOG -> mediaPickerLauncher.showPhotoPickerForResult(
TAG_ADD_SITE_ICON_DIALOG, TAG_CHANGE_SITE_ICON_DIALOG -> mediaPickerLauncher.showSiteIconPicker(
requireActivity(),
SITE_ICON_PICKER, selectedSite, null
selectedSite
)
TAG_EDIT_SITE_ICON_NOT_ALLOWED_DIALOG -> {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
import org.wordpress.android.ui.reader.services.update.ReaderUpdateLogic.UpdateTask;
import org.wordpress.android.ui.reader.services.update.ReaderUpdateServiceStarter;
import org.wordpress.android.ui.reader.tracker.ReaderTracker;
import org.wordpress.android.ui.stories.intro.StoriesIntroDialogFragment;
import org.wordpress.android.ui.uploads.UploadActionUseCase;
import org.wordpress.android.ui.uploads.UploadUtils;
import org.wordpress.android.ui.uploads.UploadUtilsWrapper;
Expand Down Expand Up @@ -440,7 +441,8 @@ private void initViewModel() {
if (mModalLayoutPickerFeatureConfig.isEnabled()) {
mMLPViewModel.createPageFlowTriggered();
} else {
handleNewPageAction(""/*empty page*/, PagePostCreationSourcesDetail.PAGE_FROM_MY_SITE);
handleNewPageAction("", "", null,
PagePostCreationSourcesDetail.PAGE_FROM_MY_SITE);
}
break;
case CREATE_NEW_STORY:
Expand All @@ -463,8 +465,9 @@ private void initViewModel() {
}
});

mMLPViewModel.getOnCreateNewPageRequested().observe(this, content -> {
handleNewPageAction(content, PagePostCreationSourcesDetail.PAGE_FROM_MY_SITE);
mMLPViewModel.getOnCreateNewPageRequested().observe(this, request -> {
handleNewPageAction(request.getTitle(), request.getContent(), request.getTemplate(),
PagePostCreationSourcesDetail.PAGE_FROM_MY_SITE);
});

mViewModel.getOnFeatureAnnouncementRequested().observe(this, action -> {
Expand Down Expand Up @@ -879,7 +882,8 @@ public void onNewPostButtonClicked() {
handleNewPostAction(PagePostCreationSourcesDetail.POST_FROM_NAV_BAR);
}

private void handleNewPageAction(String content, PagePostCreationSourcesDetail source) {
private void handleNewPageAction(String title, String content, String template,
PagePostCreationSourcesDetail source) {
if (!mSiteStore.hasSite()) {
// No site yet - Move to My Sites fragment that shows the create new site screen
mBottomNav.setCurrentSelectedPage(PageType.MY_SITE);
Expand All @@ -889,7 +893,7 @@ private void handleNewPageAction(String content, PagePostCreationSourcesDetail s
SiteModel site = getSelectedSite();
if (site != null) {
// TODO: evaluate to include the QuickStart logic like in the handleNewPostAction
ActivityLauncher.addNewPageForResult(this, site, content, source);
ActivityLauncher.addNewPageForResult(this, site, title, content, template, source);
}
}

Expand All @@ -912,12 +916,13 @@ private void handleNewStoryAction(PagePostCreationSourcesDetail source) {

SiteModel site = getSelectedSite();
if (site != null) {
AnalyticsTracker.track(AnalyticsTracker.Stat.MEDIA_PICKER_OPEN_FOR_STORIES);
// TODO: evaluate to include the QuickStart logic like in the handleNewPostAction
mMediaPickerLauncher.showStoriesPhotoPickerForResult(
this,
site
);
if (AppPrefs.shouldShowStoriesIntro()) {
StoriesIntroDialogFragment.newInstance(site)
.show(getSupportFragmentManager(), StoriesIntroDialogFragment.TAG);
} else {
mMediaPickerLauncher.showStoriesPhotoPickerForResultAndTrack(this, site);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) {
reloadMediaGrid();
}
break;
case RequestCodes.GIF_PICKER_SINGLE_SELECT:
case RequestCodes.GIF_PICKER_MULTI_SELECT:
if (resultCode == RESULT_OK
&& data.hasExtra(GifPickerActivity.KEY_SAVED_MEDIA_MODEL_LOCAL_IDS)) {
Expand Down Expand Up @@ -1019,7 +1020,6 @@ private void doAddMediaItemClicked(@NonNull AddMenuItem item) {
mMediaPickerLauncher.showGifPickerForResult(
this,
mSite,
RequestCodes.GIF_PICKER_MULTI_SELECT,
true
);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,15 +267,14 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
AppBarLayout appBarLayout = findViewById(R.id.app_bar_layout);
collapsingToolbar.setCollapsedTitleTextColor(
AppCompatResources.getColorStateList(this,
ContextExtensionsKt.getColorResIdFromAttribute(this, R.attr.colorOnPrimarySurface)));
ContextExtensionsKt.getColorResIdFromAttribute(this, R.attr.colorOnSurface)));

ElevationOverlayProvider elevationOverlayProvider = new ElevationOverlayProvider(this);

float appbarElevation = getResources().getDimension(R.dimen.appbar_elevation);
int elevatedColor = elevationOverlayProvider
.compositeOverlayIfNeeded(ContextExtensionsKt.getColorFromAttribute(this, R.attr.wpColorAppBar),
appbarElevation);

collapsingToolbar.setContentScrimColor(elevatedColor);

appBarLayout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
Expand Down
Loading

0 comments on commit 0a382ad

Please sign in to comment.