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

Expose pusher profile tag in advanced settings #6369

Merged
merged 2 commits into from
Jun 27, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions changelog.d/6369.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Expose pusher profile tag in advanced settings

Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ abstract class PushGatewayItem : EpoxyModelWithHolder<PushGatewayItem.Holder>()
holder.appName.text = pusher.appDisplayName
holder.url.setTextOrHide(pusher.data.url, hideWhenBlank = true, holder.urlTitle)
holder.format.setTextOrHide(pusher.data.format, hideWhenBlank = true, holder.formatTitle)
holder.profileTag.setTextOrHide(pusher.profileTag, hideWhenBlank = true, holder.profileTagTitle)
holder.deviceName.text = pusher.deviceDisplayName
holder.removeButton.setOnClickListener {
interactions.onRemovePushTapped(pusher)
Expand All @@ -60,6 +61,8 @@ abstract class PushGatewayItem : EpoxyModelWithHolder<PushGatewayItem.Holder>()
val deviceName by bind<TextView>(R.id.pushGatewayDeviceNameValue)
val formatTitle by bind<View>(R.id.pushGatewayFormat)
val format by bind<TextView>(R.id.pushGatewayFormatValue)
val profileTagTitle by bind<TextView>(R.id.pushGatewayProfileTag)
val profileTag by bind<TextView>(R.id.pushGatewayProfileTagValue)
val urlTitle by bind<View>(R.id.pushGatewayURL)
val url by bind<TextView>(R.id.pushGatewayURLValue)
val appName by bind<TextView>(R.id.pushGatewayAppNameValue)
Expand Down
17 changes: 17 additions & 0 deletions vector/src/main/res/layout/item_pushgateway.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,23 @@
android:textStyle=""
tools:text="event_id_only" />

<TextView
android:id="@+id/pushGatewayProfileTag"
style="@style/Widget.Vector.TextView.Body"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:text="@string/push_gateway_item_profile_tag"
android:textStyle="bold" />

<TextView
android:id="@+id/pushGatewayProfileTagValue"
style="@style/Widget.Vector.TextView.Body"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:textStyle="" />
Copy link
Contributor

@ouchadam ouchadam Jun 23, 2022

Choose a reason for hiding this comment

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

the empty text style is a little strange, would have expected normal instead of blank or removing the tag entirely, might be worth cleaning up the file whilst we're in the area 🙏

Copy link
Contributor Author

@Johennes Johennes Jun 23, 2022

Choose a reason for hiding this comment

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

I toggled the text style property to bold and back to nothing selected in Android Studio and it looks like that just removes the textStyle properties altogether. Committed and pushed that change. Is that alright?

Screenshot 2022-06-23 at 12 14 26

Copy link
Contributor

Choose a reason for hiding this comment

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

yep, that's great! I'm a little surprised that the blank case had been compiling


<Button
android:id="@+id/pushGatewayDeleteButton"
android:layout_width="wrap_content"
Expand Down
1 change: 1 addition & 0 deletions vector/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1657,6 +1657,7 @@
<string name="push_gateway_item_device_name">session_name:</string>
<string name="push_gateway_item_url">Url:</string>
<string name="push_gateway_item_format">Format:</string>
<string name="push_gateway_item_profile_tag">Profile tag:</string>

<string name="preference_voice_and_video">Voice &amp; Video</string>
<string name="preference_root_help_about">Help &amp; About</string>
Expand Down