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]);
|
||||
}
|
||||
|
||||
onView(withId(R.id.fab_vault)) //
|
||||
onView(withId(R.id.floating_action_button)) //
|
||||
.perform(click());
|
||||
|
||||
awaitCompleted();
|
||||
@ -187,14 +187,14 @@ public class VaultsOperationsTest {
|
||||
onView(withId(android.R.id.button1)) //
|
||||
.perform(click());
|
||||
|
||||
onView(withId(R.id.tv_vault_creation_hint));
|
||||
onView(withId(R.id.tv_creation_hint));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test08addExistingVaultsLeadsToAddedVaults() {
|
||||
waitForIdle(device);
|
||||
|
||||
onView(withId(R.id.fab_vault)) //
|
||||
onView(withId(R.id.floating_action_button)) //
|
||||
.perform(click());
|
||||
|
||||
waitForIdle(device);
|
||||
|
@ -42,7 +42,6 @@ class CloudConnectionListFragment : BaseFragment() {
|
||||
setupRecyclerView()
|
||||
rv_local_default_cloud.setOnClickListener { cloudConnectionListPresenter.onDefaultLocalCloudConnectionClicked() }
|
||||
floating_action_button.setOnClickListener { cloudConnectionListPresenter.onAddConnectionClicked() }
|
||||
emptyCloudConnectionsHint.setText(R.string.screen_cloud_connections_no_connections)
|
||||
}
|
||||
|
||||
override fun loadContent() {
|
||||
@ -65,7 +64,7 @@ class CloudConnectionListFragment : BaseFragment() {
|
||||
}
|
||||
|
||||
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) {
|
||||
|
@ -51,7 +51,7 @@ class VaultListFragment : BaseFragment() {
|
||||
|
||||
override fun setupView() {
|
||||
setupRecyclerView()
|
||||
fab_vault.setOnClickListener { vaultListPresenter.onCreateVaultClicked() }
|
||||
floating_action_button.setOnClickListener { vaultListPresenter.onCreateVaultClicked() }
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
@ -77,11 +77,11 @@ class VaultListFragment : BaseFragment() {
|
||||
}
|
||||
|
||||
fun showVaultCreationHint() {
|
||||
rl_vault_creation_hint.visibility = View.VISIBLE
|
||||
rl_creation_hint.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
fun hideVaultCreationHint() {
|
||||
rl_vault_creation_hint.visibility = View.GONE
|
||||
rl_creation_hint.visibility = View.GONE
|
||||
}
|
||||
|
||||
fun isVaultLocked(vaultModel: VaultModel?): Boolean {
|
||||
|
@ -13,7 +13,7 @@ import timber.log.Timber
|
||||
import kotlin.math.cos
|
||||
import kotlin.math.sin
|
||||
|
||||
class VaultListCoordinatorLayout : CoordinatorLayout {
|
||||
class ArcAwareCoordinatorLayout : CoordinatorLayout {
|
||||
|
||||
private val pixelsPerDp: Int
|
||||
|
||||
@ -34,16 +34,16 @@ class VaultListCoordinatorLayout : CoordinatorLayout {
|
||||
|
||||
override fun dispatchDraw(canvas: 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)
|
||||
}
|
||||
}
|
||||
|
||||
private fun drawArcFromHintToFloatingActionButton(canvas: Canvas) {
|
||||
val vaultCreationHint = findViewById<View>(R.id.tv_vault_creation_hint)
|
||||
val floatingActionButton = findViewById<View>(R.id.fab_vault)
|
||||
val centerXOfHint = (vaultCreationHint.left + vaultCreationHint.right) / 2f
|
||||
val bottomOfHint = vaultCreationHint.bottom.toFloat()
|
||||
val creationHint = findViewById<View>(R.id.tv_creation_hint)
|
||||
val floatingActionButton = findViewById<View>(R.id.floating_action_button)
|
||||
val centerXOfHint = (creationHint.left + creationHint.right) / 2f
|
||||
val bottomOfHint = creationHint.bottom.toFloat()
|
||||
val topOfFloatingActionButton = floatingActionButton.top.toFloat()
|
||||
|
||||
when (val layoutDirection = resources.configuration.layoutDirection) {
|
||||
@ -62,7 +62,7 @@ class VaultListCoordinatorLayout : CoordinatorLayout {
|
||||
.draw(canvas, strokeLineWithWidthOf1f())
|
||||
}
|
||||
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"?>
|
||||
<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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@ -66,5 +66,4 @@
|
||||
layout="@layout/floating_action_button_layout"
|
||||
app:layout_anchor="@id/recyclerView" />
|
||||
|
||||
|
||||
</org.cryptomator.presentation.ui.layout.SlidingCoordinatorLayout>
|
||||
</org.cryptomator.presentation.ui.layout.ArcAwareCoordinatorLayout>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?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"
|
||||
android:id="@+id/coordinatorLayout"
|
||||
android:layout_width="match_parent"
|
||||
@ -10,8 +10,8 @@
|
||||
<include layout="@layout/view_vault_creation_hint" />
|
||||
|
||||
<include
|
||||
android:id="@+id/fab_vault"
|
||||
android:id="@+id/floating_action_button"
|
||||
layout="@layout/floating_action_button_layout"
|
||||
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"
|
||||
android:id="@+id/rl_empty_cloud_connections_hint"
|
||||
android:id="@+id/rl_creation_hint"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/emptyCloudConnectionsHint"
|
||||
style="@style/AppTheme.Hint" />
|
||||
android:id="@+id/tv_creation_hint"
|
||||
style="@style/AppTheme.Hint"
|
||||
android:text="@string/screen_cloud_connections_no_connections" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
@ -1,12 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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_height="match_parent"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_vault_creation_hint"
|
||||
android:id="@+id/tv_creation_hint"
|
||||
style="@style/AppTheme.Hint"
|
||||
android:text="@string/screen_vault_list_vault_creation_hint" />
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user