class structure

BUILD SUCCESSFUL in 17s
39 actionable tasks: 6 executed, 33 up-to-date
This commit is contained in:
BO41 2018-08-28 19:48:24 +02:00
parent 5db0cc5241
commit 3ab06bf383
8 changed files with 20 additions and 42 deletions

View File

@ -90,8 +90,6 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
private MenuItem menuRssButton; private MenuItem menuRssButton;
private boolean mIsVisibleToUser = false;
public static ChannelFragment getInstance(int serviceId, String url, String name) { public static ChannelFragment getInstance(int serviceId, String url, String name) {
ChannelFragment instance = new ChannelFragment(); ChannelFragment instance = new ChannelFragment();
instance.setInitialData(serviceId, url, name); instance.setInitialData(serviceId, url, name);
@ -105,7 +103,7 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
@Override @Override
public void setUserVisibleHint(boolean isVisibleToUser) { public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser); super.setUserVisibleHint(isVisibleToUser);
mIsVisibleToUser = isVisibleToUser; boolean mIsVisibleToUser = isVisibleToUser;
if(activity != null if(activity != null
&& useAsFrontPage && useAsFrontPage
&& isVisibleToUser) { && isVisibleToUser) {

View File

@ -122,7 +122,6 @@ public class SearchFragment
private String nextPageUrl; private String nextPageUrl;
private String contentCountry; private String contentCountry;
private boolean isSuggestionsEnabled = true; private boolean isSuggestionsEnabled = true;
private boolean isSearchHistoryEnabled = true;
private PublishSubject<String> suggestionPublisher = PublishSubject.create(); private PublishSubject<String> suggestionPublisher = PublishSubject.create();
private Disposable searchDisposable; private Disposable searchDisposable;
@ -173,7 +172,7 @@ public class SearchFragment
suggestionListAdapter = new SuggestionListAdapter(activity); suggestionListAdapter = new SuggestionListAdapter(activity);
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(activity); SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(activity);
isSearchHistoryEnabled = preferences.getBoolean(getString(R.string.enable_search_history_key), true); boolean isSearchHistoryEnabled = preferences.getBoolean(getString(R.string.enable_search_history_key), true);
suggestionListAdapter.setShowSuggestionHistory(isSearchHistoryEnabled); suggestionListAdapter.setShowSuggestionHistory(isSearchHistoryEnabled);
historyRecordManager = new HistoryRecordManager(context); historyRecordManager = new HistoryRecordManager(context);

View File

@ -81,7 +81,6 @@ public class SubscriptionFragment extends BaseStateFragment<List<SubscriptionEnt
protected Parcelable itemsListState; protected Parcelable itemsListState;
private InfoListAdapter infoListAdapter; private InfoListAdapter infoListAdapter;
private View headerRootLayout;
private View whatsNewItemListHeader; private View whatsNewItemListHeader;
private View importExportListHeader; private View importExportListHeader;
@ -291,6 +290,7 @@ public class SubscriptionFragment extends BaseStateFragment<List<SubscriptionEnt
itemsList = rootView.findViewById(R.id.items_list); itemsList = rootView.findViewById(R.id.items_list);
itemsList.setLayoutManager(new LinearLayoutManager(activity)); itemsList.setLayoutManager(new LinearLayoutManager(activity));
View headerRootLayout;
infoListAdapter.setHeader(headerRootLayout = activity.getLayoutInflater().inflate(R.layout.subscription_header, itemsList, false)); infoListAdapter.setHeader(headerRootLayout = activity.getLayoutInflater().inflate(R.layout.subscription_header, itemsList, false));
whatsNewItemListHeader = headerRootLayout.findViewById(R.id.whats_new); whatsNewItemListHeader = headerRootLayout.findViewById(R.id.whats_new);
importExportListHeader = headerRootLayout.findViewById(R.id.import_export); importExportListHeader = headerRootLayout.findViewById(R.id.import_export);

View File

@ -114,7 +114,6 @@ public final class PopupVideoPlayer extends Service {
private View closeOverlayView; private View closeOverlayView;
private FloatingActionButton closeOverlayButton; private FloatingActionButton closeOverlayButton;
private WindowManager.LayoutParams closeOverlayLayoutParams;
private int tossFlingVelocity; private int tossFlingVelocity;
@ -248,7 +247,7 @@ public final class PopupVideoPlayer extends Service {
final int flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE final int flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE
| WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM; | WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM;
closeOverlayLayoutParams = new WindowManager.LayoutParams( WindowManager.LayoutParams closeOverlayLayoutParams = new WindowManager.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT,
layoutParamType, layoutParamType,
flags, flags,

View File

@ -66,25 +66,15 @@ public class PlaybackParameterDialog extends DialogFragment {
private double stepSize = DEFAULT_STEP; private double stepSize = DEFAULT_STEP;
@Nullable private SeekBar tempoSlider; @Nullable private SeekBar tempoSlider;
@Nullable private TextView tempoMinimumText;
@Nullable private TextView tempoMaximumText;
@Nullable private TextView tempoCurrentText; @Nullable private TextView tempoCurrentText;
@Nullable private TextView tempoStepDownText; @Nullable private TextView tempoStepDownText;
@Nullable private TextView tempoStepUpText; @Nullable private TextView tempoStepUpText;
@Nullable private SeekBar pitchSlider; @Nullable private SeekBar pitchSlider;
@Nullable private TextView pitchMinimumText;
@Nullable private TextView pitchMaximumText;
@Nullable private TextView pitchCurrentText; @Nullable private TextView pitchCurrentText;
@Nullable private TextView pitchStepDownText; @Nullable private TextView pitchStepDownText;
@Nullable private TextView pitchStepUpText; @Nullable private TextView pitchStepUpText;
@Nullable private TextView stepSizeOnePercentText;
@Nullable private TextView stepSizeFivePercentText;
@Nullable private TextView stepSizeTenPercentText;
@Nullable private TextView stepSizeTwentyFivePercentText;
@Nullable private TextView stepSizeOneHundredPercentText;
@Nullable private CheckBox unhookingCheckbox; @Nullable private CheckBox unhookingCheckbox;
@Nullable private CheckBox skipSilenceCheckbox; @Nullable private CheckBox skipSilenceCheckbox;
@ -181,8 +171,8 @@ public class PlaybackParameterDialog extends DialogFragment {
private void setupTempoControl(@NonNull View rootView) { private void setupTempoControl(@NonNull View rootView) {
tempoSlider = rootView.findViewById(R.id.tempoSeekbar); tempoSlider = rootView.findViewById(R.id.tempoSeekbar);
tempoMinimumText = rootView.findViewById(R.id.tempoMinimumText); TextView tempoMinimumText = rootView.findViewById(R.id.tempoMinimumText);
tempoMaximumText = rootView.findViewById(R.id.tempoMaximumText); TextView tempoMaximumText = rootView.findViewById(R.id.tempoMaximumText);
tempoCurrentText = rootView.findViewById(R.id.tempoCurrentText); tempoCurrentText = rootView.findViewById(R.id.tempoCurrentText);
tempoStepUpText = rootView.findViewById(R.id.tempoStepUp); tempoStepUpText = rootView.findViewById(R.id.tempoStepUp);
tempoStepDownText = rootView.findViewById(R.id.tempoStepDown); tempoStepDownText = rootView.findViewById(R.id.tempoStepDown);
@ -203,8 +193,8 @@ public class PlaybackParameterDialog extends DialogFragment {
private void setupPitchControl(@NonNull View rootView) { private void setupPitchControl(@NonNull View rootView) {
pitchSlider = rootView.findViewById(R.id.pitchSeekbar); pitchSlider = rootView.findViewById(R.id.pitchSeekbar);
pitchMinimumText = rootView.findViewById(R.id.pitchMinimumText); TextView pitchMinimumText = rootView.findViewById(R.id.pitchMinimumText);
pitchMaximumText = rootView.findViewById(R.id.pitchMaximumText); TextView pitchMaximumText = rootView.findViewById(R.id.pitchMaximumText);
pitchCurrentText = rootView.findViewById(R.id.pitchCurrentText); pitchCurrentText = rootView.findViewById(R.id.pitchCurrentText);
pitchStepDownText = rootView.findViewById(R.id.pitchStepDown); pitchStepDownText = rootView.findViewById(R.id.pitchStepDown);
pitchStepUpText = rootView.findViewById(R.id.pitchStepUp); pitchStepUpText = rootView.findViewById(R.id.pitchStepUp);
@ -247,11 +237,11 @@ public class PlaybackParameterDialog extends DialogFragment {
} }
private void setupStepSizeSelector(@NonNull final View rootView) { private void setupStepSizeSelector(@NonNull final View rootView) {
stepSizeOnePercentText = rootView.findViewById(R.id.stepSizeOnePercent); TextView stepSizeOnePercentText = rootView.findViewById(R.id.stepSizeOnePercent);
stepSizeFivePercentText = rootView.findViewById(R.id.stepSizeFivePercent); TextView stepSizeFivePercentText = rootView.findViewById(R.id.stepSizeFivePercent);
stepSizeTenPercentText = rootView.findViewById(R.id.stepSizeTenPercent); TextView stepSizeTenPercentText = rootView.findViewById(R.id.stepSizeTenPercent);
stepSizeTwentyFivePercentText = rootView.findViewById(R.id.stepSizeTwentyFivePercent); TextView stepSizeTwentyFivePercentText = rootView.findViewById(R.id.stepSizeTwentyFivePercent);
stepSizeOneHundredPercentText = rootView.findViewById(R.id.stepSizeOneHundredPercent); TextView stepSizeOneHundredPercentText = rootView.findViewById(R.id.stepSizeOneHundredPercent);
if (stepSizeOnePercentText != null) { if (stepSizeOnePercentText != null) {
stepSizeOnePercentText.setText(getPercentString(STEP_ONE_PERCENT_VALUE)); stepSizeOnePercentText.setText(getPercentString(STEP_ONE_PERCENT_VALUE));

View File

@ -81,12 +81,7 @@ public class ErrorActivity extends AppCompatActivity {
private ErrorInfo errorInfo; private ErrorInfo errorInfo;
private Class returnActivity; private Class returnActivity;
private String currentTimeStamp; private String currentTimeStamp;
// views
private TextView errorView;
private EditText userCommentBox; private EditText userCommentBox;
private Button reportButton;
private TextView infoView;
private TextView errorMessageView;
public static void reportUiError(final AppCompatActivity activity, final Throwable el) { public static void reportUiError(final AppCompatActivity activity, final Throwable el) {
reportError(activity, el, activity.getClass(), null, reportError(activity, el, activity.getClass(), null,
@ -194,11 +189,11 @@ public class ErrorActivity extends AppCompatActivity {
actionBar.setDisplayShowTitleEnabled(true); actionBar.setDisplayShowTitleEnabled(true);
} }
reportButton = findViewById(R.id.errorReportButton); Button reportButton = findViewById(R.id.errorReportButton);
userCommentBox = findViewById(R.id.errorCommentBox); userCommentBox = findViewById(R.id.errorCommentBox);
errorView = findViewById(R.id.errorView); TextView errorView = findViewById(R.id.errorView);
infoView = findViewById(R.id.errorInfosView); TextView infoView = findViewById(R.id.errorInfosView);
errorMessageView = findViewById(R.id.errorMessageView); TextView errorMessageView = findViewById(R.id.errorMessageView);
ActivityCommunicator ac = ActivityCommunicator.getCommunicator(); ActivityCommunicator ac = ActivityCommunicator.getCommunicator();
returnActivity = ac.returnActivity; returnActivity = ac.returnActivity;

View File

@ -47,7 +47,6 @@ public class ContentSettingsFragment extends BasePreferenceFragment {
private static final int REQUEST_IMPORT_PATH = 8945; private static final int REQUEST_IMPORT_PATH = 8945;
private static final int REQUEST_EXPORT_PATH = 30945; private static final int REQUEST_EXPORT_PATH = 30945;
private String homeDir;
private File databasesDir; private File databasesDir;
private File newpipe_db; private File newpipe_db;
private File newpipe_db_journal; private File newpipe_db_journal;
@ -81,7 +80,7 @@ public class ContentSettingsFragment extends BasePreferenceFragment {
@Override @Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
homeDir = getActivity().getApplicationInfo().dataDir; String homeDir = getActivity().getApplicationInfo().dataDir;
databasesDir = new File(homeDir + "/databases"); databasesDir = new File(homeDir + "/databases");
newpipe_db = new File(homeDir + "/databases/newpipe.db"); newpipe_db = new File(homeDir + "/databases/newpipe.db");
newpipe_db_journal = new File(homeDir + "/databases/newpipe.db-journal"); newpipe_db_journal = new File(homeDir + "/databases/newpipe.db-journal");

View File

@ -51,8 +51,6 @@ import io.reactivex.schedulers.Schedulers;
*/ */
public class SelectChannelFragment extends DialogFragment { public class SelectChannelFragment extends DialogFragment {
private SelectChannelAdapter channelAdapter;
private SubscriptionService subscriptionService;
private ImageLoader imageLoader = ImageLoader.getInstance(); private ImageLoader imageLoader = ImageLoader.getInstance();
private ProgressBar progressBar; private ProgressBar progressBar;
@ -91,7 +89,7 @@ public class SelectChannelFragment extends DialogFragment {
View v = inflater.inflate(R.layout.select_channel_fragment, container, false); View v = inflater.inflate(R.layout.select_channel_fragment, container, false);
recyclerView = v.findViewById(R.id.items_list); recyclerView = v.findViewById(R.id.items_list);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
channelAdapter = new SelectChannelAdapter(); SelectChannelAdapter channelAdapter = new SelectChannelAdapter();
recyclerView.setAdapter(channelAdapter); recyclerView.setAdapter(channelAdapter);
progressBar = v.findViewById(R.id.progressBar); progressBar = v.findViewById(R.id.progressBar);
@ -101,7 +99,7 @@ public class SelectChannelFragment extends DialogFragment {
emptyView.setVisibility(View.GONE); emptyView.setVisibility(View.GONE);
subscriptionService = SubscriptionService.getInstance(getContext()); SubscriptionService subscriptionService = SubscriptionService.getInstance(getContext());
subscriptionService.getSubscription().toObservable() subscriptionService.getSubscription().toObservable()
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())