Skip to content

Commit

Permalink
🎉Release 1.3,调整发送机制目前做到单行输入+Enter即发送,取消新UI目前为BETA测试,调整目前为Release
Browse files Browse the repository at this point in the history
  • Loading branch information
Hny0305Lin committed Jul 5, 2024
1 parent 586ccc8 commit 244893b
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
import android.util.Log;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.View;
import android.view.WindowManager;
import android.view.inputmethod.EditorInfo;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.RadioButton;
Expand Down Expand Up @@ -81,9 +83,10 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
//主要控件
private FloatingActionButton btnGO;
private FloatingActionMenu btnMenu;
private com.github.clans.fab.FloatingActionButton btnNearLinkStatus,btnNearLinkSettings,btnNearlinkUart,btnNearlinkDev;
private com.github.clans.fab.FloatingActionButton btnNearLinkStatus,btnNearLinkSettings,btnNearLinkUIChanges,btnNearlinkUart,btnNearlinkDev;
private int clickCountButton_btnNearLinkStatus = 0; //按钮计数
private int clickCountButton_btnNearLinkSettings = 0; //按钮计数
private int clickCountButton_btnNearLinkUIChanges = 0; //按钮计数,切换新旧UI
private int clickCountButton_btnNearLinkUart = 0; //按钮计数
private int clickCountButton_btnNearLinkDev = 0; //按钮计数
private CardView CNearLinkStatus,CNearlinkUart,CNearLinkSettings,CNearlinkDev,CTHANKS;
Expand Down Expand Up @@ -238,6 +241,17 @@ private void Init() {
NearLinkUserText = findViewById(id.readText);
NearLinkMeText = findViewById(id.writeText);
EditChatSend = findViewById(id.editChatSend);
EditChatSend.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView textView, int actionId, KeyEvent keyEvent) {
if (actionId == EditorInfo.IME_ACTION_DONE ||
(keyEvent != null && keyEvent.getKeyCode() == KeyEvent.KEYCODE_ENTER && keyEvent.getAction() == KeyEvent.ACTION_DOWN)) {
NearLinkChatSendData(textView);
return true;
}
return false;
}
});

CheckBoxUartWarn = findViewById(id.cbUartWarn);
NearLinkUartWarnToast = CheckBoxUartWarn.isChecked();
Expand Down Expand Up @@ -569,6 +583,8 @@ public void NearLinkChatSendData(View view) {
}
MainAPP.Vibrate(this);
}
//发送完消息清空待发送文本
EditChatSend.setText("");
});
}
}
Expand Down
14 changes: 13 additions & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
android:layout_marginTop="35dp"
android:layout_marginRight="15dp"
android:layout_marginBottom="15dp"
android:visibility="visible"
android:visibility="gone"
app:cardCornerRadius="4dp"
app:cardElevation="18dp">

Expand Down Expand Up @@ -212,6 +212,7 @@
android:layout_marginBottom="10dp"
android:layout_weight="8"
android:textColor="@color/blue_biaozhun_logowai"
android:singleLine="true"
tools:ignore="HardcodedText" />

<com.google.android.material.button.MaterialButton
Expand Down Expand Up @@ -1140,6 +1141,17 @@
app:fab_shadowColor="@color/Pink_is_fancy"
app:fab_size="mini" />

<com.github.clans.fab.FloatingActionButton
android:id="@+id/menu_labels_right_btn_nearlink_uichanges"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_baseline_done_all_24"
app:fab_colorNormal="@color/blue_biaozhun_logowai_transparent"
app:fab_colorPressed="@color/blue_biaozhun_logowai"
app:fab_label="UIChanges 聊天UI切换"
app:fab_shadowColor="@color/Pink_is_fancy"
app:fab_size="mini" />

<com.github.clans.fab.FloatingActionButton
android:id="@+id/menu_labels_right_btn_nearlink_uart"
android:layout_width="wrap_content"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<resources>
<string name="app_name">NLChat</string>
<string name="app_package">com.haohanyh.linmengjia.nearlink.nlchat.fun</string>
<string name="app_version">1.3.52.2024.0705</string>
<string name="app_version">1.3.56.2024.0706</string>

<string name="appwarn">NLChat,浩瀚银河宗旨为用爱和魔法创造Android APP。</string>
<string name="thanks3q">友情感谢</string>
Expand Down

0 comments on commit 244893b

Please sign in to comment.