Show arc from creation hint to fab in WebDAV- and Local-cloud-list too
This commit is contained in:
parent
f0396c37f1
commit
d398c069b5
@ -81,7 +81,7 @@ public class VaultsOperationsTest {
|
|||||||
removeFolderInCloud(appComponent, "0/testLoggedInVault/", CloudType.values()[cloudId]);
|
removeFolderInCloud(appComponent, "0/testLoggedInVault/", CloudType.values()[cloudId]);
|
||||||
}
|
}
|
||||||
|
|
||||||
onView(withId(R.id.fab_vault)) //
|
onView(withId(R.id.floating_action_button)) //
|
||||||
.perform(click());
|
.perform(click());
|
||||||
|
|
||||||
awaitCompleted();
|
awaitCompleted();
|
||||||
@ -187,14 +187,14 @@ public class VaultsOperationsTest {
|
|||||||
onView(withId(android.R.id.button1)) //
|
onView(withId(android.R.id.button1)) //
|
||||||
.perform(click());
|
.perform(click());
|
||||||
|
|
||||||
onView(withId(R.id.tv_vault_creation_hint));
|
onView(withId(R.id.tv_creation_hint));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void test08addExistingVaultsLeadsToAddedVaults() {
|
public void test08addExistingVaultsLeadsToAddedVaults() {
|
||||||
waitForIdle(device);
|
waitForIdle(device);
|
||||||
|
|
||||||
onView(withId(R.id.fab_vault)) //
|
onView(withId(R.id.floating_action_button)) //
|
||||||
.perform(click());
|
.perform(click());
|
||||||
|
|
||||||
waitForIdle(device);
|
waitForIdle(device);
|
||||||
|
@ -42,7 +42,6 @@ class CloudConnectionListFragment : BaseFragment() {
|
|||||||
setupRecyclerView()
|
setupRecyclerView()
|
||||||
rv_local_default_cloud.setOnClickListener { cloudConnectionListPresenter.onDefaultLocalCloudConnectionClicked() }
|
rv_local_default_cloud.setOnClickListener { cloudConnectionListPresenter.onDefaultLocalCloudConnectionClicked() }
|
||||||
floating_action_button.setOnClickListener { cloudConnectionListPresenter.onAddConnectionClicked() }
|
floating_action_button.setOnClickListener { cloudConnectionListPresenter.onAddConnectionClicked() }
|
||||||
emptyCloudConnectionsHint.setText(R.string.screen_cloud_connections_no_connections)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun loadContent() {
|
override fun loadContent() {
|
||||||
@ -65,7 +64,7 @@ class CloudConnectionListFragment : BaseFragment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun updateConnectionListHint() {
|
private fun updateConnectionListHint() {
|
||||||
rl_empty_cloud_connections_hint.visibility = if (cloudConnectionListAdapter.isEmpty) VISIBLE else GONE
|
rl_creation_hint.visibility = if (cloudConnectionListAdapter.isEmpty) VISIBLE else GONE
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setSelectedCloudType(selectedCloudType: CloudTypeModel) {
|
fun setSelectedCloudType(selectedCloudType: CloudTypeModel) {
|
||||||
|
@ -51,7 +51,7 @@ class VaultListFragment : BaseFragment() {
|
|||||||
|
|
||||||
override fun setupView() {
|
override fun setupView() {
|
||||||
setupRecyclerView()
|
setupRecyclerView()
|
||||||
fab_vault.setOnClickListener { vaultListPresenter.onCreateVaultClicked() }
|
floating_action_button.setOnClickListener { vaultListPresenter.onCreateVaultClicked() }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
@ -77,11 +77,11 @@ class VaultListFragment : BaseFragment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun showVaultCreationHint() {
|
fun showVaultCreationHint() {
|
||||||
rl_vault_creation_hint.visibility = View.VISIBLE
|
rl_creation_hint.visibility = View.VISIBLE
|
||||||
}
|
}
|
||||||
|
|
||||||
fun hideVaultCreationHint() {
|
fun hideVaultCreationHint() {
|
||||||
rl_vault_creation_hint.visibility = View.GONE
|
rl_creation_hint.visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
|
||||||
fun isVaultLocked(vaultModel: VaultModel?): Boolean {
|
fun isVaultLocked(vaultModel: VaultModel?): Boolean {
|
||||||
|
@ -13,7 +13,7 @@ import timber.log.Timber
|
|||||||
import kotlin.math.cos
|
import kotlin.math.cos
|
||||||
import kotlin.math.sin
|
import kotlin.math.sin
|
||||||
|
|
||||||
class VaultListCoordinatorLayout : CoordinatorLayout {
|
class ArcAwareCoordinatorLayout : CoordinatorLayout {
|
||||||
|
|
||||||
private val pixelsPerDp: Int
|
private val pixelsPerDp: Int
|
||||||
|
|
||||||
@ -34,16 +34,16 @@ class VaultListCoordinatorLayout : CoordinatorLayout {
|
|||||||
|
|
||||||
override fun dispatchDraw(canvas: Canvas) {
|
override fun dispatchDraw(canvas: Canvas) {
|
||||||
super.dispatchDraw(canvas)
|
super.dispatchDraw(canvas)
|
||||||
if (findViewById<View>(R.id.rl_vault_creation_hint).visibility == VISIBLE) {
|
if (findViewById<View>(R.id.rl_creation_hint).visibility == VISIBLE) {
|
||||||
drawArcFromHintToFloatingActionButton(canvas)
|
drawArcFromHintToFloatingActionButton(canvas)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun drawArcFromHintToFloatingActionButton(canvas: Canvas) {
|
private fun drawArcFromHintToFloatingActionButton(canvas: Canvas) {
|
||||||
val vaultCreationHint = findViewById<View>(R.id.tv_vault_creation_hint)
|
val creationHint = findViewById<View>(R.id.tv_creation_hint)
|
||||||
val floatingActionButton = findViewById<View>(R.id.fab_vault)
|
val floatingActionButton = findViewById<View>(R.id.floating_action_button)
|
||||||
val centerXOfHint = (vaultCreationHint.left + vaultCreationHint.right) / 2f
|
val centerXOfHint = (creationHint.left + creationHint.right) / 2f
|
||||||
val bottomOfHint = vaultCreationHint.bottom.toFloat()
|
val bottomOfHint = creationHint.bottom.toFloat()
|
||||||
val topOfFloatingActionButton = floatingActionButton.top.toFloat()
|
val topOfFloatingActionButton = floatingActionButton.top.toFloat()
|
||||||
|
|
||||||
when (val layoutDirection = resources.configuration.layoutDirection) {
|
when (val layoutDirection = resources.configuration.layoutDirection) {
|
||||||
@ -62,7 +62,7 @@ class VaultListCoordinatorLayout : CoordinatorLayout {
|
|||||||
.draw(canvas, strokeLineWithWidthOf1f())
|
.draw(canvas, strokeLineWithWidthOf1f())
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
Timber.tag("VaultListCoordinatorLay").e("Layout direction not supported, skip drawing arc")
|
Timber.tag("ArcAwareCoordinatorLayo").e("Layout direction not supported, skip drawing arc")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<org.cryptomator.presentation.ui.layout.SlidingCoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<org.cryptomator.presentation.ui.layout.ArcAwareCoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
@ -66,5 +66,4 @@
|
|||||||
layout="@layout/floating_action_button_layout"
|
layout="@layout/floating_action_button_layout"
|
||||||
app:layout_anchor="@id/recyclerView" />
|
app:layout_anchor="@id/recyclerView" />
|
||||||
|
|
||||||
|
</org.cryptomator.presentation.ui.layout.ArcAwareCoordinatorLayout>
|
||||||
</org.cryptomator.presentation.ui.layout.SlidingCoordinatorLayout>
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<org.cryptomator.presentation.ui.layout.VaultListCoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<org.cryptomator.presentation.ui.layout.ArcAwareCoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/coordinatorLayout"
|
android:id="@+id/coordinatorLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -10,8 +10,8 @@
|
|||||||
<include layout="@layout/view_vault_creation_hint" />
|
<include layout="@layout/view_vault_creation_hint" />
|
||||||
|
|
||||||
<include
|
<include
|
||||||
android:id="@+id/fab_vault"
|
android:id="@+id/floating_action_button"
|
||||||
layout="@layout/floating_action_button_layout"
|
layout="@layout/floating_action_button_layout"
|
||||||
app:layout_anchor="@id/recyclerView" />
|
app:layout_anchor="@id/recyclerView" />
|
||||||
|
|
||||||
</org.cryptomator.presentation.ui.layout.VaultListCoordinatorLayout>
|
</org.cryptomator.presentation.ui.layout.ArcAwareCoordinatorLayout>
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/rl_empty_cloud_connections_hint"
|
android:id="@+id/rl_creation_hint"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/emptyCloudConnectionsHint"
|
android:id="@+id/tv_creation_hint"
|
||||||
style="@style/AppTheme.Hint" />
|
style="@style/AppTheme.Hint"
|
||||||
|
android:text="@string/screen_cloud_connections_no_connections" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/rl_vault_creation_hint"
|
android:id="@+id/rl_creation_hint"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_vault_creation_hint"
|
android:id="@+id/tv_creation_hint"
|
||||||
style="@style/AppTheme.Hint"
|
style="@style/AppTheme.Hint"
|
||||||
android:text="@string/screen_vault_list_vault_creation_hint" />
|
android:text="@string/screen_vault_list_vault_creation_hint" />
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user