Tweaks to UI of updates tab.
* Show selectable background behind "Show/Hide apps" button. * Scroll to the relevant place in the list when showing/hiding apps. * Only show one line (ellipsized) of the apps to update in header.
This commit is contained in:
parent
0826533d40
commit
77f3a5feff
@ -12,6 +12,7 @@ import android.support.v4.content.CursorLoader;
|
|||||||
import android.support.v4.content.Loader;
|
import android.support.v4.content.Loader;
|
||||||
import android.support.v4.content.LocalBroadcastManager;
|
import android.support.v4.content.LocalBroadcastManager;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.support.v7.widget.LinearLayoutManager;
|
||||||
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.RecyclerView;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@ -137,6 +138,11 @@ public class UpdatesAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
|||||||
|
|
||||||
if (showAllUpdateableApps) {
|
if (showAllUpdateableApps) {
|
||||||
notifyItemRangeInserted(appsToShowStatus.size() + 1, updateableApps.size());
|
notifyItemRangeInserted(appsToShowStatus.size() + 1, updateableApps.size());
|
||||||
|
if (recyclerView != null) {
|
||||||
|
// Scroll so that the "Update X apps" header is at the top of the page, and the
|
||||||
|
// list of apps takes up the rest of the screen.
|
||||||
|
((LinearLayoutManager) recyclerView.getLayoutManager()).scrollToPositionWithOffset(appsToShowStatus.size(), 0);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
notifyItemRangeRemoved(appsToShowStatus.size() + 1, updateableApps.size());
|
notifyItemRangeRemoved(appsToShowStatus.size() + 1, updateableApps.size());
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,9 @@
|
|||||||
android:id="@+id/text_apps_to_update"
|
android:id="@+id/text_apps_to_update"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
tools:text="SAnd, Birthday Droid, Dados D"
|
tools:text="SAnd, Birthday Droid, Dados D, Other app, Another app"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="16dp"
|
||||||
android:layout_marginLeft="16dp"
|
android:layout_marginLeft="16dp"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
@ -50,7 +52,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/text_apps_to_update"
|
app:layout_constraintTop_toBottomOf="@+id/text_apps_to_update"
|
||||||
android:background="@android:color/transparent"
|
android:background="?attr/selectableItemBackground"
|
||||||
android:textColor="@color/fdroid_blue"
|
android:textColor="@color/fdroid_blue"
|
||||||
android:padding="0dp"
|
android:padding="0dp"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="16dp"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user