1
0
mirror of https://github.com/etesync/android synced 2024-11-25 17:38:13 +00:00

Add a FAB to the collection view activity with info about EteSync.

Many users don't understand how EteSync works and think that this replaces
their existing apps. This should make it more obvious that they should
just use the apps they already use.
This commit is contained in:
Tom Hacohen 2020-02-05 15:49:27 +02:00
parent ccc17ba141
commit 021c6595e3
3 changed files with 68 additions and 39 deletions

View File

@ -10,6 +10,7 @@ package com.etesync.syncadapter.ui
import android.accounts.Account
import android.content.Context
import android.content.DialogInterface
import android.content.Intent
import android.os.AsyncTask
import android.os.Bundle
@ -25,6 +26,7 @@ import at.bitfire.ical4android.CalendarStorageException
import at.bitfire.ical4android.TaskProvider
import at.bitfire.vcard4android.ContactsStorageException
import com.etesync.syncadapter.App
import com.etesync.syncadapter.Constants
import com.etesync.syncadapter.R
import com.etesync.syncadapter.model.CollectionInfo
import com.etesync.syncadapter.model.EntryEntity
@ -36,6 +38,7 @@ import com.etesync.syncadapter.ui.importlocal.ImportActivity
import com.etesync.syncadapter.ui.journalviewer.ListEntriesFragment
import com.etesync.syncadapter.utils.HintManager
import com.etesync.syncadapter.utils.ShowcaseBuilder
import com.google.android.material.floatingactionbutton.FloatingActionButton
import tourguide.tourguide.ToolTip
import java.io.FileNotFoundException
import java.util.*
@ -116,6 +119,16 @@ class ViewCollectionActivity : BaseActivity(), Refreshable {
tourGuide.playOn(title)
HintManager.setHintSeen(this, HINT_IMPORT, true)
}
val fab = findViewById<FloatingActionButton>(R.id.fab)
fab.setOnClickListener {
AlertDialog.Builder(this)
.setIcon(R.drawable.ic_info_dark)
.setTitle(R.string.use_native_apps_title)
.setMessage(R.string.use_native_apps_body)
.setNegativeButton(R.string.navigation_drawer_guide, { _: DialogInterface, _: Int -> WebViewActivity.openUrl(this, Constants.helpUri) })
.setPositiveButton(android.R.string.yes) { _, _ -> }.show()
}
}
override fun onCreateOptionsMenu(menu: Menu): Boolean {

View File

@ -1,5 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
@ -17,10 +21,12 @@
android:text="@string/change_journal_title"
android:textAppearance="?android:attr/textAppearanceMedium" />
<LinearLayout android:layout_width="match_parent"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="@dimen/activity_margin">
<TextView
android:id="@+id/stats"
android:layout_width="0dp"
@ -32,8 +38,7 @@
android:id="@+id/progressBar"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="right"
/>
android:layout_gravity="right" />
</LinearLayout>
<LinearLayout
@ -41,7 +46,16 @@
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical">
</LinearLayout>
android:orientation="vertical" />
</LinearLayout>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
android:src="@drawable/ic_add_light" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -140,6 +140,8 @@
<string name="not_allowed_title">Not Allowed</string>
<string name="edit_owner_only">Only the owner of this collection (%s) is allowed to edit it.</string>
<string name="members_old_journals_not_allowed">Sharing of old-style journals is not allowed. In order to share this journal, create a new one, and copy its contents over using the \"import\" dialog. If you are experiencing any issues, please contact support.</string>
<string name="use_native_apps_title">Did you know?</string>
<string name="use_native_apps_body">EteSync seamlessly integrates with Android, so to use it, just use your existing address book and calendar apps!\n\nFor more information, please check out the user guide.</string>
<!-- CollectionMembers -->
<string name="collection_members_title">Members</string>