forked from upstream-mirrors/quik
Create UI for backup activity
This commit is contained in:
@@ -93,6 +93,7 @@
|
|||||||
android:theme="@style/AppThemeLightDialog" />
|
android:theme="@style/AppThemeLightDialog" />
|
||||||
<activity android:name=".feature.settings.about.AboutController" />
|
<activity android:name=".feature.settings.about.AboutController" />
|
||||||
<activity android:name=".feature.scheduled.ScheduledActivity" />
|
<activity android:name=".feature.scheduled.ScheduledActivity" />
|
||||||
|
<activity android:name=".feature.backup.BackupActivity" />
|
||||||
|
|
||||||
<receiver android:name=".receiver.BootReceiver">
|
<receiver android:name=".receiver.BootReceiver">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import android.provider.Settings
|
|||||||
import android.provider.Telephony
|
import android.provider.Telephony
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import com.moez.QKSMS.BuildConfig
|
import com.moez.QKSMS.BuildConfig
|
||||||
|
import com.moez.QKSMS.feature.backup.BackupActivity
|
||||||
import com.moez.QKSMS.feature.blocked.BlockedActivity
|
import com.moez.QKSMS.feature.blocked.BlockedActivity
|
||||||
import com.moez.QKSMS.feature.compose.ComposeActivity
|
import com.moez.QKSMS.feature.compose.ComposeActivity
|
||||||
import com.moez.QKSMS.feature.conversationinfo.ConversationInfoActivity
|
import com.moez.QKSMS.feature.conversationinfo.ConversationInfoActivity
|
||||||
@@ -126,6 +127,11 @@ class Navigator @Inject constructor(
|
|||||||
from.startActivity(intent, options.toBundle())
|
from.startActivity(intent, options.toBundle())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun showBackup() {
|
||||||
|
analyticsManager.track("Viewed Backup")
|
||||||
|
startActivity(Intent(context, BackupActivity::class.java))
|
||||||
|
}
|
||||||
|
|
||||||
fun showScheduled() {
|
fun showScheduled() {
|
||||||
analyticsManager.track("Viewed Scheduled")
|
analyticsManager.track("Viewed Scheduled")
|
||||||
val intent = Intent(context, ScheduledActivity::class.java)
|
val intent = Intent(context, ScheduledActivity::class.java)
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import com.moez.QKSMS.common.util.Colors
|
|||||||
import com.moez.QKSMS.common.util.extensions.forEach
|
import com.moez.QKSMS.common.util.extensions.forEach
|
||||||
import com.moez.QKSMS.common.util.extensions.resolveThemeColor
|
import com.moez.QKSMS.common.util.extensions.resolveThemeColor
|
||||||
import com.moez.QKSMS.injection.appComponent
|
import com.moez.QKSMS.injection.appComponent
|
||||||
import com.uber.autodispose.android.scope
|
import com.uber.autodispose.android.ViewScopeProvider
|
||||||
import com.uber.autodispose.kotlin.autoDisposable
|
import com.uber.autodispose.kotlin.autoDisposable
|
||||||
import io.reactivex.subjects.BehaviorSubject
|
import io.reactivex.subjects.BehaviorSubject
|
||||||
import io.reactivex.subjects.Subject
|
import io.reactivex.subjects.Subject
|
||||||
@@ -97,7 +97,7 @@ class PagerTitleView @JvmOverloads constructor(context: Context, attrs: Attribut
|
|||||||
val textSecondary = context.resolveThemeColor(android.R.attr.textColorSecondary)
|
val textSecondary = context.resolveThemeColor(android.R.attr.textColorSecondary)
|
||||||
ColorStateList(states, intArrayOf(theme.theme, textSecondary))
|
ColorStateList(states, intArrayOf(theme.theme, textSecondary))
|
||||||
}
|
}
|
||||||
.autoDisposable(scope())
|
.autoDisposable(ViewScopeProvider.from(this))
|
||||||
.subscribe { colorStateList ->
|
.subscribe { colorStateList ->
|
||||||
childCount.forEach { index ->
|
childCount.forEach { index ->
|
||||||
(getChildAt(index) as? TextView)?.setTextColor(colorStateList)
|
(getChildAt(index) as? TextView)?.setTextColor(colorStateList)
|
||||||
|
|||||||
@@ -0,0 +1,101 @@
|
|||||||
|
/*
|
||||||
|
* 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/>.
|
||||||
|
*/
|
||||||
|
package com.moez.QKSMS.feature.backup
|
||||||
|
|
||||||
|
import android.app.Activity
|
||||||
|
import android.content.Intent
|
||||||
|
import android.net.Uri
|
||||||
|
import android.os.Bundle
|
||||||
|
import androidx.lifecycle.ViewModelProvider
|
||||||
|
import androidx.lifecycle.ViewModelProviders
|
||||||
|
import com.jakewharton.rxbinding2.view.clicks
|
||||||
|
import com.moez.QKSMS.R
|
||||||
|
import com.moez.QKSMS.common.base.QkThemedActivity
|
||||||
|
import com.moez.QKSMS.common.util.extensions.setBackgroundTint
|
||||||
|
import com.moez.QKSMS.common.util.extensions.setTint
|
||||||
|
import dagger.android.AndroidInjection
|
||||||
|
import io.reactivex.Observable
|
||||||
|
import io.reactivex.subjects.PublishSubject
|
||||||
|
import io.reactivex.subjects.Subject
|
||||||
|
import kotlinx.android.synthetic.main.backup_controller.*
|
||||||
|
import javax.inject.Inject
|
||||||
|
|
||||||
|
|
||||||
|
class BackupActivity : QkThemedActivity(), BackupView {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
private const val REQUEST_CODE = 427
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject lateinit var viewModelFactory: ViewModelProvider.Factory
|
||||||
|
|
||||||
|
private val viewModel by lazy { ViewModelProviders.of(this, viewModelFactory)[BackupViewModel::class.java] }
|
||||||
|
|
||||||
|
private val restoreFileSubject: Subject<Uri> = PublishSubject.create()
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
AndroidInjection.inject(this)
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
setContentView(R.layout.backup_controller)
|
||||||
|
setTitle(R.string.backup_title)
|
||||||
|
showBackButton(true)
|
||||||
|
viewModel.bindView(this)
|
||||||
|
|
||||||
|
colors.theme().let { theme ->
|
||||||
|
fab.setBackgroundTint(theme.theme)
|
||||||
|
fabIcon.setTint(theme.textPrimary)
|
||||||
|
fabLabel.setTextColor(theme.textPrimary)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||||
|
super.onActivityResult(requestCode, resultCode, data)
|
||||||
|
|
||||||
|
if (requestCode == REQUEST_CODE && resultCode == Activity.RESULT_OK) {
|
||||||
|
data?.data?.run(restoreFileSubject::onNext)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun render(state: BackupState) {
|
||||||
|
restore.isEnabled = state.upgraded
|
||||||
|
|
||||||
|
fabIcon.setImageResource(when (state.upgraded) {
|
||||||
|
true -> R.drawable.ic_file_upload_black_24dp
|
||||||
|
false -> R.drawable.ic_star_black_24dp
|
||||||
|
})
|
||||||
|
|
||||||
|
fabLabel.setText(when (state.upgraded) {
|
||||||
|
true -> R.string.backup_now
|
||||||
|
false -> R.string.title_qksms_plus
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun restoreClicks(): Observable<*> = restore.clicks()
|
||||||
|
|
||||||
|
override fun restoreFileSelected(): Observable<Uri> = restoreFileSubject
|
||||||
|
|
||||||
|
override fun fabClicks(): Observable<*> = fab.clicks()
|
||||||
|
|
||||||
|
override fun selectFile() {
|
||||||
|
val intent = Intent(Intent.ACTION_GET_CONTENT)
|
||||||
|
intent.type = "*/*"
|
||||||
|
startActivityForResult(Intent.createChooser(intent, "Choose directory"), REQUEST_CODE)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* 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/>.
|
||||||
|
*/
|
||||||
|
package com.moez.QKSMS.feature.backup
|
||||||
|
|
||||||
|
import androidx.lifecycle.ViewModel
|
||||||
|
import com.moez.QKSMS.injection.ViewModelKey
|
||||||
|
import dagger.Module
|
||||||
|
import dagger.Provides
|
||||||
|
import dagger.multibindings.IntoMap
|
||||||
|
|
||||||
|
@Module
|
||||||
|
class BackupActivityModule {
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@IntoMap
|
||||||
|
@ViewModelKey(BackupViewModel::class)
|
||||||
|
fun providePlusViewModel(viewModel: BackupViewModel): ViewModel = viewModel
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* 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/>.
|
||||||
|
*/
|
||||||
|
package com.moez.QKSMS.feature.backup
|
||||||
|
|
||||||
|
data class BackupState(
|
||||||
|
val upgraded: Boolean = false,
|
||||||
|
val lastBackup: Long = 0
|
||||||
|
)
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* 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/>.
|
||||||
|
*/
|
||||||
|
package com.moez.QKSMS.feature.backup
|
||||||
|
|
||||||
|
import android.net.Uri
|
||||||
|
import com.moez.QKSMS.common.base.QkView
|
||||||
|
import io.reactivex.Observable
|
||||||
|
|
||||||
|
interface BackupView : QkView<BackupState> {
|
||||||
|
|
||||||
|
fun restoreClicks(): Observable<*>
|
||||||
|
fun restoreFileSelected(): Observable<Uri>
|
||||||
|
fun fabClicks(): Observable<*>
|
||||||
|
|
||||||
|
fun selectFile()
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
/*
|
||||||
|
* 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/>.
|
||||||
|
*/
|
||||||
|
package com.moez.QKSMS.feature.backup
|
||||||
|
|
||||||
|
import com.moez.QKSMS.common.Navigator
|
||||||
|
import com.moez.QKSMS.common.androidxcompat.scope
|
||||||
|
import com.moez.QKSMS.common.base.QkViewModel
|
||||||
|
import com.moez.QKSMS.common.util.BillingManager
|
||||||
|
import com.uber.autodispose.kotlin.autoDisposable
|
||||||
|
import io.reactivex.rxkotlin.plusAssign
|
||||||
|
import io.reactivex.rxkotlin.withLatestFrom
|
||||||
|
import javax.inject.Inject
|
||||||
|
|
||||||
|
class BackupViewModel @Inject constructor(
|
||||||
|
private val billingManager: BillingManager,
|
||||||
|
private val navigator: Navigator
|
||||||
|
) : QkViewModel<BackupView, BackupState>(BackupState()) {
|
||||||
|
|
||||||
|
init {
|
||||||
|
disposables += billingManager.upgradeStatus
|
||||||
|
.subscribe { upgraded -> newState { copy(upgraded = upgraded) } }
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun bindView(view: BackupView) {
|
||||||
|
super.bindView(view)
|
||||||
|
|
||||||
|
view.restoreClicks()
|
||||||
|
.autoDisposable(view.scope())
|
||||||
|
.subscribe { view.selectFile() }
|
||||||
|
|
||||||
|
view.restoreFileSelected()
|
||||||
|
.autoDisposable(view.scope())
|
||||||
|
.subscribe()
|
||||||
|
|
||||||
|
view.fabClicks()
|
||||||
|
.withLatestFrom(billingManager.upgradeStatus) { _, upgraded -> upgraded }
|
||||||
|
.autoDisposable(view.scope())
|
||||||
|
.subscribe { upgraded ->
|
||||||
|
when (upgraded) {
|
||||||
|
true -> navigator.showQksmsPlusActivity("backup_fab")
|
||||||
|
false -> navigator.showQksmsPlusActivity("backup_fab")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -81,6 +81,7 @@ class MainActivity : QkThemedActivity(), MainView {
|
|||||||
Observable.merge(listOf(
|
Observable.merge(listOf(
|
||||||
inbox.clicks().map { DrawerItem.INBOX },
|
inbox.clicks().map { DrawerItem.INBOX },
|
||||||
archived.clicks().map { DrawerItem.ARCHIVED },
|
archived.clicks().map { DrawerItem.ARCHIVED },
|
||||||
|
backup.clicks().map { DrawerItem.BACKUP },
|
||||||
scheduled.clicks().map { DrawerItem.SCHEDULED },
|
scheduled.clicks().map { DrawerItem.SCHEDULED },
|
||||||
blocking.clicks().map { DrawerItem.BLOCKING },
|
blocking.clicks().map { DrawerItem.BLOCKING },
|
||||||
settings.clicks().map { DrawerItem.SETTINGS },
|
settings.clicks().map { DrawerItem.SETTINGS },
|
||||||
@@ -141,8 +142,10 @@ class MainActivity : QkThemedActivity(), MainView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Miscellaneous views
|
// Miscellaneous views
|
||||||
plusBadge.setBackgroundTint(theme.theme)
|
listOf(plusBadge1, plusBadge2).forEach { badge ->
|
||||||
plusBadge.setTextColor(theme.textPrimary)
|
badge.setBackgroundTint(theme.theme)
|
||||||
|
badge.setTextColor(theme.textPrimary)
|
||||||
|
}
|
||||||
syncingProgress.indeterminateTintList = ColorStateList.valueOf(theme.theme)
|
syncingProgress.indeterminateTintList = ColorStateList.valueOf(theme.theme)
|
||||||
plusIcon.setTint(theme.theme)
|
plusIcon.setTint(theme.theme)
|
||||||
rateIcon.setTint(theme.theme)
|
rateIcon.setTint(theme.theme)
|
||||||
@@ -193,7 +196,9 @@ class MainActivity : QkThemedActivity(), MainView {
|
|||||||
toolbar.menu.findItem(R.id.unread)?.isVisible = !markRead && selectedConversations != 0
|
toolbar.menu.findItem(R.id.unread)?.isVisible = !markRead && selectedConversations != 0
|
||||||
toolbar.menu.findItem(R.id.block)?.isVisible = selectedConversations != 0
|
toolbar.menu.findItem(R.id.block)?.isVisible = selectedConversations != 0
|
||||||
|
|
||||||
plusBadge.isVisible = drawerBadgesExperiment.variant && !state.upgraded
|
listOf(plusBadge1, plusBadge2).forEach { badge ->
|
||||||
|
badge.isVisible = drawerBadgesExperiment.variant && !state.upgraded
|
||||||
|
}
|
||||||
plus.isVisible = state.upgraded
|
plus.isVisible = state.upgraded
|
||||||
plusBanner.isVisible = !state.upgraded
|
plusBanner.isVisible = !state.upgraded
|
||||||
rateLayout.setVisible(state.showRating)
|
rateLayout.setVisible(state.showRating)
|
||||||
|
|||||||
@@ -48,4 +48,4 @@ interface MainView : QkView<MainState> {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class DrawerItem { INBOX, ARCHIVED, SCHEDULED, BLOCKING, SETTINGS, PLUS, HELP, INVITE }
|
enum class DrawerItem { INBOX, ARCHIVED, BACKUP, SCHEDULED, BLOCKING, SETTINGS, PLUS, HELP, INVITE }
|
||||||
@@ -192,6 +192,7 @@ class MainViewModel @Inject constructor(
|
|||||||
|
|
||||||
view.drawerItemIntent
|
view.drawerItemIntent
|
||||||
.doOnNext { newState { copy(drawerOpen = false) } }
|
.doOnNext { newState { copy(drawerOpen = false) } }
|
||||||
|
.doOnNext { if (it == DrawerItem.BACKUP) navigator.showBackup() }
|
||||||
.doOnNext { if (it == DrawerItem.SCHEDULED) navigator.showScheduled() }
|
.doOnNext { if (it == DrawerItem.SCHEDULED) navigator.showScheduled() }
|
||||||
.doOnNext { if (it == DrawerItem.BLOCKING) navigator.showBlockedConversations() }
|
.doOnNext { if (it == DrawerItem.BLOCKING) navigator.showBlockedConversations() }
|
||||||
.doOnNext { if (it == DrawerItem.SETTINGS) navigator.showSettings() }
|
.doOnNext { if (it == DrawerItem.SETTINGS) navigator.showSettings() }
|
||||||
|
|||||||
@@ -18,6 +18,8 @@
|
|||||||
*/
|
*/
|
||||||
package com.moez.QKSMS.injection.android
|
package com.moez.QKSMS.injection.android
|
||||||
|
|
||||||
|
import com.moez.QKSMS.feature.backup.BackupActivity
|
||||||
|
import com.moez.QKSMS.feature.backup.BackupActivityModule
|
||||||
import com.moez.QKSMS.feature.blocked.BlockedActivity
|
import com.moez.QKSMS.feature.blocked.BlockedActivity
|
||||||
import com.moez.QKSMS.feature.blocked.BlockedActivityModule
|
import com.moez.QKSMS.feature.blocked.BlockedActivityModule
|
||||||
import com.moez.QKSMS.feature.compose.ComposeActivity
|
import com.moez.QKSMS.feature.compose.ComposeActivity
|
||||||
@@ -51,6 +53,10 @@ abstract class ActivityBuilderModule {
|
|||||||
@ContributesAndroidInjector(modules = [PlusActivityModule::class])
|
@ContributesAndroidInjector(modules = [PlusActivityModule::class])
|
||||||
abstract fun bindPlusActivity(): PlusActivity
|
abstract fun bindPlusActivity(): PlusActivity
|
||||||
|
|
||||||
|
@ActivityScope
|
||||||
|
@ContributesAndroidInjector(modules = [BackupActivityModule::class])
|
||||||
|
abstract fun bindBackupActivity(): BackupActivity
|
||||||
|
|
||||||
@ActivityScope
|
@ActivityScope
|
||||||
@ContributesAndroidInjector(modules = [ComposeActivityModule::class])
|
@ContributesAndroidInjector(modules = [ComposeActivityModule::class])
|
||||||
abstract fun bindComposeActivity(): ComposeActivity
|
abstract fun bindComposeActivity(): ComposeActivity
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<!--
|
||||||
|
~ 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/>.
|
||||||
|
-->
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M19,9h-4V3H9v6H5l7,7 7,-7zM5,18v2h14v-2H5z"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<!--
|
||||||
|
~ 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/>.
|
||||||
|
-->
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M9,16h6v-6h4l-7,-7 -7,7h4zM5,18h14v2L5,20z"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<!--
|
||||||
|
~ 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/>.
|
||||||
|
-->
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M13,3c-4.97,0 -9,4.03 -9,9L1,12l3.89,3.89 0.07,0.14L9,12L6,12c0,-3.87 3.13,-7 7,-7s7,3.13 7,7 -3.13,7 -7,7c-1.93,0 -3.68,-0.79 -4.94,-2.06l-1.42,1.42C8.27,19.99 10.51,21 13,21c4.97,0 9,-4.03 9,-9s-4.03,-9 -9,-9zM12,8v5l4.28,2.54 0.72,-1.21 -3.5,-2.08L13.5,8L12,8z"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<!--
|
||||||
|
~ 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/>.
|
||||||
|
-->
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M9,3L5,6.99h3L8,14h2L10,6.99h3L9,3zM16,17.01L16,10h-2v7.01h-3L15,21l4,-3.99h-3z"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,122 @@
|
|||||||
|
<?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="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<include layout="@layout/toolbar" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1">
|
||||||
|
|
||||||
|
<ScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:paddingBottom="8dp"
|
||||||
|
android:paddingTop="8dp">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<com.moez.QKSMS.common.widget.PreferenceView
|
||||||
|
android:id="@+id/backup"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:icon="@drawable/ic_history_black_24dp"
|
||||||
|
app:title="@string/backup_last"
|
||||||
|
tools:summary="@string/backup_never" />
|
||||||
|
|
||||||
|
<com.moez.QKSMS.common.widget.PreferenceView
|
||||||
|
android:id="@+id/restore"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:icon="@drawable/ic_file_download_black_24dp"
|
||||||
|
app:summary="@string/backup_restore_summary"
|
||||||
|
app:title="@string/backup_restore_title" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="?android:attr/divider" />
|
||||||
|
|
||||||
|
<com.moez.QKSMS.common.widget.QkTextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="24dp"
|
||||||
|
android:text="@string/backup_disclaimer"
|
||||||
|
android:textColor="?android:attr/textColorTertiary"
|
||||||
|
app:textSize="secondary" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/fab"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_gravity="bottom|end"
|
||||||
|
android:layout_margin="16dp"
|
||||||
|
android:background="@drawable/rounded_rectangle_24dp"
|
||||||
|
android:elevation="4dp"
|
||||||
|
android:gravity="center"
|
||||||
|
tools:backgroundTint="@color/tools_theme">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/fabIcon"
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:layout_marginStart="12dp"
|
||||||
|
android:src="@drawable/ic_star_black_24dp"
|
||||||
|
tools:tint="@color/textPrimaryDark" />
|
||||||
|
|
||||||
|
<com.moez.QKSMS.common.widget.QkTextView
|
||||||
|
android:id="@+id/fabLabel"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:text="@string/title_qksms_plus"
|
||||||
|
android:textColor="@color/textPrimaryDark"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:textSize="primary" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="8dp"
|
||||||
|
android:background="@drawable/ab_shadow" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="?android:attr/divider" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
@@ -70,6 +70,33 @@
|
|||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:background="?android:attr/divider" />
|
android:background="?android:attr/divider" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/backup"
|
||||||
|
style="@style/DrawerRow">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
style="@style/DrawerIcon"
|
||||||
|
android:src="@drawable/ic_import_export_black_24dp"
|
||||||
|
android:tint="?android:attr/textColorSecondary" />
|
||||||
|
|
||||||
|
<com.moez.QKSMS.common.widget.QkTextView
|
||||||
|
style="@style/DrawerText"
|
||||||
|
android:text="@string/backup_title" />
|
||||||
|
|
||||||
|
<com.moez.QKSMS.common.widget.QkTextView
|
||||||
|
android:id="@+id/plusBadge1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/rounded_rectangle_2dp"
|
||||||
|
android:padding="4dp"
|
||||||
|
android:text="@string/title_qksms_plus"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:textSize="tertiary"
|
||||||
|
tools:backgroundTint="@color/tools_theme"
|
||||||
|
tools:textColor="@color/textPrimaryDark" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/scheduled"
|
android:id="@+id/scheduled"
|
||||||
style="@style/DrawerRow">
|
style="@style/DrawerRow">
|
||||||
@@ -84,7 +111,7 @@
|
|||||||
android:text="@string/drawer_scheduled" />
|
android:text="@string/drawer_scheduled" />
|
||||||
|
|
||||||
<com.moez.QKSMS.common.widget.QkTextView
|
<com.moez.QKSMS.common.widget.QkTextView
|
||||||
android:id="@+id/plusBadge"
|
android:id="@+id/plusBadge2"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/rounded_rectangle_2dp"
|
android:background="@drawable/rounded_rectangle_2dp"
|
||||||
|
|||||||
@@ -145,6 +145,14 @@
|
|||||||
|
|
||||||
<string name="gallery_toast_saved">Saved to gallery</string>
|
<string name="gallery_toast_saved">Saved to gallery</string>
|
||||||
|
|
||||||
|
<string name="backup_title">Backup and restore</string>
|
||||||
|
<string name="backup_last">Last backup</string>
|
||||||
|
<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_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>
|
||||||
|
|
||||||
<string name="scheduled_title">Scheduled</string>
|
<string name="scheduled_title">Scheduled</string>
|
||||||
<string name="scheduled_empty_description">Automatically send a message, at the exact moment you\'d like</string>
|
<string name="scheduled_empty_description">Automatically send a message, at the exact moment you\'d like</string>
|
||||||
<string name="scheduled_empty_message_1">Hey! When was your birthday again?</string>
|
<string name="scheduled_empty_message_1">Hey! When was your birthday again?</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user