Merge pull request #1062 from nextcloud/unreadMessagesPillStyle

Use chip view for pill-style unread messages counter
This commit is contained in:
Marcel Hibbe 2021-03-26 00:14:12 +01:00 committed by GitHub
commit 6253aeecad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 177 additions and 134 deletions

View File

@ -246,15 +246,15 @@ dependencies {
implementation "androidx.work:work-rxjava2:$work_version" implementation "androidx.work:work-rxjava2:$work_version"
androidTestImplementation "androidx.work:work-testing:$work_version" androidTestImplementation "androidx.work:work-testing:$work_version"
implementation 'androidx.appcompat:appcompat:1.2.0-beta01' implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.core:core-ktx:1.3.0-rc01' implementation 'androidx.core:core-ktx:1.3.0-rc01'
implementation 'androidx.sharetarget:sharetarget:1.0.0-rc01' implementation 'androidx.sharetarget:sharetarget:1.0.0-rc01'
implementation 'com.google.android.material:material:1.2.0-alpha06' implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4' implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.github.vanniktech:Emoji:0.6.0' implementation 'com.github.vanniktech:Emoji:0.6.0'
implementation group: 'androidx.emoji', name: 'emoji-bundled', version: '1.0.0' implementation group: 'androidx.emoji', name: 'emoji-bundled', version: '1.0.0'
implementation 'org.michaelevans.colorart:library:0.0.3' implementation 'org.michaelevans.colorart:library:0.0.3'
implementation 'com.google.android:flexbox:2.0.0' implementation 'com.google.android:flexbox:2.0.1'
implementation 'com.gitlab.bitfireAT:dav4jvm:2.1.2' implementation 'com.gitlab.bitfireAT:dav4jvm:2.1.2'
implementation 'org.conscrypt:conscrypt-android:2.4.0' implementation 'org.conscrypt:conscrypt-android:2.4.0'

View File

@ -23,11 +23,14 @@
package com.nextcloud.talk.newarch.features.conversationsList package com.nextcloud.talk.newarch.features.conversationsList
import android.content.Context import android.content.Context
import android.graphics.Color
import android.graphics.Typeface
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.text.TextUtils import android.text.TextUtils
import android.text.format.DateUtils import android.text.format.DateUtils
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.core.content.ContextCompat
import androidx.core.view.isVisible import androidx.core.view.isVisible
import coil.api.load import coil.api.load
import coil.transform.CircleCropTransformation import coil.transform.CircleCropTransformation
@ -73,19 +76,33 @@ open class ConversationPresenter(context: Context, onElementClick: ((Page, Holde
if (conversation.unreadMessages > 0) { if (conversation.unreadMessages > 0) {
holder.itemView.dialogUnreadBubble!!.visibility = View.VISIBLE holder.itemView.dialogUnreadBubble!!.visibility = View.VISIBLE
if (conversation.unreadMessages < 100) { holder.itemView.dialogName.setTypeface(
holder.itemView.dialogName.getTypeface(),
Typeface.BOLD
)
holder.itemView.dialogDate.setTypeface(
holder.itemView.dialogDate.getTypeface(),
Typeface.BOLD
)
holder.itemView.dialogLastMessage.setTypeface(
holder.itemView.dialogLastMessage.getTypeface(),
Typeface.BOLD
)
if (conversation.unreadMessages < 1000) {
holder.itemView.dialogUnreadBubble!!.text = conversation.unreadMessages.toLong() holder.itemView.dialogUnreadBubble!!.text = conversation.unreadMessages.toLong()
.toString() .toString()
} else { } else {
holder.itemView.dialogUnreadBubble!!.text = context.getString(R.string.nc_99_plus) holder.itemView.dialogUnreadBubble!!.text = context.getString(R.string.nc_999_plus)
} }
if (conversation.unreadMention || conversation.type == Conversation.ConversationType.ONE_TO_ONE_CONVERSATION) { if (conversation.unreadMention || conversation.type == Conversation.ConversationType.ONE_TO_ONE_CONVERSATION) {
holder.itemView.dialogUnreadBubble!!.background = holder.itemView.dialogUnreadBubble!!.setChipBackgroundColorResource(R.color.colorPrimary)
context.getDrawable(R.drawable.bubble_circle_unread_mention) holder.itemView.dialogUnreadBubble!!.setTextColor(Color.WHITE)
} else { } else {
holder.itemView.dialogUnreadBubble!!.background = holder.itemView.dialogUnreadBubble!!.setChipBackgroundColorResource(R.color.conversation_unread_bubble)
context.getDrawable(R.drawable.bubble_circle_unread) holder.itemView.dialogUnreadBubble!!.setTextColor(
ContextCompat.getColor(context, R.color.conversation_unread_bubble_text)
)
} }
} else { } else {
holder.itemView.dialogUnreadBubble!!.visibility = View.GONE holder.itemView.dialogUnreadBubble!!.visibility = View.GONE

View File

@ -3,6 +3,8 @@
~ Nextcloud Talk application ~ Nextcloud Talk application
~ ~
~ @author Mario Danic ~ @author Mario Danic
~ @author Andy Scherzinger
~ Copyright (C) 2021 Andy Scherzinger <info@andy-scherzinger.de>
~ Copyright (C) 2017-2018 Mario Danic <mario@lovelyhq.com> ~ Copyright (C) 2017-2018 Mario Danic <mario@lovelyhq.com>
~ ~
~ This program is free software: you can redistribute it and/or modify ~ This program is free software: you can redistribute it and/or modify
@ -17,35 +19,40 @@
~ ~
~ You should have received a copy of the GNU General Public License ~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>. ~ along with this program. If not, see <http://www.gnu.org/licenses/>.
~
--> -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/rv_item_view_height" android:layout_height="wrap_content"
android:layout_margin="@dimen/double_margin_between_elements" android:animateLayoutChanges="true"
android:animateLayoutChanges="true"> android:paddingLeft="@dimen/double_margin_between_elements"
android:paddingTop="12dp"
android:paddingRight="@dimen/double_margin_between_elements"
android:paddingBottom="12dp">
<FrameLayout <FrameLayout
android:id="@+id/dialogAvatarFrameLayout" android:id="@+id/dialogAvatarFrameLayout"
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="48dp" android:layout_height="48dp"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginEnd="@dimen/margin_between_elements"> android:layout_marginEnd="@dimen/double_margin_between_elements">
<ImageView <ImageView
android:id="@id/dialogAvatar" android:id="@id/dialogAvatar"
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="48dp" android:layout_height="48dp"
android:contentDescription="@null"
android:scaleType="centerCrop" android:scaleType="centerCrop"
tools:src="@tools:sample/avatars[0]"/> tools:src="@tools:sample/avatars[0]" />
<ImageView <ImageView
android:id="@+id/passwordProtectedRoomImageView" android:id="@+id/passwordProtectedRoomImageView"
android:layout_width="16dp" android:layout_width="16dp"
android:layout_height="16dp" android:layout_height="16dp"
android:layout_gravity="bottom|end" android:layout_gravity="bottom|end"
android:contentDescription="@string/protected_conversation"
android:src="@drawable/ic_lock_grey600_24px" /> android:src="@drawable/ic_lock_grey600_24px" />
<ImageView <ImageView
@ -53,77 +60,81 @@
android:layout_width="16dp" android:layout_width="16dp"
android:layout_height="16dp" android:layout_height="16dp"
android:layout_gravity="top|end" android:layout_gravity="top|end"
android:contentDescription="@string/favorite_conversation"
android:src="@drawable/ic_star_black_24dp" android:src="@drawable/ic_star_black_24dp"
android:tint="@color/favorite_icon_tint" app:tint="@color/favorite_icon_tint"
android:tintMode="src_in"/> app:tintMode="src_in" />
</FrameLayout> </FrameLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/dialogName"
android:layout_marginTop="8dp"
android:layout_toEndOf="@id/dialogAvatarFrameLayout">
<androidx.emoji.widget.EmojiTextView <androidx.emoji.widget.EmojiTextView
android:id="@id/dialogLastMessage" android:id="@id/dialogLastMessage"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true" android:layout_below="@+id/dialogName"
android:layout_toStartOf="@id/dialogUnreadBubble" android:layout_marginTop="5dp"
android:layout_toStartOf="@+id/dialogUnreadBubble"
android:layout_toEndOf="@id/dialogAvatarFrameLayout"
android:ellipsize="end" android:ellipsize="end"
android:gravity="top" android:gravity="top"
android:lines="1" android:lines="1"
android:singleLine="true" android:singleLine="true"
android:textColor="@color/conversation_last_message" android:textColor="@color/conversation_last_message"
android:textSize="14sp"
tools:text="This is the last message\nof an incredibly long two line conversation text" /> tools:text="This is the last message\nof an incredibly long two line conversation text" />
<TextView
android:id="@id/dialogUnreadBubble" <com.google.android.material.chip.Chip
android:layout_width="20dp" android:id="@+id/dialogUnreadBubble"
android:layout_height="20dp" style="@style/Widget.MaterialComponents.Chip.Choice"
android:layout_width="wrap_content"
android:layout_height="18dp"
android:layout_below="@+id/dialogName"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:background="@drawable/bubble_circle_unread" android:layout_marginTop="7dp"
android:gravity="center_vertical" android:gravity="top"
android:layout_centerInParent="true"
android:lines="1" android:lines="1"
android:textAlignment="center" android:textAppearance="@style/ChipUnreadMessagesTextAppearance"
android:textColor="@color/conversation_unread_bubble" android:textColor="@color/conversation_unread_bubble_text"
android:textSize="10sp" app:chipBackgroundColor="@color/conversation_unread_bubble"
tools:background="@drawable/bubble_circle_unread" app:chipEndPadding="-1dp"
tools:text="99+" app:chipMinTouchTargetSize="0dp"
/> app:chipStartPadding="-3dp"
app:ensureMinTouchTargetSize="false"
</RelativeLayout> tools:text="99+" />
<TextView <TextView
android:id="@id/dialogDate" android:id="@id/dialogDate"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignTop="@id/dialogAvatarFrameLayout"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_marginStart="@dimen/margin_between_elements"
android:layout_marginTop="3dp"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
android:textColor="@color/conversation_date" /> android:textColor="@color/conversation_date"
android:textSize="14sp"
tools:text="@string/nc_date_header_yesterday" />
<ProgressBar <ProgressBar
android:id="@+id/actionProgressBar"
android:layout_width="16sp" android:layout_width="16sp"
android:layout_height="16sp" android:layout_height="16sp"
android:id="@+id/actionProgressBar"
android:layout_alignBottom="@id/dialogName" android:layout_alignBottom="@id/dialogName"
android:layout_marginTop="3dp"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:layout_toEndOf="@+id/dialogAvatarFrameLayout" android:layout_toEndOf="@+id/dialogAvatarFrameLayout"
android:indeterminateTint="@color/colorPrimary" android:indeterminateTint="@color/colorPrimary"
android:visibility="gone" android:visibility="gone" />
/>
<androidx.emoji.widget.EmojiTextView <androidx.emoji.widget.EmojiTextView
android:id="@id/dialogName" android:id="@id/dialogName"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignTop="@id/dialogAvatarFrameLayout" android:layout_alignTop="@id/dialogAvatarFrameLayout"
android:layout_marginTop="3dp"
android:layout_toStartOf="@id/dialogDate" android:layout_toStartOf="@id/dialogDate"
android:layout_toEndOf="@id/actionProgressBar" android:layout_toEndOf="@id/actionProgressBar"
android:ellipsize="end" android:ellipsize="end"

View File

@ -26,12 +26,12 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<androidx.cardview.widget.CardView <com.google.android.material.card.MaterialCardView
android:id="@+id/searchCardView" android:id="@+id/searchCardView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginHorizontal="12dp" android:layout_marginHorizontal="12dp"
android:background="@color/transparent" android:background="@color/appbar"
app:cardPreventCornerOverlap="true" app:cardPreventCornerOverlap="true"
android:clipToPadding="true" android:clipToPadding="true"
android:layout_marginBottom="-4dp" android:layout_marginBottom="-4dp"
@ -148,5 +148,5 @@
</FrameLayout> </FrameLayout>
</RelativeLayout> </RelativeLayout>
</androidx.cardview.widget.CardView> </com.google.android.material.card.MaterialCardView>
</merge> </merge>

View File

@ -29,15 +29,19 @@
<color name="colorPrimaryDark">#006AA3</color> <color name="colorPrimaryDark">#006AA3</color>
<color name="colorAccent">#007CC2</color> <color name="colorAccent">#007CC2</color>
<color name="conversation_item_header">#9FBDCC</color> <color name="appbar">#1E1E1E</color>
<!--<color name="conversation_item_header">#CFCFCF</color>-->
<color name="bg_default">#222222</color> <!-- Name of person or group for the chat conversation -->
<color name="bg_alt">#222222</color> <color name="conversation_item_header">#E3E3E3</color>
<color name="conversation_unread_bubble">#373737</color>
<color name="conversation_unread_bubble_text">#D8D8D8</color>
<color name="bg_default">#121212</color>
<color name="bg_alt">#121212</color>
<color name="bg_inverse">@color/grey950</color> <color name="bg_inverse">@color/grey950</color>
<color name="fg_default">#FFFFFF</color> <color name="fg_default">#FFFFFF</color>
<color name="fg_inverse">#222222</color> <color name="fg_inverse">#121212</color>
<color name="fg_chat_message_sent">@color/fg_default</color> <color name="fg_chat_message_sent">@color/fg_default</color>
<!-- Chat window incoming message text & informational --> <!-- Chat window incoming message text & informational -->
@ -46,7 +50,7 @@
<color name="nc_chip_mention_you_background">#0083C9</color> <color name="nc_chip_mention_you_background">#0083C9</color>
<color name="nc_chip_mention_others_background">#6F6F6F</color> <color name="nc_chip_mention_others_background">#6F6F6F</color>
<color name="nc_grey">@android:color/holo_purple</color> <color name="nc_grey">@android:color/holo_purple</color>
<color name="bg_bottom_sheet">#222222</color> <color name="bg_bottom_sheet">#121212</color>
<color name="bg_selected_participant_clear_icon">#EFEFEF</color> <color name="bg_selected_participant_clear_icon">#EFEFEF</color>
<color name="bg_message_list_incoming_bubble">#484848</color> <color name="bg_message_list_incoming_bubble">#484848</color>
<color name="bg_message_list_outcoming_bubble">#003F62</color> <color name="bg_message_list_outcoming_bubble">#003F62</color>

View File

@ -27,16 +27,20 @@
<color name="colorPrimaryDark">#006AA3</color> <color name="colorPrimaryDark">#006AA3</color>
<color name="colorAccent">#007CC2</color> <color name="colorAccent">#007CC2</color>
<color name="appbar">@android:color/white</color>
<color name="fontAppbar">#A5A5A5</color>
<!-- Text color of sent messages --> <!-- Text color of sent messages -->
<color name="nc_outcoming_text_default">#FFFFFF</color> <color name="nc_outcoming_text_default">#FFFFFF</color>
<!-- Text color of received messages --> <!-- Text color of received messages -->
<color name="nc_incoming_text_default">#37505D</color> <color name="nc_incoming_text_default">#37505D</color>
<!-- Name of person or group for the chat conversation --> <!-- Name of person or group for the chat conversation -->
<color name="conversation_item_header">#37505D</color> <color name="conversation_item_header">#333333</color>
<color name="conversation_date">@color/warm_grey_two</color> <color name="conversation_date">@color/warm_grey_two</color>
<color name="conversation_last_message">@color/warm_grey_four</color> <color name="conversation_last_message">@color/warm_grey_four</color>
<color name="conversation_unread_bubble">#FFFFFF</color> <color name="conversation_unread_bubble">#DBDBDB</color>
<color name="conversation_unread_bubble_text">#222222</color>
<color name="nc_incoming_text_mention_you">#C98879</color> <color name="nc_incoming_text_mention_you">#C98879</color>
<color name="nc_incoming_text_mention_others">#37505D</color> <color name="nc_incoming_text_mention_others">#37505D</color>

View File

@ -337,7 +337,7 @@
<string name="nc_last_moderator">You need to promote a new moderator before you can leave %1$s.</string> <string name="nc_last_moderator">You need to promote a new moderator before you can leave %1$s.</string>
<!-- Chat --> <!-- Chat -->
<string name="nc_99_plus">99+</string> <string name="nc_999_plus" translatable="false">999+</string>
<string name="nc_copy_message">Copy</string> <string name="nc_copy_message">Copy</string>
<string name="nc_reply">Reply</string> <string name="nc_reply">Reply</string>
@ -355,4 +355,6 @@
<string name="nc_look_and_feel">Appearance &amp; Sounds</string> <string name="nc_look_and_feel">Appearance &amp; Sounds</string>
<string name="nc_settings_calls_sound">Calls sound</string> <string name="nc_settings_calls_sound">Calls sound</string>
<string name="nc_settings_notifications_sound">Notifications sound</string> <string name="nc_settings_notifications_sound">Notifications sound</string>
<string name="protected_conversation">protected conversation</string>
<string name="favorite_conversation">favorite conversation</string>
</resources> </resources>

View File

@ -51,6 +51,11 @@
<item name="android:textColor">@color/colorAccent</item> <item name="android:textColor">@color/colorAccent</item>
</style> </style>
<style name="ChipUnreadMessagesTextAppearance" parent="TextAppearance.MaterialComponents.Chip">
<item name="android:textSize">14sp</item>
<item name="android:textStyle">bold</item>
</style>
<style name="appActionBarStyle" parent="@style/Widget.MaterialComponents.ActionBar.Solid"> <style name="appActionBarStyle" parent="@style/Widget.MaterialComponents.ActionBar.Solid">
<item name="android:colorPrimary">@color/fg_inverse</item> <item name="android:colorPrimary">@color/fg_inverse</item>
<item name="android:textColor">@color/fg_inverse</item> <item name="android:textColor">@color/fg_inverse</item>

View File

@ -39,10 +39,10 @@ buildscript {
} }
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:4.0.1' classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_version}" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_version}"
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
classpath 'gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.5.0' classpath 'gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.7.0'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files

View File

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip

View File

@ -11,7 +11,7 @@
ruby scripts/analysis/lint-up.rb $1 $2 $3 ruby scripts/analysis/lint-up.rb $1 $2 $3
lintValue=$? lintValue=$?
./gradlew assembleGplayDebug spotbugsGplayDebugReport ./gradlew assembleGplay app:spotbugsGplayReleaseReport
# exit codes: # exit codes:
# 0: count was reduced # 0: count was reduced
@ -24,12 +24,12 @@ if [ $3 = "master" ]; then
echo "New findbugs result for master at: https://www.kaminsky.me/nc-dev/talk-findbugs/master.html" echo "New findbugs result for master at: https://www.kaminsky.me/nc-dev/talk-findbugs/master.html"
curl -u $4:$5 -X PUT https://nextcloud.kaminsky.me/remote.php/webdav/talk-findbugs/master.html --upload-file app/build/reports/spotbugs/spotbugs.html curl -u $4:$5 -X PUT https://nextcloud.kaminsky.me/remote.php/webdav/talk-findbugs/master.html --upload-file app/build/reports/spotbugs/spotbugs.html
summary=$(sed -n "/<h1>Summary<\/h1>/,/<h1>Warnings<\/h1>/p" app/build/reports/spotbugs/spotbugs.html | head -n-1 | sed s'/<\/a>//'g | sed s'/<a.*>//'g | sed s'/Summary/FindBugs (master)/' | tr "\"" "\'" | tr -d "\r\n") summary=$(sed -n "/<h1>Summary<\/h1>/,/<h1>Warnings<\/h1>/p" app/build/reports/spotbugs/spotbugs.html | head -n-1 | sed s'/<\/a>//'g | sed s'/<a.*>//'g | sed s'/Summary/SpotBugs (master)/' | tr "\"" "\'" | tr -d "\r\n")
curl -u $4:$5 -X PUT -d "$summary" https://nextcloud.kaminsky.me/remote.php/webdav/talk-findbugs/findbugs.html curl -u $4:$5 -X PUT -d "$summary" https://nextcloud.kaminsky.me/remote.php/webdav/talk-findbugs/findbugs-summary-master.html
if [ $lintValue -ne 1 ]; then if [ $lintValue -ne 1 ]; then
echo "New lint result for master at: https://www.kaminsky.me/nc-dev/talk-lint/master.html" echo "New lint result for master at: https://www.kaminsky.me/nc-dev/talk-lint/master.html"
curl -u $4:$5 -X PUT https://nextcloud.kaminsky.me/remote.php/webdav/talk-droneLogs/master.html --upload-file app/build/reports/lint/lint.html curl -u $4:$5 -X PUT https://nextcloud.kaminsky.me/remote.php/webdav/talk-lint/master.html --upload-file app/build/reports/lint/lint.html
exit 0 exit 0
fi fi
else else
@ -56,8 +56,8 @@ else
lintErrorOld=$(grep "[0-9]* error" scripts/analysis/lint-results.txt -o | cut -f1 -d" ") lintErrorOld=$(grep "[0-9]* error" scripts/analysis/lint-results.txt -o | cut -f1 -d" ")
lintWarningOld=$(grep "[0-9]* warning" scripts/analysis/lint-results.txt -o | cut -f1 -d" ") lintWarningOld=$(grep "[0-9]* warning" scripts/analysis/lint-results.txt -o | cut -f1 -d" ")
lintResult="<h1>Lint</h1><table width='500' cellpadding='5' cellspacing='2'><tr class='tablerow0'><td>Type</td><td><a href='https://www.kaminsky.me/nc-dev/talk-lint/master.html'>Master</a></td><td><a href='https://www.kaminsky.me/nc-dev/talk-lint/"$6".html'>PR</a></td></tr><tr class='tablerow1'><td>Warnings</td><td>"$lintWarningOld"</td><td>"$lintWarningNew"</td></tr><tr class='tablerow0'><td>Errors</td><td>"$lintErrorOld"</td><td>"$lintErrorNew"</td></tr></table>" lintResult="<h1>Lint</h1><table width='500' cellpadding='5' cellspacing='2'><tr class='tablerow0'><td>Type</td><td><a href='https://www.kaminsky.me/nc-dev/talk-lint/master.html'>Master</a></td><td><a href='https://www.kaminsky.me/nc-dev/talk-lint/"$6".html'>PR</a></td></tr><tr class='tablerow1'><td>Warnings</td><td>"$lintWarningOld"</td><td>"$lintWarningNew"</td></tr><tr class='tablerow0'><td>Errors</td><td>"$lintErrorOld"</td><td>"$lintErrorNew"</td></tr></table>"
findbugsResultNew=$(sed -n "/<h1>Summary<\/h1>/,/<h1>Warnings<\/h1>/p" app/build/reports/spotbugs/spotbugs.html |head -n-1 | sed s'/<\/a>//'g | sed s'/<a.*>//'g | sed s"#Summary#<a href=\"https://www.kaminsky.me/nc-dev/talk-findbugs/$6.html\">FindBugs</a> (new)#" | tr "\"" "\'" | tr -d "\n") findbugsResultNew=$(sed -n "/<h1>Summary<\/h1>/,/<h1>Warnings<\/h1>/p" app/build/reports/spotbugs/spotbugs.html |head -n-1 | sed s'/<\/a>//'g | sed s'/<a.*>//'g | sed s"#Summary#<a href=\"https://www.kaminsky.me/nc-dev/talk-findbugs/$6.html\">SpotBugs</a> (new)#" | tr "\"" "\'" | tr -d "\n")
findbugsResultOld=$(curl 2>/dev/null https://www.kaminsky.me/nc-dev/talk-findbugs/findbugs.html | tr "\"" "\'" | tr -d "\r\n" | sed s'#FindBugs#<a href=\"https://www.kaminsky.me/nc-dev/talk-findbugs/master.html">FindBugs</a>#'| tr "\"" "\'" | tr -d "\n") findbugsResultOld=$(curl 2>/dev/null https://www.kaminsky.me/nc-dev/talk-findbugs/findbugs-summary-master.html | tr "\"" "\'" | tr -d "\r\n" | sed s'#FindBugs#<a href=\"https://www.kaminsky.me/nc-dev/talk-findbugs/master.html">FindBugs</a>#'| tr "\"" "\'" | tr -d "\n")
curl -u $1:$2 -X POST https://api.github.com/repos/nextcloud/talk-android/issues/$7/comments -d "{ \"body\" : \"$lintResult $findbugsResultNew $findbugsResultOld \" }" curl -u $1:$2 -X POST https://api.github.com/repos/nextcloud/talk-android/issues/$7/comments -d "{ \"body\" : \"$lintResult $findbugsResultNew $findbugsResultOld \" }"
if [ $lintValue -eq 2 ]; then if [ $lintValue -eq 2 ]; then

View File

@ -1,2 +1,2 @@
DO NOT TOUCH; GENERATED BY DRONE DO NOT TOUCH; GENERATED BY DRONE
<span class="mdl-layout-title">Lint Report: 11 errors and 566 warnings</span> <span class="mdl-layout-title">Lint Report: 41 errors and 645 warnings</span>

View File

@ -56,7 +56,7 @@ end
# run Lint # run Lint
puts "running Lint..." puts "running Lint..."
system './gradlew clean assembleGplay app:lint' system './gradlew clean assembleGplay lint'
# confirm that Lint ran w/out error # confirm that Lint ran w/out error
result = $?.to_i result = $?.to_i
@ -178,7 +178,7 @@ previous_git_email = previous_git_email.strip
# update git user name and email for this script # update git user name and email for this script
system ("git config --local user.name '" + git_user + "'") system ("git config --local user.name '" + git_user + "'")
system ("git config --local user.email 'android@nextcloud.com'") system ("git config --local user.email '.'") # set email blank
system ("git remote rm origin") system ("git remote rm origin")
system ("git remote add origin https://" + git_user + ":" + git_token + "@github.com/nextcloud/talk-android") system ("git remote add origin https://" + git_user + ":" + git_token + "@github.com/nextcloud/talk-android")