cleanup code in StatusViewHolders (#1418)

* cleanup code in status ViewHolder

* add check for reblogButton back in
This commit is contained in:
Konrad Pozniak 2019-07-27 21:53:28 +02:00 committed by GitHub
commit 588775ff9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 125 additions and 185 deletions

View file

@ -129,7 +129,6 @@ public class LinkHelper {
}
view.setText(builder);
view.setLinksClickable(true);
view.setMovementMethod(LinkMovementMethod.getInstance());
}
@ -177,7 +176,6 @@ public class LinkHelper {
start = end;
}
view.setText(builder);
view.setLinksClickable(true);
view.setMovementMethod(LinkMovementMethod.getInstance());
}
@ -210,7 +208,7 @@ public class LinkHelper {
try {
context.startActivity(intent);
} catch (ActivityNotFoundException e) {
Log.w("LinkHelper", "Actvity was not found for intent, " + intent.toString());
Log.w("LinkHelper", "Actvity was not found for intent, " + intent);
}
}
@ -231,7 +229,7 @@ public class LinkHelper {
try {
customTabsIntent.launchUrl(context, uri);
} catch (ActivityNotFoundException e) {
Log.w("LinkHelper", "Activity was not found for intent " + customTabsIntent.toString());
Log.w("LinkHelper", "Activity was not found for intent " + customTabsIntent);
openLinkInBrowser(uri, context);
}

View file

@ -267,7 +267,7 @@ class StatusViewHelper(private val itemView: View) {
if (useAbsoluteTime) {
pollDurationInfo = context.getString(R.string.poll_info_time_absolute, getAbsoluteTime(poll.expiresAt))
} else {
val pollDuration = DateUtils.formatPollDuration(context, poll.expiresAt!!.time, timestamp)
val pollDuration = TimestampUtils.formatPollDuration(context, poll.expiresAt!!.time, timestamp)
pollDurationInfo = context.getString(R.string.poll_info_time_relative, pollDuration)
}
}

View file

@ -19,7 +19,7 @@ import android.content.Context;
import com.keylesspalace.tusky.R;
public class DateUtils {
public class TimestampUtils {
private static final long SECOND_IN_MILLIS = 1000;
private static final long MINUTE_IN_MILLIS = SECOND_IN_MILLIS * 60;