despaget certain parts of the new design

This commit is contained in:
Christian Schabesberger 2018-08-24 11:54:41 +02:00
parent 929c0e43c0
commit e7e634c201
11 changed files with 70 additions and 94 deletions

View file

@ -51,9 +51,6 @@ public abstract class BaseStateFragment<I> extends BaseFragment implements ViewC
protected Button errorButtonRetry;
protected TextView errorTextView;
@State
protected boolean useAsFrontPage = false;
@Override
public void onViewCreated(View rootView, Bundle savedInstanceState) {
super.onViewCreated(rootView, savedInstanceState);
@ -66,9 +63,6 @@ public abstract class BaseStateFragment<I> extends BaseFragment implements ViewC
wasLoading.set(isLoading.get());
}
public void useAsFrontPage(boolean value) {
useAsFrontPage = value;
}
/*//////////////////////////////////////////////////////////////////////////
// Init

View file

@ -14,24 +14,16 @@ 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");
}
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 ...
}
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 ...
}
}

View file

@ -519,13 +519,7 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
@Override
public void setTitle(String title) {
if(!useAsFrontPage) {
super.setTitle(title);
headerTitleView.setText(title);
} else {
if(mIsVisibleToUser) {
super.setTitle(title);
}
}
super.setTitle(title);
if (!useAsFrontPage) headerTitleView.setText(title);
}
}

View file

@ -57,7 +57,6 @@ public class KioskFragment extends BaseListInfoFragment<KioskInfo> {
protected String kioskId = "";
protected String kioskTranslatedName;
private boolean mIsVisibleToUser = false;
/*//////////////////////////////////////////////////////////////////////////
// Views
@ -97,7 +96,6 @@ public class KioskFragment extends BaseListInfoFragment<KioskInfo> {
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
mIsVisibleToUser = isVisibleToUser;
if(useAsFrontPage && isVisibleToUser && activity != null) {
try {
setTitle(kioskTranslatedName);
@ -191,19 +189,4 @@ public class KioskFragment extends BaseListInfoFragment<KioskInfo> {
, "Get next page of: " + url, 0);
}
}
/*//////////////////////////////////////////////////////////////////////////
// Utils
//////////////////////////////////////////////////////////////////////////*/
@Override
public void setTitle(String title) {
if(!useAsFrontPage) {
super.setTitle(title);
} else {
if(mIsVisibleToUser) {
super.setTitle(title);
}
}
}
}