通過小程序給公眾號傳遞消息_多輸入現場消息傳遞應用程序概念

通過小程序給公眾號傳遞消息

by Dawid Woldu

戴維德·沃爾杜(Dawid Woldu)

多輸入現場消息傳遞應用程序概念 (A multi-input field messaging app concept)

Some time ago I shared in a Medium article the idea for context aware messenger app. The idea challenged the design limitation behind all messenger apps allowing you to write only one message at a time.

前段時間, 我在中型文章中分享了上下文感知的Messenger應用程序的想法。 這個想法挑戰了所有Messenger應用程序背后的設計局限性,使您一次只能編寫一條消息。

What I always missed in these apps was a way to save the message I’m currently typing and type and send something else instead. Then a way to get back to previously composed message and continue. Just to stay on topic and keep some order in my conversations.

我在這些應用程序中一直想念的是一種保存我當前正在鍵入的消息并鍵入然后發送其他內容的方法。 然后是一種返回到先前編寫的消息并繼續的方法。 只是為了保持話題性,保持對話中的秩序。

The way I do it today involves the sequence of text field related gestures: Long press, Select All, Cut, Type in, Send, Long press, Paste, continue.

我今天的操作方式涉及文本字段相關手勢的順序: 長按,全選,剪切,鍵入,發送,長按,粘貼,繼續。

My concept allowed to replace that sequence with a single tap, but it was up to the app to recognise the need for saving a message based on the context of the conversation. I built a Quartz Composer prototype to show the feature in action:

我的概念允許一次單擊即可替換該序列,但應由應用程序來確定是否需要根據對話的上下文來保存消息。 我構建了一個Quartz Composer原型來展示該功能的實際效果:

But I never shared the prototype, as it wasn’t functional, allowed for only one extra input field and was done solely for the purpose of recording that video. Also Origami prototypes for Quartz Composer didn’t work very well on the device (not mentioning the absence of native keyboard).

但是我從未共享過這個原型 ,因為它沒有功能,只允許一個額外的輸入字段,并且僅僅是為了錄制視頻而完成的。 同樣,用于Quartz Composer的Origami原型在該設備上也無法很好地工作(更不用說缺少本機鍵盤了)。

Release of Origami Studio allowed me to revisit the concept and build fully functional (sort of) prototype to share.

Origami Studio的發行使我能夠重新審視概念并構建功能齊全的原型(以便共享)。

I ditched the context aware part and allowed for saving as many drafts as you need, whenever you feel like it.

我放棄了上下文相關的部分,并允許在需要時保存任意數量的草稿。

這是新原型的演示視頻。 (Here’s a demo video of the new prototype.)

在折紙工作室制作。 (Building in Origami Studio.)

I could write a separate article/tutorial for each of the technical challenges I encountered while building the proto, but I’ll limit myself to just briefly list some of them here. Hopefully these short descriptions will be enough to spark some ideas whenever you encounter similar blocks. If not don’t hesitate to ping me directly.

我可以為構建原型時遇到的每種技術挑戰寫一篇單獨的文章/教程,但我會限制自己僅在此處簡要列出其中一些挑戰。 希望這些簡短的描述足以在遇到類似的問題時引發一些想法。 如果不是這樣,請直接與我聯系 。

多行輸入字段。 (Multi line input field.)

Text Field component in Origami Studio doesn’t allow for multi line inputs. When you double tap on it to reveal it’s content’s you’ll find the actual Text Input component that does. The problem is it doesn’t have a cursor/caret. So hacked in a cursor by measuring the position of the last letter in the text field.

Origami Studio中的“文本字段”組件不允許多行輸入。 當您雙擊它以顯示其內容時,您會發現實際的文本輸入組件。 問題是它沒有光標/插入符號。 因此,通過測量文本字段中最后一個字母的位置來侵入光標。

Each time you type a letter I check if it’s a ‘space’ and if it is I append it’s index to an Array of spaces. Then I assume that whenever height of the input increases the text will break at the last recorded space. Then I measure the rest of the text to place a cursor in a correct position of the new line. When you don’t tap the space I just measure the size of the text that fit the line.

