Merge branch 'updates-tab' into 'master'
Displaying background in updates fragment See merge request !522
This commit is contained in:
commit
18bf71a149
@ -5,6 +5,7 @@ import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.fdroid.fdroid.R;
|
||||
@ -14,6 +15,7 @@ public class UpdatesViewBinder {
|
||||
private final UpdatesAdapter adapter;
|
||||
private final RecyclerView list;
|
||||
private final TextView emptyState;
|
||||
private final ImageView emptyImage;
|
||||
|
||||
public UpdatesViewBinder(AppCompatActivity activity, FrameLayout parent) {
|
||||
View view = activity.getLayoutInflater().inflate(R.layout.main_tab_updates, parent, true);
|
||||
@ -27,6 +29,7 @@ public class UpdatesViewBinder {
|
||||
list.setAdapter(adapter);
|
||||
|
||||
emptyState = (TextView) view.findViewById(R.id.empty_state);
|
||||
emptyImage = (ImageView) view.findViewById(R.id.image);
|
||||
}
|
||||
|
||||
public void bind() {
|
||||
@ -41,9 +44,11 @@ public class UpdatesViewBinder {
|
||||
if (adapter.getItemCount() == 0) {
|
||||
list.setVisibility(View.GONE);
|
||||
emptyState.setVisibility(View.VISIBLE);
|
||||
emptyImage.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
list.setVisibility(View.VISIBLE);
|
||||
emptyState.setVisibility(View.GONE);
|
||||
emptyImage.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
7
app/src/main/res/drawable/no_updates_bg.xml
Normal file
7
app/src/main/res/drawable/no_updates_bg.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<vector android:height="24dp" android:viewportHeight="634.0"
|
||||
android:viewportWidth="720.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path
|
||||
android:fillAlpha="1" android:fillColor="#f9f9f9"
|
||||
android:pathData="m 412.46036,501.73018 a 47.11509,47.11509 0 0 1 -47.11509,47.11509 47.11509,47.11509 0 0 1 -47.11509,-47.11509 h 94.23018 M 365.34527,77.69437 a 23.557545,23.557545 0 0 1 23.55755,23.55754 v 25.44215 c 66.90342,11.30762 117.78772,69.49476 117.78772,139.46067 V 407.5 l 70.67264,70.67263 H 153.32737 L 224,407.5 V 266.15473 c 0,-69.96591 50.8843,-128.15305 117.78773,-139.46067 v -25.44215 a 23.557545,23.557545 0 0 1 23.55754,-23.55754 z"
|
||||
android:strokeColor="#00000000" android:strokeWidth="1"/>
|
||||
</vector>
|
@ -1,23 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<android.support.constraint.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/mainTabSwapBackground">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/empty_state"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AppListEmptyText"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:visibility="gone"
|
||||
android:text="@string/empty_can_update_app_list" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/image"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:src="@drawable/no_updates_bg"
|
||||
android:importantForAccessibility="no"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/empty_state"
|
||||
android:tint="?attr/mainTabSwapSplashTint"
|
||||
android:scaleType="fitXY"
|
||||
android:visibility="gone" />
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/list"
|
||||
tools:listitem="@layout/app_list_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
</FrameLayout>
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
@ -114,8 +114,9 @@
|
||||
<style name="AppListEmptyText">
|
||||
<item name="android:id">@android:id/empty</item>
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:padding">20dp</item>
|
||||
<item name="android:padding">48dp</item>
|
||||
<item name="android:textSize">20sp</item>
|
||||
<item name="android:textColor">#4a4a4a</item>
|
||||
</style>
|
||||
|
||||
<style name="SwapTheme.Wizard" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
|
Loading…
x
Reference in New Issue
Block a user