Merge branch 'androidx' of https://github.com/owncloud/News-Android-App into androidx

This commit is contained in:
David Luhmer 2019-04-05 14:50:07 -03:00
commit aef30d46a4
4 changed files with 7 additions and 5 deletions

View file

@ -26,7 +26,6 @@ import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import androidx.appcompat.widget.ViewUtils;
import android.util.Log; import android.util.Log;
import android.util.SparseArray; import android.util.SparseArray;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -45,6 +44,7 @@ import android.widget.TextView;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import androidx.core.view.ViewCompat;
import butterknife.BindView; import butterknife.BindView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import de.luhmer.owncloudnewsreader.R; import de.luhmer.owncloudnewsreader.R;
@ -333,7 +333,7 @@ public class SubscriptionExpandableListAdapter extends BaseExpandableListAdapter
rotation = 180; rotation = 180;
contentDescriptionId = R.string.content_desc_collapse; contentDescriptionId = R.string.content_desc_collapse;
} else { } else {
if (ViewUtils.isLayoutRtl(listView)) { if (ViewCompat.getLayoutDirection(listView) == ViewCompat.LAYOUT_DIRECTION_RTL) {
rotation = -90; // mirror for rtl layout rotation = -90; // mirror for rtl layout
} else { } else {
rotation = 90; rotation = 90;

View file

@ -289,7 +289,7 @@ public class NewsReaderDetailFragment extends Fragment {
ButterKnife.bind(this, rootView); ButterKnife.bind(this, rootView);
recyclerView.setHasFixedSize(true); recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false)); recyclerView.setLayoutManager(new LinearLayoutManager(getActivity(), RecyclerView.VERTICAL, false));
recyclerView.setItemAnimator(new DefaultItemAnimator()); recyclerView.setItemAnimator(new DefaultItemAnimator());
ItemTouchHelper itemTouchHelper = new ItemTouchHelper(new NewsReaderItemTouchHelperCallback()); ItemTouchHelper itemTouchHelper = new ItemTouchHelper(new NewsReaderItemTouchHelperCallback());

View file

@ -41,7 +41,7 @@ public class DividerItemDecoration extends RecyclerView.ItemDecoration {
return; return;
if (!(parent.getLayoutManager() instanceof LinearLayoutManager) || if (!(parent.getLayoutManager() instanceof LinearLayoutManager) ||
((LinearLayoutManager)parent.getLayoutManager()).getOrientation() != LinearLayoutManager.VERTICAL) { ((LinearLayoutManager)parent.getLayoutManager()).getOrientation() != RecyclerView.VERTICAL) {
throw new IllegalStateException( throw new IllegalStateException(
"DividerItemDecoration can only be used with a vertical LinearLayoutManager."); "DividerItemDecoration can only be used with a vertical LinearLayoutManager.");
} }

View file

@ -24,6 +24,8 @@ import android.util.AttributeSet;
import android.util.TypedValue; import android.util.TypedValue;
import android.widget.TextView; import android.widget.TextView;
import androidx.appcompat.widget.AppCompatTextView;
/** /**
* Text view that auto adjusts text size to fit within the view. * Text view that auto adjusts text size to fit within the view.
* If the text size equals the minimum text size and still does not * If the text size equals the minimum text size and still does not
@ -32,7 +34,7 @@ import android.widget.TextView;
* @author Chase Colburn * @author Chase Colburn
* @since Apr 4, 2011 * @since Apr 4, 2011
*/ */
public class AutoResizeTextView extends TextView { public class AutoResizeTextView extends AppCompatTextView {
// Minimum text size for this text view // Minimum text size for this text view
public static final float MIN_TEXT_SIZE = 20; public static final float MIN_TEXT_SIZE = 20;