每次輸入字母時,我都會檢查它是否為“空格”,是否將其索引附加到空格數組中。 然后,我假設只要輸入的高度增加,文本就會在最后記錄的空間中斷。 然后,我測量其余文本,以將光標放置在新行的正確位置。 當您不點擊空格時,我只是測量適合該行的文本的大小。

建立對話供稿。 (Building a conversation feed.)

The challenge here was dynamically creating chat bubbles while keeping the correct order in the feed. When bot starts typing you can see the last bubble on the feed with 3 jumping dots. But if you send the message before it finishes typing your bubble should land on the feed before the bot’s bubble. I managed to make it work by keeping two arrays of messages. Temporary one (bot typing) and final and switching between them whenever bot starts typing or sends the message.

這里的挑戰是如何動態創建聊天氣泡,同時又要保持Feed中正確的順序。 機器人開始輸入內容時,您會看到Feed上的最后一個氣泡,并帶有3個跳躍點。 但是,如果您在結束輸入消息之前就發送了消息,則氣泡應在機器人氣泡之前落入供稿。 我設法通過保留兩個消息數組來使其工作。 臨時一個(機器人輸入)和最終輸入,并在機器人開始輸入或發送消息時在它們之間切換。

I created a JSON config file with the bot messages that allow you to configure what and when the bot is sending and if it should wait for your message(s) to start typing.

我使用漫游器消息創建了一個JSON配置文件,該文件可讓您配置漫游器發送的內容和時間以及是否應等待您的消息開始鍵入。

{"message":"Ok, I'm dumb. What do you want from me?!", "waitforuser":2,"delay":1}

waitforuser — describes how many user messages should the bot wait for before it starts typing. Zero means it won’t wait for user at all.delay — time in seconds before bot starts typing.

waitforuser —描述了機器人在開始鍵入之前應該等待多少用戶消息。 零表示完全不等待用戶。 delay —機器人開始鍵入之前的時間(以秒為單位)。

創建/刪除輸入字段并管理其順序。 (Creating/removing input fields and managing their order.)

Whenever you create input field I’m increasing the count on the Loop patch, but as soon as you don’t need the field anymore I tried to remove the field from the loop and keep the other input fields keep their order and content. It was impossible for me to figure out as loop patches don’t keep the reference to the actual instance of the element they’re replicating. I worked around by hiding and reusing unused fields instead of removing them from the loop.

每當您創建輸入字段時,我都會增加Loop補丁的數量,但是一旦您不再需要該字段時,我就會嘗試從循環中刪除該字段并保留其他輸入字段的順序和內容。 我不可能弄清楚,因為循環補丁并沒有保留他們復制元素的實際實例的引用 。 我通過隱藏和重用未使用的字段而不是將其從循環中刪除來解決。

下載! (Downloads!)

You can download Origami prototype, JSON file as well as multiline text field component from my Google Drive.

您可以從我的Google云端硬盤下載Origami原型,JSON文件以及多行文本字段組件。

用戶手冊: (User’s Manual:)

Long press on Send button to save the current text and create new input field. (Yes! It’s undiscoverable. I know.)Prototype is optimised for use on the device. (You can’t hide the keyboard)

長按“發送”按鈕以保存當前文本并創建新的輸入字段。 (是的!這是無法發現的。我知道。)原型針對設備使用進行了優化。 (您不能隱藏鍵盤)

最后一分鐘發現了一些有趣的事實: (Last minute discovered fun facts:)

* The prototype crashes when using emojis. ?* Multi line input field cursor can behave erratically when typing super fast (I’m sharing anyway).* When you send a message in the exact time that bot starts typing, the empty bot message can appear on the feed.* Other bug fixes and performance improvements. (What?!)

*使用表情符號時原型崩潰。 **輸入超快速時多行輸入字段光標的行為異常(無論如何我還是在共享)。*如果您在機器人開始鍵入的確切時間發送消息,則在消息源中可能會出現空的機器人消息。*其他錯誤修復和性能改進。 (什么?!)

