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

Update Gradle to 7.4.2 & AGP to 7.2.1 #16834

Merged
merged 12 commits into from
Jul 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.wordpress.android.ui.notifications.services;

import android.annotation.TargetApi;
import android.app.job.JobParameters;
import android.app.job.JobService;
import android.content.Context;
Expand All @@ -20,7 +19,6 @@ protected void attachBaseContext(Context newBase) {
super.attachBaseContext(LocaleManager.setLocale(newBase));
}

@TargetApi(22)
@Override
public boolean onStartJob(JobParameters params) {
String noteId = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package org.wordpress.android.ui.people;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.InsetDrawable;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
Expand All @@ -19,15 +15,14 @@
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.view.ViewCompat;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView.ViewHolder;

import com.google.android.material.appbar.AppBarLayout;

import org.apache.commons.text.StringEscapeUtils;
import org.jetbrains.annotations.NotNull;
import org.wordpress.android.R;
import org.wordpress.android.WordPress;
import org.wordpress.android.analytics.AnalyticsTracker;
Expand All @@ -47,7 +42,6 @@
import org.wordpress.android.util.AppLog;
import org.wordpress.android.util.GravatarUtils;
import org.wordpress.android.util.NetworkUtils;
import org.wordpress.android.util.RtlUtils;
import org.wordpress.android.util.image.ImageManager;
import org.wordpress.android.util.image.ImageType;

Expand Down Expand Up @@ -124,10 +118,11 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa

mActionableEmptyView = rootView.findViewById(R.id.actionable_empty_view);
mFilteredRecyclerView = rootView.findViewById(R.id.filtered_recycler_view);
mFilteredRecyclerView
.addItemDecoration(new PeopleItemDecoration(getActivity()));
mFilteredRecyclerView.setLogT(AppLog.T.PEOPLE);
mFilteredRecyclerView.setSwipeToRefreshEnabled(false);
mFilteredRecyclerView.addItemDecoration(
new DividerItemDecoration(mFilteredRecyclerView.getContext(), DividerItemDecoration.VERTICAL)
);

// the following will change the look and feel of the toolbar to match the current design
mFilteredRecyclerView.setToolbarLeftAndRightPadding(
Expand Down Expand Up @@ -478,44 +473,4 @@ public void onClick(View v) {
}
}
}

// Taken from http://stackoverflow.com/a/27037230
private class PeopleItemDecoration extends RecyclerView.ItemDecoration {
private InsetDrawable mDivider;

// use a custom drawable
PeopleItemDecoration(Context context) {
int[] attrs = {android.R.attr.listDivider};
TypedArray ta = context.obtainStyledAttributes(attrs);
Drawable drawable = ta.getDrawable(0);
ta.recycle();

int inset = context.getResources().getDimensionPixelOffset(R.dimen.people_list_divider_left_margin);

if (RtlUtils.isRtl(context)) {
mDivider = new InsetDrawable(drawable, 0, 0, inset, 0);
} else {
mDivider = new InsetDrawable(drawable, inset, 0, 0, 0);
}
}

@Override
public void onDraw(@NotNull Canvas c, @NotNull RecyclerView parent, @NotNull RecyclerView.State state) {
int left = ViewCompat.getPaddingStart(parent);
int right = parent.getWidth() - ViewCompat.getPaddingEnd(parent);

int childCount = parent.getChildCount();
for (int i = 0; i < childCount; i++) {
View child = parent.getChildAt(i);

RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();

int top = child.getBottom() + params.bottomMargin;
int bottom = top + mDivider.getIntrinsicHeight();

mDivider.setBounds(left, top, right, bottom);
mDivider.draw(c);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.wordpress.android.util.analytics.service;

import android.annotation.TargetApi;
import android.app.job.JobParameters;
import android.app.job.JobService;
import android.os.Bundle;
Expand All @@ -19,7 +18,6 @@
* https://developer.android.com/guide/components/broadcasts.html#receiving_broadcasts
* https://developer.android.com/guide/components/broadcasts#effects-on-process-state
*/
@TargetApi(21)
public class InstallationReferrerJobService extends JobService implements
InstallationReferrerServiceLogic.ServiceCompletionListener {
@Override
Expand Down
Loading