some changes

This commit is contained in:
Thomas 2022-09-12 16:08:57 +02:00
parent 16de400fc1
commit ca6025f14b
3 changed files with 13 additions and 3 deletions

View File

@ -116,8 +116,9 @@ public class ReorderTimelinesActivity extends BaseActivity implements OnStartDra
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(ReorderTimelinesActivity.this); SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(ReorderTimelinesActivity.this);
boolean singleBar = sharedpreferences.getBoolean(getString(R.string.SET_USE_SINGLE_TOPBAR), false); boolean singleBar = sharedpreferences.getBoolean(getString(R.string.SET_USE_SINGLE_TOPBAR), false);
if (singleBar) { if (singleBar) {
binding.titleTop.setVisibility(View.GONE); binding.titleBottom.setVisibility(View.GONE);
binding.lvReorderBottom.setVisibility(View.GONE); binding.lvReorderBottom.setVisibility(View.GONE);
binding.titleTop.setVisibility(View.GONE);
} }
changes = false; changes = false;
bottomChanges = false; bottomChanges = false;

View File

@ -25,6 +25,7 @@ import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import android.text.Editable; import android.text.Editable;
import android.text.TextWatcher; import android.text.TextWatcher;
import android.util.TypedValue;
import android.view.ContextThemeWrapper; import android.view.ContextThemeWrapper;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu; import android.view.Menu;
@ -98,13 +99,21 @@ public class PinnedTimelineHelper {
} }
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(activity); SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(activity);
boolean singleBar = sharedpreferences.getBoolean(activity.getString(R.string.SET_USE_SINGLE_TOPBAR), false); boolean singleBar = sharedpreferences.getBoolean(activity.getString(R.string.SET_USE_SINGLE_TOPBAR), false);
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) activityMainBinding.viewPager.getLayoutParams();
//Hiding/Showing bottom menu depending of settings //Hiding/Showing bottom menu depending of settings
if (singleBar) { if (singleBar) {
activityMainBinding.bottomNavView.setVisibility(View.GONE); activityMainBinding.bottomNavView.setVisibility(View.GONE);
params.setMargins(0, 0, 0, 0);
} else { } else {
TypedValue tv = new TypedValue();
activityMainBinding.bottomNavView.setVisibility(View.VISIBLE); activityMainBinding.bottomNavView.setVisibility(View.VISIBLE);
if (activity.getTheme().resolveAttribute(R.attr.actionBarSize, tv, true)) {
int actionBarHeight = TypedValue.complexToDimensionPixelSize(tv.data, activity.getResources().getDisplayMetrics());
params.setMargins(0, 0, 0, actionBarHeight);
} }
}
activityMainBinding.viewPager.setLayoutParams(params);
List<PinnedTimeline> pinnedTimelines = pinned.pinnedTimelines; List<PinnedTimeline> pinnedTimelines = pinned.pinnedTimelines;
if (!singleBar) { if (!singleBar) {

View File

@ -121,7 +121,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:layout_marginBottom="?actionBarSize"></androidx.coordinatorlayout.widget.CoordinatorLayout> android:layout_marginBottom="?actionBarSize" />
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>
<com.google.android.material.navigation.NavigationView <com.google.android.material.navigation.NavigationView