Merge "Hide header if no items present" into rvc-dev am: 729c6c64a9
Change-Id: I50515da88d2fd132b1a1d85f98c6e1554bd342db
This commit is contained in:
@@ -32,6 +32,7 @@ import android.view.View;
|
|||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
|
||||||
import androidx.preference.Preference;
|
import androidx.preference.Preference;
|
||||||
|
import androidx.preference.PreferenceCategory;
|
||||||
import androidx.preference.PreferenceViewHolder;
|
import androidx.preference.PreferenceViewHolder;
|
||||||
|
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
@@ -54,6 +55,13 @@ public class AppBubbleListPreferenceController extends AppConversationListPrefer
|
|||||||
super(context, backend);
|
super(context, backend);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateState(Preference preference) {
|
||||||
|
// loading convos is async; hide header until we know we have conversations to show
|
||||||
|
preference.setVisible(false);
|
||||||
|
super.updateState(preference);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResume(NotificationBackend.AppRow appRow,
|
public void onResume(NotificationBackend.AppRow appRow,
|
||||||
@Nullable NotificationChannel channel, @Nullable NotificationChannelGroup group,
|
@Nullable NotificationChannel channel, @Nullable NotificationChannelGroup group,
|
||||||
@@ -134,6 +142,15 @@ public class AppBubbleListPreferenceController extends AppConversationListPrefer
|
|||||||
return pref;
|
return pref;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void populateList() {
|
||||||
|
super.populateList();
|
||||||
|
if (mPreference == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mPreference.setVisible(mPreference.getPreferenceCount() > 0);
|
||||||
|
}
|
||||||
|
|
||||||
/** Simple preference with a 'x' button at the end. */
|
/** Simple preference with a 'x' button at the end. */
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
public static class ConversationPreference extends Preference implements View.OnClickListener {
|
public static class ConversationPreference extends Preference implements View.OnClickListener {
|
||||||
|
@@ -116,7 +116,7 @@ public class AppConversationListPreferenceController extends NotificationPrefere
|
|||||||
return R.string.conversations_category_title;
|
return R.string.conversations_category_title;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void populateList() {
|
protected void populateList() {
|
||||||
if (mPreference == null) {
|
if (mPreference == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user