cleanup code, remove some unneeded files
This commit is contained in:
parent
07edebdfcf
commit
f2f3be37b3
47 changed files with 189 additions and 286 deletions
|
|
@ -117,7 +117,7 @@ public class AccountListFragment extends BaseFragment implements AccountActionLi
|
|||
View rootView = inflater.inflate(R.layout.fragment_account_list, container, false);
|
||||
|
||||
Context context = getContext();
|
||||
recyclerView = (RecyclerView) rootView.findViewById(R.id.recycler_view);
|
||||
recyclerView = rootView.findViewById(R.id.recycler_view);
|
||||
recyclerView.setHasFixedSize(true);
|
||||
layoutManager = new LinearLayoutManager(context);
|
||||
recyclerView.setLayoutManager(layoutManager);
|
||||
|
|
@ -153,7 +153,7 @@ public class AccountListFragment extends BaseFragment implements AccountActionLi
|
|||
BaseActivity activity = (BaseActivity) getActivity();
|
||||
|
||||
if (jumpToTopAllowed()) {
|
||||
TabLayout layout = (TabLayout) activity.findViewById(R.id.tab_layout);
|
||||
TabLayout layout = activity.findViewById(R.id.tab_layout);
|
||||
onTabSelectedListener = new TabLayout.OnTabSelectedListener() {
|
||||
@Override
|
||||
public void onTabSelected(TabLayout.Tab tab) {}
|
||||
|
|
@ -226,7 +226,7 @@ public class AccountListFragment extends BaseFragment implements AccountActionLi
|
|||
@Override
|
||||
public void onDestroyView() {
|
||||
if (jumpToTopAllowed()) {
|
||||
TabLayout tabLayout = (TabLayout) getActivity().findViewById(R.id.tab_layout);
|
||||
TabLayout tabLayout = getActivity().findViewById(R.id.tab_layout);
|
||||
tabLayout.removeOnTabSelectedListener(onTabSelectedListener);
|
||||
}
|
||||
super.onDestroyView();
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ public class ComposeOptionsFragment extends BottomSheetDialogFragment {
|
|||
String statusVisibility = arguments.getString("visibility");
|
||||
boolean statusHideText = arguments.getBoolean("hideText");
|
||||
|
||||
radio = (RadioGroup) rootView.findViewById(R.id.radio_visibility);
|
||||
radio = rootView.findViewById(R.id.radio_visibility);
|
||||
int radioCheckedId = R.id.radio_public;
|
||||
if (statusVisibility != null) {
|
||||
switch (statusVisibility) {
|
||||
|
|
@ -83,16 +83,16 @@ public class ComposeOptionsFragment extends BottomSheetDialogFragment {
|
|||
}
|
||||
radio.check(radioCheckedId);
|
||||
|
||||
RadioButton publicButton = (RadioButton) rootView.findViewById(R.id.radio_public);
|
||||
RadioButton unlistedButton = (RadioButton) rootView.findViewById(R.id.radio_unlisted);
|
||||
RadioButton privateButton = (RadioButton) rootView.findViewById(R.id.radio_private);
|
||||
RadioButton directButton = (RadioButton) rootView.findViewById(R.id.radio_direct);
|
||||
RadioButton publicButton = rootView.findViewById(R.id.radio_public);
|
||||
RadioButton unlistedButton = rootView.findViewById(R.id.radio_unlisted);
|
||||
RadioButton privateButton = rootView.findViewById(R.id.radio_private);
|
||||
RadioButton directButton = rootView.findViewById(R.id.radio_direct);
|
||||
setRadioButtonDrawable(getContext(), publicButton, R.drawable.ic_public_24dp);
|
||||
setRadioButtonDrawable(getContext(), unlistedButton, R.drawable.ic_lock_open_24dp);
|
||||
setRadioButtonDrawable(getContext(), privateButton, R.drawable.ic_lock_outline_24dp);
|
||||
setRadioButtonDrawable(getContext(), directButton, R.drawable.ic_email_24dp);
|
||||
|
||||
hideText = (CheckBox) rootView.findViewById(R.id.compose_hide_text);
|
||||
hideText = rootView.findViewById(R.id.compose_hide_text);
|
||||
hideText.setChecked(statusHideText);
|
||||
|
||||
return rootView;
|
||||
|
|
|
|||
|
|
@ -109,10 +109,10 @@ public class NotificationsFragment extends SFragment implements
|
|||
|
||||
// Setup the SwipeRefreshLayout.
|
||||
Context context = getContext();
|
||||
swipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.swipe_refresh_layout);
|
||||
swipeRefreshLayout = rootView.findViewById(R.id.swipe_refresh_layout);
|
||||
swipeRefreshLayout.setOnRefreshListener(this);
|
||||
// Setup the RecyclerView.
|
||||
recyclerView = (RecyclerView) rootView.findViewById(R.id.recycler_view);
|
||||
recyclerView = rootView.findViewById(R.id.recycler_view);
|
||||
recyclerView.setHasFixedSize(true);
|
||||
layoutManager = new LinearLayoutManager(context);
|
||||
recyclerView.setLayoutManager(layoutManager);
|
||||
|
|
@ -152,7 +152,7 @@ public class NotificationsFragment extends SFragment implements
|
|||
MainActivity activity = (MainActivity) getActivity();
|
||||
|
||||
// MainActivity's layout is guaranteed to be inflated until onCreate returns.
|
||||
TabLayout layout = (TabLayout) activity.findViewById(R.id.tab_layout);
|
||||
TabLayout layout = activity.findViewById(R.id.tab_layout);
|
||||
onTabSelectedListener = new TabLayout.OnTabSelectedListener() {
|
||||
@Override
|
||||
public void onTabSelected(TabLayout.Tab tab) {
|
||||
|
|
@ -208,7 +208,7 @@ public class NotificationsFragment extends SFragment implements
|
|||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
TabLayout tabLayout = (TabLayout) getActivity().findViewById(R.id.tab_layout);
|
||||
TabLayout tabLayout = getActivity().findViewById(R.id.tab_layout);
|
||||
tabLayout.removeOnTabSelectedListener(onTabSelectedListener);
|
||||
|
||||
LocalBroadcastManager.getInstance(getContext())
|
||||
|
|
|
|||
|
|
@ -134,10 +134,10 @@ public class TimelineFragment extends SFragment implements
|
|||
|
||||
// Setup the SwipeRefreshLayout.
|
||||
Context context = getContext();
|
||||
swipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.swipe_refresh_layout);
|
||||
swipeRefreshLayout = rootView.findViewById(R.id.swipe_refresh_layout);
|
||||
swipeRefreshLayout.setOnRefreshListener(this);
|
||||
// Setup the RecyclerView.
|
||||
recyclerView = (RecyclerView) rootView.findViewById(R.id.recycler_view);
|
||||
recyclerView = rootView.findViewById(R.id.recycler_view);
|
||||
recyclerView.setHasFixedSize(true);
|
||||
layoutManager = new LinearLayoutManager(context);
|
||||
recyclerView.setLayoutManager(layoutManager);
|
||||
|
|
@ -175,7 +175,7 @@ public class TimelineFragment extends SFragment implements
|
|||
super.onActivityCreated(savedInstanceState);
|
||||
|
||||
if (jumpToTopAllowed()) {
|
||||
TabLayout layout = (TabLayout) getActivity().findViewById(R.id.tab_layout);
|
||||
TabLayout layout = getActivity().findViewById(R.id.tab_layout);
|
||||
onTabSelectedListener = new TabLayout.OnTabSelectedListener() {
|
||||
@Override
|
||||
public void onTabSelected(TabLayout.Tab tab) {
|
||||
|
|
@ -241,7 +241,7 @@ public class TimelineFragment extends SFragment implements
|
|||
@Override
|
||||
public void onDestroyView() {
|
||||
if (jumpToTopAllowed()) {
|
||||
TabLayout tabLayout = (TabLayout) getActivity().findViewById(R.id.tab_layout);
|
||||
TabLayout tabLayout = getActivity().findViewById(R.id.tab_layout);
|
||||
tabLayout.removeOnTabSelectedListener(onTabSelectedListener);
|
||||
}
|
||||
LocalBroadcastManager.getInstance(getContext()).unregisterReceiver(timelineReceiver);
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ public class ViewMediaFragment extends BaseFragment {
|
|||
|
||||
private PhotoViewAttacher attacher;
|
||||
private PhotoActionsListener photoActionsListener;
|
||||
View rootView;
|
||||
PhotoView photoView;
|
||||
private View rootView;
|
||||
private PhotoView photoView;
|
||||
|
||||
private static final String ARG_START_POSTPONED_TRANSITION = "startPostponedTransition";
|
||||
|
||||
|
|
@ -67,7 +67,7 @@ public class ViewMediaFragment extends BaseFragment {
|
|||
public View onCreateView(LayoutInflater inflater, final ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
rootView = inflater.inflate(R.layout.fragment_view_media, container, false);
|
||||
photoView = (PhotoView) rootView.findViewById(R.id.view_media_image);
|
||||
photoView = rootView.findViewById(R.id.view_media_image);
|
||||
|
||||
final Bundle arguments = getArguments();
|
||||
final String url = arguments.getString("url");
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ public class ViewThreadFragment extends SFragment implements
|
|||
private String thisThreadsStatusId;
|
||||
private TimelineReceiver timelineReceiver;
|
||||
|
||||
int statusIndex = 0;
|
||||
private int statusIndex = 0;
|
||||
|
||||
private final PairedList<Status, StatusViewData> statuses =
|
||||
new PairedList<>(ViewDataUtils.statusMapper());
|
||||
|
|
@ -84,10 +84,10 @@ public class ViewThreadFragment extends SFragment implements
|
|||
View rootView = inflater.inflate(R.layout.fragment_view_thread, container, false);
|
||||
|
||||
Context context = getContext();
|
||||
swipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.swipe_refresh_layout);
|
||||
swipeRefreshLayout = rootView.findViewById(R.id.swipe_refresh_layout);
|
||||
swipeRefreshLayout.setOnRefreshListener(this);
|
||||
|
||||
recyclerView = (RecyclerView) rootView.findViewById(R.id.recycler_view);
|
||||
recyclerView = rootView.findViewById(R.id.recycler_view);
|
||||
recyclerView.setHasFixedSize(true);
|
||||
LinearLayoutManager layoutManager = new LinearLayoutManager(context);
|
||||
recyclerView.setLayoutManager(layoutManager);
|
||||
|
|
@ -335,7 +335,7 @@ public class ViewThreadFragment extends SFragment implements
|
|||
}
|
||||
}
|
||||
|
||||
public int setStatus(Status status) {
|
||||
private int setStatus(Status status) {
|
||||
if (statuses.size() > 0
|
||||
&& statusIndex < statuses.size()
|
||||
&& statuses.get(statusIndex).equals(status)) {
|
||||
|
|
@ -350,7 +350,7 @@ public class ViewThreadFragment extends SFragment implements
|
|||
return i;
|
||||
}
|
||||
|
||||
public void setContext(List<Status> ancestors, List<Status> descendants) {
|
||||
private void setContext(List<Status> ancestors, List<Status> descendants) {
|
||||
Status mainStatus = null;
|
||||
|
||||
// In case of refresh, remove old ancestors and descendants first. We'll remove all blindly,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue