Skip to content

Commit

Permalink
Text posts are now full width
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonHalvdansson committed Oct 3, 2023
1 parent 5ef85ef commit 8749c82
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ protected void onCreate(Bundle savedInstanceState) {
case TYPE_POST:
replyingScrollView.setVisibility(View.GONE);
topCommentTextView.setVisibility(View.VISIBLE);
topCommentTextView.setText("Submitting post");
topCommentTextView.setText("Create submission");

titleContainer.setVisibility(View.VISIBLE);
urlContainer.setVisibility(View.VISIBLE);
Expand Down Expand Up @@ -204,7 +204,7 @@ public void handleOnBackPressed() {
//This thing should only be enabled when we want to show the dialog, otherwise
//we just do the default back behavior (which is predictive back)
AlertDialog dialog = new MaterialAlertDialogBuilder(editText.getContext())
.setTitle("Discard draft?")
.setTitle(type == TYPE_POST ? "Discard post?" : "Discard comment?")
.setPositiveButton("Discard", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
dialog.cancel();
Expand Down
126 changes: 65 additions & 61 deletions app/src/main/res/layout/comments_header.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@

</RelativeLayout>
</RelativeLayout>
<!--
<!-- This is reader mode
<RelativeLayout
android:layout_width="0dp"
android:layout_weight="1"
Expand Down Expand Up @@ -168,7 +168,7 @@
android:foreground="?selectableItemBackground"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:paddingBottom="12dp"
android:paddingBottom="8dp"
android:paddingTop="@dimen/comments_header_top_padding"
android:paddingLeft="16dp"
android:paddingRight="16dp">
Expand All @@ -190,70 +190,69 @@
tools:text="Court dismisses Genius lawsuit over lyrics-scraping by Google" />

<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<LinearLayout
android:orientation="vertical"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">

<LinearLayout
android:id="@+id/comments_header_link_info_container"
android:layout_marginTop="3dp"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<ImageView
android:id="@+id/comments_header_favicon"
android:src="@drawable/ic_action_web"
android:layout_marginRight="4dp"
android:layout_width="17dp"
android:layout_height="17dp" />

<TextView
android:id="@+id/comments_header_url"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?attr/textColorDefault"
tools:text="(rankscience.com)"
android:fontFamily="@font/product_sans" />
android:id="@+id/comments_header_link_info_container"
android:layout_marginTop="3dp"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">

</LinearLayout>
<ImageView
android:id="@+id/comments_header_favicon"
android:src="@drawable/ic_action_web"
android:layout_marginRight="4dp"
android:layout_width="17dp"
android:layout_height="17dp" />

<org.sufficientlysecure.htmltextview.HtmlTextView
android:id="@+id/comments_header_text"
android:visibility="gone"
android:textColor="?attr/storyColorNormal"
android:layout_marginTop="4dp"
android:textSize="15sp"
android:textIsSelectable="true"
<TextView
android:id="@+id/comments_header_url"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?attr/textColorDefault"
tools:text="(rankscience.com)"
android:fontFamily="@font/product_sans" />

<LinearLayout
android:paddingTop="6dp"
android:id="@+id/comments_header_poll_layout"
android:visibility="gone"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</LinearLayout>

</LinearLayout>
<org.sufficientlysecure.htmltextview.HtmlTextView
android:id="@+id/comments_header_text"
android:visibility="gone"
android:text="This is a bunch of text because the text was actually a text post, who would have known?"
android:textColor="?attr/storyColorNormal"
android:layout_marginTop="4dp"
android:textSize="15sp"
android:paddingBottom="3dp"
android:textIsSelectable="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/product_sans" />

<LinearLayout
android:id="@+id/comments_header_meta_container"
android:layout_marginTop="5dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:paddingTop="6dp"
android:id="@+id/comments_header_poll_layout"
android:visibility="gone"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<Space
android:layout_width="1dp"
android:layout_height="1dp"/>
</LinearLayout>

<LinearLayout
android:id="@+id/comments_header_meta_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="1dp"
android:orientation="horizontal">

<LinearLayout
android:layout_marginTop="6dp"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">

<ImageView
android:id="@+id/comments_header_meta_votes_icon"
Expand Down Expand Up @@ -321,15 +320,20 @@

</LinearLayout>

</LinearLayout>

<ImageView
android:id="@+id/comments_header_link_image"
android:layout_gravity="bottom"
android:src="@drawable/ic_action_link"
android:layout_width="28dp"
android:layout_marginBottom="-2dp"
android:layout_height="28dp"/>

<Space
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />

<ImageView
android:id="@+id/comments_header_link_image"
android:src="@drawable/ic_action_link"
android:layout_width="28dp"
android:layout_height="28dp"/>

</LinearLayout>

</LinearLayout>
</LinearLayout>
Expand Down

0 comments on commit 8749c82

Please sign in to comment.