翻譯自: https://www.freecodecamp.org/news/multi-input-field-messaging-app-concept-911096778de3/

通過小程序給公眾號傳遞消息

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/395299.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/395299.shtml
英文地址,請注明出處:http://en.pswp.cn/news/395299.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

Oracle【IT實驗室】數據庫備份與恢復之二:SQL*Loader

2.1 基本知識 Oracle 的 SQL* LOADER 可以將外部格式化的文本數據加載到數據庫表中。通常 與 SPOOL導出文本數據方法配合使用。 1.命令格式 SQLLDR keywordvalue [,keywordvalue,……] 例:$ sqlldr user/pwd controlemp.ctl dataemp.dat ba…

關于spring 獲取不到網站上的xsd的處理記錄

2019獨角獸企業重金招聘Python工程師標準>>> 前兩天做一個項目還好好的,今天突然報出這個錯誤 cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element mvc:annotation-driven 應該是xml文件找不到相應…

藍寶石英語怎么讀_黑金和藍寶石

這是一直以后我個人的一個理解誤區,或者說是信息誤區,就是這兩個產品線,差別到底在哪里?以前我一直認為黑金的成分是純天然的,而藍寶石有一定的合成物質。這個信息一定是我從哪里讀到的,由于無處求證&#…

秘密潛入2小辣椒_短暫潛入2次,我顯然不知道自己作為開發人員正在做什么

秘密潛入2小辣椒by Zachary Kuhn扎卡里庫恩(Zachary Kuhn) 那兩次我顯然不知道我作為開發人員正在做什么 (Those two times where I clearly had no clue what I was doing as a developer) Last week I had a short conversation with coworkers about how we had messed up …

提高你的javascript代碼逼格系列之函數與數組

不知道大家有沒有一種感覺,那就是自己寫的javascript代碼雖然能完全解決工作上的需要,但是,一眼望去,too simple!!!簡直就是一個傻子都能看懂的水平,于是,在工作之余&…

印度評論九章量子計算機,張禮立:中國 “九章”量子計算機到底厲害在哪?...

【背景信息】12月4日,《科學》雜志公布了中國“九章”的重大突破。 這臺由中國科學技術大學潘建偉、陸朝陽等學者研制的76個光子的量子計算原型機,推動全球量子計算的前沿研究達到一個新高度。盡管距離實際應用仍有漫漫長路,但成功實現了“量…

手機web網頁制作的認識(有關meta標簽)

近日以來一直在看JQuery Mobile 一個手機開發框架&#xff0c;說實話真的很頭疼的~~~~ 因為里面有很多的屬性、方法和事件~~~ 下面是手機網頁的一些認識&#xff1a; 一、<meta name"viewport" id"viewport" content"widthdevice-width, initial-s…

包打包和解析過程 unity_Unity學習—資源管理概覽

本文介紹了 Unity 常用四種默認路徑&#xff0c;以及 AssetDataBase、Resources、AssetBundle 和目前最新的 Addressable 四種資源管理方式文中所有 API 均以版本 2019.3 為準本文原地址&#xff1a;Unity學習—資源管理概覽資源路徑Application.dataPath官方文檔只讀&#xff…

graphql tools_聲明式GraphQL:編寫更少的代碼,并使用graphql-tools完成更多工作

graphql toolsI’ve been working with GraphQL for a few months now, but only recently began using Apollo’s graphql-tools library. After learning a few idioms, I am able to mock up a functional API quickly. This is largely due to its low-code, declarative a…

用idea搭建SSM項目,原來這么簡單

目錄 前言軟件環境創建項目數據庫文件配置文件pom.xmllog4j.propertiesjdbc.propertiesapplicationContext.xmlspring-mvc.xmlweb.xml運行項目編寫代碼前言 前陣子突發奇想&#xff0c;想學習下SpringMVC的源碼&#xff0c;于是打算用idea搭建一個簡易的maven版SSM案例&#xf…

