mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 18:35:40 +03:00
Review + design update
This commit is contained in:
parent
df3d3b63c8
commit
391e952fbd
6 changed files with 38 additions and 27 deletions
|
@ -16,12 +16,14 @@
|
|||
package im.vector.app.core.ui.list
|
||||
|
||||
import android.widget.TextView
|
||||
import androidx.annotation.ColorInt
|
||||
import com.airbnb.epoxy.EpoxyAttribute
|
||||
import com.airbnb.epoxy.EpoxyModelClass
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.epoxy.VectorEpoxyHolder
|
||||
import im.vector.app.core.epoxy.VectorEpoxyModel
|
||||
import im.vector.app.core.extensions.setTextOrHide
|
||||
import im.vector.app.features.themes.ThemeUtils
|
||||
|
||||
/**
|
||||
* A generic list item header left aligned with notice color.
|
||||
|
@ -32,9 +34,18 @@ abstract class GenericItemHeader : VectorEpoxyModel<GenericItemHeader.Holder>()
|
|||
@EpoxyAttribute
|
||||
var text: String? = null
|
||||
|
||||
@EpoxyAttribute
|
||||
@ColorInt
|
||||
var textColor: Int? = null
|
||||
|
||||
override fun bind(holder: Holder) {
|
||||
super.bind(holder)
|
||||
holder.text.setTextOrHide(text)
|
||||
if (textColor != null) {
|
||||
holder.text.setTextColor(textColor!!)
|
||||
} else {
|
||||
holder.text.setTextColor(ThemeUtils.getColor(holder.view.context, R.attr.vctr_notice_text_color))
|
||||
}
|
||||
}
|
||||
|
||||
class Holder : VectorEpoxyHolder() {
|
||||
|
|
|
@ -172,7 +172,10 @@ class BugReportActivity : VectorBaseActivity<ActivityBugReportBinding>() {
|
|||
Toast.makeText(this@BugReportActivity,
|
||||
getString(R.string.send_bug_report_failed, reason), Toast.LENGTH_LONG).show()
|
||||
}
|
||||
ReportType.SUGGESTION,
|
||||
ReportType.SUGGESTION -> {
|
||||
Toast.makeText(this@BugReportActivity,
|
||||
getString(R.string.send_suggestion_failed, reason), Toast.LENGTH_LONG).show()
|
||||
}
|
||||
ReportType.SPACE_BETA_FEEDBACK -> {
|
||||
Toast.makeText(this@BugReportActivity,
|
||||
getString(R.string.feedback_failed, reason), Toast.LENGTH_LONG).show()
|
||||
|
@ -208,7 +211,9 @@ class BugReportActivity : VectorBaseActivity<ActivityBugReportBinding>() {
|
|||
ReportType.BUG_REPORT -> {
|
||||
Toast.makeText(this@BugReportActivity, R.string.send_bug_report_sent, Toast.LENGTH_LONG).show()
|
||||
}
|
||||
ReportType.SUGGESTION,
|
||||
ReportType.SUGGESTION -> {
|
||||
Toast.makeText(this@BugReportActivity, R.string.send_suggestion_sent, Toast.LENGTH_LONG).show()
|
||||
}
|
||||
ReportType.SPACE_BETA_FEEDBACK -> {
|
||||
Toast.makeText(this@BugReportActivity, R.string.feedback_sent, Toast.LENGTH_LONG).show()
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ import android.view.View
|
|||
import com.airbnb.epoxy.EpoxyController
|
||||
import im.vector.app.R
|
||||
import im.vector.app.RoomGroupingMethod
|
||||
import im.vector.app.core.resources.ColorProvider
|
||||
import im.vector.app.core.resources.StringProvider
|
||||
import im.vector.app.core.ui.list.genericFooterItem
|
||||
import im.vector.app.core.ui.list.genericItemHeader
|
||||
|
@ -39,6 +40,7 @@ import javax.inject.Inject
|
|||
|
||||
class SpaceSummaryController @Inject constructor(
|
||||
private val avatarRenderer: AvatarRenderer,
|
||||
private val colorProvider: ColorProvider,
|
||||
private val stringProvider: StringProvider) : EpoxyController() {
|
||||
|
||||
var callback: Callback? = null
|
||||
|
@ -73,6 +75,7 @@ class SpaceSummaryController @Inject constructor(
|
|||
genericItemHeader {
|
||||
id("legacy_groups")
|
||||
text(stringProvider.getString(R.string.groups_header))
|
||||
textColor(colorProvider.getColorFromAttribute(R.attr.riotx_text_primary))
|
||||
}
|
||||
|
||||
// add home for communities
|
||||
|
@ -105,11 +108,6 @@ class SpaceSummaryController @Inject constructor(
|
|||
rootSpaces: List<RoomSummary>?,
|
||||
expandedStates: Map<String, Boolean>,
|
||||
homeCount: RoomAggregateNotificationCount) {
|
||||
genericItemHeader {
|
||||
id("spaces")
|
||||
text(stringProvider.getString(R.string.spaces_header))
|
||||
}
|
||||
|
||||
spaceBetaHeaderItem {
|
||||
id("beta_header")
|
||||
clickAction(View.OnClickListener {
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
android:viewportHeight="16">
|
||||
<path
|
||||
android:pathData="M6.2887,10.748C8.7036,10.748 10.6612,8.7897 10.6612,6.374C10.6612,3.9583 8.7036,2 6.2887,2C3.8739,2 1.9163,3.9583 1.9163,6.374C1.9163,7.038 2.0642,7.6674 2.3288,8.2311L1.6,9.7683C1.2011,10.6099 2.0682,11.492 2.9165,11.1074L4.5258,10.378C5.0651,10.6159 5.6615,10.748 6.2887,10.748Z"
|
||||
android:fillColor="#238CF5"
|
||||
android:fillColor="#368BD6"
|
||||
android:fillType="evenOdd"/>
|
||||
<path
|
||||
android:pathData="M12.6608,7.3739C12.6608,9.7896 10.7032,11.7479 8.2883,11.7479C7.8421,11.7479 7.4114,11.681 7.0059,11.5568C7.7732,12.2953 8.8076,12.7479 9.9456,12.7479C10.5605,12.7479 11.1451,12.6158 11.6737,12.3778L13.211,13.0887C14.0564,13.4796 14.9301,12.6043 14.5376,11.7597L13.8272,10.2308C14.0865,9.6672 14.2315,9.0378 14.2315,8.3739C14.2315,6.4535 13.0188,4.8221 11.3323,4.2339C12.1516,5.0289 12.6608,6.1419 12.6608,7.3739Z"
|
||||
android:fillColor="#238CF5"
|
||||
android:fillColor="#368BD6"
|
||||
android:fillType="evenOdd"/>
|
||||
</vector>
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout 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="wrap_content"
|
||||
android:padding="16dp">
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/rounded_rect_stroke_8"
|
||||
android:padding="8dp">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -16,26 +16,21 @@
|
|||
android:layout_marginTop="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:importantForAccessibility="no"
|
||||
android:src="@drawable/ic_beta_pill" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/spaces_beta_welcome_to_spaces"
|
||||
android:text="@string/spaces_header"
|
||||
android:textColor="?riotx_text_primary"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
android:textStyle="bold"
|
||||
app:drawableEndCompat="@drawable/ic_beta_pill" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:text="@string/spaces_beta_welcome_to_spaces_desc"
|
||||
android:textColor="?riotx_text_secondary"
|
||||
android:textSize="15sp" />
|
||||
|
@ -44,14 +39,14 @@
|
|||
android:id="@+id/spaceBetaFeedbackAction"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:drawablePadding="8dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:text="@string/give_feedback"
|
||||
android:drawableStart="@drawable/ic_feedback"
|
||||
android:drawablePadding="8dp"
|
||||
android:textColor="@color/vector_info_color"
|
||||
android:textSize="15sp" />
|
||||
android:textSize="15sp"
|
||||
app:drawableStartCompat="@drawable/ic_feedback" />
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
|
|
@ -2164,6 +2164,8 @@
|
|||
<string name="send_suggestion">Make a suggestion</string>
|
||||
<string name="send_suggestion_content">Please write your suggestion below.</string>
|
||||
<string name="send_suggestion_report_placeholder">Describe your suggestion here</string>
|
||||
<string name="send_suggestion_sent">Thanks, the suggestion has been successfully sent</string>
|
||||
<string name="send_suggestion_failed">The suggestion failed to be sent (%s)</string>
|
||||
|
||||
<string name="send_feedback_space_title">Spaces feedback</string>
|
||||
<string name="feedback">Feedback</string>
|
||||
|
@ -3353,7 +3355,7 @@
|
|||
|
||||
<string name="space_add_existing_rooms">Add existing rooms and space</string>
|
||||
<string name="spaces_beta_welcome_to_spaces">Welcome to Spaces!</string>
|
||||
<string name="spaces_beta_welcome_to_spaces_desc">Spaces are ways to group rooms and people for work, fun or just yourself.</string>
|
||||
<string name="spaces_beta_welcome_to_spaces_desc">Spaces are a new way to group rooms and people.</string>
|
||||
<string name="you_are_invited">You are invited</string>
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue