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

Commit f5f84305 authored by Katherine Kuan's avatar Katherine Kuan
Browse files

Fix group source crash on phone

- The group source button is supposed to be a scrolling header
in the list of group members on the phone portrait view, but
we can't add a header view to a ListView after the adapter is set.
(Setting the adapter had to be moved before setting the header
view otherwise the group detail page would flicker on every
sync).

- Make the header static as a simplification and hide the view
if there's no group source needed.

- Remove fading edge on group members list

Bug: 5195472
Change-Id: Ibedc629ddd85a54ed8beee92650df617a09d2a6c
parent 9c747ac6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@
        android:layout_marginLeft="@dimen/group_detail_border_padding"
        android:layout_marginRight="@dimen/group_detail_border_padding"
        android:cacheColorHint="#00000000"
        android:fadingEdge="none"
        android:divider="@null" />

</LinearLayout>
 No newline at end of file
+1 −0
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:cacheColorHint="#00000000"
        android:fadingEdge="none"
        android:divider="@null" />

</LinearLayout>
 No newline at end of file
+3 −1
Original line number Diff line number Diff line
@@ -42,7 +42,9 @@
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:text="@string/view_updates_from_group"/>
            android:textColor="@color/action_bar_button_text_color"
            android:text="@string/view_updates_from_group"
            style="@android:style/Widget.Holo.ActionBar.TabText"/>

        <ImageView
            android:id="@android:id/icon"
+9 −1
Original line number Diff line number Diff line
@@ -20,10 +20,18 @@
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <FrameLayout
        android:id="@+id/group_source_view_container"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical" />

    <ListView
        android:id="@android:id/list"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_height="0dip"
        android:layout_weight="1"
        android:fadingEdge="none"
        android:scrollbarStyle="outsideOverlay"/>

</LinearLayout>
+2 −7
Original line number Diff line number Diff line
@@ -317,9 +317,8 @@ public class GroupDetailFragment extends Fragment implements OnScrollListener {
    /**
     * Once the account type, group source action, and group source URI have been determined
     * (based on the result from the {@link Loader}), then we can display this to the user in 1 of
     * 3 ways depending on screen size and orientation: either as a button in the action bar,
     * a button in a static header on the page, or as a header that scrolls with the
     * {@link ListView}.
     * 2 ways depending on screen size and orientation: either as a button in the action bar or as
     * a button in a static header on the page.
     */
    private void updateAccountType(final String accountTypeString, final String dataSet) {

@@ -345,10 +344,6 @@ public class GroupDetailFragment extends Fragment implements OnScrollListener {
                // the view there.
                if (mGroupSourceViewContainer != null) {
                    mGroupSourceViewContainer.addView(mGroupSourceView);
                } else {
                    // Otherwise, display the group source as a scrolling header within the
                    // {@link ListView} of group members.
                    mMemberListView.addHeaderView(mGroupSourceView);
                }
            }