浙江理工大學計算機組成原理試卷,浙江理工大學計算機組成原理設計試題.doc...

計算機組成原理課程設計報告2013/2014第二學期指導教師&#xff1a;許建龍 張芳班級&#xff1a;12計科2班姓名&#xff1a;學號&#xff1a; 計算機組成原理大型實驗任務書(計算機12級1、2、3班和實驗班)實驗目的&#xff1a;深入了解計算機各種指令的執行過程&#xff0c;以及…

mac vagrant 虛擬機nfs掛載點

需求&#xff1a;在mac 上安裝了虛擬機&#xff0c;虛擬機系統為centos6.5&#xff0c;現在希望講虛擬機上點目錄通過nfs共享給mac使用 下面主要描述通過nfs共享目錄給mac調用的過程 過程參考網址&#xff1a; http://www.moqifei.com/archives/1534 &#xff08;我主要參考的這…

nodejs中require的路徑是一個文件夾時發生了什么

node中使用require的時候如果路徑是一個文件夾時&#xff0c;或者特殊的情況require(..);require(.); 這是node實戰這本書里說的情況&#xff0c;但是我在node6.9版本中發現不完全是這樣&#xff0c;可能是后來做了修改。下面說說在6.9下require路徑的過程。 這里以require(.)說…

python調用ctypes中windll中的方法超時處理_python中使用ctypes調用MinGW生成的動態鏈接庫(dll)...

關于gcc編譯dll的我就不說了&#xff0c;網上舉例一大堆&#xff0c;下面以g為例。假設有一個test.cpp文件如下&#xff1a;extern "C" {__declspec(dllexport) double add(double x,double y);}double add(double x,double y){return xy;}在MinGW中使用g編譯&#x…

慣用過程模型_慣用的Ruby:編寫漂亮的代碼

慣用過程模型Ruby is a beautiful programming language.Ruby是一種美麗的編程語言。 According to Ruby’s official web page, Ruby is a:根據Ruby的官方網頁&#xff0c;Ruby是&#xff1a; “dynamic, open source programming language with a focus on simplicity and …

采用晶體管為基本元件的計算機發展階段是,計算機應用基礎知識點

第一章 計算機基礎知識1、計算機發展階段第一代&#xff1a;電子管計算機采用電子管為基本元件&#xff0c;設計使用機器語言或匯編語言。要用于科學和工程計算 第二代&#xff1a;晶體管計算機采用晶體管為基本元件&#xff0c;程序設計采用高級語言&#xff0c;出現了操作系統…

springcloud系列三 搭建服務模塊

搭建服務模塊為了模擬正式開發環境,只是少寫了service層直接在controller里面直接引用,直接上圖和代碼:更為方便: 創建完成之后加入配置: pom.xml文件: <?xml version"1.0" encoding"UTF-8"?> <project xmlns"http://maven.apache.org/POM…

P1801 黑匣子_NOI導刊2010提高(06)

題目描述 Black Box是一種原始的數據庫。它可以儲存一個整數數組&#xff0c;還有一個特別的變量i。最開始的時候Black Box是空的&#xff0e;而i等于0。這個Black Box要處理一串命令。 命令只有兩種&#xff1a; ADD(x):把x元素放進BlackBox; GET:i加1&#xff0c;然后輸出Bla…

MySql模糊查詢

常規like的使用限制&#xff1a; 1. like %keyword &#xff1a;索引失效&#xff0c;使用全表掃描。但可以通過翻轉函數like前模糊查詢建立翻轉函數索引走翻轉函數索引&#xff0c;不走全表掃描。 2. like keyword% &#xff1a;索引有效。 3. like %keyword% &#xff1a;索引…

python psycopg2使用_python?操作數據庫:psycopg2的使用

1 conn psycopg2.connect(database"testdb", user"postgres",password"cohondob", host"127.0.0.1", port"5432")這個API打開一個連接到PostgreSQL數據庫。如果成功打開數據庫時&#xff0c;它返回一個連接對象。2cursor c…