Show list of backups on restore click

This commit is contained in:
Moez Bhatti
2018-08-22 22:11:00 -04:00
parent b7605cd362
commit cde31e31a5
15 changed files with 390 additions and 28 deletions
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2017 Moez Bhatti <moez.bhatti@gmail.com>
~
~ This file is part of QKSMS.
~
~ QKSMS is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ QKSMS is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout 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="wrap_content"
android:orientation="vertical">
<com.moez.QKSMS.common.widget.QkTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="24dp"
android:layout_marginStart="24dp"
android:layout_marginTop="16dp"
android:text="@string/backup_restore_dialog_title"
android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold"
app:textSize="primary" />
<com.moez.QKSMS.common.widget.QkTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="24dp"
android:layout_marginStart="24dp"
android:layout_marginTop="2dp"
android:text="@string/backup_restore_dialog_summary"
android:textColor="?android:attr/textColorTertiary"
app:textSize="primary" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="16dp"
android:background="?android:attr/divider" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/files"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipChildren="false"
android:clipToPadding="false"
android:paddingBottom="8dp"
android:paddingTop="8dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:itemCount="3"
tools:listitem="@layout/backup_list_item" />
<com.moez.QKSMS.common.widget.QkTextView
android:id="@+id/empty"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginEnd="24dp"
android:layout_marginStart="24dp"
android:gravity="center"
android:text="@string/backup_restore_dialog_empty"
android:textColor="?android:attr/textColorSecondary"
app:textSize="secondary" />
</LinearLayout>
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2017 Moez Bhatti <moez.bhatti@gmail.com>
~
~ This file is part of QKSMS.
~
~ QKSMS is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ QKSMS is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
-->
<androidx.constraintlayout.widget.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="wrap_content"
android:orientation="vertical"
android:paddingBottom="8dp"
android:paddingEnd="24dp"
android:paddingStart="24dp"
android:paddingTop="8dp">
<com.moez.QKSMS.common.widget.QkTextView
android:id="@+id/title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold"
app:layout_constraintEnd_toStartOf="@id/size"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:textSize="secondary"
tools:text="5/7/18 4:18 PM" />
<com.moez.QKSMS.common.widget.QkTextView
android:id="@+id/messages"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:textColor="?android:attr/textColorTertiary"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/title"
app:textSize="secondary"
tools:text="72,302 messages" />
<com.moez.QKSMS.common.widget.QkTextView
android:id="@+id/size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?android:attr/textColorTertiary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:textSize="secondary"
tools:text="31.8 MB" />
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -150,6 +150,14 @@
<string name="backup_never">Never</string>
<string name="backup_restore_title">Restore</string>
<string name="backup_restore_summary">Select a backup</string>
<string name="backup_restore_dialog_title">Backups</string>
<string name="backup_restore_dialog_summary" translatable="false">/QKSMS/Backups</string>
<string name="backup_restore_dialog_empty">No backups found</string>
<plurals name="backup_message_count">
<item quantity="zero">No messages</item>
<item quantity="one">%d message</item>
<item quantity="other">%d messages</item>
</plurals>
<string name="backup_disclaimer">Currently, only SMS is supported by Backup and Restore. MMS support and scheduled backups will be coming soon!</string>
<string name="backup_now">Backup now</string>