-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎉Release 1.3,调整部分代码结构并添加LICENSE,添加新UIdebug布局
- Loading branch information
1 parent
138f923
commit 6012433
Showing
10 changed files
with
107 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
.../main/java/com/haohanyh/linmengjia/nearlink/nlchat/fun/ChatCore/ChatUIAnimationUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...main/java/com/haohanyh/linmengjia/nearlink/nlchat/fun/ChatCore/ChatUIBackgroundUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* 受Haohanyh Computer Software Products Open Source LICENSE保护 https://github.com/Hny0305Lin/LICENSE/blob/main/LICENSE */ | ||
package com.haohanyh.linmengjia.nearlink.nlchat.fun.ChatCore; | ||
|
||
import android.content.Context; | ||
import android.graphics.drawable.ColorDrawable; | ||
import android.graphics.drawable.Drawable; | ||
import android.net.Uri; | ||
import android.view.View; | ||
|
||
import androidx.cardview.widget.CardView; | ||
|
||
import java.io.InputStream; | ||
|
||
public class ChatUIBackgroundUtils { | ||
|
||
// 设置启动时的背景 | ||
public static void setSavedBackground(Context context, View mainUIView) { | ||
String backgroundPath = ChatFileUtils.getBackgroundPath(context); | ||
if (backgroundPath != null) { | ||
Uri backgroundUri = Uri.parse(backgroundPath); | ||
try { | ||
InputStream inputStream = context.getContentResolver().openInputStream(backgroundUri); | ||
Drawable drawable = Drawable.createFromStream(inputStream, backgroundUri.toString()); | ||
mainUIView.setBackground(drawable); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} | ||
|
||
// 设置 CardView 背景为半透明 | ||
public static void setCardViewBackground(CardView cardView, int color) { | ||
if (cardView != null) { | ||
cardView.setBackground(new ColorDrawable(color)); // 设置半透明背景 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<solid android:color="@color/newui_log_i" /> | ||
<corners android:radius="8dp" /> | ||
<padding android:left="8dp" android:top="8dp" android:right="8dp" android:bottom="8dp" /> | ||
</shape> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="horizontal" | ||
android:padding="3dp" | ||
android:gravity="center"> | ||
|
||
<TextView | ||
android:id="@+id/text_message_body" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:background="@drawable/bg_debug_bubble_log" | ||
android:gravity="top|bottom" | ||
android:breakStrategy="simple" | ||
android:hyphenationFrequency="none" | ||
android:maxWidth="220dp" | ||
android:padding="10dp" | ||
android:text="Hello, this is a sent message! Test!" | ||
android:textColor="@android:color/black"/> | ||
|
||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters