Change horizontal spacing automatically
This commit is contained in:
parent
bb753f46c1
commit
02b4c9542c
@ -3,6 +3,7 @@ package de.danoeh.antennapod.fragment;
|
||||
import android.content.ClipData;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.LightingColorFilter;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
@ -47,9 +48,6 @@ import io.reactivex.MaybeOnSubscribe;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Document;
|
||||
|
||||
/**
|
||||
* Displays information about a feed.
|
||||
@ -71,6 +69,7 @@ public class FeedInfoFragment extends Fragment {
|
||||
private TextView txtvUrl;
|
||||
private TextView txtvAuthorHeader;
|
||||
private ImageView imgvBackground;
|
||||
private View header;
|
||||
private Menu optionsMenu;
|
||||
private ToolbarIconTintManager iconTintManager;
|
||||
|
||||
@ -124,6 +123,7 @@ public class FeedInfoFragment extends Fragment {
|
||||
txtvTitle = root.findViewById(R.id.txtvTitle);
|
||||
txtvAuthorHeader = root.findViewById(R.id.txtvAuthor);
|
||||
imgvBackground = root.findViewById(R.id.imgvBackground);
|
||||
header = root.findViewById(R.id.headerContainer);
|
||||
root.findViewById(R.id.butShowInfo).setVisibility(View.INVISIBLE);
|
||||
root.findViewById(R.id.butShowSettings).setVisibility(View.INVISIBLE);
|
||||
// https://github.com/bumptech/glide/issues/529
|
||||
@ -159,6 +159,13 @@ public class FeedInfoFragment extends Fragment {
|
||||
}, error -> Log.d(TAG, Log.getStackTraceString(error)), () -> { });
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfigurationChanged(Configuration newConfig) {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
int horizontalSpacing = (int) getResources().getDimension(R.dimen.additional_horizontal_spacing);
|
||||
header.setPadding(horizontalSpacing, header.getPaddingTop(), horizontalSpacing, header.getPaddingBottom());
|
||||
}
|
||||
|
||||
private void showFeed() {
|
||||
Log.d(TAG, "Language is " + feed.getLanguage());
|
||||
Log.d(TAG, "Author is " + feed.getAuthor());
|
||||
|
@ -2,6 +2,7 @@ package de.danoeh.antennapod.fragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.LightingColorFilter;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
@ -98,6 +99,7 @@ public class FeedItemlistFragment extends Fragment implements AdapterView.OnItem
|
||||
private TextView txtvAuthor;
|
||||
private ImageButton butShowInfo;
|
||||
private ImageButton butShowSettings;
|
||||
private View header;
|
||||
private Menu optionsMenu;
|
||||
private ToolbarIconTintManager iconTintManager;
|
||||
|
||||
@ -155,6 +157,7 @@ public class FeedItemlistFragment extends Fragment implements AdapterView.OnItem
|
||||
butShowSettings = root.findViewById(R.id.butShowSettings);
|
||||
txtvInformation = root.findViewById(R.id.txtvInformation);
|
||||
txtvFailure = root.findViewById(R.id.txtvFailure);
|
||||
header = root.findViewById(R.id.headerContainer);
|
||||
AppBarLayout appBar = root.findViewById(R.id.appBar);
|
||||
CollapsingToolbarLayout collapsingToolbar = root.findViewById(R.id.collapsing_toolbar);
|
||||
|
||||
@ -245,6 +248,13 @@ public class FeedItemlistFragment extends Fragment implements AdapterView.OnItem
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfigurationChanged(Configuration newConfig) {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
int horizontalSpacing = (int) getResources().getDimension(R.dimen.additional_horizontal_spacing);
|
||||
header.setPadding(horizontalSpacing, header.getPaddingTop(), horizontalSpacing, header.getPaddingBottom());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
if (!super.onOptionsItemSelected(item)) {
|
||||
|
@ -2,6 +2,7 @@ package de.danoeh.antennapod.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Configuration;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import androidx.appcompat.view.ContextThemeWrapper;
|
||||
@ -39,6 +40,14 @@ public class EpisodeItemListRecyclerView extends RecyclerView {
|
||||
setLayoutManager(layoutManager);
|
||||
setHasFixedSize(true);
|
||||
addItemDecoration(new HorizontalDividerItemDecoration.Builder(getContext()).build());
|
||||
setClipToPadding(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onConfigurationChanged(Configuration newConfig) {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
int horizontalSpacing = (int) getResources().getDimension(R.dimen.additional_horizontal_spacing);
|
||||
setPadding(horizontalSpacing, getPaddingTop(), horizontalSpacing, getPaddingBottom());
|
||||
}
|
||||
|
||||
public void saveScrollPosition(String tag) {
|
||||
|
@ -23,7 +23,6 @@
|
||||
android:layout_below="@+id/txtvInformation"
|
||||
android:layout_marginTop="0dp"
|
||||
android:layout_marginBottom="0dp"
|
||||
android:clipToPadding="false"
|
||||
android:paddingTop="@dimen/list_vertical_padding"
|
||||
android:paddingBottom="@dimen/list_vertical_padding"
|
||||
android:paddingHorizontal="@dimen/additional_horizontal_spacing"
|
||||
|
@ -53,7 +53,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingHorizontal="@dimen/additional_horizontal_spacing"
|
||||
android:clipToPadding="false"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
|
||||
<ProgressBar
|
||||
|
@ -5,7 +5,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingHorizontal="@dimen/additional_horizontal_spacing"
|
||||
android:id="@+id/headerContainer"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
|
@ -37,7 +37,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingHorizontal="@dimen/additional_horizontal_spacing"
|
||||
android:clipToPadding="false"
|
||||
android:layout_below="@id/divider" />
|
||||
|
||||
<ProgressBar
|
||||
|
@ -37,7 +37,6 @@
|
||||
android:layout_marginTop="-4dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingHorizontal="@dimen/additional_horizontal_spacing"
|
||||
android:clipToPadding="false"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
</RelativeLayout>
|
||||
|
@ -16,8 +16,7 @@
|
||||
android:layout_height="match_parent"
|
||||
android:paddingHorizontal="@dimen/additional_horizontal_spacing"
|
||||
android:layout_below="@id/toolbar"
|
||||
android:id="@+id/recyclerView"
|
||||
android:clipToPadding="false"/>
|
||||
android:id="@+id/recyclerView"/>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progLoading"
|
||||
|
Loading…
x
Reference in New Issue
Block a user