summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorflofriday <flohacksfriday@gmail.com>2024-07-01 12:25:36 +0200
committerGitHub <noreply@github.com>2024-07-01 12:25:36 +0200
commit2b7ed4055fbd01a1a6e3b956f4d3d3d137112ac7 (patch)
tree71393a5f2645fa4a9b4a403b7d0ce503d9b847d4
parente51b0a36950d54705c1de5d511d66efb246dace4 (diff)
downloadAntennaPod-2b7ed4055fbd01a1a6e3b956f4d3d3d137112ac7.zip
Improve search bar design on add podcast screen (#7249)
* Improve search bar design on add podcast screen The search bar now looks more up to date with modern android styles. * Fix colorPrimaryContainer in default color schemes The color should be usable as the background for containers with a tint of the accent color, but it was set to the full accent color. Now it is much more in line with how it should work.
-rw-r--r--app/src/main/java/de/danoeh/antennapod/ui/screen/AddFeedFragment.java6
-rw-r--r--app/src/main/res/layout/addfeed.xml100
-rw-r--r--ui/common/src/main/res/values/styles.xml10
3 files changed, 63 insertions, 53 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/ui/screen/AddFeedFragment.java b/app/src/main/java/de/danoeh/antennapod/ui/screen/AddFeedFragment.java
index 0b95fd601..bb882ad40 100644
--- a/app/src/main/java/de/danoeh/antennapod/ui/screen/AddFeedFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/ui/screen/AddFeedFragment.java
@@ -19,6 +19,8 @@ import androidx.activity.result.contract.ActivityResultContracts.GetContent;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
+
+import androidx.core.widget.NestedScrollView;
import androidx.documentfile.provider.DocumentFile;
import androidx.fragment.app.Fragment;
import com.google.android.material.snackbar.Snackbar;
@@ -39,6 +41,7 @@ import de.danoeh.antennapod.net.discovery.PodcastIndexPodcastSearcher;
import de.danoeh.antennapod.ui.appstartintent.OnlineFeedviewActivityStarter;
import de.danoeh.antennapod.ui.discovery.OnlineSearchFragment;
import de.danoeh.antennapod.ui.screen.feed.FeedItemlistFragment;
+import de.danoeh.antennapod.ui.view.LiftOnScrollListener;
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
@@ -77,6 +80,9 @@ public class AddFeedFragment extends Fragment {
}
((MainActivity) getActivity()).setupToolbarToggle(viewBinding.toolbar, displayUpArrow);
+ NestedScrollView scrollView = viewBinding.getRoot().findViewById(R.id.scrollView);
+ scrollView.setOnScrollChangeListener(new LiftOnScrollListener(viewBinding.appbar));
+
viewBinding.searchItunesButton.setOnClickListener(v
-> activity.loadChildFragment(OnlineSearchFragment.newInstance(ItunesPodcastSearcher.class)));
viewBinding.searchFyydButton.setOnClickListener(v
diff --git a/app/src/main/res/layout/addfeed.xml b/app/src/main/res/layout/addfeed.xml
index e402e0401..bc42aba05 100644
--- a/app/src/main/res/layout/addfeed.xml
+++ b/app/src/main/res/layout/addfeed.xml
@@ -10,8 +10,7 @@
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:fitsSystemWindows="true"
- android:elevation="0dp">
+ android:fitsSystemWindows="true">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
@@ -24,51 +23,8 @@
</com.google.android.material.appbar.AppBarLayout>
- <androidx.cardview.widget.CardView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="16dp"
- android:layout_marginRight="16dp"
- app:cardCornerRadius="8dp"
- app:cardElevation="4dp">
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal">
-
- <ImageView
- android:id="@+id/searchButton"
- android:layout_width="40dp"
- android:layout_height="match_parent"
- android:layout_marginLeft="8dp"
- android:layout_marginRight="8dp"
- android:contentDescription="@string/search_podcast_hint"
- android:scaleType="center"
- app:srcCompat="@drawable/ic_search" />
-
- <EditText
- android:id="@+id/combinedFeedSearchEditText"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:inputType="text"
- android:imeOptions="actionSearch"
- android:importantForAutofill="no"
- android:layout_marginStart="0dp"
- android:layout_marginLeft="0dp"
- android:layout_marginRight="8dp"
- android:layout_marginEnd="8dp"
- android:paddingTop="16dp"
- android:paddingBottom="16dp"
- android:hint="@string/search_podcast_hint"
- android:background="@null" />
-
- </LinearLayout>
-
- </androidx.cardview.widget.CardView>
-
- <ScrollView
+ <androidx.core.widget.NestedScrollView
+ android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
@@ -78,7 +34,53 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
- android:padding="16dp">
+ android:paddingHorizontal="16dp"
+ android:paddingBottom="16dp">
+
+ <androidx.cardview.widget.CardView
+ android:layout_width="match_parent"
+ android:layout_height="56dp"
+ android:layout_marginTop="8dp"
+ app:cardCornerRadius="28dp"
+ app:cardElevation="0dp">
+
+ <LinearLayout
+ android:id="@+id/searchbar"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:background="?attr/colorPrimaryContainer">
+
+ <ImageView
+ android:id="@+id/searchButton"
+ android:layout_width="40dp"
+ android:layout_height="match_parent"
+ android:layout_marginLeft="8dp"
+ android:layout_marginRight="8dp"
+ android:contentDescription="@string/search_podcast_hint"
+ android:scaleType="center"
+ app:srcCompat="@drawable/ic_search" />
+
+ <EditText
+ android:id="@+id/combinedFeedSearchEditText"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:inputType="text"
+ android:imeOptions="actionSearch"
+ android:importantForAutofill="no"
+ android:layout_marginStart="0dp"
+ android:layout_marginLeft="0dp"
+ android:layout_marginRight="8dp"
+ android:layout_marginEnd="8dp"
+ android:paddingTop="16dp"
+ android:paddingBottom="16dp"
+ android:hint="@string/search_podcast_hint"
+ android:background="@null" />
+
+ </LinearLayout>
+
+ </androidx.cardview.widget.CardView>
<androidx.fragment.app.FragmentContainerView
android:id="@+id/quickFeedDiscovery"
@@ -152,6 +154,6 @@
</LinearLayout>
- </ScrollView>
+ </androidx.core.widget.NestedScrollView>
</LinearLayout>
diff --git a/ui/common/src/main/res/values/styles.xml b/ui/common/src/main/res/values/styles.xml
index 65aaf512a..4513d6374 100644
--- a/ui/common/src/main/res/values/styles.xml
+++ b/ui/common/src/main/res/values/styles.xml
@@ -39,8 +39,8 @@
<item name="colorSecondary">@color/accent_light</item>
<item name="colorOnSecondary">@color/white</item>
<item name="colorPrimaryDark">@color/accent_light</item>
- <item name="colorPrimaryContainer">@color/accent_light</item>
- <item name="colorOnPrimaryContainer">@color/white</item>
+ <item name="colorPrimaryContainer">#D6E6F3</item>
+ <item name="colorOnPrimaryContainer">@color/black</item>
<item name="android:colorBackground">@color/background_light</item>
<item name="colorSurface">@color/background_light</item>
<item name="colorSurfaceVariant">#D3DCE0</item>
@@ -83,8 +83,8 @@
<item name="colorSecondary">@color/accent_dark</item>
<item name="colorOnSecondary">@color/black</item>
<item name="colorPrimaryDark">@color/accent_dark</item>
- <item name="colorPrimaryContainer">@color/accent_dark</item>
- <item name="colorOnPrimaryContainer">@color/black</item>
+ <item name="colorPrimaryContainer">#29374E</item>
+ <item name="colorOnPrimaryContainer">@color/white</item>
<item name="android:colorBackground">@color/background_darktheme</item>
<item name="colorSurface">@color/background_darktheme</item>
<item name="colorSurfaceVariant">#2F3B4F</item>
@@ -108,6 +108,8 @@
<item name="background_color">@color/black</item>
<item name="background_elevated">@color/black</item>
<item name="android:navigationBarColor">@color/black</item>
+ <item name="colorPrimaryContainer">#0D182B</item>
+ <item name="colorOnPrimaryContainer">@color/white</item>
</style>
<style name="Theme.AntennaPod.Dynamic.Light.NoTitle" parent="Theme.AntennaPod.Dynamic.Light">