cleanup code in StatusViewHolders (#1418)
* cleanup code in status ViewHolder * add check for reblogButton back in
This commit is contained in:
parent
57edf86495
commit
588775ff9b
12 changed files with 125 additions and 185 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
Loading…
Add table
Add a link
Reference in a new issue