Reintegrate optional text formatting toolbar
This commit is contained in:
parent
5decd801fc
commit
62a44980de
13 changed files with 466 additions and 12 deletions
|
@ -5134,6 +5134,10 @@ public class XmppConnectionService extends Service {
|
|||
return getBooleanPreference("allow_message_correction", R.bool.allow_message_correction);
|
||||
}
|
||||
|
||||
public boolean showTextFormatting() {
|
||||
return getBooleanPreference("showtextformatting", R.bool.showtextformatting);
|
||||
}
|
||||
|
||||
public boolean sendChatStates() {
|
||||
return getBooleanPreference("chat_states", R.bool.chat_states);
|
||||
}
|
||||
|
|
|
@ -89,7 +89,6 @@ import androidx.annotation.IdRes;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.content.pm.ShortcutInfoCompat;
|
||||
import androidx.core.content.pm.ShortcutManagerCompat;
|
||||
|
@ -135,6 +134,7 @@ import net.java.otr4j.session.SessionStatus;
|
|||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import eu.siacs.conversations.medialib.activities.EditActivity;
|
||||
import eu.siacs.conversations.ui.util.QuoteHelper;
|
||||
import eu.siacs.conversations.utils.ChatBackgroundHelper;
|
||||
import io.ipfs.cid.Cid;
|
||||
|
||||
|
@ -394,6 +394,97 @@ public class ConversationFragment extends XmppFragment
|
|||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
private final OnClickListener meCommand = v -> Objects.requireNonNull(binding.textinput.getText()).insert(0, Message.ME_COMMAND + " ");
|
||||
private final OnClickListener quote = v -> insertQuote();
|
||||
private final OnClickListener boldText = v -> insertFormatting("bold");
|
||||
private final OnClickListener italicText = v -> insertFormatting("italic");
|
||||
private final OnClickListener monospaceText = v -> insertFormatting("monospace");
|
||||
private final OnClickListener strikethroughText = v -> insertFormatting("strikethrough");
|
||||
private final OnClickListener close = v -> closeFormatting();
|
||||
|
||||
private void closeFormatting() {
|
||||
final MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(activity);
|
||||
builder.setTitle(R.string.action_close);
|
||||
builder.setMessage(R.string.close_format_text);
|
||||
builder.setPositiveButton(getString(R.string.action_close),
|
||||
(dialog, which) -> {
|
||||
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(activity);
|
||||
preferences.edit().putBoolean("showtextformatting", false).apply();
|
||||
binding.textformat.setVisibility(GONE);
|
||||
updateSendButton();
|
||||
});
|
||||
builder.setNegativeButton(getString(R.string.cancel), null);
|
||||
builder.create().show();
|
||||
}
|
||||
|
||||
private void insertFormatting(String format) {
|
||||
final String BOLD = "*";
|
||||
final String ITALIC = "_";
|
||||
final String MONOSPACE = "`";
|
||||
final String STRIKETHROUGH = "~";
|
||||
|
||||
int selStart = this.binding.textinput.getSelectionStart();
|
||||
int selEnd = this.binding.textinput.getSelectionEnd();
|
||||
int min = 0;
|
||||
int max = this.binding.textinput.getText().length();
|
||||
if (this.binding.textinput.isFocused()) {
|
||||
selStart = this.binding.textinput.getSelectionStart();
|
||||
selEnd = this.binding.textinput.getSelectionEnd();
|
||||
min = Math.max(0, Math.min(selStart, selEnd));
|
||||
max = Math.max(0, Math.max(selStart, selEnd));
|
||||
}
|
||||
final CharSequence selectedText = this.binding.textinput.getText().subSequence(min, max);
|
||||
|
||||
if (format.equals("bold")) {
|
||||
if (selectedText.length() != 0) {
|
||||
this.binding.textinput.getText().replace(Math.min(selStart, selEnd), Math.max(selStart, selEnd),
|
||||
BOLD + selectedText + BOLD, 0, selectedText.length() + 2);
|
||||
} else {
|
||||
this.binding.textinput.getText().insert(this.binding.textinput.getSelectionStart(), (BOLD));
|
||||
}
|
||||
return;
|
||||
} else if (format.equals("italic")) {
|
||||
if (selectedText.length() != 0) {
|
||||
this.binding.textinput.getText().replace(Math.min(selStart, selEnd), Math.max(selStart, selEnd),
|
||||
ITALIC + selectedText + ITALIC, 0, selectedText.length() + 2);
|
||||
} else {
|
||||
this.binding.textinput.getText().insert(this.binding.textinput.getSelectionStart(), (ITALIC));
|
||||
}
|
||||
return;
|
||||
} else if (format.equals("monospace")) {
|
||||
if (selectedText.length() != 0) {
|
||||
this.binding.textinput.getText().replace(Math.min(selStart, selEnd), Math.max(selStart, selEnd),
|
||||
MONOSPACE + selectedText + MONOSPACE, 0, selectedText.length() + 2);
|
||||
} else {
|
||||
this.binding.textinput.getText().insert(this.binding.textinput.getSelectionStart(), (MONOSPACE));
|
||||
}
|
||||
return;
|
||||
} else if (format.equals("strikethrough")) {
|
||||
if (selectedText.length() != 0) {
|
||||
this.binding.textinput.getText().replace(Math.min(selStart, selEnd), Math.max(selStart, selEnd),
|
||||
STRIKETHROUGH + selectedText + STRIKETHROUGH, 0, selectedText.length() + 2);
|
||||
} else {
|
||||
this.binding.textinput.getText().insert(this.binding.textinput.getSelectionStart(), (STRIKETHROUGH));
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private void insertQuote() {
|
||||
int pos = 0;
|
||||
if (this.binding.textinput.getSelectionStart() == this.binding.textinput.getSelectionEnd()) {
|
||||
pos = this.binding.textinput.getSelectionStart();
|
||||
}
|
||||
if (pos == 0) {
|
||||
Objects.requireNonNull(binding.textinput.getText()).insert(0, QuoteHelper.QUOTE_CHAR + " ");
|
||||
} else {
|
||||
Objects.requireNonNull(binding.textinput.getText()).insert(pos, System.getProperty("line.separator") + QuoteHelper.QUOTE_CHAR + " ");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private final OnScrollListener mOnScrollListener =
|
||||
new OnScrollListener() {
|
||||
|
||||
|
@ -2187,7 +2278,7 @@ public class ConversationFragment extends XmppFragment
|
|||
correctMessage(selectedMessage);
|
||||
return true;
|
||||
case R.id.retract_message:
|
||||
new AlertDialog.Builder(activity)
|
||||
new MaterialAlertDialogBuilder(activity)
|
||||
.setTitle(R.string.retract_message)
|
||||
.setMessage(R.string.do_you_really_want_to_retract_this_message)
|
||||
.setPositiveButton(R.string.yes, (dialog, whichButton) -> {
|
||||
|
@ -2261,7 +2352,7 @@ public class ConversationFragment extends XmppFragment
|
|||
retryDecryption(selectedMessage);
|
||||
return true;
|
||||
case R.id.block_media:
|
||||
new AlertDialog.Builder(activity)
|
||||
new MaterialAlertDialogBuilder(activity)
|
||||
.setTitle(R.string.block_media)
|
||||
.setMessage("Do you really want to block this media in all messages?")
|
||||
.setPositiveButton(R.string.yes, (dialog, whichButton) -> {
|
||||
|
@ -2417,7 +2508,7 @@ public class ConversationFragment extends XmppFragment
|
|||
addShortcut();
|
||||
break;
|
||||
case R.id.action_block_avatar:
|
||||
new AlertDialog.Builder(activity)
|
||||
new MaterialAlertDialogBuilder(activity)
|
||||
.setTitle(R.string.block_media)
|
||||
.setMessage("Do you really want to block this avatar?")
|
||||
.setPositiveButton(R.string.yes, (dialog, whichButton) -> {
|
||||
|
@ -3641,7 +3732,7 @@ public class ConversationFragment extends XmppFragment
|
|||
activity.onConversationArchived(this.conversation);
|
||||
return false;
|
||||
}
|
||||
updateinputfield();
|
||||
updateinputfield(canSendMeCommand());
|
||||
if (activity != null) {
|
||||
activity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
|
||||
}
|
||||
|
@ -5416,7 +5507,7 @@ public class ConversationFragment extends XmppFragment
|
|||
}
|
||||
}
|
||||
|
||||
public void updateinputfield() {
|
||||
public void updateinputfield(final boolean me) {
|
||||
LinearLayout emojipickerview = binding.emojisStickerLayout;
|
||||
ViewGroup.LayoutParams params = emojipickerview.getLayoutParams();
|
||||
Fragment secondaryFragment = activity.getFragmentManager().findFragmentById(R.id.secondary_fragment);
|
||||
|
@ -5452,6 +5543,11 @@ public class ConversationFragment extends XmppFragment
|
|||
params.height = keyboardHeight;
|
||||
emojipickerview.setLayoutParams(params);
|
||||
}
|
||||
if (activity != null && activity.xmppConnectionService != null && isKeyboardVisible && activity.xmppConnectionService.showTextFormatting()) {
|
||||
showTextFormat(me);
|
||||
} else {
|
||||
hideTextFormat();
|
||||
}
|
||||
return ViewCompat.onApplyWindowInsets(v, insets);
|
||||
});
|
||||
} else {
|
||||
|
@ -5484,6 +5580,11 @@ public class ConversationFragment extends XmppFragment
|
|||
params.height = keyboardHeight;
|
||||
emojipickerview.setLayoutParams(params);
|
||||
}
|
||||
if (activity != null && activity.xmppConnectionService != null && keyboardOpen && activity.xmppConnectionService.showTextFormatting()) {
|
||||
showTextFormat(me);
|
||||
} else {
|
||||
hideTextFormat();
|
||||
}
|
||||
};
|
||||
keyboardHeightProvider = new KeyboardHeightProvider(activity, activity.getWindowManager(), llRoot, keyboardHeightListener);
|
||||
}
|
||||
|
@ -5796,4 +5897,38 @@ public class ConversationFragment extends XmppFragment
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
private boolean canSendMeCommand() {
|
||||
if (conversation != null) {
|
||||
final String body = binding.textinput.getText().toString();
|
||||
return body.isEmpty();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void showTextFormat(final boolean me) {
|
||||
this.binding.textformat.setVisibility(View.VISIBLE);
|
||||
this.binding.me.setEnabled(me);
|
||||
this.binding.me.setOnClickListener(meCommand);
|
||||
this.binding.quote.setOnClickListener(quote);
|
||||
this.binding.bold.setOnClickListener(boldText);
|
||||
this.binding.italic.setOnClickListener(italicText);
|
||||
this.binding.monospace.setOnClickListener(monospaceText);
|
||||
this.binding.strikethrough.setOnClickListener(strikethroughText);
|
||||
this.binding.close.setOnClickListener(close);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
this.binding.me.setTooltipText(activity.getString(R.string.me));
|
||||
this.binding.quote.setTooltipText(activity.getString(R.string.quote));
|
||||
this.binding.bold.setTooltipText(activity.getString(R.string.bold));
|
||||
this.binding.italic.setTooltipText(activity.getString(R.string.italic));
|
||||
this.binding.monospace.setTooltipText(activity.getString(R.string.monospace));
|
||||
this.binding.monospace.setTooltipText(activity.getString(R.string.monospace));
|
||||
this.binding.strikethrough.setTooltipText(activity.getString(R.string.strikethrough));
|
||||
this.binding.close.setTooltipText(activity.getString(R.string.action_close));
|
||||
}
|
||||
}
|
||||
|
||||
private void hideTextFormat() {
|
||||
this.binding.textformat.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
|
5
src/main/res/drawable/rounded_close_24.xml
Normal file
5
src/main/res/drawable/rounded_close_24.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="?colorControlNormal" android:viewportHeight="960" android:viewportWidth="960" android:width="24dp">
|
||||
|
||||
<path android:fillColor="@android:color/white" android:pathData="M480,536L284,732Q273,743 256,743Q239,743 228,732Q217,721 217,704Q217,687 228,676L424,480L228,284Q217,273 217,256Q217,239 228,228Q239,217 256,217Q273,217 284,228L480,424L676,228Q687,217 704,217Q721,217 732,228Q743,239 743,256Q743,273 732,284L536,480L732,676Q743,687 743,704Q743,721 732,732Q721,743 704,743Q687,743 676,732L480,536Z"/>
|
||||
|
||||
</vector>
|
5
src/main/res/drawable/rounded_code_24.xml
Normal file
5
src/main/res/drawable/rounded_code_24.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="?colorControlNormal" android:viewportHeight="960" android:viewportWidth="960" android:width="24dp">
|
||||
|
||||
<path android:fillColor="@android:color/white" android:pathData="M193,481L348,636Q359,647 359,664Q359,681 348,692Q337,703 320,703Q303,703 292,692L108,508Q102,502 99.5,495Q97,488 97,480Q97,472 99.5,465Q102,458 108,452L292,268Q304,256 320.5,256Q337,256 349,268Q361,280 361,296.5Q361,313 349,325L193,481ZM767,479L612,324Q601,313 601,296Q601,279 612,268Q623,257 640,257Q657,257 668,268L852,452Q858,458 860.5,465Q863,472 863,480Q863,488 860.5,495Q858,502 852,508L668,692Q656,704 640,703.5Q624,703 612,691Q600,679 600,662.5Q600,646 612,634L767,479Z"/>
|
||||
|
||||
</vector>
|
5
src/main/res/drawable/rounded_format_bold_24.xml
Normal file
5
src/main/res/drawable/rounded_format_bold_24.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="?colorControlNormal" android:viewportHeight="960" android:viewportWidth="960" android:width="24dp">
|
||||
|
||||
<path android:fillColor="@android:color/white" android:pathData="M352,760Q319,760 295.5,736.5Q272,713 272,680L272,280Q272,247 295.5,223.5Q319,200 352,200L493,200Q558,200 613,240Q668,280 668,351Q668,402 645,429.5Q622,457 602,469L602,469Q627,480 657.5,510Q688,540 688,600Q688,689 623,724.5Q558,760 501,760L352,760ZM393,648L497,648Q545,648 555.5,623.5Q566,599 566,588Q566,577 555.5,552.5Q545,528 494,528L393,528L393,648ZM393,420L486,420Q519,420 534,403Q549,386 549,365Q549,341 532,326Q515,311 488,311L393,311L393,420Z"/>
|
||||
|
||||
</vector>
|
5
src/main/res/drawable/rounded_format_italic_24.xml
Normal file
5
src/main/res/drawable/rounded_format_italic_24.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="?colorControlNormal" android:viewportHeight="960" android:viewportWidth="960" android:width="24dp">
|
||||
|
||||
<path android:fillColor="@android:color/white" android:pathData="M250,760Q229,760 214.5,745.5Q200,731 200,710Q200,689 214.5,674.5Q229,660 250,660L360,660L480,300L370,300Q349,300 334.5,285.5Q320,271 320,250Q320,229 334.5,214.5Q349,200 370,200L670,200Q691,200 705.5,214.5Q720,229 720,250Q720,271 705.5,285.5Q691,300 670,300L580,300L460,660L550,660Q571,660 585.5,674.5Q600,689 600,710Q600,731 585.5,745.5Q571,760 550,760L250,760Z"/>
|
||||
|
||||
</vector>
|
5
src/main/res/drawable/rounded_strikethrough_s_24.xml
Normal file
5
src/main/res/drawable/rounded_strikethrough_s_24.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="?colorControlNormal" android:viewportHeight="960" android:viewportWidth="960" android:width="24dp">
|
||||
|
||||
<path android:fillColor="@android:color/white" android:pathData="M486,800Q423,800 369.5,766.5Q316,733 285,677Q276,661 282.5,643.5Q289,626 306,617Q324,607 343.5,613.5Q363,620 374,638Q392,668 422.5,686Q453,704 488,704Q532,704 564.5,677Q597,650 597,608Q597,608 597,608Q597,608 597,608Q597,588 611,574Q625,560 645,560Q665,560 679.5,574Q694,588 694,608Q694,611 694,614Q694,617 694,620Q694,699 631.5,749.5Q569,800 486,800ZM120,480Q103,480 91.5,468.5Q80,457 80,440Q80,423 91.5,411.5Q103,400 120,400L840,400Q857,400 868.5,411.5Q880,423 880,440Q880,457 868.5,468.5Q857,480 840,480L120,480ZM328,315Q311,305 305,285.5Q299,266 309,249Q334,202 381,178Q428,154 482,154Q530,154 572.5,174Q615,194 644,232Q655,246 651,264Q647,282 632,293Q615,305 595.5,302Q576,299 562,283Q547,266 527,258Q507,250 484,250Q457,250 432,261Q407,272 394,295Q384,313 364.5,319Q345,325 328,315Z"/>
|
||||
|
||||
</vector>
|
|
@ -177,10 +177,16 @@
|
|||
android:id="@+id/textsend"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:paddingHorizontal="8dp"
|
||||
android:paddingVertical="6dp">
|
||||
android:paddingVertical="6dp"
|
||||
android:animateLayoutChanges="true">
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/textinput_layout_new"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:animateLayoutChanges="true" >
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/input_layout"
|
||||
|
@ -349,10 +355,93 @@
|
|||
android:text="@string/request_to_speak" />
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/textformat"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/textinput_layout_new"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingRight="8dp"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingLeft="8dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:animateLayoutChanges="true"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/me"
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="42dp"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/me"
|
||||
android:gravity="center"
|
||||
android:text="/me"
|
||||
android:textSize="18sp"
|
||||
android:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/quote"
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="42dp"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/quote"
|
||||
android:gravity="center"
|
||||
android:text=">"
|
||||
android:textSize="18sp"
|
||||
android:visibility="visible" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/bold"
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="42dp"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/bold"
|
||||
android:src="@drawable/rounded_format_bold_24"
|
||||
android:visibility="visible" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/italic"
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="42dp"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/italic"
|
||||
android:src="@drawable/rounded_format_italic_24"
|
||||
android:visibility="visible" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/monospace"
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="42dp"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/monospace"
|
||||
android:src="@drawable/rounded_code_24"
|
||||
android:visibility="visible" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/strikethrough"
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="42dp"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/strikethrough"
|
||||
android:src="@drawable/rounded_strikethrough_s_24"
|
||||
android:visibility="visible" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/close"
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="42dp"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/action_close"
|
||||
android:src="@drawable/rounded_close_24"
|
||||
android:visibility="visible" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/emojis_sticker_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_below="@+id/textformat"
|
||||
android:orientation="vertical"
|
||||
android:visibility="visible"
|
||||
android:animateLayoutChanges="true" >
|
||||
|
@ -437,10 +526,9 @@
|
|||
android:gravity="bottom|center_horizontal"
|
||||
android:text="@string/gifs"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
|
|
|
@ -10,4 +10,5 @@
|
|||
<bool name="internal_meda_viewer">true</bool>
|
||||
<bool name="enable_otr">false</bool>
|
||||
<bool name="use_unicolored_chatbg">false</bool>
|
||||
<bool name="showtextformatting">false</bool>
|
||||
</resources>
|
||||
|
|
|
@ -1282,7 +1282,7 @@
|
|||
<string name="could_not_create_file">could_not_create_file</string>
|
||||
<string name="save_to_downloads">Save to Downloads</string>
|
||||
<string name="save_to_downloads_success">File successfully saved to Downloads folder</string>
|
||||
<string name="mappreview_url">https://staticmap.monocles.eu/map.png</string>
|
||||
<string name="mappreview_url" translatable="false">https://staticmap.monocles.eu/map.png</string>
|
||||
<string name="mute_locally">Mute locally</string>
|
||||
<string name="unmute_locally">Unmute locally</string>
|
||||
<string name="invite_to_start_chat">Invite to start chat</string>
|
||||
|
@ -1300,4 +1300,11 @@
|
|||
<string name="custom_background_color">Custom background color</string>
|
||||
<string name="compose_using_rich_text">Compose using rich text</string>
|
||||
<string name="compose_using_rich_text_summary">The message editor will show formatting as you type</string>
|
||||
<string name="bold">Bold</string>
|
||||
<string name="italic">Italic</string>
|
||||
<string name="monospace">Monospace</string>
|
||||
<string name="strikethrough">Strikethrough</string>
|
||||
<string name="close_format_text">Do you really want to close the text formatting toolbar? You can enable the toolbar in the settings again.</string>
|
||||
<string name="pref_showtextformatting_sum">Show text formatting toolbar in chat while keyboard is shown</string>
|
||||
<string name="pref_showtextformatting">Text formatting toolbar</string>
|
||||
</resources>
|
|
@ -177,6 +177,12 @@
|
|||
android:icon="@drawable/thread_hint"
|
||||
android:summary="@string/pref_show_thread_feature_summary"
|
||||
android:title="@string/pref_show_thread_feature" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="@bool/showtextformatting"
|
||||
android:key="showtextformatting"
|
||||
android:icon="@drawable/rounded_format_bold_24"
|
||||
android:summary="@string/pref_showtextformatting_sum"
|
||||
android:title="@string/pref_showtextformatting" />
|
||||
<ListPreference
|
||||
android:defaultValue="@string/quick_action"
|
||||
android:dialogTitle="@string/choose_quick_action"
|
||||
|
|
|
@ -27,5 +27,99 @@
|
|||
android:verticalSpacing="0dp"
|
||||
android:numColumns="2" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/emojis_sticker_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:orientation="vertical"
|
||||
android:visibility="visible"
|
||||
android:animateLayoutChanges="true" >
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" >
|
||||
|
||||
<androidx.emoji2.emojipicker.EmojiPickerView
|
||||
android:id="@+id/emoji_picker"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="visible" />
|
||||
|
||||
<de.monocles.chat.GridView
|
||||
android:id="@+id/stickersview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="4dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_marginRight="4dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:divider="@android:color/transparent"
|
||||
android:numColumns="6"
|
||||
android:dividerHeight="0dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<de.monocles.chat.GridView
|
||||
android:id="@+id/gifsview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="4dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_marginRight="4dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:divider="@android:color/transparent"
|
||||
android:numColumns="4"
|
||||
android:dividerHeight="0dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="62dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="bottom|center_horizontal"
|
||||
android:orientation="horizontal"
|
||||
android:animateLayoutChanges="true" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/emojis_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="bottom|center_horizontal"
|
||||
android:text="@string/emojis"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/stickers_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="bottom|center_horizontal"
|
||||
android:text="@string/stickers"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gifs_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="bottom|center_horizontal"
|
||||
android:text="@string/gifs"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
</layout>
|
||||
|
|
|
@ -24,5 +24,99 @@
|
|||
android:verticalSpacing="0dp"
|
||||
android:numColumns="2" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/emojis_sticker_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:orientation="vertical"
|
||||
android:visibility="visible"
|
||||
android:animateLayoutChanges="true" >
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" >
|
||||
|
||||
<androidx.emoji2.emojipicker.EmojiPickerView
|
||||
android:id="@+id/emoji_picker"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="visible" />
|
||||
|
||||
<de.monocles.chat.GridView
|
||||
android:id="@+id/stickersview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="4dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_marginRight="4dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:divider="@android:color/transparent"
|
||||
android:numColumns="6"
|
||||
android:dividerHeight="0dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<de.monocles.chat.GridView
|
||||
android:id="@+id/gifsview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="4dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_marginRight="4dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:divider="@android:color/transparent"
|
||||
android:numColumns="4"
|
||||
android:dividerHeight="0dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="62dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="bottom|center_horizontal"
|
||||
android:orientation="horizontal"
|
||||
android:animateLayoutChanges="true" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/emojis_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="bottom|center_horizontal"
|
||||
android:text="@string/emojis"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/stickers_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="bottom|center_horizontal"
|
||||
android:text="@string/stickers"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gifs_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="bottom|center_horizontal"
|
||||
android:text="@string/gifs"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
</layout>
|
||||
|
|
Loading…
Reference in a new issue