diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java index 8d18e29e9..58d3861bf 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java @@ -19,8 +19,8 @@ import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; -import android.widget.LinearLayout; import android.widget.ProgressBar; +import android.widget.TextView; import android.widget.Toast; import com.yqritc.recyclerviewflexibledivider.HorizontalDividerItemDecoration; @@ -75,7 +75,7 @@ public class AllEpisodesFragment extends Fragment { RecyclerView recyclerView; AllEpisodesRecycleAdapter listAdapter; private ProgressBar progLoading; - private LinearLayout layoutEmpty; + private View emptyView; List episodes; private List downloaderList; @@ -333,8 +333,10 @@ public class AllEpisodesFragment extends Fragment { onFragmentLoaded(); } - layoutEmpty = (LinearLayout) root.findViewById(R.id.llEmpty); - layoutEmpty.setVisibility(View.GONE); + emptyView = (View) root.findViewById(R.id.emptyView); + emptyView.setVisibility(View.GONE); + ((TextView)emptyView.findViewById(R.id.txtvtitle)).setText(R.string.no_all_episodes_head_label); + ((TextView)emptyView.findViewById(R.id.txtvmessage)).setText(R.string.no_all_episodes_label); return root; } @@ -349,9 +351,9 @@ public class AllEpisodesFragment extends Fragment { } if (episodes == null || episodes.size() == 0) { recyclerView.setVisibility(View.GONE); - layoutEmpty.setVisibility(View.VISIBLE); + emptyView.setVisibility(View.VISIBLE); } else { - layoutEmpty.setVisibility(View.GONE); + emptyView.setVisibility(View.GONE); recyclerView.setVisibility(View.VISIBLE); } @@ -486,7 +488,7 @@ public class AllEpisodesFragment extends Fragment { } if (viewsCreated && !itemsLoaded) { recyclerView.setVisibility(View.GONE); - layoutEmpty.setVisibility(View.GONE); + emptyView.setVisibility(View.GONE); progLoading.setVisibility(View.VISIBLE); } disposable = Observable.fromCallable(this::loadData) diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/FavoriteEpisodesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/FavoriteEpisodesFragment.java index 5f4d0e882..ed6c57f64 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/FavoriteEpisodesFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/FavoriteEpisodesFragment.java @@ -51,8 +51,8 @@ public class FavoriteEpisodesFragment extends AllEpisodesFragment { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View root = super.onCreateViewHelper(inflater, container, savedInstanceState, R.layout.all_episodes_fragment); - ((TextView)root.findViewById(R.id.emptyHeader)).setText(R.string.no_fav_episodes_head_label); - ((TextView)root.findViewById(R.id.empty)).setText(R.string.no_fav_episodes_label); + ((TextView)root.findViewById(R.id.txtvtitle)).setText(R.string.no_fav_episodes_head_label); + ((TextView)root.findViewById(R.id.txtvmessage)).setText(R.string.no_fav_episodes_label); ItemTouchHelper.SimpleCallback simpleItemTouchCallback = new ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT) { @Override diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/NewEpisodesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/NewEpisodesFragment.java index 0808caa0c..6dc01aa14 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/NewEpisodesFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/NewEpisodesFragment.java @@ -46,8 +46,8 @@ public class NewEpisodesFragment extends AllEpisodesFragment { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View root = super.onCreateViewHelper(inflater, container, savedInstanceState, R.layout.all_episodes_fragment); - ((TextView)root.findViewById(R.id.emptyHeader)).setText(R.string.no_new_episodes_head_label); - ((TextView)root.findViewById(R.id.empty)).setText(R.string.no_new_episodes_label); + ((TextView)root.findViewById(R.id.txtvtitle)).setText(R.string.no_new_episodes_head_label); + ((TextView)root.findViewById(R.id.txtvmessage)).setText(R.string.no_new_episodes_label); ItemTouchHelper.SimpleCallback simpleItemTouchCallback = new ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT) { @Override diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java index 2125fe4a2..07693a87f 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java @@ -19,7 +19,6 @@ import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; -import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.TextView; @@ -73,7 +72,7 @@ public class QueueFragment extends Fragment { private TextView infoBar; private RecyclerView recyclerView; private QueueRecyclerAdapter recyclerAdapter; - private LinearLayout layoutEmpty; + private View emptyView; private ProgressBar progLoading; private List queue; @@ -495,8 +494,10 @@ public class QueueFragment extends Fragment { ); itemTouchHelper.attachToRecyclerView(recyclerView); //empty view - layoutEmpty = (LinearLayout) root.findViewById(R.id.llEmpty); - layoutEmpty.setVisibility(View.GONE); + emptyView = (View) root.findViewById(R.id.emptyView); + emptyView.setVisibility(View.GONE); + ((TextView)emptyView.findViewById(R.id.txtvtitle)).setText(R.string.no_items_header_label); + ((TextView)emptyView.findViewById(R.id.txtvmessage)).setText(R.string.no_items_label); progLoading = root.findViewById(R.id.progLoading); progLoading.setVisibility(View.VISIBLE); @@ -514,9 +515,9 @@ public class QueueFragment extends Fragment { } if(queue == null || queue.size() == 0) { recyclerView.setVisibility(View.GONE); - layoutEmpty.setVisibility(View.VISIBLE); + emptyView.setVisibility(View.VISIBLE); } else { - layoutEmpty.setVisibility(View.GONE); + emptyView.setVisibility(View.GONE); recyclerView.setVisibility(View.VISIBLE); } @@ -630,7 +631,7 @@ public class QueueFragment extends Fragment { } if (queue == null) { recyclerView.setVisibility(View.GONE); - layoutEmpty.setVisibility(View.GONE); + emptyView.setVisibility(View.GONE); progLoading.setVisibility(View.VISIBLE); } disposable = Observable.fromCallable(DBReader::getQueue) diff --git a/app/src/main/res/layout/all_episodes_fragment.xml b/app/src/main/res/layout/all_episodes_fragment.xml index 0ce509ac4..099216007 100644 --- a/app/src/main/res/layout/all_episodes_fragment.xml +++ b/app/src/main/res/layout/all_episodes_fragment.xml @@ -17,40 +17,9 @@ tools:itemCount="13" tools:listitem="@layout/new_episodes_listitem" /> - - - - - - - + - + - - - - -