mirror of
https://github.com/k0shk0sh/FastHub.git
synced 2025-12-08 19:05:54 +00:00
this commit allows toggling of reply comment.
This commit is contained in:
parent
11681e649c
commit
2003a8679a
@ -6,7 +6,6 @@ import android.support.v7.widget.AppCompatImageView;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.fastaccess.App;
|
||||
import com.fastaccess.R;
|
||||
import com.fastaccess.data.dao.model.Comment;
|
||||
import com.fastaccess.helper.InputHelper;
|
||||
@ -65,7 +64,8 @@ public class CommentsViewHolder extends BaseViewHolder<Comment> {
|
||||
}
|
||||
name.setText(commentsModel.getUser() != null ? commentsModel.getUser().getLogin() : "Anonymous");
|
||||
if (commentsModel.getCreatedAt().before(commentsModel.getUpdatedAt())) {
|
||||
date.setText(ParseDateFormat.getTimeAgo(commentsModel.getCreatedAt()) + " " + App.getInstance().getResources().getString(R.string.edited));
|
||||
date.setText(String.format("%s %s", ParseDateFormat.getTimeAgo(commentsModel.getCreatedAt()),
|
||||
date.getResources().getString(R.string.edited)));
|
||||
} else {
|
||||
date.setText(ParseDateFormat.getTimeAgo(commentsModel.getCreatedAt()));
|
||||
}
|
||||
|
||||
@ -6,11 +6,13 @@ import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.annotation.StringRes;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.transition.TransitionManager;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.LinearLayout;
|
||||
@ -66,17 +68,18 @@ public class EditorActivity extends BaseActivity<EditorMvp.View, EditorPresenter
|
||||
@BindView(R.id.editText) FontEditText editText;
|
||||
@BindView(R.id.editorIconsHolder) View editorIconsHolder;
|
||||
@BindView(R.id.sentVia) CheckBox sentVia;
|
||||
@BindView(R.id.autocomplete)
|
||||
ListView mention;
|
||||
@BindView(R.id.list_divider) View listDivider;
|
||||
|
||||
@BindView(R.id.parentView) View parentView;
|
||||
@State @BundleConstant.ExtraTYpe String extraType;
|
||||
|
||||
@State String itemId;
|
||||
@State String login;
|
||||
@State int issueNumber;
|
||||
@State long commentId = 0;
|
||||
@State String sha;
|
||||
@State EditReviewCommentModel reviewComment;
|
||||
@BindView(R.id.autocomplete)
|
||||
ListView mention;
|
||||
|
||||
@Override protected int layout() {
|
||||
return R.layout.editor_layout;
|
||||
@ -143,6 +146,17 @@ public class EditorActivity extends BaseActivity<EditorMvp.View, EditorPresenter
|
||||
listDivider.setVisibility(GONE);
|
||||
}
|
||||
|
||||
@OnClick(R.id.replyQuoteText) void onToggleQuote() {
|
||||
TransitionManager.beginDelayedTransition((ViewGroup) parentView);
|
||||
if (quote.getMaxLines() == 3) {
|
||||
quote.setMaxLines(Integer.MAX_VALUE);
|
||||
} else {
|
||||
quote.setMaxLines(3);
|
||||
}
|
||||
quote.setCompoundDrawablesWithIntrinsicBounds(0, 0, quote.getMaxLines() == 3
|
||||
? R.drawable.ic_arrow_drop_down : R.drawable.ic_arrow_drop_up, 0);
|
||||
}
|
||||
|
||||
@OnClick(R.id.view) void onViewMarkDown() {
|
||||
if (editText.isEnabled() && !InputHelper.isEmpty(editText)) {
|
||||
editText.setEnabled(false);
|
||||
|
||||
9
app/src/main/res/drawable/ic_arrow_drop_up.xml
Normal file
9
app/src/main/res/drawable/ic_arrow_drop_up.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0">
|
||||
<path
|
||||
android:fillColor="?icon_color"
|
||||
android:pathData="M7,14l5,-5 5,5z"/>
|
||||
</vector>
|
||||
@ -4,7 +4,8 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:id="@+id/parentView">
|
||||
|
||||
<include layout="@layout/appbar_elevation_dark"/>
|
||||
|
||||
@ -17,7 +18,7 @@
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
@ -25,14 +26,19 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.fastaccess.ui.widgets.FontTextView
|
||||
android:id="@+id/replyQuoteText"
|
||||
android:textIsSelectable="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="0.6"
|
||||
android:drawableEnd="@drawable/ic_arrow_drop_down"
|
||||
android:drawablePadding="@dimen/spacing_normal"
|
||||
android:maxLines="3"
|
||||
android:padding="@dimen/spacing_xs_large"
|
||||
android:textIsSelectable="true"
|
||||
tools:text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas quis sagittis purus. Cras pulvinar urna ut velit accumsan consectetur. Aenean mauris purus, rutrum eget luctus sit amet, efficitur vel mauris. Sed pulvinar nisl non ligula lacinia ultricies. Etiam quis purus sem. Morbi rutrum tristique ex sed commodo. Pellentesque volutpat laoreet urna et vestibulum. Vivamus id justo sed felis cursus venenatis id vitae felis. Praesent at condimentum erat. Vivamus vel est a dolor tincidunt porta. Mauris ut nisl tortor."/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
@ -270,15 +276,15 @@
|
||||
android:id="@+id/sentVia"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="true"
|
||||
android:layout_gravity="end"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:button="@null"
|
||||
android:maxLines="1"
|
||||
android:layout_gravity="end"
|
||||
android:checked="true"
|
||||
android:drawableEnd="?android:attr/listChoiceIndicatorMultiple"
|
||||
android:paddingStart="@dimen/spacing_xs_large"
|
||||
android:paddingEnd="@dimen/spacing_xs_large"
|
||||
android:maxLines="1"
|
||||
android:paddingBottom="@dimen/spacing_normal"
|
||||
android:paddingEnd="@dimen/spacing_xs_large"
|
||||
android:paddingStart="@dimen/spacing_xs_large"
|
||||
android:paddingTop="@dimen/spacing_normal"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
|
||||
tools:text="@string/sent_from_fasthub"/>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user