Merge pull request #1248 from Jatin0312/master

Fix for issue #1224 showing complete notification on click
This commit is contained in:
Vivek Maskara 2018-03-06 02:46:20 +05:30 committed by GitHub
commit 51221f69c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 46 additions and 29 deletions

View file

@ -1,11 +1,13 @@
package fr.free.nrw.commons.notification;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.borjabravo.readmoretextview.ReadMoreTextView;
import com.pedrogomez.renderers.Renderer;
import butterknife.BindView;
@ -17,8 +19,8 @@ import fr.free.nrw.commons.R;
*/
public class NotificationRenderer extends Renderer<Notification> {
@BindView(R.id.title) TextView title;
@BindView(R.id.description) TextView description;
@BindView(R.id.title) ReadMoreTextView title;
@BindView(R.id.description) ReadMoreTextView description;
@BindView(R.id.time) TextView time;
@BindView(R.id.icon) ImageView icon;
private NotificationClicked listener;
@ -46,9 +48,13 @@ public class NotificationRenderer extends Renderer<Notification> {
@Override
public void render() {
Notification notification = getContent();
title.setText(notification.notificationText);
StringBuilder str = new StringBuilder(notification.notificationText);
str.append(" " );
title.setText(str);
time.setText(notification.date);
description.setText(notification.description);
StringBuilder desc = new StringBuilder(notification.description);
desc.append(" ");
description.setText(desc);
switch (notification.notificationType) {
case THANK_YOU_EDIT:
icon.setImageResource(R.drawable.ic_edit_black_24dp);