mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Propose a message as a draft for new created groups.
This commit is contained in:
@@ -558,6 +558,13 @@ JNIEXPORT jstring Java_com_b44t_messenger_MrChat_getSubtitle(JNIEnv *env, jclass
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT jint Java_com_b44t_messenger_MrChat_getParamInt(JNIEnv *env, jclass cls, jint key, jint def)
|
||||
{
|
||||
mrchat_t* ths = get_mrchat_t(env, cls);
|
||||
return mrparam_get_int(ths? ths->m_param:NULL, key, def);
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT jstring Java_com_b44t_messenger_MrChat_MrChatGetDraft(JNIEnv *env, jclass c, jlong hChat) /* returns NULL for "no draft" */
|
||||
{
|
||||
mrchat_t* ths = (mrchat_t*)hChat;
|
||||
|
||||
@@ -50,6 +50,9 @@ public class MrChat {
|
||||
public native String getName();
|
||||
public native String getSubtitle();
|
||||
|
||||
public static int MR_CHAT_PARAM_UNPROMOTED = 'U';
|
||||
public native int getParamInt(int key, int def);
|
||||
|
||||
public String getDraft() {
|
||||
return MrChatGetDraft(m_hChat);
|
||||
}
|
||||
|
||||
@@ -301,7 +301,7 @@ public class MrMailbox {
|
||||
MrStockAddStr(11, LocaleController.getString("AttachAudio", R.string.AttachAudio));
|
||||
MrStockAddStr(12, LocaleController.getString("AttachDocument", R.string.AttachDocument));
|
||||
MrStockAddStr(13, LocaleController.getString("DefaultStatusText", R.string.DefaultStatusText));
|
||||
MrStockAddStr(14, LocaleController.getString("SubjectPrefix", R.string.SubjectPrefix));
|
||||
MrStockAddStr(14, LocaleController.getString("MsgNewGroupDraft", R.string.MsgNewGroupDraft));
|
||||
}
|
||||
|
||||
public static String getInviteText() {
|
||||
|
||||
@@ -816,7 +816,14 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
});
|
||||
|
||||
TextView emptyView = new TextView(context);
|
||||
emptyView.setText(LocaleController.getString("NoMessages", R.string.NoMessages));
|
||||
|
||||
if( m_mrChat.getParamInt(MrChat.MR_CHAT_PARAM_UNPROMOTED, 0)==1 ) {
|
||||
emptyView.setText(LocaleController.getString("MsgNewGroupDraftHint", R.string.MsgNewGroupDraftHint));
|
||||
}
|
||||
else {
|
||||
emptyView.setText(LocaleController.getString("NoMessages", R.string.NoMessages));
|
||||
}
|
||||
|
||||
emptyView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14);
|
||||
emptyView.setGravity(Gravity.CENTER);
|
||||
emptyView.setTextColor(Theme.CHAT_EMPTY_VIEW_TEXT_COLOR);
|
||||
@@ -824,7 +831,10 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
emptyView.getBackground().setColorFilter(Theme.colorFilter);
|
||||
emptyView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
|
||||
emptyView.setPadding(AndroidUtilities.dp(10), AndroidUtilities.dp(2), AndroidUtilities.dp(10), AndroidUtilities.dp(3));
|
||||
emptyViewContainer.addView(emptyView, new FrameLayout.LayoutParams(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER));
|
||||
FrameLayout.LayoutParams fl = new FrameLayout.LayoutParams(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER);
|
||||
fl.leftMargin = AndroidUtilities.dp(24);
|
||||
fl.rightMargin = AndroidUtilities.dp(24);
|
||||
emptyViewContainer.addView(emptyView, fl);
|
||||
|
||||
if (chatActivityEnterView != null) {
|
||||
chatActivityEnterView.onDestroy();
|
||||
|
||||
@@ -568,4 +568,6 @@
|
||||
<string name="AskResetNotifications">Alle Benachrichtigungseinstellungen und Töne dieser Seite, der Kontakte und der Gruppen zurücksetzen?</string>
|
||||
<string name="AttachFiles">Dateien anhängen</string>
|
||||
<string name="ErrGroupNameEmpty">Bitte einen Namen für die Gruppe eingeben.</string>
|
||||
<string name="MsgNewGroupDraft">Hallo, ich habe die Gruppe \"_\" für uns erstellt.</string>
|
||||
<string name="MsgNewGroupDraftHint">Eine erste Nachricht schreiben; dann können die anderen in der Gruppe antworten.</string>
|
||||
</resources>
|
||||
|
||||
@@ -568,4 +568,6 @@
|
||||
<string name="AttachFiles">Attach files</string>
|
||||
<string name="Chats">Chats</string>
|
||||
<string name="ErrGroupNameEmpty">Please enter a name for the group.</string>
|
||||
<string name="MsgNewGroupDraftHint">Write a first message to allow others to reply in this group.</string>
|
||||
<string name="MsgNewGroupDraft">Hello, I\'ve just created the group \"_\" for us.</string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user