Put name and options next to each other in the reply layout

filtering
Floens 10 years ago
parent 24a2875071
commit 603987a481
  1. 10
      Clover/app/src/main/java/org/floens/chan/core/presenter/ReplyPresenter.java
  2. 15
      Clover/app/src/main/java/org/floens/chan/ui/layout/ReplyLayout.java
  3. 41
      Clover/app/src/main/res/layout/layout_reply_input.xml

@ -134,11 +134,10 @@ public class ReplyPresenter implements ReplyManager.FileListener, ReplyManager.H
public void onMoreClicked() {
moreOpen = !moreOpen;
callback.openName(moreOpen);
callback.openNameOptions(moreOpen);
if (!loadable.isThreadMode()) {
callback.openSubject(moreOpen);
}
callback.openOptions(moreOpen);
if (previewOpen) {
callback.openFileName(moreOpen);
if (board.spoilers) {
@ -301,9 +300,8 @@ public class ReplyPresenter implements ReplyManager.FileListener, ReplyManager.H
previewOpen = false;
selectedQuote = -1;
callback.openMessage(false, true, "", false);
callback.openName(false);
callback.openSubject(false);
callback.openOptions(false);
callback.openNameOptions(false);
callback.openFileName(false);
callback.openSpoiler(false, false);
callback.openPreview(false, null);
@ -403,12 +401,10 @@ public class ReplyPresenter implements ReplyManager.FileListener, ReplyManager.H
void setCommentHint(String hint);
void openName(boolean open);
void openNameOptions(boolean open);
void openSubject(boolean open);
void openOptions(boolean open);
void openFileName(boolean open);
void setFileName(String fileName);

@ -39,12 +39,12 @@ import org.floens.chan.core.model.Reply;
import org.floens.chan.core.presenter.ReplyPresenter;
import org.floens.chan.core.settings.ChanSettings;
import org.floens.chan.ui.drawable.DropdownArrowDrawable;
import org.floens.chan.ui.theme.ThemeHelper;
import org.floens.chan.ui.view.LoadView;
import org.floens.chan.ui.view.SelectionListeningEditText;
import org.floens.chan.utils.AndroidUtils;
import org.floens.chan.utils.AnimationUtils;
import org.floens.chan.utils.ImageDecoder;
import org.floens.chan.ui.theme.ThemeHelper;
import java.io.File;
@ -68,6 +68,7 @@ public class ReplyLayout extends LoadView implements View.OnClickListener, Anima
private EditText subject;
private EditText options;
private EditText fileName;
private LinearLayout nameOptions;
private SelectionListeningEditText comment;
private TextView commentCounter;
private LinearLayout previewContainer;
@ -112,6 +113,7 @@ public class ReplyLayout extends LoadView implements View.OnClickListener, Anima
subject = (EditText) replyInputLayout.findViewById(R.id.subject);
options = (EditText) replyInputLayout.findViewById(R.id.options);
fileName = (EditText) replyInputLayout.findViewById(R.id.file_name);
nameOptions = (LinearLayout) replyInputLayout.findViewById(R.id.name_options);
comment = (SelectionListeningEditText) replyInputLayout.findViewById(R.id.comment);
comment.addTextChangedListener(this);
comment.setSelectionChangedListener(this);
@ -172,7 +174,7 @@ public class ReplyLayout extends LoadView implements View.OnClickListener, Anima
@Override
public void onLayoutAnimationProgress(boolean vertical, View view, float progress) {
if (view == name) {
if (view == nameOptions) {
moreDropdown.setRotation(openingName ? progress : 1f - progress);
}
}
@ -282,9 +284,9 @@ public class ReplyLayout extends LoadView implements View.OnClickListener, Anima
}
@Override
public void openName(boolean open) {
public void openNameOptions(boolean open) {
openingName = open;
AnimationUtils.animateHeight(name, open, comment.getWidth(), 300, this);
AnimationUtils.animateHeight(nameOptions, open, comment.getWidth(), 300, this);
}
@Override
@ -292,11 +294,6 @@ public class ReplyLayout extends LoadView implements View.OnClickListener, Anima
AnimationUtils.animateHeight(subject, open, comment.getWidth());
}
@Override
public void openOptions(boolean open) {
AnimationUtils.animateHeight(options, open, comment.getWidth());
}
@Override
public void openFileName(boolean open) {
AnimationUtils.animateHeight(fileName, open, comment.getWidth());

@ -46,15 +46,33 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
android:paddingLeft="8dp"
android:paddingTop="8dp">
<EditText
android:id="@+id/name"
<LinearLayout
android:id="@+id/name_options"
android:layout_width="match_parent"
android:layout_height="0dp"
android:hint="@string/reply_name"
android:inputType="textCapSentences|textAutoCorrect"
android:singleLine="true"
android:textSize="16sp"
android:visibility="gone" />
android:orientation="horizontal"
android:visibility="gone">
<EditText
android:id="@+id/name"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:hint="@string/reply_name"
android:inputType="textCapSentences|textAutoCorrect"
android:singleLine="true"
android:textSize="16sp" />
<EditText
android:id="@+id/options"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:hint="@string/reply_options"
android:singleLine="true"
android:textSize="16sp" />
</LinearLayout>
<EditText
android:id="@+id/subject"
@ -66,15 +84,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
android:textSize="16sp"
android:visibility="gone" />
<EditText
android:id="@+id/options"
android:layout_width="match_parent"
android:layout_height="0dp"
android:hint="@string/reply_options"
android:singleLine="true"
android:textSize="16sp"
android:visibility="gone" />
<EditText
android:id="@+id/file_name"
android:layout_width="match_parent"

Loading…
Cancel
Save