添加SOS广播接收
This commit is contained in:
parent
3c827a56cf
commit
7a4df0444e
@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Wed Feb 12 18:04:02 HKT 2025
|
#Wed Feb 12 19:45:53 GMT 2025
|
||||||
stageCount=2
|
stageCount=2
|
||||||
libraryProject=libappbase
|
libraryProject=libappbase
|
||||||
baseVersion=1.4
|
baseVersion=1.4
|
||||||
publishVersion=1.4.1
|
publishVersion=1.4.1
|
||||||
buildCount=0
|
buildCount=22
|
||||||
baseBetaVersion=1.4.2
|
baseBetaVersion=1.4.2
|
||||||
|
@ -6,18 +6,22 @@ package cc.winboll.studio.appbase;
|
|||||||
* @Describe APPbase 应用类
|
* @Describe APPbase 应用类
|
||||||
*/
|
*/
|
||||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
import cc.winboll.studio.libappbase.SOSCSBroadcastReceiver;
|
||||||
|
import android.content.IntentFilter;
|
||||||
|
|
||||||
public class App extends GlobalApplication {
|
public class App extends GlobalApplication {
|
||||||
|
|
||||||
public static final String TAG = "App";
|
public static final String TAG = "App";
|
||||||
|
|
||||||
|
SOSCSBroadcastReceiver mSOSCSBroadcastReceiver;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
GlobalApplication.setIsDebuging(this, BuildConfig.DEBUG);
|
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
LogUtils.setLogLevel(LogUtils.LOG_LEVEL.Debug);
|
GlobalApplication.setIsDebuging(this, BuildConfig.DEBUG);
|
||||||
LogUtils.setALlTAGListEnable(true);
|
mSOSCSBroadcastReceiver = new SOSCSBroadcastReceiver();
|
||||||
LogUtils.d(TAG, "LogUtils init");
|
IntentFilter intentFilter = new IntentFilter();
|
||||||
|
intentFilter.addAction(SOSCSBroadcastReceiver.ACTION_SOS);
|
||||||
|
registerReceiver(mSOSCSBroadcastReceiver, intentFilter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,23 @@
|
|||||||
package cc.winboll.studio.appbase;
|
package cc.winboll.studio.appbase;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
import cc.winboll.studio.appbase.R;
|
||||||
|
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||||
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
|
import cc.winboll.studio.libappbase.LogView;
|
||||||
import com.hjq.toast.ToastUtils;
|
import com.hjq.toast.ToastUtils;
|
||||||
|
|
||||||
public class MainActivity extends AppCompatActivity {
|
public class MainActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
public static final String TAG = "MainActivity";
|
||||||
|
|
||||||
|
LogView mLogView;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@ -18,13 +26,32 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
Toolbar toolbar = findViewById(R.id.activitymainToolbar1);
|
Toolbar toolbar = findViewById(R.id.activitymainToolbar1);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
CheckBox cbIsDebugMode = findViewById(R.id.activitymainCheckBox1);
|
CheckBox cbIsDebugMode = findViewById(R.id.activitymainCheckBox1);
|
||||||
cbIsDebugMode.setChecked(GlobalApplication.isDebuging());
|
cbIsDebugMode.setChecked(GlobalApplication.isDebuging());
|
||||||
|
mLogView = findViewById(R.id.activitymainLogView1);
|
||||||
|
|
||||||
|
if (GlobalApplication.isDebuging()) { mLogView.start(); }
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
LogUtils.d(TAG, "onResume");
|
||||||
|
super.onResume();
|
||||||
|
mLogView.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onSwitchDebugMode(View view) {
|
public void onSwitchDebugMode(View view) {
|
||||||
GlobalApplication.setIsDebuging(this, ((CheckBox)view).isChecked());
|
GlobalApplication.setIsDebuging(this, ((CheckBox)view).isChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onSOS(View view) {
|
||||||
|
// 创建Intent对象,指定广播的action
|
||||||
|
Intent intent = new Intent("cc.winboll.studio.libappbase.SOSCSBroadcastReceiver.ACTION_SOS");
|
||||||
|
// 可以添加额外的数据
|
||||||
|
intent.putExtra("data", "这是广播携带的数据");
|
||||||
|
// 发送广播
|
||||||
|
sendBroadcast(intent);
|
||||||
|
LogUtils.d(TAG, "onSOS");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,6 +47,26 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="right">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="SOS"
|
||||||
|
android:onClick="onSOS"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<cc.winboll.studio.libappbase.LogView
|
||||||
|
android:layout_weight="1.0"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:id="@+id/activitymainLogView1"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -29,8 +29,10 @@ dependencies {
|
|||||||
api 'com.github.getActivity:ToastUtils:10.5'
|
api 'com.github.getActivity:ToastUtils:10.5'
|
||||||
|
|
||||||
api 'androidx.appcompat:appcompat:1.3.1'
|
api 'androidx.appcompat:appcompat:1.3.1'
|
||||||
//api 'androidx.vectordrawable:vectordrawable:1.1.0'
|
api 'androidx.vectordrawable:vectordrawable:1.1.0'
|
||||||
//api 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
|
api 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
|
||||||
|
api 'androidx.fragment:fragment:1.1.0'
|
||||||
|
api 'com.google.android.material:material:1.1.0'
|
||||||
|
|
||||||
api fileTree(dir: 'libs', include: ['*.jar'])
|
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Wed Feb 12 18:03:55 HKT 2025
|
#Wed Feb 12 19:45:53 GMT 2025
|
||||||
stageCount=2
|
stageCount=2
|
||||||
libraryProject=libappbase
|
libraryProject=libappbase
|
||||||
baseVersion=1.4
|
baseVersion=1.4
|
||||||
publishVersion=1.4.1
|
publishVersion=1.4.1
|
||||||
buildCount=0
|
buildCount=22
|
||||||
baseBetaVersion=1.4.2
|
baseBetaVersion=1.4.2
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
<service android:name=".SimpleOperateSignalCenterService"/>
|
<service android:name=".SimpleOperateSignalCenterService"/>
|
||||||
|
|
||||||
|
<activity android:name=".LogActivity"/>
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
@ -0,0 +1,24 @@
|
|||||||
|
package cc.winboll.studio.libappbase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ZhanGSKen@QQ.COM
|
||||||
|
* @Date 2025/02/04 10:20:16
|
||||||
|
* @Describe WinBoll Activity 接口
|
||||||
|
*/
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
import cc.winboll.studio.libappbase.bean.APPInfo;
|
||||||
|
|
||||||
|
public interface IWinBollActivity {
|
||||||
|
|
||||||
|
public static final String TAG = "IWinBollActivity";
|
||||||
|
|
||||||
|
// 获取当前具有 IWinBoll 特征的 AppCompatActivity 活动窗口
|
||||||
|
AppCompatActivity getActivity();
|
||||||
|
|
||||||
|
abstract public APPInfo getAppInfo();
|
||||||
|
abstract public String getTag();
|
||||||
|
abstract Toolbar initToolBar();
|
||||||
|
abstract boolean isEnableDisplayHomeAsUp();
|
||||||
|
abstract boolean isAddWinBollToolBar();
|
||||||
|
}
|
@ -0,0 +1,68 @@
|
|||||||
|
package cc.winboll.studio.libappbase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ZhanGSKen@QQ.COM
|
||||||
|
* @Date 2024/08/12 15:07:58
|
||||||
|
* @Describe WinBoll 应用日志窗口
|
||||||
|
*/
|
||||||
|
import android.os.Bundle;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||||
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
|
import cc.winboll.studio.libappbase.bean.APPInfo;
|
||||||
|
import cc.winboll.studio.libappbase.R;
|
||||||
|
|
||||||
|
public class LogActivity extends AppCompatActivity implements IWinBollActivity {
|
||||||
|
|
||||||
|
public static final String TAG = "LogActivity";
|
||||||
|
|
||||||
|
LogView mLogView;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AppCompatActivity getActivity() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public APPInfo getAppInfo() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTag() {
|
||||||
|
return TAG;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Toolbar initToolBar() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isEnableDisplayHomeAsUp() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAddWinBollToolBar() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
LogUtils.d(TAG, "onCreate");
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_log);
|
||||||
|
mLogView = findViewById(R.id.logview);
|
||||||
|
|
||||||
|
if (GlobalApplication.isDebuging()) { mLogView.start(); }
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
LogUtils.d(TAG, "onResume");
|
||||||
|
super.onResume();
|
||||||
|
mLogView.start();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,387 @@
|
|||||||
|
package cc.winboll.studio.libappbase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ZhanGSKen@QQ.COM
|
||||||
|
* @Date 2024/08/12 14:36:18
|
||||||
|
* @Describe 日志视图类,继承 RelativeLayout 类。
|
||||||
|
*/
|
||||||
|
import android.content.ClipData;
|
||||||
|
import android.content.ClipboardManager;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Message;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.AdapterView;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.CheckBox;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
|
import android.widget.ScrollView;
|
||||||
|
import android.widget.Spinner;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
|
import cc.winboll.studio.libappbase.R;
|
||||||
|
import java.text.Collator;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class LogView extends RelativeLayout {
|
||||||
|
|
||||||
|
public static final String TAG = "LogView";
|
||||||
|
|
||||||
|
public volatile boolean mIsHandling;
|
||||||
|
public volatile boolean mIsAddNewLog;
|
||||||
|
|
||||||
|
Context mContext;
|
||||||
|
ScrollView mScrollView;
|
||||||
|
TextView mTextView;
|
||||||
|
CheckBox mSelectableCheckBox;
|
||||||
|
CheckBox mSelectAllTAGCheckBox;
|
||||||
|
TAGListAdapter mTAGListAdapter;
|
||||||
|
LogViewThread mLogViewThread;
|
||||||
|
LogViewHandler mLogViewHandler;
|
||||||
|
Spinner mLogLevelSpinner;
|
||||||
|
ArrayAdapter<CharSequence> mLogLevelSpinnerAdapter;
|
||||||
|
// 标签列表
|
||||||
|
RecyclerView recyclerView;
|
||||||
|
|
||||||
|
public LogView(Context context) {
|
||||||
|
super(context);
|
||||||
|
initView(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
public LogView(Context context, AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
initView(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
public LogView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||||
|
super(context, attrs, defStyleAttr);
|
||||||
|
initView(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
public LogView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||||
|
super(context, attrs, defStyleAttr, defStyleRes);
|
||||||
|
initView(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void start() {
|
||||||
|
mLogViewThread = new LogViewThread(LogView.this);
|
||||||
|
mLogViewThread.start();
|
||||||
|
// 显示日志
|
||||||
|
showAndScrollLogView();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void scrollLogUp() {
|
||||||
|
mScrollView.post(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
mScrollView.fullScroll(ScrollView.FOCUS_DOWN);
|
||||||
|
// 日志显示结束
|
||||||
|
mLogViewHandler.setIsHandling(false);
|
||||||
|
// 检查是否添加了新日志
|
||||||
|
if (mLogViewHandler.isAddNewLog()) {
|
||||||
|
// 有新日志添加,先更改新日志标志
|
||||||
|
mLogViewHandler.setIsAddNewLog(false);
|
||||||
|
// 再次发送显示日志的显示
|
||||||
|
Message message = mLogViewHandler.obtainMessage(LogViewHandler.MSG_LOGVIEW_UPDATE);
|
||||||
|
mLogViewHandler.sendMessage(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void initView(Context context) {
|
||||||
|
mContext = context;
|
||||||
|
mLogViewHandler = new LogViewHandler();
|
||||||
|
// 加载视图布局
|
||||||
|
addView(inflate(mContext, cc.winboll.studio.libappbase.R.layout.view_log, null));
|
||||||
|
// 初始化日志子控件视图
|
||||||
|
//
|
||||||
|
mScrollView = findViewById(cc.winboll.studio.libappbase.R.id.viewlogScrollViewLog);
|
||||||
|
mTextView = findViewById(cc.winboll.studio.libappbase.R.id.viewlogTextViewLog);
|
||||||
|
// 获取Log Level spinner实例
|
||||||
|
mLogLevelSpinner = findViewById(cc.winboll.studio.libappbase.R.id.viewlogSpinner1);
|
||||||
|
|
||||||
|
(findViewById(cc.winboll.studio.libappbase.R.id.viewlogButtonClean)).setOnClickListener(new View.OnClickListener(){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
LogUtils.cleanLog();
|
||||||
|
LogUtils.d(TAG, "Log is cleaned.");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
(findViewById(cc.winboll.studio.libappbase.R.id.viewlogButtonCopy)).setOnClickListener(new View.OnClickListener(){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
|
||||||
|
ClipboardManager cm = (ClipboardManager) mContext.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||||
|
cm.setPrimaryClip(ClipData.newPlainText(mContext.getPackageName(), LogUtils.loadLog()));
|
||||||
|
LogUtils.d(TAG, "Log is copied.");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
mSelectableCheckBox = findViewById(cc.winboll.studio.libappbase.R.id.viewlogCheckBoxSelectable);
|
||||||
|
mSelectableCheckBox.setOnClickListener(new View.OnClickListener(){
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (mSelectableCheckBox.isChecked()) {
|
||||||
|
setDescendantFocusability(ViewGroup.FOCUS_BEFORE_DESCENDANTS);
|
||||||
|
} else {
|
||||||
|
setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 设置日志级别列表
|
||||||
|
ArrayList<String> adapterItems = new ArrayList<>();
|
||||||
|
for (LogUtils.LOG_LEVEL e : LogUtils.LOG_LEVEL.values()) {
|
||||||
|
adapterItems.add(e.name());
|
||||||
|
}
|
||||||
|
// 假设你有一个字符串数组作为选项列表
|
||||||
|
//String[] options = {"Option 1", "Option 2", "Option 3"};
|
||||||
|
// 创建一个ArrayAdapter来绑定数据到spinner
|
||||||
|
mLogLevelSpinnerAdapter = ArrayAdapter.createFromResource(
|
||||||
|
context, cc.winboll.studio.libappbase.R.array.enum_loglevel_array, android.R.layout.simple_spinner_item);
|
||||||
|
mLogLevelSpinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||||
|
|
||||||
|
// 设置适配器并将它应用到spinner上
|
||||||
|
mLogLevelSpinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); // 设置下拉视图样式
|
||||||
|
mLogLevelSpinner.setAdapter(mLogLevelSpinnerAdapter);
|
||||||
|
// 为Spinner添加监听器
|
||||||
|
mLogLevelSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||||
|
@Override
|
||||||
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
//String selectedOption = mLogLevelSpinnerAdapter.getItem(position);
|
||||||
|
// 处理选中的选项...
|
||||||
|
LogUtils.setLogLevel(LogUtils.LOG_LEVEL.values()[position]);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onNothingSelected(AdapterView<?> parent) {
|
||||||
|
// 如果没有选择,则执行此操作...
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 获取默认值的索引
|
||||||
|
int defaultValueIndex = LogUtils.getLogLevel().ordinal();
|
||||||
|
|
||||||
|
if (defaultValueIndex != -1) {
|
||||||
|
// 如果找到了默认值,设置默认选项
|
||||||
|
mLogLevelSpinner.setSelection(defaultValueIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 加载标签列表
|
||||||
|
Map<String, Boolean> mapTAGList = LogUtils.getMapTAGList();
|
||||||
|
boolean isAllSelect = true;
|
||||||
|
for (Map.Entry<String, Boolean> entry : mapTAGList.entrySet()) {
|
||||||
|
if (entry.getValue() == false) {
|
||||||
|
isAllSelect = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CheckBox cbALLTAG = findViewById(cc.winboll.studio.libappbase.R.id.viewlogCheckBox1);
|
||||||
|
cbALLTAG.setChecked(isAllSelect);
|
||||||
|
|
||||||
|
// 加载标签表
|
||||||
|
recyclerView = findViewById(cc.winboll.studio.libappbase.R.id.viewlogRecyclerView1);
|
||||||
|
LinearLayoutManager layoutManager = new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false);
|
||||||
|
recyclerView.setLayoutManager(layoutManager);
|
||||||
|
mTAGListAdapter = new TAGListAdapter(mapTAGList);
|
||||||
|
recyclerView.setAdapter(mTAGListAdapter);
|
||||||
|
|
||||||
|
// 可以添加点击监听器来处理勾选框状态变化后的逻辑,比如获取当前勾选情况等
|
||||||
|
mTAGListAdapter.notifyDataSetChanged();
|
||||||
|
|
||||||
|
mSelectAllTAGCheckBox = findViewById(cc.winboll.studio.libappbase.R.id.viewlogCheckBox1);
|
||||||
|
mSelectAllTAGCheckBox.setOnClickListener(new View.OnClickListener(){
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
LogUtils.setALlTAGListEnable(mSelectAllTAGCheckBox.isChecked());
|
||||||
|
//LogUtils.setALlTAGListEnable(false);
|
||||||
|
//mTAGListAdapter.notifyDataSetChanged();
|
||||||
|
mTAGListAdapter.reload();
|
||||||
|
//ToastUtils.show(String.format("onClick\nmSelectAllTAGCheckBox.isChecked() : %s", mSelectAllTAGCheckBox.isChecked()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// 设置滚动时不聚焦日志
|
||||||
|
setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateLogView() {
|
||||||
|
if (mLogViewHandler.isHandling() == true) {
|
||||||
|
// 正在处理日志显示,
|
||||||
|
// 就先设置一个新日志标志位
|
||||||
|
// 以便日志显示完后,再次显示新日志内容
|
||||||
|
mLogViewHandler.setIsAddNewLog(true);
|
||||||
|
} else {
|
||||||
|
//LogUtils.d(TAG, "LogListener showLog(String path)");
|
||||||
|
Message message = mLogViewHandler.obtainMessage(LogViewHandler.MSG_LOGVIEW_UPDATE);
|
||||||
|
mLogViewHandler.sendMessage(message);
|
||||||
|
mLogViewHandler.setIsAddNewLog(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void showAndScrollLogView() {
|
||||||
|
mTextView.setText(LogUtils.loadLog());
|
||||||
|
scrollLogUp();
|
||||||
|
}
|
||||||
|
|
||||||
|
class LogViewHandler extends Handler {
|
||||||
|
|
||||||
|
final static int MSG_LOGVIEW_UPDATE = 0;
|
||||||
|
volatile boolean isHandling;
|
||||||
|
volatile boolean isAddNewLog;
|
||||||
|
|
||||||
|
public LogViewHandler() {
|
||||||
|
setIsHandling(false);
|
||||||
|
setIsAddNewLog(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsHandling(boolean isHandling) {
|
||||||
|
this.isHandling = isHandling;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isHandling() {
|
||||||
|
return isHandling;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsAddNewLog(boolean isAddNewLog) {
|
||||||
|
this.isAddNewLog = isAddNewLog;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isAddNewLog() {
|
||||||
|
return isAddNewLog;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void handleMessage(Message msg) {
|
||||||
|
switch (msg.what) {
|
||||||
|
case MSG_LOGVIEW_UPDATE:{
|
||||||
|
if (isHandling() == false) {
|
||||||
|
setIsHandling(true);
|
||||||
|
showAndScrollLogView();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
super.handleMessage(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TAGItemModel {
|
||||||
|
private String tag;
|
||||||
|
private boolean isChecked;
|
||||||
|
|
||||||
|
public TAGItemModel(String tag, boolean isChecked) {
|
||||||
|
this.tag = tag;
|
||||||
|
this.isChecked = isChecked;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTag() {
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTag(String tag) {
|
||||||
|
this.tag = tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isChecked() {
|
||||||
|
return isChecked;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChecked(boolean checked) {
|
||||||
|
isChecked = checked;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class TAGListAdapter extends RecyclerView.Adapter<TAGListAdapter.ViewHolder> {
|
||||||
|
|
||||||
|
private Map<String, Boolean> mapOrigin;
|
||||||
|
private List<TAGItemModel> itemList;
|
||||||
|
|
||||||
|
public TAGListAdapter(Map<String, Boolean> map) {
|
||||||
|
mapOrigin = map;
|
||||||
|
loadMap(mapOrigin);
|
||||||
|
}
|
||||||
|
|
||||||
|
void loadMap(Map<String, Boolean> map) {
|
||||||
|
itemList = new ArrayList<TAGItemModel>();
|
||||||
|
for (Map.Entry<String, Boolean> entry : map.entrySet()) {
|
||||||
|
itemList.add(new TAGItemModel(entry.getKey(), entry.getValue()));
|
||||||
|
}
|
||||||
|
// 添加排序功能,按照tag进行升序排序
|
||||||
|
Collections.sort(itemList, new SortMapEntryByKeyString(true));
|
||||||
|
//Collections.sort(itemList, new SortMapEntryByKeyString(false));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void reload() {
|
||||||
|
loadMap(mapOrigin);
|
||||||
|
super.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_logtag, parent, false);
|
||||||
|
return new ViewHolder(view);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||||
|
final TAGItemModel item = itemList.get(position);
|
||||||
|
holder.tvText.setText(item.getTag());
|
||||||
|
holder.cbChecked.setChecked(item.isChecked());
|
||||||
|
holder.cbChecked.setOnClickListener(new View.OnClickListener(){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
LogUtils.setTAGListEnable(item.getTag(), ((CheckBox)v).isChecked());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return itemList.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
TextView tvText;
|
||||||
|
CheckBox cbChecked;
|
||||||
|
|
||||||
|
public ViewHolder(@NonNull View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
tvText = itemView.findViewById(R.id.viewlogtagTextView1);
|
||||||
|
cbChecked = itemView.findViewById(R.id.viewlogtagCheckBox1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class SortMapEntryByKeyString implements Comparator<TAGItemModel> {
|
||||||
|
private boolean mIsDesc = true;
|
||||||
|
// isDesc 是否降序排列
|
||||||
|
public SortMapEntryByKeyString(boolean isDesc) {
|
||||||
|
mIsDesc = isDesc;
|
||||||
|
}
|
||||||
|
Collator cmp = Collator.getInstance(java.util.Locale.CHINA);
|
||||||
|
@Override
|
||||||
|
public int compare(TAGItemModel o1, TAGItemModel o2) {
|
||||||
|
if (mIsDesc) {
|
||||||
|
return o1.getTag().compareTo(o2.getTag());
|
||||||
|
} else {
|
||||||
|
return o2.getTag().compareTo(o1.getTag());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,80 @@
|
|||||||
|
package cc.winboll.studio.libappbase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ZhanGSKen@QQ.COM
|
||||||
|
* @Date 2024/08/12 14:43:50
|
||||||
|
* @Describe 日志视图线程类
|
||||||
|
*/
|
||||||
|
import android.os.FileObserver;
|
||||||
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
|
import java.lang.ref.WeakReference;
|
||||||
|
|
||||||
|
public class LogViewThread extends Thread {
|
||||||
|
|
||||||
|
public static final String TAG = "LogViewThread";
|
||||||
|
|
||||||
|
// 线程退出标志
|
||||||
|
volatile boolean isExist = false;
|
||||||
|
// 应用日志文件监听实例
|
||||||
|
LogListener mLogListener;
|
||||||
|
// 日志视图弱引用
|
||||||
|
WeakReference<LogView> mwrLogView;
|
||||||
|
|
||||||
|
//
|
||||||
|
// 构造函数
|
||||||
|
// @logView : 日志显示输出视图类
|
||||||
|
public LogViewThread(LogView logView) {
|
||||||
|
mwrLogView = new WeakReference<LogView>(logView);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsExist(boolean isExist) {
|
||||||
|
this.isExist = isExist;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isExist() {
|
||||||
|
return isExist;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
String szLogDir = LogUtils.getLogCacheDir().getPath();
|
||||||
|
mLogListener = new LogListener(szLogDir);
|
||||||
|
mLogListener.startWatching();
|
||||||
|
while (isExist() == false) {
|
||||||
|
try {
|
||||||
|
Thread.sleep(1000);
|
||||||
|
} catch (InterruptedException e) {}
|
||||||
|
}
|
||||||
|
mLogListener.stopWatching();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// 日志文件监听类
|
||||||
|
//
|
||||||
|
class LogListener extends FileObserver {
|
||||||
|
public LogListener(String path) {
|
||||||
|
super(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEvent(int event, String path) {
|
||||||
|
int e = event & FileObserver.ALL_EVENTS;
|
||||||
|
switch (e) {
|
||||||
|
case FileObserver.CLOSE_WRITE:{
|
||||||
|
if (mwrLogView.get() != null) {
|
||||||
|
mwrLogView.get().updateLogView();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case FileObserver.DELETE:{
|
||||||
|
if (mwrLogView.get() != null) {
|
||||||
|
mwrLogView.get().updateLogView();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package cc.winboll.studio.libappbase;
|
||||||
|
|
||||||
|
import android.content.BroadcastReceiver;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
|
* @Date 2025/02/12 23:44:57
|
||||||
|
* @Describe 简单信号通信中心接收器
|
||||||
|
*/
|
||||||
|
public class SOSCSBroadcastReceiver extends BroadcastReceiver {
|
||||||
|
|
||||||
|
public static final String TAG = "SOSCSBroadcastReceiver";
|
||||||
|
public static final String ACTION_SOS = SOSCSBroadcastReceiver.class.getName() + ".ACTION_SOS";
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onReceive(Context context, Intent intent) {
|
||||||
|
String action = intent.getAction();
|
||||||
|
if(action.equals(context.getString(R.string.action_sos))) {
|
||||||
|
LogUtils.d(TAG, "action_sos");
|
||||||
|
} else {
|
||||||
|
LogUtils.d(TAG, String.format("action %s", action));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -11,12 +11,21 @@ import android.content.Intent;
|
|||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
|
|
||||||
public class SimpleOperateSignalCenterService extends Service {
|
public class SimpleOperateSignalCenterService extends Service {
|
||||||
|
|
||||||
public static final String TAG = "SimpleOperateSignalCenterService";
|
public static final String TAG = "SimpleOperateSignalCenterService";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBinder onBind(Intent intent) {
|
public IBinder onBind(Intent intent) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||||
|
return super.onStartCommand(intent, flags, startId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,142 @@
|
|||||||
|
package cc.winboll.studio.libappbase.bean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ZhanGSKen@QQ.COM
|
||||||
|
* @Date 2025/01/20 14:19:02
|
||||||
|
* @Describe 应用信息类
|
||||||
|
*/
|
||||||
|
import cc.winboll.studio.libappbase.R;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public class APPInfo implements Serializable {
|
||||||
|
|
||||||
|
public static final String TAG = "APPInfo";
|
||||||
|
|
||||||
|
// 应用名称
|
||||||
|
String appName;
|
||||||
|
// 应用图标
|
||||||
|
int appIcon;
|
||||||
|
// 应用描述
|
||||||
|
String appDescription;
|
||||||
|
// 应用Git仓库地址
|
||||||
|
String appGitName;
|
||||||
|
// 应用Git仓库拥有者
|
||||||
|
String appGitOwner;
|
||||||
|
// 应用Git仓库分支
|
||||||
|
String appGitAPPBranch;
|
||||||
|
// 应用Git仓库子项目文件夹
|
||||||
|
String appGitAPPSubProjectFolder;
|
||||||
|
// 应用主页
|
||||||
|
String appHomePage;
|
||||||
|
// 应用包名称
|
||||||
|
String appAPKName;
|
||||||
|
// 应用包存储文件夹名称
|
||||||
|
String appAPKFolderName;
|
||||||
|
|
||||||
|
public APPInfo(String appName, int appIcon, String appDescription, String appGitName, String appGitOwner, String appGitAPPBranch, String appGitAPPSubProjectFolder, String appHomePage, String appAPKName, String appAPKFolderName) {
|
||||||
|
this.appName = appName;
|
||||||
|
this.appIcon = appIcon;
|
||||||
|
this.appDescription = appDescription;
|
||||||
|
this.appGitName = appGitName;
|
||||||
|
this.appGitOwner = appGitOwner;
|
||||||
|
this.appGitAPPBranch = appGitAPPBranch;
|
||||||
|
this.appGitAPPSubProjectFolder = appGitAPPSubProjectFolder;
|
||||||
|
this.appHomePage = appHomePage;
|
||||||
|
this.appAPKName = appAPKName;
|
||||||
|
this.appAPKFolderName = appAPKFolderName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public APPInfo() {
|
||||||
|
this.appName = "WinBoll-APP";
|
||||||
|
this.appIcon = R.drawable.ic_launcher;
|
||||||
|
this.appDescription = "WinBoll APP";
|
||||||
|
this.appGitName = "APP";
|
||||||
|
this.appGitOwner = "Studio";
|
||||||
|
this.appGitAPPBranch = "app";
|
||||||
|
this.appGitAPPSubProjectFolder = "app";
|
||||||
|
this.appHomePage = "https://www.winboll.cc/studio/details.php?app=APP";
|
||||||
|
this.appAPKName = "APP";
|
||||||
|
this.appAPKFolderName = "APP";
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAppGitOwner(String appGitOwner) {
|
||||||
|
this.appGitOwner = appGitOwner;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAppGitOwner() {
|
||||||
|
return appGitOwner;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAppGitAPPBranch(String appGitAPPBranch) {
|
||||||
|
this.appGitAPPBranch = appGitAPPBranch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAppGitAPPBranch() {
|
||||||
|
return appGitAPPBranch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAppGitAPPSubProjectFolder(String appGitAPPSubProjectFolder) {
|
||||||
|
this.appGitAPPSubProjectFolder = appGitAPPSubProjectFolder;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAppGitAPPSubProjectFolder() {
|
||||||
|
return appGitAPPSubProjectFolder;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAppIcon(int appIcon) {
|
||||||
|
this.appIcon = appIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getAppIcon() {
|
||||||
|
return appIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAppDescription(String appDescription) {
|
||||||
|
this.appDescription = appDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAppDescription() {
|
||||||
|
return appDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAppAPKFolderName(String appAPKFolderName) {
|
||||||
|
this.appAPKFolderName = appAPKFolderName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAppAPKFolderName() {
|
||||||
|
return appAPKFolderName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAppName(String appName) {
|
||||||
|
this.appName = appName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAppName() {
|
||||||
|
return appName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAppGitName(String appGitName) {
|
||||||
|
this.appGitName = appGitName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAppGitName() {
|
||||||
|
return appGitName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAppHomePage(String appHomePage) {
|
||||||
|
this.appHomePage = appHomePage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAppHomePage() {
|
||||||
|
return appHomePage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAppAPKName(String appAPKName) {
|
||||||
|
this.appAPKName = appAPKName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAppAPKName() {
|
||||||
|
return appAPKName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 9.2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 5.1 KiB |
Binary file not shown.
Before Width: | Height: | Size: 14 KiB |
Binary file not shown.
Before Width: | Height: | Size: 19 KiB |
41
libappbase/src/main/res/drawable/bg_shadow.xml
Normal file
41
libappbase/src/main/res/drawable/bg_shadow.xml
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||||
|
<!-- 阴影部分 -->
|
||||||
|
<!-- 个人觉得更形象的表达:top代表下边的阴影高度,left代表右边的阴影宽度。其实也就是相对应的offset,solid中的颜色是阴影的颜色,也可以设置角度等等 -->
|
||||||
|
<item
|
||||||
|
android:left="2dp"
|
||||||
|
android:top="2dp"
|
||||||
|
android:right="2dp"
|
||||||
|
android:bottom="2dp">
|
||||||
|
<shape android:shape="rectangle" >
|
||||||
|
<gradient
|
||||||
|
android:angle="270"
|
||||||
|
android:endColor="#0F000000"
|
||||||
|
android:startColor="#0F000000" />
|
||||||
|
<corners
|
||||||
|
android:bottomLeftRadius="6dip"
|
||||||
|
android:bottomRightRadius="6dip"
|
||||||
|
android:topLeftRadius="6dip"
|
||||||
|
android:topRightRadius="6dip" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<!-- 背景部分 -->
|
||||||
|
<!-- 形象的表达:bottom代表背景部分在上边缘超出阴影的高度,right代表背景部分在左边超出阴影的宽度(相对应的offset) -->
|
||||||
|
<item
|
||||||
|
android:left="3dp"
|
||||||
|
android:top="3dp"
|
||||||
|
android:right="3dp"
|
||||||
|
android:bottom="5dp">
|
||||||
|
<shape android:shape="rectangle" >
|
||||||
|
<gradient
|
||||||
|
android:angle="270"
|
||||||
|
android:endColor="@color/colorAccent"
|
||||||
|
android:startColor="@color/colorAccent" />
|
||||||
|
<corners
|
||||||
|
android:bottomLeftRadius="6dip"
|
||||||
|
android:bottomRightRadius="6dip"
|
||||||
|
android:topLeftRadius="6dip"
|
||||||
|
android:topRightRadius="6dip" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
11
libappbase/src/main/res/drawable/ic_launcher.xml
Normal file
11
libappbase/src/main/res/drawable/ic_launcher.xml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:viewportWidth="24">
|
||||||
|
<path
|
||||||
|
android:fillColor="#ff000000"
|
||||||
|
android:pathData="M16.61,15.15C16.15,15.15 15.77,14.78 15.77,14.32S16.15,13.5 16.61,13.5H16.61C17.07,13.5 17.45,13.86 17.45,14.32C17.45,14.78 17.07,15.15 16.61,15.15M7.41,15.15C6.95,15.15 6.57,14.78 6.57,14.32C6.57,13.86 6.95,13.5 7.41,13.5H7.41C7.87,13.5 8.24,13.86 8.24,14.32C8.24,14.78 7.87,15.15 7.41,15.15M16.91,10.14L18.58,7.26C18.67,7.09 18.61,6.88 18.45,6.79C18.28,6.69 18.07,6.75 18,6.92L16.29,9.83C14.95,9.22 13.5,8.9 12,8.91C10.47,8.91 9,9.24 7.73,9.82L6.04,6.91C5.95,6.74 5.74,6.68 5.57,6.78C5.4,6.87 5.35,7.08 5.44,7.25L7.1,10.13C4.25,11.69 2.29,14.58 2,18H22C21.72,14.59 19.77,11.7 16.91,10.14H16.91Z"/>
|
||||||
|
|
||||||
|
</vector>
|
8
libappbase/src/main/res/drawable/view_border.xml
Normal file
8
libappbase/src/main/res/drawable/view_border.xml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<stroke
|
||||||
|
android:width="1dp"
|
||||||
|
android:color="#000000" /> <!-- 这里可调整边框宽度和颜色 -->
|
||||||
|
<solid android:color="@android:color/transparent" />
|
||||||
|
</shape>
|
16
libappbase/src/main/res/layout/activity_log.xml
Normal file
16
libappbase/src/main/res/layout/activity_log.xml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<cc.winboll.studio.libappbase.LogView
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1.0"
|
||||||
|
android:id="@+id/logview"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
121
libappbase/src/main/res/layout/view_log.xml
Normal file
121
libappbase/src/main/res/layout/view_log.xml
Normal file
@ -0,0 +1,121 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="#FF000000">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:background="@drawable/bg_shadow"
|
||||||
|
android:id="@+id/viewlogRelativeLayoutToolbar">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:text="Clean"
|
||||||
|
android:textSize="14dp"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:id="@+id/viewlogButtonClean"
|
||||||
|
android:layout_marginLeft="5dp"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:background="#FF000000"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:text="LV:"
|
||||||
|
android:layout_toRightOf="@+id/viewlogButtonClean"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:id="@+id/viewlogTextView1"
|
||||||
|
android:textColor="#FFFFFFFF"/>
|
||||||
|
|
||||||
|
<Spinner
|
||||||
|
android:background="#FFFFFFFF"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:layout_toRightOf="@+id/viewlogTextView1"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:id="@+id/viewlogSpinner1"/>
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:layout_toLeftOf="@+id/viewlogButtonCopy"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:text="Selectable"
|
||||||
|
android:background="#FFFFFFFF"
|
||||||
|
android:paddingRight="10dp"
|
||||||
|
android:textSize="16dp"
|
||||||
|
android:id="@+id/viewlogCheckBoxSelectable"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:text="Copy"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:textSize="14dp"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:id="@+id/viewlogButtonCopy"
|
||||||
|
android:layout_marginRight="5dp"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:background="@drawable/bg_shadow"
|
||||||
|
android:layout_below="@+id/viewlogRelativeLayoutToolbar"
|
||||||
|
android:id="@+id/viewlogLinearLayout1"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="ALL"
|
||||||
|
android:id="@+id/viewlogCheckBox1"/>
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/view_border"
|
||||||
|
android:id="@+id/viewlogRecyclerView1"
|
||||||
|
android:layout_weight="1.0"
|
||||||
|
android:layout_marginRight="5dp"
|
||||||
|
android:padding="2dp"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1.0"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_below="@+id/viewlogLinearLayout1">
|
||||||
|
|
||||||
|
<ScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="#FF000000"
|
||||||
|
android:id="@+id/viewlogScrollViewLog">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:text="Text"
|
||||||
|
android:textColor="#FF00FF00"
|
||||||
|
android:textIsSelectable="true"
|
||||||
|
android:id="@+id/viewlogTextViewLog"/>
|
||||||
|
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
32
libappbase/src/main/res/layout/view_logtag.xml
Normal file
32
libappbase/src/main/res/layout/view_logtag.xml
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:cardBackgroundColor="#F5F5F5"
|
||||||
|
app:cardElevation="4dp"
|
||||||
|
app:cardCornerRadius="4dp"
|
||||||
|
android:id="@+id/listviewauthinfoCardView1"
|
||||||
|
android:layout_marginLeft="0dp"
|
||||||
|
android:layout_marginRight="5dp">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:id="@+id/viewlogtagTextView1"/>
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:id="@+id/viewlogtagCheckBox1"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
11
libappbase/src/main/res/values/array.xml
Normal file
11
libappbase/src/main/res/values/array.xml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<array name="enum_loglevel_array">
|
||||||
|
<item>Off</item>
|
||||||
|
<item>Error</item>
|
||||||
|
<item>Warn</item>
|
||||||
|
<item>Info</item>
|
||||||
|
<item>Debug</item>
|
||||||
|
<item>Verbose</item>
|
||||||
|
</array>
|
||||||
|
</resources>
|
@ -3,5 +3,6 @@
|
|||||||
|
|
||||||
<string name="lib_name">libappbase</string>
|
<string name="lib_name">libappbase</string>
|
||||||
<string name="hello_world">Hello world!</string>
|
<string name="hello_world">Hello world!</string>
|
||||||
|
<string name="action_sos">cc.winboll.studio.libappbase.SOSCSBroadcastReceiver.ACTION_SOS</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user