Modified Custom Sharing UI to increase quantity of lines allocated to edittext fields, add ellipsis on title field as required, truncate suggested title to 60 char, and include entire toot text in description field

This commit is contained in:
crockwave 2019-02-18 15:31:32 -06:00
parent 6a745cf9b5
commit 8fc44c9002
2 changed files with 15 additions and 17 deletions

View File

@ -23,6 +23,7 @@ import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
@ -128,22 +129,18 @@ public class CustomSharingActivity extends BaseActivity implements OnCustomShari
set_custom_sharing_title = findViewById(R.id.set_custom_sharing_title);
set_custom_sharing_description = findViewById(R.id.set_custom_sharing_description);
set_custom_sharing_keywords = findViewById(R.id.set_custom_sharing_keywords);
set_custom_sharing_title.setEllipsize(TextUtils.TruncateAt.END);
//set text on title, description, and keywords
System.out.println("Content: " + bundle_content);
String[] lines = bundle_content.split("\n");
set_custom_sharing_title.setText(lines[0]);
if (lines.length >= 2) {
String newDescription = "";
int i = 0;
for (String line: lines) {
i += 1;
if (i > 1) {
newDescription = newDescription + line;
}
}
set_custom_sharing_description.setText(newDescription);
String newTitle = "";
if (lines[0].length() > 60) {
newTitle = lines[0].substring(0, 60) + "...";;
} else {
newTitle = lines[0];
}
set_custom_sharing_title.setText(newTitle);
set_custom_sharing_description.setText(bundle_content);
set_custom_sharing_keywords.setText(bundle_tags);
set_custom_sharing_save = findViewById(R.id.set_custom_sharing_save);
set_custom_sharing_save.setOnClickListener(new View.OnClickListener() {

View File

@ -57,7 +57,7 @@
android:layout_height="wrap_content"
android:id="@+id/set_custom_sharing_title"
android:minLines="1"
android:lines="1"
android:lines="2"
android:maxLines="2"
android:hint="@string/title_hint_custom_sharing"
/>
@ -77,8 +77,9 @@
android:layout_height="wrap_content"
android:id="@+id/set_custom_sharing_description"
android:minLines="4"
android:lines="4"
android:maxLines="5"
android:lines="7"
android:inputType="textMultiLine"
android:maxLines="7"
android:hint="@string/description_hint_custom_sharing"
/>
@ -97,8 +98,8 @@
android:layout_height="wrap_content"
android:id="@+id/set_custom_sharing_keywords"
android:minLines="1"
android:lines="1"
android:maxLines="1"
android:lines="2"
android:maxLines="2"
android:hint="@string/keywords_hint_custom_sharing"
/>