Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3cb8171f authored by Arc Wang's avatar Arc Wang
Browse files

Center apps Preference title when there is no summary

Hide apps Preference summary when a summary is empty
then its title will be vertically centered.

Bug: 229646669
Test: manual visual
      Settings -> Apps -> See all apps
      Settings -> Notifications -> App settings
      Settings -> Storage -> Apps
      Settings -> System -> Language & input -> App Languages
Change-Id: I6fceba243e2ccac9ea180b940b571da07e1ba805
Merged-In: I6fceba243e2ccac9ea180b940b571da07e1ba805
parent f9ebeadb
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -95,10 +95,17 @@ public class ApplicationViewHolder extends RecyclerView.ViewHolder {

    void setSummary(CharSequence summary) {
        mSummary.setText(summary);
        updateSummaryVisibility();
    }

    void setSummary(@StringRes int summary) {
        mSummary.setText(summary);
        updateSummaryVisibility();
    }

    private void updateSummaryVisibility() {
        // Hide an empty summary and then title will be vertically centered.
        mSummary.setVisibility(TextUtils.isEmpty(mSummary.getText()) ? View.GONE : View.VISIBLE);
    }

    void setEnabled(boolean isEnabled) {