diff --git a/app/src/main/java/org/schabi/newpipe/MainActivity.java b/app/src/main/java/org/schabi/newpipe/MainActivity.java index 3ff55cb76..03b856d31 100644 --- a/app/src/main/java/org/schabi/newpipe/MainActivity.java +++ b/app/src/main/java/org/schabi/newpipe/MainActivity.java @@ -181,7 +181,6 @@ public class MainActivity extends AppCompatActivity implements HistoryListener { ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { - actionBar.setDisplayShowTitleEnabled(false); actionBar.setDisplayHomeAsUpEnabled(false); } return true; diff --git a/app/src/main/java/org/schabi/newpipe/fragments/BlankFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/BlankFragment.java index e9e50dd69..e81645202 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/BlankFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/BlankFragment.java @@ -2,6 +2,7 @@ package org.schabi.newpipe.fragments; import android.os.Bundle; import android.support.annotation.Nullable; +import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -13,6 +14,24 @@ public class BlankFragment extends BaseFragment { @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { + if(activity != null && activity.getSupportActionBar() != null) { + activity.getSupportActionBar() + .setTitle("NewPipe"); + } return inflater.inflate(R.layout.fragment_blank, container, false); } + + @Override + public void setUserVisibleHint(boolean isVisibleToUser) { + super.setUserVisibleHint(isVisibleToUser); + if(isVisibleToUser) { + if(activity != null && activity.getSupportActionBar() != null) { + activity.getSupportActionBar() + .setTitle("NewPipe"); + } + // leave this inline. Will make it harder for copy cats. + // If you are a Copy cat FUCK YOU. + // I WILL FIND YOU, AND I WILL ... + } + } } diff --git a/app/src/main/java/org/schabi/newpipe/fragments/MainFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/MainFragment.java index 317630faa..190361f0e 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/MainFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/MainFragment.java @@ -84,6 +84,15 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte viewPager.setOffscreenPageLimit(adapter.getCount()); tabLayout.setupWithViewPager(viewPager); + + if(PreferenceManager.getDefaultSharedPreferences(getActivity()) + .getString(getString(R.string.main_page_content_key), getString(R.string.blank_page_key)) + .equals(getString(R.string.subscription_page_key))) { + tabLayout.getTabAt(0).setIcon(R.drawable.ic_channel_white_24dp); + } else { + tabLayout.getTabAt(0).setIcon(R.drawable.ic_whatshot_white_24dp); + tabLayout.getTabAt(1).setIcon(R.drawable.ic_channel_white_24dp); + } } /*////////////////////////////////////////////////////////////////////////// @@ -108,7 +117,6 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte ActionBar supportActionBar = activity.getSupportActionBar(); if (supportActionBar != null) { - supportActionBar.setDisplayShowTitleEnabled(false); supportActionBar.setDisplayHomeAsUpEnabled(false); } } @@ -171,7 +179,8 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte @Override public CharSequence getPageTitle(int position) { - return getString(this.tabTitles[position]); + //return getString(this.tabTitles[position]); + return ""; } @Override diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java index daa1b62ed..61a97e847 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java @@ -26,6 +26,7 @@ import org.schabi.newpipe.R; import org.schabi.newpipe.database.subscription.SubscriptionEntity; import org.schabi.newpipe.extractor.ListExtractor; import org.schabi.newpipe.extractor.NewPipe; +import org.schabi.newpipe.extractor.UrlIdHandler; import org.schabi.newpipe.extractor.channel.ChannelInfo; import org.schabi.newpipe.extractor.exceptions.ExtractionException; import org.schabi.newpipe.fragments.list.BaseListInfoFragment; @@ -33,6 +34,7 @@ import org.schabi.newpipe.fragments.subscription.SubscriptionService; import org.schabi.newpipe.report.UserAction; import org.schabi.newpipe.util.AnimationUtils; import org.schabi.newpipe.util.ExtractorHelper; +import org.schabi.newpipe.util.KioskTranslator; import org.schabi.newpipe.util.Localization; import java.util.List; @@ -81,6 +83,20 @@ public class ChannelFragment extends BaseListInfoFragment { // LifeCycle //////////////////////////////////////////////////////////////////////////*/ + @Override + public void setUserVisibleHint(boolean isVisibleToUser) { + super.setUserVisibleHint(isVisibleToUser); + if(activity != null + && useAsFrontPage + && isVisibleToUser) { + try { + activity.getSupportActionBar().setTitle(currentInfo.name); + } catch (Exception e) { + onError(e); + } + } + } + @Override public void onAttach(Context context) { super.onAttach(context); @@ -125,7 +141,6 @@ public class ChannelFragment extends BaseListInfoFragment { ActionBar supportActionBar = activity.getSupportActionBar(); if(useAsFrontPage) { supportActionBar.setDisplayHomeAsUpEnabled(false); - //supportActionBar.setDisplayShowTitleEnabled(false); } else { inflater.inflate(R.menu.menu_channel, menu); diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/feed/FeedFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/feed/FeedFragment.java index 379ec591a..835647eec 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/feed/FeedFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/feed/FeedFragment.java @@ -121,7 +121,7 @@ public class FeedFragment extends BaseListFragment, Voi } if(useAsFrontPage) { - supportActionBar.setDisplayHomeAsUpEnabled(false); + supportActionBar.setDisplayShowTitleEnabled(true); //supportActionBar.setDisplayShowTitleEnabled(false); } } diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/kiosk/KioskFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/kiosk/KioskFragment.java index b1387b1ad..a9d1cda76 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/kiosk/KioskFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/kiosk/KioskFragment.java @@ -53,6 +53,9 @@ import static org.schabi.newpipe.util.AnimationUtils.animateView; public class KioskFragment extends BaseListInfoFragment { + private String kioskId = ""; + + /*////////////////////////////////////////////////////////////////////////// // Views //////////////////////////////////////////////////////////////////////////*/ @@ -76,6 +79,7 @@ public class KioskFragment extends BaseListInfoFragment { instance.setInitialData(serviceId, kioskTypeUrlIdHandler.getUrl(kioskId), kioskId); + instance.kioskId = kioskId; return instance; } @@ -83,6 +87,18 @@ public class KioskFragment extends BaseListInfoFragment { // LifeCycle //////////////////////////////////////////////////////////////////////////*/ + @Override + public void setUserVisibleHint(boolean isVisibleToUser) { + super.setUserVisibleHint(isVisibleToUser); + if(useAsFrontPage && isVisibleToUser) { + try { + activity.getSupportActionBar().setTitle(KioskTranslator.getTranslatedKioskName(kioskId, getActivity())); + } catch (Exception e) { + onError(e); + } + } + } + @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { return inflater.inflate(R.layout.fragment_kiosk, container, false); @@ -97,7 +113,6 @@ public class KioskFragment extends BaseListInfoFragment { super.onCreateOptionsMenu(menu, inflater); ActionBar supportActionBar = activity.getSupportActionBar(); if (supportActionBar != null && useAsFrontPage) { - //supportActionBar.setDisplayShowTitleEnabled(false); supportActionBar.setDisplayHomeAsUpEnabled(false); } } diff --git a/app/src/main/java/org/schabi/newpipe/fragments/subscription/SubscriptionFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/subscription/SubscriptionFragment.java index afb2f078e..c4dfbc50d 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/subscription/SubscriptionFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/subscription/SubscriptionFragment.java @@ -7,6 +7,7 @@ import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; +import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -19,6 +20,7 @@ import org.schabi.newpipe.fragments.BaseStateFragment; import org.schabi.newpipe.info_list.InfoItemBuilder; import org.schabi.newpipe.info_list.InfoListAdapter; import org.schabi.newpipe.report.UserAction; +import org.schabi.newpipe.util.KioskTranslator; import org.schabi.newpipe.util.NavigationHelper; import java.util.ArrayList; @@ -52,6 +54,17 @@ public class SubscriptionFragment extends BaseStateFragment + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_channel.xml b/app/src/main/res/layout/fragment_channel.xml index 460f95a7a..67691fc81 100644 --- a/app/src/main/res/layout/fragment_channel.xml +++ b/app/src/main/res/layout/fragment_channel.xml @@ -62,4 +62,10 @@ android:visibility="gone" tools:visibility="visible"/> + + diff --git a/app/src/main/res/layout/fragment_feed.xml b/app/src/main/res/layout/fragment_feed.xml index 0f2d0b675..0868d8233 100644 --- a/app/src/main/res/layout/fragment_feed.xml +++ b/app/src/main/res/layout/fragment_feed.xml @@ -34,4 +34,10 @@ android:visibility="gone" tools:visibility="visible"/> + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_kiosk.xml b/app/src/main/res/layout/fragment_kiosk.xml index a85c30cb1..4730e66c8 100644 --- a/app/src/main/res/layout/fragment_kiosk.xml +++ b/app/src/main/res/layout/fragment_kiosk.xml @@ -4,6 +4,7 @@ android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_main.xml b/app/src/main/res/layout/fragment_main.xml index dac5478ff..b1dd3e20b 100644 --- a/app/src/main/res/layout/fragment_main.xml +++ b/app/src/main/res/layout/fragment_main.xml @@ -10,13 +10,14 @@ android:id="@+id/main_tab_layout" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_alignParentBottom="true" + android:layout_alignParentTop="true" + android:background="@color/dark_youtube_primary_color" app:tabGravity="fill"/> + android:layout_below="@id/main_tab_layout"/> diff --git a/app/src/main/res/layout/fragment_playlist.xml b/app/src/main/res/layout/fragment_playlist.xml index d5ef26a63..37c609fa4 100644 --- a/app/src/main/res/layout/fragment_playlist.xml +++ b/app/src/main/res/layout/fragment_playlist.xml @@ -62,4 +62,10 @@ android:visibility="gone" tools:visibility="visible"/> + + diff --git a/app/src/main/res/layout/fragment_search.xml b/app/src/main/res/layout/fragment_search.xml index 04b10347c..d49d23175 100644 --- a/app/src/main/res/layout/fragment_search.xml +++ b/app/src/main/res/layout/fragment_search.xml @@ -81,4 +81,10 @@ android:visibility="gone" tools:visibility="visible"/> + + diff --git a/app/src/main/res/layout/fragment_subscription.xml b/app/src/main/res/layout/fragment_subscription.xml index 35cfbfeb7..e0d0348dc 100644 --- a/app/src/main/res/layout/fragment_subscription.xml +++ b/app/src/main/res/layout/fragment_subscription.xml @@ -35,4 +35,10 @@ android:visibility="gone" tools:visibility="visible"/> + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_video_detail.xml b/app/src/main/res/layout/fragment_video_detail.xml index 0d87809fc..b067db7bc 100644 --- a/app/src/main/res/layout/fragment_video_detail.xml +++ b/app/src/main/res/layout/fragment_video_detail.xml @@ -1,345 +1,308 @@ - - - + + android:focusableInTouchMode="true"> - - + android:layout_height="match_parent" + android:visibility="visible" + app:parallax_factor="1.9"> - - + + android:orientation="vertical"> - - - - - - - - - - + - - + android:foreground="?attr/selectableItemBackground"> + android:id="@+id/detail_thumbnail_image_view" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@android:color/transparent" + android:contentDescription="@string/detail_thumbnail_view_description" + android:scaleType="centerCrop" + tools:ignore="RtlHardcoded" + tools:layout_height="200dp" + tools:src="@drawable/dummy_thumbnail"/> + + - - - - - - - - + + android:background="?android:windowBackground"> - - - - - - - - - - - - - - - - - - - - - - - - + - - - + android:paddingRight="12dp"> + tools:text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed a ultricies ex. Integer sit amet sodales risus. Duis non mi et urna pretium bibendum. Nunc eleifend est quis ipsum porttitor egestas. Sed facilisis, nisl quis eleifend pellentesque, orci metus egestas dolor, at accumsan eros metus quis libero."/> - - + android:layout_marginLeft="5dp" + android:src="@drawable/arrow_down" + tools:ignore="ContentDescription,RtlHardcoded"/> - + - - + + + + + + + - + + android:layout_marginTop="6dp" + android:baselineAligned="false" + android:orientation="horizontal"> - + + + + + + + + + + + + + + + + + + + + + android:background="?attr/selectableItemBackground" + android:gravity="center_vertical" + android:orientation="horizontal" + android:paddingBottom="8dp" + android:paddingLeft="12dp" + android:paddingRight="12dp" + android:paddingTop="8dp"> + + + + + + + + - - - - - - - + - - + android:layout_marginTop="5dp" + android:orientation="vertical" + android:visibility="gone" + tools:visibility="visible"> + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + diff --git a/app/src/main/res/layout/toolbar_layout.xml b/app/src/main/res/layout/toolbar_layout.xml index 36ab6454e..096974c03 100644 --- a/app/src/main/res/layout/toolbar_layout.xml +++ b/app/src/main/res/layout/toolbar_layout.xml @@ -36,9 +36,4 @@ - - \ No newline at end of file