Skip to content

Instantly share code, notes, and snippets.

@fmedlin
Created November 6, 2021 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fmedlin/2dcf19ce657900a6cf30ef6d45afa436 to your computer and use it in GitHub Desktop.
Save fmedlin/2dcf19ce657900a6cf30ef6d45afa436 to your computer and use it in GitHub Desktop.
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_about, container, false);
return setupViews(view);
}
private View setupViews(View view) {
setVersionAndCopyrightText(view);
handleViewClicks(view);
handleTextViewClicks(view);
((SpinningImageButton) view.findViewById(R.id.about_logo)).setSpeedListener(this);
return view;
}
private void setVersionAndCopyrightText(View view) {
TextView version = view.findViewById(R.id.about_version);
version.setText(PrefUtils.versionInfo());
TextView copyright = view.findViewById(R.id.about_copyright);
int thisYear = Calendar.getInstance().get(Calendar.YEAR);
copyright.setText(String.format(Locale.getDefault(), getString(R.string.about_copyright), thisYear));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment