fix: restore compact android ui density
This commit is contained in:
@@ -33,6 +33,8 @@ import android.content.res.ColorStateList;
|
|||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
public final class BossUi {
|
public final class BossUi {
|
||||||
@@ -127,9 +129,9 @@ public final class BossUi {
|
|||||||
|
|
||||||
public static void applyTopIconButtonStyle(Context context, ImageButton button) {
|
public static void applyTopIconButtonStyle(Context context, ImageButton button) {
|
||||||
button.setBackgroundResource(R.drawable.bg_top_icon_button);
|
button.setBackgroundResource(R.drawable.bg_top_icon_button);
|
||||||
button.setMinimumWidth(dp(context, 40));
|
button.setMinimumWidth(dp(context, 36));
|
||||||
button.setMinimumHeight(dp(context, 40));
|
button.setMinimumHeight(dp(context, 36));
|
||||||
button.setPadding(dp(context, 8), dp(context, 8), dp(context, 8), dp(context, 8));
|
button.setPadding(dp(context, 7), dp(context, 7), dp(context, 7), dp(context, 7));
|
||||||
ImageViewCompat.setImageTintList(button, ColorStateList.valueOf(context.getColor(R.color.boss_text_primary)));
|
ImageViewCompat.setImageTintList(button, ColorStateList.valueOf(context.getColor(R.color.boss_text_primary)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -235,7 +237,7 @@ public final class BossUi {
|
|||||||
);
|
);
|
||||||
params.bottomMargin = dp(context, 1);
|
params.bottomMargin = dp(context, 1);
|
||||||
row.setLayoutParams(params);
|
row.setLayoutParams(params);
|
||||||
row.setPadding(dp(context, 16), dp(context, 14), dp(context, 16), dp(context, 14));
|
row.setPadding(dp(context, 14), dp(context, 10), dp(context, 14), dp(context, 10));
|
||||||
row.setBackgroundResource(R.drawable.bg_list_row);
|
row.setBackgroundResource(R.drawable.bg_list_row);
|
||||||
if (listener != null) {
|
if (listener != null) {
|
||||||
row.setClickable(true);
|
row.setClickable(true);
|
||||||
@@ -254,7 +256,7 @@ public final class BossUi {
|
|||||||
|
|
||||||
TextView titleView = new TextView(context);
|
TextView titleView = new TextView(context);
|
||||||
titleView.setText(title);
|
titleView.setText(title);
|
||||||
titleView.setTextSize(17);
|
titleView.setTextSize(16);
|
||||||
titleView.setTypeface(Typeface.DEFAULT_BOLD);
|
titleView.setTypeface(Typeface.DEFAULT_BOLD);
|
||||||
titleView.setTextColor(context.getColor(R.color.boss_text_primary));
|
titleView.setTextColor(context.getColor(R.color.boss_text_primary));
|
||||||
textWrap.addView(titleView);
|
textWrap.addView(titleView);
|
||||||
@@ -262,7 +264,7 @@ public final class BossUi {
|
|||||||
if (!TextUtils.isEmpty(subtitle)) {
|
if (!TextUtils.isEmpty(subtitle)) {
|
||||||
TextView subtitleView = new TextView(context);
|
TextView subtitleView = new TextView(context);
|
||||||
subtitleView.setText(subtitle);
|
subtitleView.setText(subtitle);
|
||||||
subtitleView.setTextSize(14);
|
subtitleView.setTextSize(13);
|
||||||
subtitleView.setTextColor(context.getColor(R.color.boss_text_muted));
|
subtitleView.setTextColor(context.getColor(R.color.boss_text_muted));
|
||||||
subtitleView.setPadding(0, dp(context, 4), 0, 0);
|
subtitleView.setPadding(0, dp(context, 4), 0, 0);
|
||||||
textWrap.addView(subtitleView);
|
textWrap.addView(subtitleView);
|
||||||
@@ -271,7 +273,7 @@ public final class BossUi {
|
|||||||
if (!TextUtils.isEmpty(meta)) {
|
if (!TextUtils.isEmpty(meta)) {
|
||||||
TextView metaView = new TextView(context);
|
TextView metaView = new TextView(context);
|
||||||
metaView.setText(meta);
|
metaView.setText(meta);
|
||||||
metaView.setTextSize(12);
|
metaView.setTextSize(11);
|
||||||
metaView.setTextColor(context.getColor(R.color.boss_text_soft));
|
metaView.setTextColor(context.getColor(R.color.boss_text_soft));
|
||||||
metaView.setPadding(0, dp(context, 6), 0, 0);
|
metaView.setPadding(0, dp(context, 6), 0, 0);
|
||||||
textWrap.addView(metaView);
|
textWrap.addView(metaView);
|
||||||
@@ -378,7 +380,7 @@ public final class BossUi {
|
|||||||
LinearLayout row = buildListRow(context, title, subtitle, meta, badge, listener);
|
LinearLayout row = buildListRow(context, title, subtitle, meta, badge, listener);
|
||||||
row.setBackgroundColor(Color.WHITE);
|
row.setBackgroundColor(Color.WHITE);
|
||||||
row.setElevation(0f);
|
row.setElevation(0f);
|
||||||
row.setPadding(dp(context, 16), dp(context, 13), dp(context, 16), dp(context, 13));
|
row.setPadding(dp(context, 14), dp(context, 10), dp(context, 14), dp(context, 10));
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -397,7 +399,7 @@ public final class BossUi {
|
|||||||
);
|
);
|
||||||
row.setLayoutParams(params);
|
row.setLayoutParams(params);
|
||||||
row.setBackgroundColor(Color.WHITE);
|
row.setBackgroundColor(Color.WHITE);
|
||||||
row.setPadding(dp(context, 18), dp(context, 15), dp(context, 18), dp(context, 15));
|
row.setPadding(dp(context, 14), dp(context, 10), dp(context, 14), dp(context, 10));
|
||||||
|
|
||||||
LinearLayout textWrap = new LinearLayout(context);
|
LinearLayout textWrap = new LinearLayout(context);
|
||||||
textWrap.setOrientation(LinearLayout.VERTICAL);
|
textWrap.setOrientation(LinearLayout.VERTICAL);
|
||||||
@@ -409,7 +411,7 @@ public final class BossUi {
|
|||||||
|
|
||||||
TextView titleView = new TextView(context);
|
TextView titleView = new TextView(context);
|
||||||
titleView.setText(title);
|
titleView.setText(title);
|
||||||
titleView.setTextSize(17);
|
titleView.setTextSize(16);
|
||||||
titleView.setTypeface(Typeface.DEFAULT_BOLD);
|
titleView.setTypeface(Typeface.DEFAULT_BOLD);
|
||||||
titleView.setTextColor(context.getColor(R.color.boss_text_primary));
|
titleView.setTextColor(context.getColor(R.color.boss_text_primary));
|
||||||
textWrap.addView(titleView);
|
textWrap.addView(titleView);
|
||||||
@@ -417,7 +419,7 @@ public final class BossUi {
|
|||||||
if (!TextUtils.isEmpty(subtitle)) {
|
if (!TextUtils.isEmpty(subtitle)) {
|
||||||
TextView subtitleView = new TextView(context);
|
TextView subtitleView = new TextView(context);
|
||||||
subtitleView.setText(subtitle);
|
subtitleView.setText(subtitle);
|
||||||
subtitleView.setTextSize(14);
|
subtitleView.setTextSize(13);
|
||||||
subtitleView.setTextColor(context.getColor(R.color.boss_text_muted));
|
subtitleView.setTextColor(context.getColor(R.color.boss_text_muted));
|
||||||
subtitleView.setPadding(0, dp(context, 4), 0, 0);
|
subtitleView.setPadding(0, dp(context, 4), 0, 0);
|
||||||
textWrap.addView(subtitleView);
|
textWrap.addView(subtitleView);
|
||||||
@@ -454,19 +456,19 @@ public final class BossUi {
|
|||||||
);
|
);
|
||||||
params.bottomMargin = dp(context, 10);
|
params.bottomMargin = dp(context, 10);
|
||||||
card.setLayoutParams(params);
|
card.setLayoutParams(params);
|
||||||
card.setPadding(dp(context, 20), dp(context, 18), dp(context, 20), dp(context, 18));
|
card.setPadding(dp(context, 16), dp(context, 14), dp(context, 16), dp(context, 14));
|
||||||
card.setBackgroundColor(Color.WHITE);
|
card.setBackgroundColor(Color.WHITE);
|
||||||
card.setElevation(0f);
|
card.setElevation(0f);
|
||||||
|
|
||||||
TextView avatar = new TextView(context);
|
TextView avatar = new TextView(context);
|
||||||
LinearLayout.LayoutParams avatarParams = new LinearLayout.LayoutParams(dp(context, 70), dp(context, 70));
|
LinearLayout.LayoutParams avatarParams = new LinearLayout.LayoutParams(dp(context, 56), dp(context, 56));
|
||||||
avatar.setLayoutParams(avatarParams);
|
avatar.setLayoutParams(avatarParams);
|
||||||
avatar.setGravity(Gravity.CENTER);
|
avatar.setGravity(Gravity.CENTER);
|
||||||
avatar.setText(firstLetter(name));
|
avatar.setText(firstLetter(name));
|
||||||
avatar.setTextSize(30);
|
avatar.setTextSize(24);
|
||||||
avatar.setTypeface(Typeface.DEFAULT_BOLD);
|
avatar.setTypeface(Typeface.DEFAULT_BOLD);
|
||||||
avatar.setTextColor(context.getColor(R.color.boss_green));
|
avatar.setTextColor(context.getColor(R.color.boss_green));
|
||||||
avatar.setBackground(createRoundedBackground(Color.parseColor("#DFF3E8"), dp(context, 35)));
|
avatar.setBackground(createRoundedBackground(Color.parseColor("#DFF3E8"), dp(context, 28)));
|
||||||
card.addView(avatar);
|
card.addView(avatar);
|
||||||
|
|
||||||
LinearLayout textWrap = new LinearLayout(context);
|
LinearLayout textWrap = new LinearLayout(context);
|
||||||
@@ -481,14 +483,14 @@ public final class BossUi {
|
|||||||
|
|
||||||
TextView titleView = new TextView(context);
|
TextView titleView = new TextView(context);
|
||||||
titleView.setText(TextUtils.isEmpty(name) ? "我的" : name);
|
titleView.setText(TextUtils.isEmpty(name) ? "我的" : name);
|
||||||
titleView.setTextSize(22);
|
titleView.setTextSize(20);
|
||||||
titleView.setTypeface(Typeface.DEFAULT_BOLD);
|
titleView.setTypeface(Typeface.DEFAULT_BOLD);
|
||||||
titleView.setTextColor(context.getColor(R.color.boss_text_primary));
|
titleView.setTextColor(context.getColor(R.color.boss_text_primary));
|
||||||
textWrap.addView(titleView);
|
textWrap.addView(titleView);
|
||||||
|
|
||||||
TextView subtitleView = new TextView(context);
|
TextView subtitleView = new TextView(context);
|
||||||
subtitleView.setText(subtitle);
|
subtitleView.setText(subtitle);
|
||||||
subtitleView.setTextSize(14);
|
subtitleView.setTextSize(13);
|
||||||
subtitleView.setTextColor(context.getColor(R.color.boss_text_muted));
|
subtitleView.setTextColor(context.getColor(R.color.boss_text_muted));
|
||||||
subtitleView.setPadding(0, dp(context, 5), 0, 0);
|
subtitleView.setPadding(0, dp(context, 5), 0, 0);
|
||||||
textWrap.addView(subtitleView);
|
textWrap.addView(subtitleView);
|
||||||
@@ -567,7 +569,7 @@ public final class BossUi {
|
|||||||
params.rightMargin = dp(context, 12);
|
params.rightMargin = dp(context, 12);
|
||||||
params.bottomMargin = dp(context, 1);
|
params.bottomMargin = dp(context, 1);
|
||||||
card.setLayoutParams(params);
|
card.setLayoutParams(params);
|
||||||
card.setPadding(dp(context, 14), dp(context, 13), dp(context, 14), dp(context, 13));
|
card.setPadding(dp(context, 12), dp(context, 10), dp(context, 12), dp(context, 10));
|
||||||
card.setBackgroundColor(Color.WHITE);
|
card.setBackgroundColor(Color.WHITE);
|
||||||
card.setElevation(0f);
|
card.setElevation(0f);
|
||||||
if (listener != null) {
|
if (listener != null) {
|
||||||
@@ -580,15 +582,15 @@ public final class BossUi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
FrameLayout avatarWrap = new FrameLayout(context);
|
FrameLayout avatarWrap = new FrameLayout(context);
|
||||||
LinearLayout.LayoutParams avatarWrapParams = new LinearLayout.LayoutParams(dp(context, 56), dp(context, 56));
|
LinearLayout.LayoutParams avatarWrapParams = new LinearLayout.LayoutParams(dp(context, 48), dp(context, 48));
|
||||||
avatarWrap.setLayoutParams(avatarWrapParams);
|
avatarWrap.setLayoutParams(avatarWrapParams);
|
||||||
|
|
||||||
TextView avatar = new TextView(context);
|
TextView avatar = new TextView(context);
|
||||||
FrameLayout.LayoutParams avatarParams = new FrameLayout.LayoutParams(dp(context, 52), dp(context, 52));
|
FrameLayout.LayoutParams avatarParams = new FrameLayout.LayoutParams(dp(context, 44), dp(context, 44));
|
||||||
avatar.setLayoutParams(avatarParams);
|
avatar.setLayoutParams(avatarParams);
|
||||||
avatar.setGravity(Gravity.CENTER);
|
avatar.setGravity(Gravity.CENTER);
|
||||||
avatar.setText(firstLetter(firstNonEmpty(row.avatarLabel, row.title, "设")));
|
avatar.setText(firstLetter(firstNonEmpty(row.avatarLabel, row.title, "设")));
|
||||||
avatar.setTextSize(22);
|
avatar.setTextSize(18);
|
||||||
avatar.setTypeface(Typeface.DEFAULT_BOLD);
|
avatar.setTypeface(Typeface.DEFAULT_BOLD);
|
||||||
avatar.setTextColor(resolveDeviceAccentColor(row.statusKey));
|
avatar.setTextColor(resolveDeviceAccentColor(row.statusKey));
|
||||||
avatar.setBackground(createRoundedBackground(resolveDeviceAvatarBackground(row.statusKey), dp(context, 18)));
|
avatar.setBackground(createRoundedBackground(resolveDeviceAvatarBackground(row.statusKey), dp(context, 18)));
|
||||||
@@ -615,7 +617,7 @@ public final class BossUi {
|
|||||||
|
|
||||||
TextView titleView = new TextView(context);
|
TextView titleView = new TextView(context);
|
||||||
titleView.setText(TextUtils.isEmpty(row.title) ? "设备" : row.title);
|
titleView.setText(TextUtils.isEmpty(row.title) ? "设备" : row.title);
|
||||||
titleView.setTextSize(17);
|
titleView.setTextSize(16);
|
||||||
titleView.setTypeface(Typeface.DEFAULT_BOLD);
|
titleView.setTypeface(Typeface.DEFAULT_BOLD);
|
||||||
titleView.setTextColor(context.getColor(R.color.boss_text_primary));
|
titleView.setTextColor(context.getColor(R.color.boss_text_primary));
|
||||||
titleView.setMaxLines(1);
|
titleView.setMaxLines(1);
|
||||||
@@ -624,7 +626,7 @@ public final class BossUi {
|
|||||||
|
|
||||||
TextView subtitleView = new TextView(context);
|
TextView subtitleView = new TextView(context);
|
||||||
subtitleView.setText(row.subtitle);
|
subtitleView.setText(row.subtitle);
|
||||||
subtitleView.setTextSize(13);
|
subtitleView.setTextSize(12);
|
||||||
subtitleView.setTextColor(context.getColor(R.color.boss_text_muted));
|
subtitleView.setTextColor(context.getColor(R.color.boss_text_muted));
|
||||||
subtitleView.setPadding(0, dp(context, 5), 0, 0);
|
subtitleView.setPadding(0, dp(context, 5), 0, 0);
|
||||||
subtitleView.setMaxLines(2);
|
subtitleView.setMaxLines(2);
|
||||||
@@ -633,7 +635,7 @@ public final class BossUi {
|
|||||||
|
|
||||||
TextView metaView = new TextView(context);
|
TextView metaView = new TextView(context);
|
||||||
metaView.setText(row.meta);
|
metaView.setText(row.meta);
|
||||||
metaView.setTextSize(12);
|
metaView.setTextSize(11);
|
||||||
metaView.setTextColor(resolveDeviceMetaColor(context, row.statusKey));
|
metaView.setTextColor(resolveDeviceMetaColor(context, row.statusKey));
|
||||||
metaView.setPadding(0, dp(context, 6), 0, 0);
|
metaView.setPadding(0, dp(context, 6), 0, 0);
|
||||||
metaView.setMaxLines(2);
|
metaView.setMaxLines(2);
|
||||||
@@ -765,14 +767,14 @@ public final class BossUi {
|
|||||||
) {
|
) {
|
||||||
LinearLayout card = new LinearLayout(context);
|
LinearLayout card = new LinearLayout(context);
|
||||||
card.setOrientation(LinearLayout.HORIZONTAL);
|
card.setOrientation(LinearLayout.HORIZONTAL);
|
||||||
card.setGravity(Gravity.TOP);
|
card.setGravity(Gravity.CENTER_VERTICAL);
|
||||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
||||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||||
LinearLayout.LayoutParams.WRAP_CONTENT
|
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||||
);
|
);
|
||||||
params.bottomMargin = dp(context, 1);
|
params.bottomMargin = dp(context, 1);
|
||||||
card.setLayoutParams(params);
|
card.setLayoutParams(params);
|
||||||
card.setPadding(dp(context, 16), dp(context, 12), dp(context, 16), dp(context, 12));
|
card.setPadding(dp(context, 14), dp(context, 8), dp(context, 14), dp(context, 8));
|
||||||
card.setBackgroundColor(highlighted ? Color.parseColor("#EAF8F0") : row.pinnedConversation ? PINNED_ROW_BG : Color.WHITE);
|
card.setBackgroundColor(highlighted ? Color.parseColor("#EAF8F0") : row.pinnedConversation ? PINNED_ROW_BG : Color.WHITE);
|
||||||
card.setElevation(0f);
|
card.setElevation(0f);
|
||||||
if (listener != null) {
|
if (listener != null) {
|
||||||
@@ -793,37 +795,38 @@ public final class BossUi {
|
|||||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||||
1f
|
1f
|
||||||
);
|
);
|
||||||
centerParams.leftMargin = dp(context, 12);
|
centerParams.leftMargin = dp(context, 10);
|
||||||
centerParams.rightMargin = dp(context, 10);
|
centerParams.rightMargin = dp(context, 8);
|
||||||
centerColumn.setLayoutParams(centerParams);
|
centerColumn.setLayoutParams(centerParams);
|
||||||
|
|
||||||
TextView titleView = new TextView(context);
|
TextView titleView = new TextView(context);
|
||||||
titleView.setText(TextUtils.isEmpty(row.threadTitle) ? "未命名会话" : row.threadTitle);
|
titleView.setText(TextUtils.isEmpty(row.threadTitle) ? "未命名会话" : row.threadTitle);
|
||||||
titleView.setTextSize(17);
|
titleView.setTextSize(15);
|
||||||
|
titleView.setIncludeFontPadding(false);
|
||||||
|
titleView.setGravity(Gravity.CENTER_VERTICAL);
|
||||||
titleView.setTypeface(Typeface.DEFAULT_BOLD);
|
titleView.setTypeface(Typeface.DEFAULT_BOLD);
|
||||||
titleView.setTextColor(context.getColor(R.color.boss_text_primary));
|
titleView.setTextColor(context.getColor(R.color.boss_text_primary));
|
||||||
titleView.setMaxLines(1);
|
titleView.setMaxLines(1);
|
||||||
titleView.setEllipsize(TextUtils.TruncateAt.END);
|
titleView.setEllipsize(TextUtils.TruncateAt.END);
|
||||||
|
titleView.setLayoutParams(new LinearLayout.LayoutParams(
|
||||||
|
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||||
|
dp(context, 22)
|
||||||
|
));
|
||||||
centerColumn.addView(titleView);
|
centerColumn.addView(titleView);
|
||||||
|
|
||||||
if (!TextUtils.isEmpty(row.folderLabel)) {
|
|
||||||
TextView folderView = new TextView(context);
|
|
||||||
folderView.setText(row.folderLabel);
|
|
||||||
folderView.setTextSize(13);
|
|
||||||
folderView.setTextColor(context.getColor(R.color.boss_text_muted));
|
|
||||||
folderView.setPadding(0, dp(context, 4), 0, 0);
|
|
||||||
folderView.setMaxLines(1);
|
|
||||||
folderView.setEllipsize(TextUtils.TruncateAt.END);
|
|
||||||
centerColumn.addView(folderView);
|
|
||||||
}
|
|
||||||
|
|
||||||
TextView previewView = new TextView(context);
|
TextView previewView = new TextView(context);
|
||||||
previewView.setText(TextUtils.isEmpty(row.lastMessagePreview) ? "暂无消息" : row.lastMessagePreview);
|
previewView.setText(buildConversationPreviewText(row.folderLabel, row.lastMessagePreview));
|
||||||
previewView.setTextSize(13);
|
previewView.setTextSize(12);
|
||||||
|
previewView.setIncludeFontPadding(false);
|
||||||
|
previewView.setGravity(Gravity.CENTER_VERTICAL);
|
||||||
previewView.setTextColor(context.getColor(R.color.boss_text_soft));
|
previewView.setTextColor(context.getColor(R.color.boss_text_soft));
|
||||||
previewView.setPadding(0, dp(context, 4), 0, 0);
|
previewView.setPadding(0, 0, 0, 0);
|
||||||
previewView.setMaxLines(1);
|
previewView.setMaxLines(1);
|
||||||
previewView.setEllipsize(TextUtils.TruncateAt.END);
|
previewView.setEllipsize(TextUtils.TruncateAt.END);
|
||||||
|
previewView.setLayoutParams(new LinearLayout.LayoutParams(
|
||||||
|
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||||
|
dp(context, 20)
|
||||||
|
));
|
||||||
centerColumn.addView(previewView);
|
centerColumn.addView(previewView);
|
||||||
|
|
||||||
card.addView(centerColumn);
|
card.addView(centerColumn);
|
||||||
@@ -836,38 +839,25 @@ public final class BossUi {
|
|||||||
LinearLayout.LayoutParams.WRAP_CONTENT
|
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||||
));
|
));
|
||||||
|
|
||||||
if (!row.pinnedConversation && !TextUtils.isEmpty(row.topPinnedLabel)) {
|
|
||||||
TextView pinnedView = new TextView(context);
|
|
||||||
pinnedView.setText(row.topPinnedLabel);
|
|
||||||
pinnedView.setTextSize(11);
|
|
||||||
pinnedView.setTypeface(Typeface.DEFAULT_BOLD);
|
|
||||||
pinnedView.setTextColor(context.getColor(R.color.boss_green));
|
|
||||||
pinnedView.setBackground(createRoundedBackground(Color.parseColor("#E7F7EE"), dp(context, 9)));
|
|
||||||
pinnedView.setPadding(dp(context, 7), dp(context, 3), dp(context, 7), dp(context, 3));
|
|
||||||
pinnedView.setLayoutParams(new LinearLayout.LayoutParams(
|
|
||||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
|
||||||
LinearLayout.LayoutParams.WRAP_CONTENT
|
|
||||||
));
|
|
||||||
trailingColumn.addView(pinnedView);
|
|
||||||
}
|
|
||||||
|
|
||||||
TextView timeView = new TextView(context);
|
TextView timeView = new TextView(context);
|
||||||
timeView.setText(TextUtils.isEmpty(row.timeLabel) ? "--:--" : row.timeLabel);
|
timeView.setText(TextUtils.isEmpty(row.timeLabel) ? "--:--" : row.timeLabel);
|
||||||
timeView.setTextSize(12);
|
timeView.setTextSize(10);
|
||||||
|
timeView.setIncludeFontPadding(false);
|
||||||
timeView.setTextColor(context.getColor(R.color.boss_text_muted));
|
timeView.setTextColor(context.getColor(R.color.boss_text_muted));
|
||||||
timeView.setPadding(0, dp(context, TextUtils.isEmpty(row.topPinnedLabel) || row.pinnedConversation ? 2 : 8), 0, 0);
|
timeView.setPadding(0, 0, 0, 0);
|
||||||
timeView.setLayoutParams(new LinearLayout.LayoutParams(
|
timeView.setLayoutParams(new LinearLayout.LayoutParams(
|
||||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||||
LinearLayout.LayoutParams.WRAP_CONTENT
|
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||||
));
|
));
|
||||||
trailingColumn.addView(timeView);
|
trailingColumn.addView(timeView);
|
||||||
|
|
||||||
|
List<View> trailingStatusViews = new ArrayList<>();
|
||||||
|
|
||||||
if (selectionMode) {
|
if (selectionMode) {
|
||||||
View selector = buildConversationSelectionIndicator(context, selected);
|
View selector = buildConversationSelectionIndicator(context, selected);
|
||||||
LinearLayout.LayoutParams selectorParams = new LinearLayout.LayoutParams(dp(context, 20), dp(context, 20));
|
LinearLayout.LayoutParams selectorParams = new LinearLayout.LayoutParams(dp(context, 20), dp(context, 20));
|
||||||
selectorParams.topMargin = dp(context, 8);
|
|
||||||
selector.setLayoutParams(selectorParams);
|
selector.setLayoutParams(selectorParams);
|
||||||
trailingColumn.addView(selector);
|
trailingStatusViews.add(selector);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (highlighted) {
|
if (highlighted) {
|
||||||
@@ -882,28 +872,30 @@ public final class BossUi {
|
|||||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||||
LinearLayout.LayoutParams.WRAP_CONTENT
|
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||||
);
|
);
|
||||||
targetParams.topMargin = dp(context, 8);
|
|
||||||
targetView.setLayoutParams(targetParams);
|
targetView.setLayoutParams(targetParams);
|
||||||
trailingColumn.addView(targetView);
|
trailingStatusViews.add(targetView);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (row.unreadCount > 0) {
|
if (row.unreadCount > 0) {
|
||||||
TextView unreadView = new TextView(context);
|
TextView unreadView = new TextView(context);
|
||||||
unreadView.setText(row.unreadCount > 99 ? "99+" : String.valueOf(row.unreadCount));
|
unreadView.setText(row.unreadCount > 99 ? "99+" : String.valueOf(row.unreadCount));
|
||||||
unreadView.setTextSize(11);
|
unreadView.setTextSize(9);
|
||||||
|
unreadView.setIncludeFontPadding(false);
|
||||||
unreadView.setTypeface(Typeface.DEFAULT_BOLD);
|
unreadView.setTypeface(Typeface.DEFAULT_BOLD);
|
||||||
unreadView.setTextColor(Color.WHITE);
|
unreadView.setTextColor(Color.WHITE);
|
||||||
unreadView.setGravity(Gravity.CENTER);
|
unreadView.setGravity(Gravity.CENTER);
|
||||||
unreadView.setMinWidth(dp(context, 20));
|
unreadView.setMinWidth(dp(context, 16));
|
||||||
unreadView.setBackground(createRoundedBackground(Color.parseColor("#FF5A5A"), dp(context, 10)));
|
unreadView.setMinimumWidth(dp(context, 16));
|
||||||
unreadView.setPadding(dp(context, 6), dp(context, 2), dp(context, 6), dp(context, 2));
|
unreadView.setMinHeight(dp(context, 16));
|
||||||
|
unreadView.setMinimumHeight(dp(context, 16));
|
||||||
|
unreadView.setBackground(createRoundedBackground(Color.parseColor("#FF5A5A"), dp(context, 8)));
|
||||||
|
unreadView.setPadding(dp(context, 4), 0, dp(context, 4), 0);
|
||||||
LinearLayout.LayoutParams unreadParams = new LinearLayout.LayoutParams(
|
LinearLayout.LayoutParams unreadParams = new LinearLayout.LayoutParams(
|
||||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||||
LinearLayout.LayoutParams.WRAP_CONTENT
|
dp(context, 16)
|
||||||
);
|
);
|
||||||
unreadParams.topMargin = dp(context, 8);
|
|
||||||
unreadView.setLayoutParams(unreadParams);
|
unreadView.setLayoutParams(unreadParams);
|
||||||
trailingColumn.addView(unreadView);
|
trailingStatusViews.add(unreadView);
|
||||||
}
|
}
|
||||||
|
|
||||||
int activityCount = Math.max(0, Math.min(row.activityIconCount, WechatSurfaceMapper.maxConversationActivityIcons()));
|
int activityCount = Math.max(0, Math.min(row.activityIconCount, WechatSurfaceMapper.maxConversationActivityIcons()));
|
||||||
@@ -915,7 +907,6 @@ public final class BossUi {
|
|||||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||||
LinearLayout.LayoutParams.WRAP_CONTENT
|
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||||
);
|
);
|
||||||
activityParams.topMargin = dp(context, 8);
|
|
||||||
activityWrap.setLayoutParams(activityParams);
|
activityWrap.setLayoutParams(activityParams);
|
||||||
for (int i = 0; i < activityCount; i++) {
|
for (int i = 0; i < activityCount; i++) {
|
||||||
View dot = buildAnimatedActivityDot(context, i);
|
View dot = buildAnimatedActivityDot(context, i);
|
||||||
@@ -926,13 +917,12 @@ public final class BossUi {
|
|||||||
}
|
}
|
||||||
activityWrap.addView(dot);
|
activityWrap.addView(dot);
|
||||||
}
|
}
|
||||||
trailingColumn.addView(activityWrap);
|
trailingStatusViews.add(activityWrap);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (row.contextIndicatorVisible) {
|
if (row.contextIndicatorVisible) {
|
||||||
FrameLayout ringWrap = new FrameLayout(context);
|
FrameLayout ringWrap = new FrameLayout(context);
|
||||||
LinearLayout.LayoutParams ringWrapParams = new LinearLayout.LayoutParams(dp(context, 24), dp(context, 24));
|
LinearLayout.LayoutParams ringWrapParams = new LinearLayout.LayoutParams(dp(context, 24), dp(context, 24));
|
||||||
ringWrapParams.topMargin = dp(context, 6);
|
|
||||||
ringWrap.setLayoutParams(ringWrapParams);
|
ringWrap.setLayoutParams(ringWrapParams);
|
||||||
ringWrap.setBackground(createRoundedBackground(CONTEXT_RING_BG, dp(context, 12)));
|
ringWrap.setBackground(createRoundedBackground(CONTEXT_RING_BG, dp(context, 12)));
|
||||||
ringWrap.setContentDescription(TextUtils.isEmpty(row.contextStatusLabel)
|
ringWrap.setContentDescription(TextUtils.isEmpty(row.contextStatusLabel)
|
||||||
@@ -948,13 +938,90 @@ public final class BossUi {
|
|||||||
FrameLayout.LayoutParams ringParams = new FrameLayout.LayoutParams(dp(context, 16), dp(context, 16), Gravity.CENTER);
|
FrameLayout.LayoutParams ringParams = new FrameLayout.LayoutParams(dp(context, 16), dp(context, 16), Gravity.CENTER);
|
||||||
ring.setLayoutParams(ringParams);
|
ring.setLayoutParams(ringParams);
|
||||||
ringWrap.addView(ring);
|
ringWrap.addView(ring);
|
||||||
trailingColumn.addView(ringWrap);
|
trailingStatusViews.add(ringWrap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addCompactTrailingStatuses(context, trailingColumn, trailingStatusViews);
|
||||||
|
|
||||||
card.addView(trailingColumn);
|
card.addView(trailingColumn);
|
||||||
return card;
|
return card;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void addCompactTrailingStatuses(Context context, LinearLayout trailingColumn, List<View> statusViews) {
|
||||||
|
if (statusViews.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (statusViews.size() == 1) {
|
||||||
|
View statusView = statusViews.get(0);
|
||||||
|
LinearLayout.LayoutParams params = ensureLinearLayoutParams(statusView);
|
||||||
|
params.topMargin = dp(context, 2);
|
||||||
|
statusView.setLayoutParams(params);
|
||||||
|
trailingColumn.addView(statusView);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
LinearLayout statusRow = new LinearLayout(context);
|
||||||
|
statusRow.setOrientation(LinearLayout.HORIZONTAL);
|
||||||
|
statusRow.setGravity(Gravity.END | Gravity.CENTER_VERTICAL);
|
||||||
|
int rowHeight = containsFrameStatus(statusViews) ? 24 : 18;
|
||||||
|
LinearLayout.LayoutParams rowParams = new LinearLayout.LayoutParams(
|
||||||
|
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||||
|
dp(context, rowHeight)
|
||||||
|
);
|
||||||
|
rowParams.topMargin = dp(context, 2);
|
||||||
|
statusRow.setLayoutParams(rowParams);
|
||||||
|
for (int index = 0; index < statusViews.size(); index += 1) {
|
||||||
|
View statusView = statusViews.get(index);
|
||||||
|
LinearLayout.LayoutParams childParams = ensureLinearLayoutParams(statusView);
|
||||||
|
childParams.topMargin = 0;
|
||||||
|
childParams.leftMargin = index == 0 ? 0 : dp(context, 4);
|
||||||
|
statusView.setLayoutParams(childParams);
|
||||||
|
statusRow.addView(statusView);
|
||||||
|
}
|
||||||
|
trailingColumn.addView(statusRow);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean containsFrameStatus(List<View> statusViews) {
|
||||||
|
for (View statusView : statusViews) {
|
||||||
|
if (statusView instanceof FrameLayout) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static LinearLayout.LayoutParams ensureLinearLayoutParams(View view) {
|
||||||
|
ViewGroup.LayoutParams current = view.getLayoutParams();
|
||||||
|
if (current instanceof LinearLayout.LayoutParams) {
|
||||||
|
return (LinearLayout.LayoutParams) current;
|
||||||
|
}
|
||||||
|
if (current != null) {
|
||||||
|
return new LinearLayout.LayoutParams(current.width, current.height);
|
||||||
|
}
|
||||||
|
return new LinearLayout.LayoutParams(
|
||||||
|
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||||
|
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String buildConversationPreviewText(@Nullable String folderLabel, @Nullable String preview) {
|
||||||
|
String normalizedFolder = folderLabel == null ? "" : folderLabel.trim();
|
||||||
|
String normalizedPreview = preview == null ? "" : preview.trim();
|
||||||
|
if (!TextUtils.isEmpty(normalizedFolder) && !TextUtils.isEmpty(normalizedPreview)) {
|
||||||
|
if (normalizedFolder.contains(normalizedPreview)) {
|
||||||
|
return normalizedFolder;
|
||||||
|
}
|
||||||
|
return normalizedFolder + " · " + normalizedPreview;
|
||||||
|
}
|
||||||
|
if (!TextUtils.isEmpty(normalizedFolder)) {
|
||||||
|
return normalizedFolder;
|
||||||
|
}
|
||||||
|
if (!TextUtils.isEmpty(normalizedPreview)) {
|
||||||
|
return normalizedPreview;
|
||||||
|
}
|
||||||
|
return "暂无消息";
|
||||||
|
}
|
||||||
|
|
||||||
private static View buildConversationSelectionIndicator(Context context, boolean selected) {
|
private static View buildConversationSelectionIndicator(Context context, boolean selected) {
|
||||||
View indicator = new View(context);
|
View indicator = new View(context);
|
||||||
GradientDrawable drawable = new GradientDrawable();
|
GradientDrawable drawable = new GradientDrawable();
|
||||||
@@ -2493,29 +2560,29 @@ public final class BossUi {
|
|||||||
firstNonEmpty(row.avatarPrimary, row.threadTitle, "会"),
|
firstNonEmpty(row.avatarPrimary, row.threadTitle, "会"),
|
||||||
AVATAR_BG_COLORS[0],
|
AVATAR_BG_COLORS[0],
|
||||||
Color.WHITE,
|
Color.WHITE,
|
||||||
52
|
44
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
FrameLayout groupWrap = new FrameLayout(context);
|
FrameLayout groupWrap = new FrameLayout(context);
|
||||||
LinearLayout.LayoutParams wrapParams = new LinearLayout.LayoutParams(dp(context, 52), dp(context, 52));
|
LinearLayout.LayoutParams wrapParams = new LinearLayout.LayoutParams(dp(context, 44), dp(context, 44));
|
||||||
groupWrap.setLayoutParams(wrapParams);
|
groupWrap.setLayoutParams(wrapParams);
|
||||||
|
|
||||||
GradientDrawable bg = createRoundedBackground(Color.parseColor("#F2F6F3"), dp(context, 18));
|
GradientDrawable bg = createRoundedBackground(Color.parseColor("#F2F6F3"), dp(context, 15));
|
||||||
bg.setStroke(dp(context, 1), Color.parseColor("#E5ECE7"));
|
bg.setStroke(dp(context, 1), Color.parseColor("#E5ECE7"));
|
||||||
groupWrap.setBackground(bg);
|
groupWrap.setBackground(bg);
|
||||||
|
|
||||||
int visibleCount = Math.min(row.groupAvatarMembers.length, 4);
|
int visibleCount = Math.min(row.groupAvatarMembers.length, 4);
|
||||||
if (visibleCount == 0) {
|
if (visibleCount == 0) {
|
||||||
groupWrap.addView(buildCenteredAvatarTile(context, "群", AVATAR_BG_COLORS[1], 32, 10, 10));
|
groupWrap.addView(buildCenteredAvatarTile(context, "群", AVATAR_BG_COLORS[1], 28, 8, 8));
|
||||||
return groupWrap;
|
return groupWrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
int[][] offsets = {
|
int[][] offsets = {
|
||||||
{4, 4},
|
{4, 4},
|
||||||
{24, 4},
|
{22, 4},
|
||||||
{4, 24},
|
{4, 22},
|
||||||
{24, 24}
|
{22, 22}
|
||||||
};
|
};
|
||||||
for (int i = 0; i < visibleCount; i++) {
|
for (int i = 0; i < visibleCount; i++) {
|
||||||
WechatSurfaceMapper.GroupAvatarMember member = row.groupAvatarMembers[i];
|
WechatSurfaceMapper.GroupAvatarMember member = row.groupAvatarMembers[i];
|
||||||
@@ -2523,7 +2590,7 @@ public final class BossUi {
|
|||||||
context,
|
context,
|
||||||
firstNonEmpty(member.avatarLabel, member.title, "群"),
|
firstNonEmpty(member.avatarLabel, member.title, "群"),
|
||||||
AVATAR_BG_COLORS[(i + 1) % AVATAR_BG_COLORS.length],
|
AVATAR_BG_COLORS[(i + 1) % AVATAR_BG_COLORS.length],
|
||||||
22,
|
18,
|
||||||
offsets[i][0],
|
offsets[i][0],
|
||||||
offsets[i][1]
|
offsets[i][1]
|
||||||
));
|
));
|
||||||
@@ -2543,7 +2610,7 @@ public final class BossUi {
|
|||||||
avatarView.setLayoutParams(avatarParams);
|
avatarView.setLayoutParams(avatarParams);
|
||||||
avatarView.setGravity(Gravity.CENTER);
|
avatarView.setGravity(Gravity.CENTER);
|
||||||
avatarView.setText(firstLetter(labelSource));
|
avatarView.setText(firstLetter(labelSource));
|
||||||
avatarView.setTextSize(sizeDp >= 48 ? 24 : 12);
|
avatarView.setTextSize(sizeDp >= 44 ? 18 : 10);
|
||||||
avatarView.setTypeface(Typeface.DEFAULT_BOLD);
|
avatarView.setTypeface(Typeface.DEFAULT_BOLD);
|
||||||
avatarView.setTextColor(textColor);
|
avatarView.setTextColor(textColor);
|
||||||
avatarView.setBackground(createRoundedBackground(backgroundColor, dp(context, sizeDp / 2)));
|
avatarView.setBackground(createRoundedBackground(backgroundColor, dp(context, sizeDp / 2)));
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
@@ -1238,13 +1239,18 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
int color = getColor(active ? R.color.boss_green : R.color.boss_text_muted);
|
int color = getColor(active ? R.color.boss_green : R.color.boss_text_muted);
|
||||||
button.setBackgroundColor(Color.TRANSPARENT);
|
button.setBackgroundColor(Color.TRANSPARENT);
|
||||||
button.setTextColor(color);
|
button.setTextColor(color);
|
||||||
button.setTextSize(12);
|
button.setTextSize(11);
|
||||||
button.setAllCaps(false);
|
button.setAllCaps(false);
|
||||||
button.setGravity(android.view.Gravity.CENTER);
|
button.setGravity(android.view.Gravity.CENTER);
|
||||||
button.setCompoundDrawablesWithIntrinsicBounds(0, iconRes, 0, 0);
|
Drawable topIcon = getDrawable(iconRes);
|
||||||
button.setCompoundDrawablePadding(BossUi.dp(this, 3));
|
if (topIcon != null) {
|
||||||
|
int iconSize = BossUi.dp(this, 20);
|
||||||
|
topIcon.setBounds(0, 0, iconSize, iconSize);
|
||||||
|
}
|
||||||
|
button.setCompoundDrawables(null, topIcon, null, null);
|
||||||
|
button.setCompoundDrawablePadding(BossUi.dp(this, 2));
|
||||||
button.setCompoundDrawableTintList(ColorStateList.valueOf(color));
|
button.setCompoundDrawableTintList(ColorStateList.valueOf(color));
|
||||||
button.setPadding(0, BossUi.dp(this, 5), 0, BossUi.dp(this, 3));
|
button.setPadding(0, BossUi.dp(this, 4), 0, BossUi.dp(this, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void configureTopAction(WechatSurfaceMapper.RootTopAction action) {
|
private void configureTopAction(WechatSurfaceMapper.RootTopAction action) {
|
||||||
|
|||||||
@@ -12,18 +12,18 @@
|
|||||||
android:background="@color/boss_surface"
|
android:background="@color/boss_surface"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingLeft="20dp"
|
android:paddingLeft="18dp"
|
||||||
android:paddingTop="14dp"
|
android:paddingTop="10dp"
|
||||||
android:paddingRight="20dp"
|
android:paddingRight="18dp"
|
||||||
android:paddingBottom="12dp">
|
android:paddingBottom="8dp">
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:id="@+id/screen_back_button"
|
android:id="@+id/screen_back_button"
|
||||||
android:layout_width="40dp"
|
android:layout_width="36dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="36dp"
|
||||||
android:background="@drawable/bg_top_icon_button"
|
android:background="@drawable/bg_top_icon_button"
|
||||||
android:contentDescription="返回"
|
android:contentDescription="返回"
|
||||||
android:padding="8dp"
|
android:padding="7dp"
|
||||||
android:src="@drawable/ic_boss_back"
|
android:src="@drawable/ic_boss_back"
|
||||||
android:tint="@color/boss_text_primary" />
|
android:tint="@color/boss_text_primary" />
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="会话信息"
|
android:text="会话信息"
|
||||||
android:textColor="@color/boss_text_primary"
|
android:textColor="@color/boss_text_primary"
|
||||||
android:textSize="22sp"
|
android:textSize="20sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -56,24 +56,24 @@
|
|||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:id="@+id/screen_header_action"
|
android:id="@+id/screen_header_action"
|
||||||
android:layout_width="40dp"
|
android:layout_width="36dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="36dp"
|
||||||
android:layout_marginLeft="8dp"
|
android:layout_marginLeft="8dp"
|
||||||
android:background="@drawable/bg_top_icon_button"
|
android:background="@drawable/bg_top_icon_button"
|
||||||
android:contentDescription="更多"
|
android:contentDescription="更多"
|
||||||
android:padding="8dp"
|
android:padding="7dp"
|
||||||
android:src="@drawable/ic_boss_more"
|
android:src="@drawable/ic_boss_more"
|
||||||
android:tint="@color/boss_text_primary"
|
android:tint="@color/boss_text_primary"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:id="@+id/screen_refresh_button"
|
android:id="@+id/screen_refresh_button"
|
||||||
android:layout_width="40dp"
|
android:layout_width="36dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="36dp"
|
||||||
android:layout_marginLeft="8dp"
|
android:layout_marginLeft="8dp"
|
||||||
android:background="@drawable/bg_top_icon_button"
|
android:background="@drawable/bg_top_icon_button"
|
||||||
android:contentDescription="刷新"
|
android:contentDescription="刷新"
|
||||||
android:padding="8dp"
|
android:padding="7dp"
|
||||||
android:src="@drawable/ic_boss_refresh"
|
android:src="@drawable/ic_boss_refresh"
|
||||||
android:tint="@color/boss_text_primary" />
|
android:tint="@color/boss_text_primary" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -12,18 +12,18 @@
|
|||||||
android:background="@color/boss_surface"
|
android:background="@color/boss_surface"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingLeft="20dp"
|
android:paddingLeft="18dp"
|
||||||
android:paddingTop="14dp"
|
android:paddingTop="10dp"
|
||||||
android:paddingRight="20dp"
|
android:paddingRight="18dp"
|
||||||
android:paddingBottom="12dp">
|
android:paddingBottom="8dp">
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:id="@+id/screen_back_button"
|
android:id="@+id/screen_back_button"
|
||||||
android:layout_width="40dp"
|
android:layout_width="36dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="36dp"
|
||||||
android:background="@drawable/bg_top_icon_button"
|
android:background="@drawable/bg_top_icon_button"
|
||||||
android:contentDescription="返回"
|
android:contentDescription="返回"
|
||||||
android:padding="8dp"
|
android:padding="7dp"
|
||||||
android:src="@drawable/ic_boss_back"
|
android:src="@drawable/ic_boss_back"
|
||||||
android:tint="@color/boss_text_primary" />
|
android:tint="@color/boss_text_primary" />
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="标题"
|
android:text="标题"
|
||||||
android:textColor="@color/boss_text_primary"
|
android:textColor="@color/boss_text_primary"
|
||||||
android:textSize="22sp"
|
android:textSize="20sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -56,24 +56,24 @@
|
|||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:id="@+id/screen_header_action"
|
android:id="@+id/screen_header_action"
|
||||||
android:layout_width="40dp"
|
android:layout_width="36dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="36dp"
|
||||||
android:layout_marginLeft="8dp"
|
android:layout_marginLeft="8dp"
|
||||||
android:background="@drawable/bg_top_icon_button"
|
android:background="@drawable/bg_top_icon_button"
|
||||||
android:contentDescription="更多"
|
android:contentDescription="更多"
|
||||||
android:padding="8dp"
|
android:padding="7dp"
|
||||||
android:src="@drawable/ic_boss_more"
|
android:src="@drawable/ic_boss_more"
|
||||||
android:tint="@color/boss_text_primary"
|
android:tint="@color/boss_text_primary"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:id="@+id/screen_refresh_button"
|
android:id="@+id/screen_refresh_button"
|
||||||
android:layout_width="40dp"
|
android:layout_width="36dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="36dp"
|
||||||
android:layout_marginLeft="8dp"
|
android:layout_marginLeft="8dp"
|
||||||
android:background="@drawable/bg_top_icon_button"
|
android:background="@drawable/bg_top_icon_button"
|
||||||
android:contentDescription="刷新"
|
android:contentDescription="刷新"
|
||||||
android:padding="8dp"
|
android:padding="7dp"
|
||||||
android:src="@drawable/ic_boss_refresh"
|
android:src="@drawable/ic_boss_refresh"
|
||||||
android:tint="@color/boss_text_primary" />
|
android:tint="@color/boss_text_primary" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -12,18 +12,18 @@
|
|||||||
android:background="@color/boss_surface"
|
android:background="@color/boss_surface"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingLeft="20dp"
|
android:paddingLeft="18dp"
|
||||||
android:paddingTop="14dp"
|
android:paddingTop="10dp"
|
||||||
android:paddingRight="20dp"
|
android:paddingRight="18dp"
|
||||||
android:paddingBottom="12dp">
|
android:paddingBottom="8dp">
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:id="@+id/screen_back_button"
|
android:id="@+id/screen_back_button"
|
||||||
android:layout_width="40dp"
|
android:layout_width="36dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="36dp"
|
||||||
android:background="@drawable/bg_top_icon_button"
|
android:background="@drawable/bg_top_icon_button"
|
||||||
android:contentDescription="返回"
|
android:contentDescription="返回"
|
||||||
android:padding="8dp"
|
android:padding="7dp"
|
||||||
android:src="@drawable/ic_boss_back"
|
android:src="@drawable/ic_boss_back"
|
||||||
android:tint="@color/boss_text_primary" />
|
android:tint="@color/boss_text_primary" />
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="发起群聊"
|
android:text="发起群聊"
|
||||||
android:textColor="@color/boss_text_primary"
|
android:textColor="@color/boss_text_primary"
|
||||||
android:textSize="22sp"
|
android:textSize="20sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -56,24 +56,24 @@
|
|||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:id="@+id/screen_header_action"
|
android:id="@+id/screen_header_action"
|
||||||
android:layout_width="40dp"
|
android:layout_width="36dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="36dp"
|
||||||
android:layout_marginLeft="8dp"
|
android:layout_marginLeft="8dp"
|
||||||
android:background="@drawable/bg_top_icon_button"
|
android:background="@drawable/bg_top_icon_button"
|
||||||
android:contentDescription="更多"
|
android:contentDescription="更多"
|
||||||
android:padding="8dp"
|
android:padding="7dp"
|
||||||
android:src="@drawable/ic_boss_more"
|
android:src="@drawable/ic_boss_more"
|
||||||
android:tint="@color/boss_text_primary"
|
android:tint="@color/boss_text_primary"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:id="@+id/screen_refresh_button"
|
android:id="@+id/screen_refresh_button"
|
||||||
android:layout_width="40dp"
|
android:layout_width="36dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="36dp"
|
||||||
android:layout_marginLeft="8dp"
|
android:layout_marginLeft="8dp"
|
||||||
android:background="@drawable/bg_top_icon_button"
|
android:background="@drawable/bg_top_icon_button"
|
||||||
android:contentDescription="刷新"
|
android:contentDescription="刷新"
|
||||||
android:padding="8dp"
|
android:padding="7dp"
|
||||||
android:src="@drawable/ic_boss_refresh"
|
android:src="@drawable/ic_boss_refresh"
|
||||||
android:tint="@color/boss_text_primary" />
|
android:tint="@color/boss_text_primary" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -12,18 +12,18 @@
|
|||||||
android:background="@color/boss_surface"
|
android:background="@color/boss_surface"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingLeft="20dp"
|
android:paddingLeft="18dp"
|
||||||
android:paddingTop="14dp"
|
android:paddingTop="10dp"
|
||||||
android:paddingRight="20dp"
|
android:paddingRight="18dp"
|
||||||
android:paddingBottom="12dp">
|
android:paddingBottom="8dp">
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:id="@+id/screen_back_button"
|
android:id="@+id/screen_back_button"
|
||||||
android:layout_width="40dp"
|
android:layout_width="36dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="36dp"
|
||||||
android:background="@drawable/bg_top_icon_button"
|
android:background="@drawable/bg_top_icon_button"
|
||||||
android:contentDescription="返回"
|
android:contentDescription="返回"
|
||||||
android:padding="8dp"
|
android:padding="7dp"
|
||||||
android:src="@drawable/ic_boss_back"
|
android:src="@drawable/ic_boss_back"
|
||||||
android:tint="@color/boss_text_primary" />
|
android:tint="@color/boss_text_primary" />
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="群资料"
|
android:text="群资料"
|
||||||
android:textColor="@color/boss_text_primary"
|
android:textColor="@color/boss_text_primary"
|
||||||
android:textSize="22sp"
|
android:textSize="20sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -56,24 +56,24 @@
|
|||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:id="@+id/screen_header_action"
|
android:id="@+id/screen_header_action"
|
||||||
android:layout_width="40dp"
|
android:layout_width="36dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="36dp"
|
||||||
android:layout_marginLeft="8dp"
|
android:layout_marginLeft="8dp"
|
||||||
android:background="@drawable/bg_top_icon_button"
|
android:background="@drawable/bg_top_icon_button"
|
||||||
android:contentDescription="更多"
|
android:contentDescription="更多"
|
||||||
android:padding="8dp"
|
android:padding="7dp"
|
||||||
android:src="@drawable/ic_boss_more"
|
android:src="@drawable/ic_boss_more"
|
||||||
android:tint="@color/boss_text_primary"
|
android:tint="@color/boss_text_primary"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:id="@+id/screen_refresh_button"
|
android:id="@+id/screen_refresh_button"
|
||||||
android:layout_width="40dp"
|
android:layout_width="36dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="36dp"
|
||||||
android:layout_marginLeft="8dp"
|
android:layout_marginLeft="8dp"
|
||||||
android:background="@drawable/bg_top_icon_button"
|
android:background="@drawable/bg_top_icon_button"
|
||||||
android:contentDescription="刷新"
|
android:contentDescription="刷新"
|
||||||
android:padding="8dp"
|
android:padding="7dp"
|
||||||
android:src="@drawable/ic_boss_refresh"
|
android:src="@drawable/ic_boss_refresh"
|
||||||
android:tint="@color/boss_text_primary" />
|
android:tint="@color/boss_text_primary" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -214,19 +214,19 @@
|
|||||||
android:background="@color/boss_surface"
|
android:background="@color/boss_surface"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingLeft="20dp"
|
android:paddingLeft="18dp"
|
||||||
android:paddingTop="14dp"
|
android:paddingTop="10dp"
|
||||||
android:paddingRight="20dp"
|
android:paddingRight="18dp"
|
||||||
android:paddingBottom="12dp">
|
android:paddingBottom="8dp">
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:id="@+id/back_button"
|
android:id="@+id/back_button"
|
||||||
android:layout_width="40dp"
|
android:layout_width="36dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="36dp"
|
||||||
android:layout_marginRight="8dp"
|
android:layout_marginRight="8dp"
|
||||||
android:background="@drawable/bg_top_icon_button"
|
android:background="@drawable/bg_top_icon_button"
|
||||||
android:contentDescription="返回"
|
android:contentDescription="返回"
|
||||||
android:padding="8dp"
|
android:padding="7dp"
|
||||||
android:src="@drawable/ic_boss_back"
|
android:src="@drawable/ic_boss_back"
|
||||||
android:tint="@color/boss_text_primary"
|
android:tint="@color/boss_text_primary"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
@@ -246,7 +246,7 @@
|
|||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:text="会话"
|
android:text="会话"
|
||||||
android:textColor="@color/boss_text_primary"
|
android:textColor="@color/boss_text_primary"
|
||||||
android:textSize="22sp"
|
android:textSize="20sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -263,16 +263,16 @@
|
|||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/top_search_input"
|
android:id="@+id/top_search_input"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="36dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="@drawable/bg_secondary_button"
|
android:background="@drawable/bg_secondary_button"
|
||||||
android:hint="搜索项目或线程"
|
android:hint="搜索项目或线程"
|
||||||
android:imeOptions="actionSearch"
|
android:imeOptions="actionSearch"
|
||||||
android:inputType="text"
|
android:inputType="text"
|
||||||
android:paddingLeft="14dp"
|
android:paddingLeft="12dp"
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="7dp"
|
||||||
android:paddingRight="14dp"
|
android:paddingRight="12dp"
|
||||||
android:paddingBottom="8dp"
|
android:paddingBottom="7dp"
|
||||||
android:textColor="@color/boss_text_primary"
|
android:textColor="@color/boss_text_primary"
|
||||||
android:textColorHint="@color/boss_text_muted"
|
android:textColorHint="@color/boss_text_muted"
|
||||||
android:textSize="15sp"
|
android:textSize="15sp"
|
||||||
@@ -280,22 +280,22 @@
|
|||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:id="@+id/search_button"
|
android:id="@+id/search_button"
|
||||||
android:layout_width="40dp"
|
android:layout_width="36dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="36dp"
|
||||||
android:layout_marginRight="8dp"
|
android:layout_marginRight="8dp"
|
||||||
android:background="@drawable/bg_top_icon_button"
|
android:background="@drawable/bg_top_icon_button"
|
||||||
android:contentDescription="搜索"
|
android:contentDescription="搜索"
|
||||||
android:padding="8dp"
|
android:padding="7dp"
|
||||||
android:src="@drawable/ic_boss_search"
|
android:src="@drawable/ic_boss_search"
|
||||||
android:tint="@color/boss_text_primary" />
|
android:tint="@color/boss_text_primary" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:id="@+id/refresh_button"
|
android:id="@+id/refresh_button"
|
||||||
android:layout_width="40dp"
|
android:layout_width="36dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="36dp"
|
||||||
android:background="@drawable/bg_top_icon_button"
|
android:background="@drawable/bg_top_icon_button"
|
||||||
android:contentDescription="快捷操作"
|
android:contentDescription="快捷操作"
|
||||||
android:padding="8dp"
|
android:padding="7dp"
|
||||||
android:src="@drawable/ic_boss_add"
|
android:src="@drawable/ic_boss_add"
|
||||||
android:tint="@color/boss_text_primary" />
|
android:tint="@color/boss_text_primary" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -313,13 +313,13 @@
|
|||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="64dp"
|
android:layout_height="58dp"
|
||||||
android:background="@color/boss_surface"
|
android:background="@color/boss_surface"
|
||||||
android:elevation="10dp"
|
android:elevation="10dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingTop="4dp"
|
android:paddingTop="3dp"
|
||||||
android:paddingBottom="4dp"
|
android:paddingBottom="3dp"
|
||||||
android:paddingLeft="10dp"
|
android:paddingLeft="10dp"
|
||||||
android:paddingRight="10dp">
|
android:paddingRight="10dp">
|
||||||
|
|
||||||
@@ -332,7 +332,7 @@
|
|||||||
android:text="会话"
|
android:text="会话"
|
||||||
android:textAllCaps="false"
|
android:textAllCaps="false"
|
||||||
android:textColor="@color/boss_green"
|
android:textColor="@color/boss_green"
|
||||||
android:textSize="12sp"
|
android:textSize="11sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
@@ -344,7 +344,7 @@
|
|||||||
android:text="设备"
|
android:text="设备"
|
||||||
android:textAllCaps="false"
|
android:textAllCaps="false"
|
||||||
android:textColor="@color/boss_text_muted"
|
android:textColor="@color/boss_text_muted"
|
||||||
android:textSize="12sp"
|
android:textSize="11sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
@@ -356,7 +356,7 @@
|
|||||||
android:text="我的"
|
android:text="我的"
|
||||||
android:textAllCaps="false"
|
android:textAllCaps="false"
|
||||||
android:textColor="@color/boss_text_muted"
|
android:textColor="@color/boss_text_muted"
|
||||||
android:textSize="12sp"
|
android:textSize="11sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -12,18 +12,18 @@
|
|||||||
android:background="@color/boss_surface"
|
android:background="@color/boss_surface"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingLeft="20dp"
|
android:paddingLeft="18dp"
|
||||||
android:paddingTop="14dp"
|
android:paddingTop="10dp"
|
||||||
android:paddingRight="20dp"
|
android:paddingRight="18dp"
|
||||||
android:paddingBottom="12dp">
|
android:paddingBottom="8dp">
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:id="@+id/screen_back_button"
|
android:id="@+id/screen_back_button"
|
||||||
android:layout_width="40dp"
|
android:layout_width="36dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="36dp"
|
||||||
android:background="@drawable/bg_top_icon_button"
|
android:background="@drawable/bg_top_icon_button"
|
||||||
android:contentDescription="返回"
|
android:contentDescription="返回"
|
||||||
android:padding="8dp"
|
android:padding="7dp"
|
||||||
android:src="@drawable/ic_boss_back"
|
android:src="@drawable/ic_boss_back"
|
||||||
android:tint="@color/boss_text_primary" />
|
android:tint="@color/boss_text_primary" />
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:text="项目详情"
|
android:text="项目详情"
|
||||||
android:textColor="@color/boss_text_primary"
|
android:textColor="@color/boss_text_primary"
|
||||||
android:textSize="20sp"
|
android:textSize="19sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -58,24 +58,24 @@
|
|||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:id="@+id/screen_header_action"
|
android:id="@+id/screen_header_action"
|
||||||
android:layout_width="40dp"
|
android:layout_width="36dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="36dp"
|
||||||
android:layout_marginLeft="8dp"
|
android:layout_marginLeft="8dp"
|
||||||
android:background="@drawable/bg_top_icon_button"
|
android:background="@drawable/bg_top_icon_button"
|
||||||
android:contentDescription="更多"
|
android:contentDescription="更多"
|
||||||
android:padding="8dp"
|
android:padding="7dp"
|
||||||
android:src="@drawable/ic_boss_more"
|
android:src="@drawable/ic_boss_more"
|
||||||
android:tint="@color/boss_text_primary"
|
android:tint="@color/boss_text_primary"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:id="@+id/screen_refresh_button"
|
android:id="@+id/screen_refresh_button"
|
||||||
android:layout_width="40dp"
|
android:layout_width="36dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="36dp"
|
||||||
android:layout_marginLeft="8dp"
|
android:layout_marginLeft="8dp"
|
||||||
android:background="@drawable/bg_top_icon_button"
|
android:background="@drawable/bg_top_icon_button"
|
||||||
android:contentDescription="刷新"
|
android:contentDescription="刷新"
|
||||||
android:padding="8dp"
|
android:padding="7dp"
|
||||||
android:src="@drawable/ic_boss_refresh"
|
android:src="@drawable/ic_boss_refresh"
|
||||||
android:tint="@color/boss_text_primary" />
|
android:tint="@color/boss_text_primary" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -12,18 +12,18 @@
|
|||||||
android:background="@color/boss_surface"
|
android:background="@color/boss_surface"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingLeft="20dp"
|
android:paddingLeft="18dp"
|
||||||
android:paddingTop="14dp"
|
android:paddingTop="10dp"
|
||||||
android:paddingRight="20dp"
|
android:paddingRight="18dp"
|
||||||
android:paddingBottom="12dp">
|
android:paddingBottom="8dp">
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:id="@+id/screen_back_button"
|
android:id="@+id/screen_back_button"
|
||||||
android:layout_width="40dp"
|
android:layout_width="36dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="36dp"
|
||||||
android:background="@drawable/bg_top_icon_button"
|
android:background="@drawable/bg_top_icon_button"
|
||||||
android:contentDescription="返回"
|
android:contentDescription="返回"
|
||||||
android:padding="8dp"
|
android:padding="7dp"
|
||||||
android:src="@drawable/ic_boss_back"
|
android:src="@drawable/ic_boss_back"
|
||||||
android:tint="@color/boss_text_primary" />
|
android:tint="@color/boss_text_primary" />
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:text="标题"
|
android:text="标题"
|
||||||
android:textColor="@color/boss_text_primary"
|
android:textColor="@color/boss_text_primary"
|
||||||
android:textSize="22sp"
|
android:textSize="20sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -60,24 +60,24 @@
|
|||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:id="@+id/screen_header_action"
|
android:id="@+id/screen_header_action"
|
||||||
android:layout_width="40dp"
|
android:layout_width="36dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="36dp"
|
||||||
android:layout_marginLeft="8dp"
|
android:layout_marginLeft="8dp"
|
||||||
android:background="@drawable/bg_top_icon_button"
|
android:background="@drawable/bg_top_icon_button"
|
||||||
android:contentDescription="更多"
|
android:contentDescription="更多"
|
||||||
android:padding="8dp"
|
android:padding="7dp"
|
||||||
android:src="@drawable/ic_boss_more"
|
android:src="@drawable/ic_boss_more"
|
||||||
android:tint="@color/boss_text_primary"
|
android:tint="@color/boss_text_primary"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:id="@+id/screen_refresh_button"
|
android:id="@+id/screen_refresh_button"
|
||||||
android:layout_width="40dp"
|
android:layout_width="36dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="36dp"
|
||||||
android:layout_marginLeft="8dp"
|
android:layout_marginLeft="8dp"
|
||||||
android:background="@drawable/bg_top_icon_button"
|
android:background="@drawable/bg_top_icon_button"
|
||||||
android:contentDescription="刷新"
|
android:contentDescription="刷新"
|
||||||
android:padding="8dp"
|
android:padding="7dp"
|
||||||
android:src="@drawable/ic_boss_refresh"
|
android:src="@drawable/ic_boss_refresh"
|
||||||
android:tint="@color/boss_text_primary" />
|
android:tint="@color/boss_text_primary" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -50,18 +50,28 @@ public class BossUiConversationRowTest {
|
|||||||
TextView previewView = (TextView) centerColumn.getChildAt(centerColumn.getChildCount() - 1);
|
TextView previewView = (TextView) centerColumn.getChildAt(centerColumn.getChildCount() - 1);
|
||||||
|
|
||||||
String metrics = String.format(
|
String metrics = String.format(
|
||||||
"row=%d center=%d trailing=%d title=%d preview=%d",
|
"row=%d height=%d avatarHeight=%d center=%dx%d trailing=%dx%d title=%dx%d preview=%dx%d",
|
||||||
rowView.getMeasuredWidth(),
|
rowView.getMeasuredWidth(),
|
||||||
|
rowView.getMeasuredHeight(),
|
||||||
|
rowView.getChildAt(0).getMeasuredHeight(),
|
||||||
centerColumn.getMeasuredWidth(),
|
centerColumn.getMeasuredWidth(),
|
||||||
|
centerColumn.getMeasuredHeight(),
|
||||||
trailingColumn.getMeasuredWidth(),
|
trailingColumn.getMeasuredWidth(),
|
||||||
|
trailingColumn.getMeasuredHeight(),
|
||||||
titleView.getMeasuredWidth(),
|
titleView.getMeasuredWidth(),
|
||||||
previewView.getMeasuredWidth()
|
titleView.getMeasuredHeight(),
|
||||||
|
previewView.getMeasuredWidth(),
|
||||||
|
previewView.getMeasuredHeight()
|
||||||
);
|
);
|
||||||
assertEquals("列表项应使用微信式扁平 padding: " + metrics, BossUi.dp(context, 16), rowView.getPaddingLeft());
|
assertEquals("列表项应恢复成更紧凑的信息密度: " + metrics, BossUi.dp(context, 14), rowView.getPaddingLeft());
|
||||||
assertEquals("列表项应使用微信式扁平 padding: " + metrics, BossUi.dp(context, 12), rowView.getPaddingTop());
|
assertEquals("列表项应恢复成更紧凑的信息密度: " + metrics, BossUi.dp(context, 8), rowView.getPaddingTop());
|
||||||
assertEquals("列表项应使用微信式扁平 padding: " + metrics, BossUi.dp(context, 16), rowView.getPaddingRight());
|
assertEquals("列表项应恢复成更紧凑的信息密度: " + metrics, BossUi.dp(context, 14), rowView.getPaddingRight());
|
||||||
assertEquals("列表项应使用微信式扁平 padding: " + metrics, BossUi.dp(context, 12), rowView.getPaddingBottom());
|
assertEquals("列表项应恢复成更紧凑的信息密度: " + metrics, BossUi.dp(context, 8), rowView.getPaddingBottom());
|
||||||
assertEquals("列表项不应保持卡片式浮层感: " + metrics, 0f, rowView.getElevation(), 0.01f);
|
assertEquals("列表项不应保持卡片式浮层感: " + metrics, 0f, rowView.getElevation(), 0.01f);
|
||||||
|
assertTrue("单条会话行不应再撑到接近 90dp: " + metrics, rowView.getMeasuredHeight() <= BossUi.dp(context, 78));
|
||||||
|
assertEquals("会话头像应恢复到更克制的尺寸: " + metrics, BossUi.dp(context, 44), rowView.getChildAt(0).getLayoutParams().width);
|
||||||
|
assertEquals("会话头像应恢复到更克制的尺寸: " + metrics, BossUi.dp(context, 44), rowView.getChildAt(0).getLayoutParams().height);
|
||||||
|
assertEquals("标题字号应回到中等密度", 15f, titleView.getTextSize() / context.getResources().getDisplayMetrics().scaledDensity, 0.5f);
|
||||||
assertTrue("中间文字列不应被挤成 0 宽: " + metrics, centerColumn.getMeasuredWidth() > 0);
|
assertTrue("中间文字列不应被挤成 0 宽: " + metrics, centerColumn.getMeasuredWidth() > 0);
|
||||||
assertTrue("标题需要保留可见宽度: " + metrics, titleView.getMeasuredWidth() > 0);
|
assertTrue("标题需要保留可见宽度: " + metrics, titleView.getMeasuredWidth() > 0);
|
||||||
assertTrue("预览需要保留可见宽度: " + metrics, previewView.getMeasuredWidth() > 0);
|
assertTrue("预览需要保留可见宽度: " + metrics, previewView.getMeasuredWidth() > 0);
|
||||||
|
|||||||
@@ -48,6 +48,10 @@ public class BossUiRootSurfaceTest {
|
|||||||
|
|
||||||
View header = content.getChildAt(0);
|
View header = content.getChildAt(0);
|
||||||
assertEquals("资料头不应保留浮层卡片感", 0f, header.getElevation(), 0.01f);
|
assertEquals("资料头不应保留浮层卡片感", 0f, header.getElevation(), 0.01f);
|
||||||
|
assertTrue("资料头应保持横向布局", header instanceof LinearLayout);
|
||||||
|
View avatar = ((LinearLayout) header).getChildAt(0);
|
||||||
|
assertEquals("我的页头像应恢复到中等尺寸", BossUi.dp(activity, 56), avatar.getLayoutParams().width);
|
||||||
|
assertEquals("我的页头像应恢复到中等尺寸", BossUi.dp(activity, 56), avatar.getLayoutParams().height);
|
||||||
assertTrue(viewTreeContainsText(header, "Kris"));
|
assertTrue(viewTreeContainsText(header, "Kris"));
|
||||||
assertTrue(viewTreeContainsText(header, "krisolo"));
|
assertTrue(viewTreeContainsText(header, "krisolo"));
|
||||||
assertTrue(viewTreeContainsText(header, "最高管理员"));
|
assertTrue(viewTreeContainsText(header, "最高管理员"));
|
||||||
@@ -101,10 +105,12 @@ public class BossUiRootSurfaceTest {
|
|||||||
assertEquals("会话", conversations.getText().toString());
|
assertEquals("会话", conversations.getText().toString());
|
||||||
assertEquals("设备", devices.getText().toString());
|
assertEquals("设备", devices.getText().toString());
|
||||||
assertEquals("我的", me.getText().toString());
|
assertEquals("我的", me.getText().toString());
|
||||||
|
assertEquals("顶部标题应恢复到更克制的字号", 20f, ((TextView) activity.findViewById(R.id.top_title)).getTextSize() / activity.getResources().getDisplayMetrics().scaledDensity, 0.5f);
|
||||||
|
assertEquals("底栏高度应恢复到更紧凑的有效面积", BossUi.dp(activity, 58), ((View) conversations.getParent()).getLayoutParams().height);
|
||||||
assertNotNull("会话 tab 应显示顶部图标", conversations.getCompoundDrawables()[1]);
|
assertNotNull("会话 tab 应显示顶部图标", conversations.getCompoundDrawables()[1]);
|
||||||
assertNotNull("设备 tab 应显示顶部图标", devices.getCompoundDrawables()[1]);
|
assertNotNull("设备 tab 应显示顶部图标", devices.getCompoundDrawables()[1]);
|
||||||
assertNotNull("我的 tab 应显示顶部图标", me.getCompoundDrawables()[1]);
|
assertNotNull("我的 tab 应显示顶部图标", me.getCompoundDrawables()[1]);
|
||||||
assertEquals("底栏文字应压成微信式小字号", 12f, conversations.getTextSize() / activity.getResources().getDisplayMetrics().scaledDensity, 0.5f);
|
assertEquals("底栏文字应保持小字号", 11f, conversations.getTextSize() / activity.getResources().getDisplayMetrics().scaledDensity, 0.5f);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean viewTreeContainsText(View root, String expectedText) {
|
private static boolean viewTreeContainsText(View root, String expectedText) {
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ public class BossUiTopActionStyleTest {
|
|||||||
|
|
||||||
BossUi.applyTopIconButtonStyle(context, button);
|
BossUi.applyTopIconButtonStyle(context, button);
|
||||||
|
|
||||||
assertEquals(BossUi.dp(context, 40), button.getMinimumWidth());
|
assertEquals(BossUi.dp(context, 36), button.getMinimumWidth());
|
||||||
assertEquals(BossUi.dp(context, 40), button.getMinimumHeight());
|
assertEquals(BossUi.dp(context, 36), button.getMinimumHeight());
|
||||||
assertEquals(BossUi.dp(context, 8), button.getPaddingLeft());
|
assertEquals(BossUi.dp(context, 7), button.getPaddingLeft());
|
||||||
assertEquals(BossUi.dp(context, 8), button.getPaddingTop());
|
assertEquals(BossUi.dp(context, 7), button.getPaddingTop());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,8 +96,8 @@ public class ConversationInfoActivityTest {
|
|||||||
SwitchCompat takeoverSwitch = findFirstSwitch(takeoverRow);
|
SwitchCompat takeoverSwitch = findFirstSwitch(takeoverRow);
|
||||||
|
|
||||||
assertEquals(LinearLayout.HORIZONTAL, takeoverRow.getOrientation());
|
assertEquals(LinearLayout.HORIZONTAL, takeoverRow.getOrientation());
|
||||||
assertEquals(BossUi.dp(activity, 18), takeoverRow.getPaddingLeft());
|
assertEquals(BossUi.dp(activity, 14), takeoverRow.getPaddingLeft());
|
||||||
assertEquals(BossUi.dp(activity, 18), takeoverRow.getPaddingRight());
|
assertEquals(BossUi.dp(activity, 14), takeoverRow.getPaddingRight());
|
||||||
assertNotNull(takeoverSwitch);
|
assertNotNull(takeoverSwitch);
|
||||||
assertEquals("", String.valueOf(takeoverSwitch.getText()));
|
assertEquals("", String.valueOf(takeoverSwitch.getText()));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user