Browse Source

Fix some bottom nav bar related issues. Check description.

1. Fixed inconsistent bottom bar hiding. Since currently bottom bar cannot hide with motionlayout, keep bottom bar visible.
2. Remove unnecessary padding in location and hashtag fragment.
3. Fix the last item in more preference screen hidden under bottom bar.
renovate/org.robolectric-robolectric-4.x
Ammar Githam 4 years ago
parent
commit
1ede8ad4bf
  1. 18
      app/src/main/java/awais/instagrabber/fragments/settings/MorePreferencesFragment.java
  2. 4
      app/src/main/res/layout/activity_main.xml
  3. 2
      app/src/main/res/layout/fragment_discover.xml
  4. 1
      app/src/main/res/layout/fragment_hashtag.xml
  5. 1
      app/src/main/res/layout/fragment_location.xml

18
app/src/main/java/awais/instagrabber/fragments/settings/MorePreferencesFragment.java

@ -4,8 +4,11 @@ import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import androidx.annotation.NonNull;
@ -19,6 +22,7 @@ import androidx.preference.Preference;
import androidx.preference.PreferenceCategory;
import androidx.preference.PreferenceScreen;
import androidx.preference.PreferenceViewHolder;
import androidx.recyclerview.widget.RecyclerView;
import java.util.List;
@ -53,6 +57,20 @@ public class MorePreferencesFragment extends BasePreferencesFragment {
public MorePreferencesFragment() {
}
@Override
public RecyclerView onCreateRecyclerView(final LayoutInflater inflater, final ViewGroup parent, final Bundle savedInstanceState) {
final RecyclerView recyclerView = super.onCreateRecyclerView(inflater, parent, savedInstanceState);
final Context context = getContext();
if (recyclerView != null && context != null) {
recyclerView.setClipToPadding(false);
recyclerView.setPadding(recyclerView.getPaddingLeft(),
recyclerView.getPaddingTop(),
recyclerView.getPaddingRight(),
Utils.getActionBarHeight(context));
}
return recyclerView;
}
@Override
void setupPreferenceScreen(final PreferenceScreen screen) {
final String cookie = settingsHelper.getString(Constants.COOKIE);

4
app/src/main/res/layout/activity_main.xml

@ -64,11 +64,11 @@
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<!--app:layout_behavior="@string/hide_bottom_view_on_scroll_behavior"-->
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bottomNavView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
app:labelVisibilityMode="auto"
app:layout_behavior="@string/hide_bottom_view_on_scroll_behavior" />
app:labelVisibilityMode="auto" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

2
app/src/main/res/layout/fragment_discover.xml

@ -11,7 +11,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:paddingBottom="?attr/actionBarSize"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<androidx.recyclerview.widget.RecyclerView
@ -19,6 +18,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:paddingBottom="?actionBarSize"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:spanCount="2"
tools:itemCount="10"

1
app/src/main/res/layout/fragment_hashtag.xml

@ -19,7 +19,6 @@
android:layout_width="match_parent"
android:layout_height="0dp"
android:clipToPadding="false"
android:paddingBottom="?attr/actionBarSize"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/header">

1
app/src/main/res/layout/fragment_location.xml

@ -19,7 +19,6 @@
android:layout_width="match_parent"
android:layout_height="0dp"
android:clipToPadding="false"
android:paddingBottom="?attr/actionBarSize"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/header">

Loading…
Cancel
Save