Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wear Plugin Add button to access to Exchange site for cwf in doc #3273

Merged
merged 2 commits into from
Mar 20, 2024
Merged
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
1,580 changes: 1,580 additions & 0 deletions _docs/icons/more_cwf.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions core/interfaces/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,6 @@
<string name="pref_show_date">Show Date</string>
<string name="default_custom_watchface_comment">Default watchface, you can click on EXPORT WATCHFACE button to generate a template</string>
<string name="wear_default_watchface">Default Watchface</string>
<string name="wear_more_watchfaces">More watchfaces</string>

</resources>
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package app.aaps.plugins.sync.wear

import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
Expand Down Expand Up @@ -67,9 +68,9 @@ class WearFragment : DaggerFragment() {
importExportPrefs.importCustomWatchface(this)
}
}
binding.defaultCustom.setOnClickListener {
rxBus.send(EventMobileToWear(EventData.ActionrequestSetDefaultWatchface(dateUtil.now())))
updateGui()
binding.moreCustom.setOnClickListener {
val intent = Intent().apply { action = Intent.ACTION_VIEW; data = Uri.parse(rh.gs(R.string.wear_link_to_more_cwf_doc)) }
startActivity(intent)
}
binding.exportCustom.setOnClickListener {
rxBus.send(EventMobileToWear(EventData.ActionrequestCustomWatchface(true)))
Expand Down
270 changes: 270 additions & 0 deletions plugins/sync/src/main/res/drawable/more_cwf.xml

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions plugins/sync/src/main/res/layout/wear_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -157,24 +157,24 @@
app:layout_columnWeight="1"
app:layout_gravity="fill"
app:layout_row="1"
app:layout_column="0" />
app:layout_column="1" />

<app.aaps.core.ui.elements.SingleClickButton
android:id="@+id/default_custom"
android:id="@+id/more_custom"
style="@style/GrayButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:drawableTop="@drawable/set_default"
android:drawableTop="@drawable/more_cwf"
android:paddingStart="0dp"
android:paddingEnd="0dp"
android:text="@string/wear_default_watchface"
android:text="@string/wear_more_watchfaces"
android:textSize="12sp"
android:textColor="?attr/treatmentButton"
android:visibility="visible"
app:layout_columnWeight="1"
app:layout_gravity="fill"
app:layout_row="1"
app:layout_column="1" />
app:layout_column="0" />

</androidx.gridlayout.widget.GridLayout>

Expand Down
1 change: 1 addition & 0 deletions plugins/sync/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@
<string name="wear_infos_watchface">Infos Watchface</string>
<string name="wear_export_watchface">Export template</string>
<string name="wear_new_custom_watchface_exported">Custom watchface template exported</string>
<string name="wear_link_to_more_cwf_doc">https://androidaps.readthedocs.io/en/latest/ExchangeSiteCustomWatchfaces/index.html</string>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set translatable to false, so we don't have to copy this in crowdin :D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept the link translatable to be able to replace the "/en/" by language code within crowdin and then access to the "translated" exchange page within doc.

<string name="resend_all_data">Resend All Data</string>
<string name="open_settings_on_wear">Open Settings on Wear</string>
<string name="cwf_infos_pref_locked">List of prefs locked by the Watchface</string>
Expand Down