Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class AboutActivity : EdgeToEdgeIDEActivity() {
supportActionBar!!.setDisplayHomeAsUpEnabled(true)
supportActionBar!!.setTitle(R.string.about)
toolbar.setNavigationOnClickListener { onBackPressedDispatcher.onBackPressed() }
feedbackButtonManager = FeedbackButtonManager(this@AboutActivity, fabFeedback)
feedbackButtonManager = FeedbackButtonManager(this@AboutActivity, fabFeedback.root)
feedbackButtonManager?.setupDraggableFab()

aboutHeader.apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class MainActivity : EdgeToEdgeIDEActivity() {
feedbackButtonManager =
FeedbackButtonManager(
activity = this,
feedbackFab = binding.fabFeedback,
feedbackFab = binding.fabFeedback.root,
)

feedbackButtonManager?.setupDraggableFab()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package com.itsaky.androidide.activities

import android.content.Intent
import android.os.Bundle
import android.util.TypedValue
import android.view.View
import android.view.ViewTreeObserver
import android.view.animation.Animation
Expand Down Expand Up @@ -171,24 +170,21 @@ class OnboardingActivity : AppIntro2() {

val appIntroContainer: ConstraintLayout? = findViewById(R.id.background)
if (appIntroContainer != null) {
feedbackButton = FloatingActionButton(this@OnboardingActivity).apply {
id = R.id.fab_feedback
setImageResource(R.drawable.baseline_feedback_64)
contentDescription = getString(string.send_feedback)
val layoutParams = ConstraintLayout.LayoutParams(
// Reuse the shared feedback FAB definition (size, icon, elevation) so this
// matches every other screen (ADFA-2686); only positioning is set here.
feedbackButton = (layoutInflater.inflate(
R.layout.feedback_fab, appIntroContainer, false
) as FloatingActionButton).apply {
layoutParams = ConstraintLayout.LayoutParams(
ConstraintLayout.LayoutParams.WRAP_CONTENT,
ConstraintLayout.LayoutParams.WRAP_CONTENT
)

layoutParams.startToStart = ConstraintLayout.LayoutParams.PARENT_ID
layoutParams.bottomToBottom = ConstraintLayout.LayoutParams.PARENT_ID
val marginInPx = TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP,
16f,
resources.displayMetrics
).toInt()
layoutParams.setMargins(marginInPx, marginInPx, marginInPx, marginInPx)
this.layoutParams = layoutParams
).apply {
startToStart = ConstraintLayout.LayoutParams.PARENT_ID
bottomToBottom = ConstraintLayout.LayoutParams.PARENT_ID
val marginInPx =
resources.getDimensionPixelSize(R.dimen.feedback_fab_margin)
setMargins(marginInPx, marginInPx, marginInPx, marginInPx)
}
}

appIntroContainer.addView(feedbackButton)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class PluginManagerActivity : EdgeToEdgeIDEActivity() {
feedbackButtonManager =
FeedbackButtonManager(
activity = this,
feedbackFab = binding.fabFeedback,
feedbackFab = binding.fabFeedback.root,
)
feedbackButtonManager?.setupDraggableFab()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class PreferencesActivity : EdgeToEdgeIDEActivity() {

feedbackButtonManager = FeedbackButtonManager(
activity = this,
feedbackFab = binding.fabFeedback,
feedbackFab = binding.fabFeedback.root,
)
feedbackButtonManager?.setupDraggableFab()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ abstract class BaseEditorActivity :
feedbackButtonManager =
FeedbackButtonManager(
activity = this,
feedbackFab = binding.fabFeedback,
feedbackFab = binding.fabFeedback.root,
getLogContent = ::getLogContent,
)
feedbackButtonManager?.setupDraggableFab()
Expand Down
8 changes: 8 additions & 0 deletions app/src/main/res/layout-land/activity_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,12 @@

</com.google.android.material.appbar.AppBarLayout>

<include
android:id="@+id/fab_feedback"
layout="@layout/feedback_fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/feedback_fab_margin"
android:layout_gravity="bottom|start" />

</androidx.coordinatorlayout.widget.CoordinatorLayout>
8 changes: 8 additions & 0 deletions app/src/main/res/layout-sw600dp/activity_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,12 @@

</com.google.android.material.appbar.AppBarLayout>

<include
android:id="@+id/fab_feedback"
layout="@layout/feedback_fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/feedback_fab_margin"
android:layout_gravity="bottom|start" />

</androidx.coordinatorlayout.widget.CoordinatorLayout>
11 changes: 4 additions & 7 deletions app/src/main/res/layout/activity_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,12 @@

</com.google.android.material.appbar.AppBarLayout>

<com.google.android.material.floatingactionbutton.FloatingActionButton
<include
android:id="@+id/fab_feedback"
layout="@layout/feedback_fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:layout_gravity="bottom|start"
android:contentDescription="@string/send_feedback"
android:elevation="16dp"
android:src="@drawable/baseline_feedback_64"
app:fabCustomSize="32dp" />
android:layout_margin="@dimen/feedback_fab_margin"
android:layout_gravity="bottom|start" />

</androidx.coordinatorlayout.widget.CoordinatorLayout>
9 changes: 3 additions & 6 deletions app/src/main/res/layout/activity_editor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,12 @@

</FrameLayout>

<com.google.android.material.floatingactionbutton.FloatingActionButton
<include
android:id="@+id/fab_feedback"
layout="@layout/feedback_fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:contentDescription="@string/send_feedback"
android:elevation="16dp"
android:src="@drawable/baseline_feedback_64"
app:fabCustomSize="32dp"
android:layout_margin="@dimen/feedback_fab_margin"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />

Expand Down
9 changes: 3 additions & 6 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,12 @@
android:visibility="gone" />
</FrameLayout>

<com.google.android.material.floatingactionbutton.FloatingActionButton
<include
android:id="@+id/fab_feedback"
layout="@layout/feedback_fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:contentDescription="@string/send_feedback"
android:elevation="16dp"
android:src="@drawable/baseline_feedback_64"
app:fabCustomSize="32dp"
android:layout_margin="@dimen/feedback_fab_margin"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />

Expand Down
11 changes: 4 additions & 7 deletions app/src/main/res/layout/activity_plugin_manager.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,12 @@
android:contentDescription="@string/cd_add"
app:srcCompat="@drawable/ic_add" />

<com.google.android.material.floatingactionbutton.FloatingActionButton
<include
android:id="@+id/fab_feedback"
layout="@layout/feedback_fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:elevation="16dp"
android:layout_gravity="bottom|start"
android:contentDescription="@string/send_feedback"
android:src="@drawable/baseline_feedback_64"
app:fabCustomSize="32dp" />
android:layout_margin="@dimen/feedback_fab_margin"
android:layout_gravity="bottom|start" />

</androidx.coordinatorlayout.widget.CoordinatorLayout>
9 changes: 3 additions & 6 deletions app/src/main/res/layout/activity_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,12 @@

</androidx.core.widget.NestedScrollView>

<com.google.android.material.floatingactionbutton.FloatingActionButton
<include
android:id="@+id/fab_feedback"
layout="@layout/feedback_fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|start"
android:layout_margin="16dp"
android:contentDescription="@string/send_feedback"
android:elevation="16dp"
android:src="@drawable/baseline_feedback_64"
app:fabCustomSize="32dp" />
android:layout_margin="@dimen/feedback_fab_margin" />

</androidx.coordinatorlayout.widget.CoordinatorLayout>
18 changes: 18 additions & 0 deletions app/src/main/res/layout/feedback_fab.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Centralized "Send feedback" FAB (ADFA-2686).
This defines the button's APPEARANCE only (size, icon, elevation, content description).
Host screens supply positioning on the <include> tag (or in code for OnboardingActivity),
so every feedback FAB renders as the same small, consistent circle.
-->
<com.google.android.material.floatingactionbutton.FloatingActionButton
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/fab_feedback"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/send_feedback"
app:elevation="16dp"
app:srcCompat="@drawable/baseline_feedback_64"
app:fabCustomSize="@dimen/feedback_fab_size"
app:maxImageSize="@dimen/feedback_fab_icon_size" />
6 changes: 6 additions & 0 deletions resources/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,10 @@
<dimen name="toolbar_item_spacing">24dp</dimen>
<dimen name="faq_bottom_padding">24dp</dimen>
<dimen name="debugoverlay_content_spacing">16dp</dimen>

<!-- Feedback FAB (ADFA-2686): centralized so the button is one consistent size everywhere.
feedback_fab_icon_size controls how snugly the icon fills the circle. -->
<dimen name="feedback_fab_size">32dp</dimen>
<dimen name="feedback_fab_icon_size">26dp</dimen>
<dimen name="feedback_fab_margin">16dp</dimen>
</resources>
Loading