Compare commits
45 Commits
apputils-v
...
appbase-v1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8bdd42ce68 | ||
|
|
d4986c6ba4 | ||
|
|
529f420668 | ||
|
|
b3439aa36a | ||
|
|
7488fa7af2 | ||
|
|
d4e4541bfd | ||
|
|
ac627e53b1 | ||
|
|
42a2e6d559 | ||
|
|
0d44734c0b | ||
|
|
e89873046b | ||
|
|
f3ef7226d8 | ||
|
|
9706a39f41 | ||
|
|
e85cbd803e | ||
|
|
00a9ec1d66 | ||
|
|
64051bb9fe | ||
|
|
5e42f21c9a | ||
|
|
c394a37e0a | ||
|
|
dd7600d617 | ||
|
|
c203557a6a | ||
|
|
00b619ee99 | ||
|
|
3a6fb3e17c | ||
|
|
75c2f6304c | ||
|
|
ec6926f629 | ||
|
|
ede6c07deb | ||
|
|
3fe1ea7ff2 | ||
|
|
5411d5e590 | ||
|
|
facf0b001d | ||
|
|
df58c0355c | ||
|
|
e657e45218 | ||
|
|
c22946f0a5 | ||
|
|
1363a7dcce | ||
|
|
e0ca5725f1 | ||
|
|
3c4988532f | ||
|
|
b0a34579fa | ||
|
|
dd08747edb | ||
|
|
603640b3cb | ||
|
|
5b06ce9699 | ||
|
|
363fc6c7c1 | ||
|
|
7f43f8b5c5 | ||
|
|
a117e6e110 | ||
|
|
c1f576e343 | ||
|
|
1dad84b65e | ||
|
|
1ae377e665 | ||
|
|
02fa0a4134 | ||
|
|
a730aa3f92 |
@@ -18,15 +18,8 @@ def genVersionName(def versionName){
|
|||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
productFlavors {
|
compileSdkVersion 32
|
||||||
beta {
|
buildToolsVersion "32.0.0"
|
||||||
}
|
|
||||||
stage {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
compileSdkVersion 30
|
|
||||||
buildToolsVersion "30.0.3"
|
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "cc.winboll.studio.androiddemo"
|
applicationId "cc.winboll.studio.androiddemo"
|
||||||
@@ -36,7 +29,7 @@ android {
|
|||||||
// versionName 更新后需要手动设置
|
// versionName 更新后需要手动设置
|
||||||
// .winboll/winbollBuildProps.properties 文件的 stageCount=0
|
// .winboll/winbollBuildProps.properties 文件的 stageCount=0
|
||||||
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
||||||
versionName "1.0"
|
versionName "15.0"
|
||||||
if(true) {
|
if(true) {
|
||||||
versionName = genVersionName("${versionName}")
|
versionName = genVersionName("${versionName}")
|
||||||
}
|
}
|
||||||
@@ -54,21 +47,25 @@ dependencies {
|
|||||||
api fileTree(dir: 'libs', include: ['*.jar'])
|
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
|
||||||
// 吐司类库
|
// 吐司类库
|
||||||
implementation 'com.github.getActivity:ToastUtils:10.5'
|
api 'com.github.getActivity:ToastUtils:10.5'
|
||||||
|
|
||||||
// Android 类库
|
// Android 类库
|
||||||
// https://mvnrepository.com/artifact/com.android.support/support-v4
|
api 'com.android.support:appcompat-v7:28.0.0' // 包含 AppCompatActivity
|
||||||
implementation 'com.android.support:support-v4:28.0.0'
|
|
||||||
// https://mvnrepository.com/artifact/com.android.support/support-compat
|
// https://mvnrepository.com/artifact/com.android.support/support-compat
|
||||||
implementation 'com.android.support:support-compat:28.0.0'
|
api 'com.android.support:support-compat:28.0.0' // 保留原有依赖(可选)
|
||||||
|
// https://mvnrepository.com/artifact/com.android.support/support-v4
|
||||||
|
api 'com.android.support:support-v4:28.0.0'
|
||||||
// https://mvnrepository.com/artifact/com.android.support/support-media-compat
|
// https://mvnrepository.com/artifact/com.android.support/support-media-compat
|
||||||
implementation 'com.android.support:support-media-compat:28.0.0'
|
api 'com.android.support:support-media-compat:28.0.0'
|
||||||
// https://mvnrepository.com/artifact/com.android.support/support-core-utils
|
// https://mvnrepository.com/artifact/com.android.support/support-core-utils
|
||||||
implementation 'com.android.support:support-core-utils:28.0.0'
|
api 'com.android.support:support-core-utils:28.0.0'
|
||||||
// https://mvnrepository.com/artifact/com.android.support/support-core-ui
|
// https://mvnrepository.com/artifact/com.android.support/support-core-ui
|
||||||
implementation 'com.android.support:support-core-ui:28.0.0'
|
api 'com.android.support:support-core-ui:28.0.0'
|
||||||
// https://mvnrepository.com/artifact/com.android.support/support-fragment
|
// https://mvnrepository.com/artifact/com.android.support/support-fragment
|
||||||
implementation 'com.android.support:support-fragment:28.0.0'
|
api 'com.android.support:support-fragment:28.0.0'
|
||||||
// https://mvnrepository.com/artifact/com.android.support/recyclerview-v7
|
// https://mvnrepository.com/artifact/com.android.support/recyclerview-v7
|
||||||
implementation 'com.android.support:recyclerview-v7:28.0.0'
|
api 'com.android.support:recyclerview-v7:28.0.0'
|
||||||
|
|
||||||
|
api 'cc.winboll.studio:libappbase:15.0.9'
|
||||||
|
api 'cc.winboll.studio:libapputils:15.0.11'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Tue Mar 11 18:02:14 GMT 2025
|
#Wed Mar 26 07:23:51 GMT 2025
|
||||||
stageCount=0
|
stageCount=0
|
||||||
libraryProject=
|
libraryProject=
|
||||||
baseVersion=1.0
|
baseVersion=15.0
|
||||||
publishVersion=1.0.0
|
publishVersion=15.0.0
|
||||||
buildCount=1
|
buildCount=11
|
||||||
baseBetaVersion=1.0.1
|
baseBetaVersion=15.0.1
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/AppTheme"
|
android:theme="@style/AppTheme"
|
||||||
android:resizeableActivity="true"
|
android:resizeableActivity="true"
|
||||||
android:name=".GlobalApplication">
|
android:name=".App">
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package cc.winboll.studio.androiddemo;
|
package cc.winboll.studio.androiddemo;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.Application;
|
|
||||||
import android.content.ClipData;
|
import android.content.ClipData;
|
||||||
import android.content.ClipboardManager;
|
import android.content.ClipboardManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -22,6 +21,7 @@ import android.widget.HorizontalScrollView;
|
|||||||
import android.widget.ScrollView;
|
import android.widget.ScrollView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.Closeable;
|
import java.io.Closeable;
|
||||||
@@ -39,15 +39,15 @@ import java.util.Date;
|
|||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
|
||||||
public class GlobalApplication extends Application {
|
public class App extends GlobalApplication {
|
||||||
|
|
||||||
private static Handler MAIN_HANDLER = new Handler(Looper.getMainLooper());
|
private static Handler MAIN_HANDLER = new Handler(Looper.getMainLooper());
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
CrashHandler.getInstance().registerGlobal(this);
|
//CrashHandler.getInstance().registerGlobal(this);
|
||||||
CrashHandler.getInstance().registerPart(this);
|
//CrashHandler.getInstance().registerPart(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void write(InputStream input, OutputStream output) throws IOException {
|
public static void write(InputStream input, OutputStream output) throws IOException {
|
||||||
@@ -252,7 +252,7 @@ public class GlobalApplication extends Application {
|
|||||||
|
|
||||||
private static String getKernel() {
|
private static String getKernel() {
|
||||||
try {
|
try {
|
||||||
return GlobalApplication.toString(new FileInputStream("/proc/version")).trim();
|
return App.toString(new FileInputStream("/proc/version")).trim();
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
return e.getMessage();
|
return e.getMessage();
|
||||||
}
|
}
|
||||||
@@ -2,14 +2,24 @@ package cc.winboll.studio.androiddemo;
|
|||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import cc.winboll.studio.libappbase.LogView;
|
||||||
|
|
||||||
public class MainActivity extends Activity {
|
public class MainActivity extends Activity {
|
||||||
|
|
||||||
|
LogView mLogView;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
|
|
||||||
|
mLogView = findViewById(R.id.logview);
|
||||||
|
mLogView.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
mLogView.start();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -4,13 +4,34 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:gravity="center_vertical|center_horizontal">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="0dp"
|
||||||
android:text="Android Demo"
|
android:gravity="center_vertical|center_horizontal"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
android:layout_weight="1.0">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Android Demo"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1.0">
|
||||||
|
|
||||||
|
<cc.winboll.studio.libappbase.LogView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Text"
|
||||||
|
android:id="@+id/logview"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -18,15 +18,8 @@ def genVersionName(def versionName){
|
|||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
productFlavors {
|
compileSdkVersion 32
|
||||||
beta {
|
buildToolsVersion "32.0.0"
|
||||||
}
|
|
||||||
stage {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
compileSdkVersion 30
|
|
||||||
buildToolsVersion "30.0.3"
|
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "cc.winboll.studio.androidxdemo"
|
applicationId "cc.winboll.studio.androidxdemo"
|
||||||
@@ -36,7 +29,7 @@ android {
|
|||||||
// versionName 更新后需要手动设置
|
// versionName 更新后需要手动设置
|
||||||
// .winboll/winbollBuildProps.properties 文件的 stageCount=0
|
// .winboll/winbollBuildProps.properties 文件的 stageCount=0
|
||||||
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
||||||
versionName "1.0"
|
versionName "15.0"
|
||||||
if(true) {
|
if(true) {
|
||||||
versionName = genVersionName("${versionName}")
|
versionName = genVersionName("${versionName}")
|
||||||
}
|
}
|
||||||
@@ -54,23 +47,26 @@ dependencies {
|
|||||||
api fileTree(dir: 'libs', include: ['*.jar'])
|
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
|
||||||
// SSH
|
// SSH
|
||||||
implementation 'com.jcraft:jsch:0.1.55'
|
api 'com.jcraft:jsch:0.1.55'
|
||||||
// Html 解析
|
// Html 解析
|
||||||
implementation 'org.jsoup:jsoup:1.13.1'
|
api 'org.jsoup:jsoup:1.13.1'
|
||||||
// 二维码类库
|
// 二维码类库
|
||||||
implementation 'com.google.zxing:core:3.4.1'
|
api 'com.google.zxing:core:3.4.1'
|
||||||
implementation 'com.journeyapps:zxing-android-embedded:3.6.0'
|
api 'com.journeyapps:zxing-android-embedded:3.6.0'
|
||||||
// 应用介绍页类库
|
// 应用介绍页类库
|
||||||
implementation 'io.github.medyo:android-about-page:2.0.0'
|
api 'io.github.medyo:android-about-page:2.0.0'
|
||||||
// 吐司类库
|
// 吐司类库
|
||||||
implementation 'com.github.getActivity:ToastUtils:10.5'
|
api 'com.github.getActivity:ToastUtils:10.5'
|
||||||
// 网络连接类库
|
// 网络连接类库
|
||||||
implementation 'com.squareup.okhttp3:okhttp:4.4.1'
|
api 'com.squareup.okhttp3:okhttp:4.4.1'
|
||||||
// Android 类库
|
// AndroidX 类库
|
||||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
api 'androidx.appcompat:appcompat:1.0.0'
|
||||||
implementation 'androidx.viewpager:viewpager:1.0.0'
|
api 'com.google.android.material:material:1.4.0'
|
||||||
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
|
//api 'androidx.viewpager:viewpager:1.0.0'
|
||||||
implementation 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
|
//api 'androidx.vectordrawable:vectordrawable:1.1.0'
|
||||||
implementation 'androidx.fragment:fragment:1.1.0'
|
//api 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
|
||||||
implementation 'com.google.android.material:material:1.4.0'
|
//api 'androidx.fragment:fragment:1.1.0'
|
||||||
|
|
||||||
|
api 'cc.winboll.studio:libappbase:15.0.9'
|
||||||
|
api 'cc.winboll.studio:libapputils:15.0.11'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Tue Mar 11 18:25:43 GMT 2025
|
#Mon Mar 24 06:19:57 GMT 2025
|
||||||
stageCount=0
|
stageCount=0
|
||||||
libraryProject=
|
libraryProject=
|
||||||
baseVersion=1.0
|
baseVersion=15.0
|
||||||
publishVersion=1.0.0
|
publishVersion=15.0.0
|
||||||
buildCount=4
|
buildCount=8
|
||||||
baseBetaVersion=1.0.1
|
baseBetaVersion=15.0.1
|
||||||
|
|||||||
@@ -8,9 +8,9 @@
|
|||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/AppTheme"
|
android:theme="@style/MyAppTheme"
|
||||||
android:resizeableActivity="true"
|
android:resizeableActivity="true"
|
||||||
android:name=".GlobalApplication">
|
android:name=".App">
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package cc.winboll.studio.androidxdemo;
|
package cc.winboll.studio.androidxdemo;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.Application;
|
|
||||||
import android.content.ClipData;
|
import android.content.ClipData;
|
||||||
import android.content.ClipboardManager;
|
import android.content.ClipboardManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -22,6 +21,7 @@ import android.widget.HorizontalScrollView;
|
|||||||
import android.widget.ScrollView;
|
import android.widget.ScrollView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.Closeable;
|
import java.io.Closeable;
|
||||||
@@ -39,15 +39,15 @@ import java.util.Date;
|
|||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
|
||||||
public class GlobalApplication extends Application {
|
public class App extends GlobalApplication {
|
||||||
|
|
||||||
private static Handler MAIN_HANDLER = new Handler(Looper.getMainLooper());
|
private static Handler MAIN_HANDLER = new Handler(Looper.getMainLooper());
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
CrashHandler.getInstance().registerGlobal(this);
|
//CrashHandler.getInstance().registerGlobal(this);
|
||||||
CrashHandler.getInstance().registerPart(this);
|
//CrashHandler.getInstance().registerPart(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void write(InputStream input, OutputStream output) throws IOException {
|
public static void write(InputStream input, OutputStream output) throws IOException {
|
||||||
@@ -252,7 +252,7 @@ public class GlobalApplication extends Application {
|
|||||||
|
|
||||||
private static String getKernel() {
|
private static String getKernel() {
|
||||||
try {
|
try {
|
||||||
return GlobalApplication.toString(new FileInputStream("/proc/version")).trim();
|
return App.toString(new FileInputStream("/proc/version")).trim();
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
return e.getMessage();
|
return e.getMessage();
|
||||||
}
|
}
|
||||||
@@ -3,9 +3,12 @@ package cc.winboll.studio.androidxdemo;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
import cc.winboll.studio.libappbase.LogView;
|
||||||
|
|
||||||
public class MainActivity extends AppCompatActivity {
|
public class MainActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
LogView mLogView;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@@ -14,6 +17,12 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
Toolbar toolbar=(Toolbar)findViewById(R.id.toolbar);
|
Toolbar toolbar=(Toolbar)findViewById(R.id.toolbar);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
|
mLogView = findViewById(R.id.logview);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
mLogView.start();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -34,5 +34,18 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1.0">
|
||||||
|
|
||||||
|
<cc.winboll.studio.libappbase.LogView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:id="@+id/logview"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<!-- Base application theme. -->
|
<!-- Base application theme. -->
|
||||||
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
<style name="MyAppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||||
<!-- Customize your theme here. -->
|
<!-- Customize your theme here. -->
|
||||||
<item name="colorPrimary">@color/colorPrimary</item>
|
<item name="colorPrimary">@color/colorPrimary</item>
|
||||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||||
|
|||||||
@@ -18,8 +18,9 @@ def genVersionName(def versionName){
|
|||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 30
|
|
||||||
buildToolsVersion "30.0.3"
|
compileSdkVersion 32
|
||||||
|
buildToolsVersion "32.0.0"
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "cc.winboll.studio.appbase"
|
applicationId "cc.winboll.studio.appbase"
|
||||||
@@ -29,7 +30,7 @@ android {
|
|||||||
// versionName 更新后需要手动设置
|
// versionName 更新后需要手动设置
|
||||||
// .winboll/winbollBuildProps.properties 文件的 stageCount=0
|
// .winboll/winbollBuildProps.properties 文件的 stageCount=0
|
||||||
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
||||||
versionName "15.0"
|
versionName "15.1"
|
||||||
if(true) {
|
if(true) {
|
||||||
versionName = genVersionName("${versionName}")
|
versionName = genVersionName("${versionName}")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Sat Mar 15 15:30:02 HKT 2025
|
#Wed Mar 26 15:43:05 HKT 2025
|
||||||
stageCount=3
|
stageCount=1
|
||||||
libraryProject=libappbase
|
libraryProject=libappbase
|
||||||
baseVersion=15.0
|
baseVersion=15.1
|
||||||
publishVersion=15.0.2
|
publishVersion=15.1.0
|
||||||
buildCount=0
|
buildCount=0
|
||||||
baseBetaVersion=15.0.3
|
baseBetaVersion=15.1.1
|
||||||
|
|||||||
@@ -7,12 +7,15 @@
|
|||||||
android:name=".App"
|
android:name=".App"
|
||||||
android:icon="@drawable/ic_launcher"
|
android:icon="@drawable/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/MyAppTheme"
|
android:theme="@style/MyAPPBaseTheme"
|
||||||
android:resizeableActivity="true">
|
android:resizeableActivity="true">
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
|
android:resizeableActivity="true"
|
||||||
|
android:launchMode="singleInstance"
|
||||||
|
android:taskAffinity="cc.winboll.studio.appbase.task.main"
|
||||||
android:exported="true">
|
android:exported="true">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -33,6 +36,7 @@
|
|||||||
|
|
||||||
<service
|
<service
|
||||||
android:name=".MyTileService"
|
android:name=".MyTileService"
|
||||||
|
android:exported="true"
|
||||||
android:label="@string/tileservice_name"
|
android:label="@string/tileservice_name"
|
||||||
android:icon="@drawable/ic_launcher"
|
android:icon="@drawable/ic_launcher"
|
||||||
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
|
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
|
||||||
@@ -49,9 +53,18 @@
|
|||||||
android:name=".services.MainService"
|
android:name=".services.MainService"
|
||||||
android:exported="true"/>
|
android:exported="true"/>
|
||||||
|
|
||||||
|
<service
|
||||||
|
android:name="cc.winboll.studio.appbase.services.TestDemoBindService"
|
||||||
|
android:exported="true"/>
|
||||||
|
|
||||||
|
<service
|
||||||
|
android:name="cc.winboll.studio.appbase.services.TestDemoService"
|
||||||
|
android:exported="true"/>
|
||||||
|
|
||||||
<service android:name=".services.AssistantService"/>
|
<service android:name=".services.AssistantService"/>
|
||||||
|
|
||||||
<receiver android:name="cc.winboll.studio.appbase.receivers.MainReceiver">
|
<receiver android:name="cc.winboll.studio.appbase.receivers.MainReceiver"
|
||||||
|
android:exported="true">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
|
||||||
@@ -81,13 +94,14 @@
|
|||||||
|
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
<receiver android:name=".widgets.APPNewsWidgetClickListener">
|
<receiver android:name=".receivers.APPNewsWidgetClickListener"
|
||||||
|
android:exported="true">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
|
||||||
<action android:name="cc.winboll.studio.appbase.widgets.APPNewsWidgetClickListener.ACTION_PRE"/>
|
<action android:name="cc.winboll.studio.appbase.receivers.APPNewsWidgetClickListener.ACTION_PRE"/>
|
||||||
|
|
||||||
<action android:name="cc.winboll.studio.appbase.widgets.APPNewsWidgetClickListener.ACTION_NEXT"/>
|
<action android:name="cc.winboll.studio.appbase.receivers.APPNewsWidgetClickListener.ACTION_NEXT"/>
|
||||||
|
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
@@ -97,11 +111,9 @@
|
|||||||
android:name="android.max_aspect"
|
android:name="android.max_aspect"
|
||||||
android:value="4.0"/>
|
android:value="4.0"/>
|
||||||
|
|
||||||
<service android:name="cc.winboll.studio.appbase.services.TestDemoBindService"
|
<activity android:name=".activities.NewActivity"/>
|
||||||
android:exported="true"/>
|
|
||||||
|
|
||||||
<service android:name="cc.winboll.studio.appbase.services.TestDemoService"
|
<activity android:name=".activities.New2Activity"/>
|
||||||
android:exported="true"/>
|
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ public class App extends GlobalApplication {
|
|||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
GlobalApplication.setIsDebuging(this, BuildConfig.DEBUG);
|
|
||||||
mSOSCenterServiceReceiver = new SOSCenterServiceReceiver();
|
mSOSCenterServiceReceiver = new SOSCenterServiceReceiver();
|
||||||
IntentFilter intentFilter = new IntentFilter();
|
IntentFilter intentFilter = new IntentFilter();
|
||||||
intentFilter.addAction(SOS.ACTION_SOS);
|
intentFilter.addAction(SOS.ACTION_SOS);
|
||||||
|
|||||||
@@ -1,28 +1,47 @@
|
|||||||
package cc.winboll.studio.appbase;
|
package cc.winboll.studio.appbase;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.app.ActivityOptions;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.graphics.Rect;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
import android.widget.Toolbar;
|
|
||||||
import cc.winboll.studio.appbase.R;
|
import cc.winboll.studio.appbase.R;
|
||||||
|
import cc.winboll.studio.appbase.activities.NewActivity;
|
||||||
import cc.winboll.studio.appbase.services.MainService;
|
import cc.winboll.studio.appbase.services.MainService;
|
||||||
import cc.winboll.studio.appbase.services.TestDemoBindService;
|
import cc.winboll.studio.appbase.services.TestDemoBindService;
|
||||||
import cc.winboll.studio.appbase.services.TestDemoService;
|
import cc.winboll.studio.appbase.services.TestDemoService;
|
||||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
import cc.winboll.studio.libappbase.LogView;
|
|
||||||
import cc.winboll.studio.libappbase.sos.SOS;
|
import cc.winboll.studio.libappbase.sos.SOS;
|
||||||
import cc.winboll.studio.libappbase.utils.ToastUtils;
|
import cc.winboll.studio.libappbase.utils.ToastUtils;
|
||||||
import cc.winboll.studio.libappbase.widgets.StatusWidget;
|
import cc.winboll.studio.libappbase.widgets.StatusWidget;
|
||||||
|
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
||||||
|
import cc.winboll.studio.libappbase.winboll.LogActivity;
|
||||||
|
import cc.winboll.studio.libappbase.winboll.WinBollActivityManager;
|
||||||
|
import android.support.v7.widget.Toolbar;
|
||||||
|
|
||||||
public class MainActivity extends Activity {
|
public class MainActivity extends AppCompatActivity implements IWinBollActivity {
|
||||||
|
|
||||||
public static final String TAG = "MainActivity";
|
public static final String TAG = "MainActivity";
|
||||||
|
|
||||||
LogView mLogView;
|
@Override
|
||||||
|
public Activity getActivity() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTag() {
|
||||||
|
return TAG;
|
||||||
|
}
|
||||||
|
|
||||||
|
Toolbar mToolbar;
|
||||||
|
//LogView mLogView;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -30,19 +49,37 @@ public class MainActivity extends Activity {
|
|||||||
ToastUtils.show("onCreate");
|
ToastUtils.show("onCreate");
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
|
|
||||||
Toolbar toolbar = findViewById(R.id.activitymainToolbar1);
|
mToolbar = findViewById(R.id.toolbar);
|
||||||
setActionBar(toolbar);
|
setSupportActionBar(mToolbar);
|
||||||
|
|
||||||
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);
|
//mLogView = findViewById(R.id.activitymainLogView1);
|
||||||
|
|
||||||
if (GlobalApplication.isDebuging()) {
|
// if (GlobalApplication.isDebuging()) {
|
||||||
mLogView.start();
|
// mLogView.start();
|
||||||
ToastUtils.show("LogView start.");
|
// ToastUtils.show("LogView start.");
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
getMenuInflater().inflate(R.menu.toolbar_main, menu);
|
||||||
|
return super.onCreateOptionsMenu(menu);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
if (item.getItemId() == cc.winboll.studio.appbase.R.id.item_log) {
|
||||||
|
onLogActivity();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// 在switch语句中处理每个ID,并在处理完后返回true,未处理的情况返回false。
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
@@ -51,15 +88,9 @@ public class MainActivity extends Activity {
|
|||||||
sendBroadcast(intentAPPWidget);
|
sendBroadcast(intentAPPWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
@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());
|
boolean isDebuging = ((CheckBox)view).isChecked();
|
||||||
|
GlobalApplication.setIsDebuging(isDebuging);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onStartCenter(View view) {
|
public void onStartCenter(View view) {
|
||||||
@@ -89,7 +120,7 @@ public class MainActivity extends Activity {
|
|||||||
startService(intentService);
|
startService(intentService);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onTestSOS(View view) {
|
public void onTestDemoServiceSOS(View view) {
|
||||||
Intent intent = new Intent(this, TestDemoService.class);
|
Intent intent = new Intent(this, TestDemoService.class);
|
||||||
stopService(intent);
|
stopService(intent);
|
||||||
if (App.isDebuging()) {
|
if (App.isDebuging()) {
|
||||||
@@ -140,4 +171,28 @@ public class MainActivity extends Activity {
|
|||||||
Intent intent = new Intent(this, TestDemoBindService.class);
|
Intent intent = new Intent(this, TestDemoBindService.class);
|
||||||
stopService(intent);
|
stopService(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onTestOpenNewActivity(View view) {
|
||||||
|
WinBollActivityManager.getInstance(this).startWinBollActivity(this, NewActivity.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onLogActivity() {
|
||||||
|
|
||||||
|
|
||||||
|
Intent intent = new Intent(MainActivity.this, LogActivity.class);
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT);
|
||||||
|
// Define the bounds.
|
||||||
|
Rect bounds = new Rect(500, 300, 100, 0);
|
||||||
|
|
||||||
|
// Set the bounds as an activity option.
|
||||||
|
|
||||||
|
ActivityOptions options = ActivityOptions.makeBasic();
|
||||||
|
|
||||||
|
options.setLaunchBounds(bounds);
|
||||||
|
|
||||||
|
//Intent intent = new Intent(this, LpgActivity.class);
|
||||||
|
|
||||||
|
startActivity(intent, options.toBundle());
|
||||||
|
//WinBollActivityManager.getInstance(this).startWinBollActivity(this, intent, LogActivity.class);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ package cc.winboll.studio.appbase;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.service.quicksettings.Tile;
|
import android.service.quicksettings.Tile;
|
||||||
import android.service.quicksettings.TileService;
|
import android.service.quicksettings.TileService;
|
||||||
import cc.winboll.studio.appbase.beans.MainServiceBean;
|
import cc.winboll.studio.appbase.models.MainServiceBean;
|
||||||
import cc.winboll.studio.appbase.services.MainService;
|
import cc.winboll.studio.appbase.services.MainService;
|
||||||
|
|
||||||
public class MyTileService extends TileService {
|
public class MyTileService extends TileService {
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package cc.winboll.studio.appbase.activities;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
|
* @Date 2025/03/25 11:46:40
|
||||||
|
* @Describe 测试窗口2
|
||||||
|
*/
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import cc.winboll.studio.appbase.R;
|
||||||
|
import cc.winboll.studio.libappbase.LogView;
|
||||||
|
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
||||||
|
import cc.winboll.studio.libappbase.winboll.WinBollActivityManager;
|
||||||
|
|
||||||
|
public class New2Activity extends Activity implements IWinBollActivity {
|
||||||
|
|
||||||
|
public static final String TAG = "New2Activity";
|
||||||
|
|
||||||
|
//LogView mLogView;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Activity getActivity() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTag() {
|
||||||
|
return TAG;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_new2);
|
||||||
|
|
||||||
|
// mLogView = findViewById(R.id.logview);
|
||||||
|
// mLogView.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
//mLogView.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onCloseThisActivity(View view) {
|
||||||
|
WinBollActivityManager.getInstance(this).finish(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onCloseAllActivity(View view) {
|
||||||
|
WinBollActivityManager.getInstance(this).finishAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onNewActivity(View view) {
|
||||||
|
WinBollActivityManager.getInstance(this).startWinBollActivity(this, NewActivity.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package cc.winboll.studio.appbase.activities;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
|
* @Date 2025/03/25 05:04:22
|
||||||
|
*/
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import cc.winboll.studio.appbase.R;
|
||||||
|
import cc.winboll.studio.libappbase.LogView;
|
||||||
|
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
||||||
|
import cc.winboll.studio.libappbase.winboll.WinBollActivityManager;
|
||||||
|
|
||||||
|
public class NewActivity extends Activity implements IWinBollActivity {
|
||||||
|
|
||||||
|
public static final String TAG = "NewActivity";
|
||||||
|
|
||||||
|
//LogView mLogView;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Activity getActivity() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTag() {
|
||||||
|
return TAG;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_new);
|
||||||
|
// mLogView = findViewById(R.id.logview);
|
||||||
|
// mLogView.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
//mLogView.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onCloseThisActivity(View view) {
|
||||||
|
WinBollActivityManager.getInstance(this).finish(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onCloseAllActivity(View view) {
|
||||||
|
WinBollActivityManager.getInstance(this).finishAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onNew2Activity(View view) {
|
||||||
|
WinBollActivityManager.getInstance(this).startWinBollActivity(this, New2Activity.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package cc.winboll.studio.appbase.beans;
|
package cc.winboll.studio.appbase.models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author ZhanGSKen@AliYun.Com
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package cc.winboll.studio.appbase.beans;
|
package cc.winboll.studio.appbase.models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author ZhanGSKen@AliYun.Com
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package cc.winboll.studio.appbase.beans;
|
package cc.winboll.studio.appbase.models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author ZhanGSKen@AliYun.Com
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package cc.winboll.studio.appbase.beans;
|
package cc.winboll.studio.appbase.models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author ZhanGSKen@AliYun.Com
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
package cc.winboll.studio.appbase.widgets;
|
package cc.winboll.studio.appbase.receivers;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author ZhanGSKen@AliYun.Com
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
* @Date 2025/02/15 17:20:46
|
* @Date 2025/03/24 07:11:44
|
||||||
* @Describe WidgetButtonClickListener
|
|
||||||
*/
|
*/
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import cc.winboll.studio.appbase.widgets.APPNewsWidget;
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
|
|
||||||
public class APPNewsWidgetClickListener extends BroadcastReceiver {
|
public class APPNewsWidgetClickListener extends BroadcastReceiver {
|
||||||
@@ -10,7 +10,7 @@ import android.content.ComponentName;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
import cc.winboll.studio.appbase.beans.WinBollNewsBean;
|
import cc.winboll.studio.appbase.models.WinBollNewsBean;
|
||||||
import cc.winboll.studio.appbase.services.MainService;
|
import cc.winboll.studio.appbase.services.MainService;
|
||||||
import cc.winboll.studio.appbase.widgets.APPNewsWidget;
|
import cc.winboll.studio.appbase.widgets.APPNewsWidget;
|
||||||
import cc.winboll.studio.libappbase.AppUtils;
|
import cc.winboll.studio.libappbase.AppUtils;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.ServiceConnection;
|
import android.content.ServiceConnection;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import cc.winboll.studio.appbase.beans.MainServiceBean;
|
import cc.winboll.studio.appbase.models.MainServiceBean;
|
||||||
import cc.winboll.studio.appbase.services.AssistantService;
|
import cc.winboll.studio.appbase.services.AssistantService;
|
||||||
import cc.winboll.studio.appbase.services.MainService;
|
import cc.winboll.studio.appbase.services.MainService;
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import android.content.ServiceConnection;
|
|||||||
import android.os.Binder;
|
import android.os.Binder;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import cc.winboll.studio.appbase.MyTileService;
|
import cc.winboll.studio.appbase.MyTileService;
|
||||||
import cc.winboll.studio.appbase.beans.MainServiceBean;
|
import cc.winboll.studio.appbase.models.MainServiceBean;
|
||||||
import cc.winboll.studio.appbase.handlers.MainServiceHandler;
|
import cc.winboll.studio.appbase.handlers.MainServiceHandler;
|
||||||
import cc.winboll.studio.appbase.receivers.MainReceiver;
|
import cc.winboll.studio.appbase.receivers.MainReceiver;
|
||||||
import cc.winboll.studio.appbase.services.AssistantService;
|
import cc.winboll.studio.appbase.services.AssistantService;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Binder;
|
import android.os.Binder;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import cc.winboll.studio.appbase.beans.TestDemoBindServiceBean;
|
import cc.winboll.studio.appbase.models.TestDemoBindServiceBean;
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
import cc.winboll.studio.libappbase.sos.WinBoll;
|
import cc.winboll.studio.libappbase.sos.WinBoll;
|
||||||
import cc.winboll.studio.appbase.App;
|
import cc.winboll.studio.appbase.App;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Binder;
|
import android.os.Binder;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import cc.winboll.studio.appbase.beans.TestDemoServiceBean;
|
import cc.winboll.studio.appbase.models.TestDemoServiceBean;
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
import cc.winboll.studio.libappbase.sos.WinBoll;
|
import cc.winboll.studio.libappbase.sos.WinBoll;
|
||||||
|
|
||||||
|
|||||||
@@ -12,15 +12,16 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.widget.RemoteViews;
|
import android.widget.RemoteViews;
|
||||||
import cc.winboll.studio.appbase.R;
|
import cc.winboll.studio.appbase.R;
|
||||||
import cc.winboll.studio.appbase.beans.WinBollNewsBean;
|
import cc.winboll.studio.appbase.models.WinBollNewsBean;
|
||||||
|
import cc.winboll.studio.appbase.receivers.APPNewsWidgetClickListener;
|
||||||
import cc.winboll.studio.libappbase.AppUtils;
|
import cc.winboll.studio.libappbase.AppUtils;
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
|
import cc.winboll.studio.libappbase.sos.APPModel;
|
||||||
|
import cc.winboll.studio.libappbase.sos.WinBoll;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import cc.winboll.studio.libappbase.sos.APPModel;
|
|
||||||
import cc.winboll.studio.libappbase.sos.WinBoll;
|
|
||||||
|
|
||||||
public class APPNewsWidget extends AppWidgetProvider {
|
public class APPNewsWidget extends AppWidgetProvider {
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,10 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<android.widget.Toolbar
|
<android.support.v7.widget.Toolbar
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/activitymainToolbar1"/>
|
android:id="@+id/toolbar"/>
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -72,6 +72,26 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="right">
|
android:gravity="right">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="StartCenter"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:onClick="onStartCenter"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="StopCenter"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:onClick="onStopCenter"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<HorizontalScrollView
|
<HorizontalScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
@@ -106,53 +126,40 @@
|
|||||||
|
|
||||||
</HorizontalScrollView>
|
</HorizontalScrollView>
|
||||||
|
|
||||||
<HorizontalScrollView
|
<HorizontalScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="SartTestDemoBindService"
|
android:text="SartTestDemoBindService"
|
||||||
android:textAllCaps="false"
|
android:textAllCaps="false"
|
||||||
android:onClick="onSartTestDemoBindService"/>
|
android:onClick="onSartTestDemoBindService"/>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="StopTestDemoBindService"
|
android:text="StopTestDemoBindService"
|
||||||
android:textAllCaps="false"
|
android:textAllCaps="false"
|
||||||
android:onClick="onStopTestDemoBindService"/>
|
android:onClick="onStopTestDemoBindService"/>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="StopTestDemoBindServiceNoSettings"
|
android:text="StopTestDemoBindServiceNoSettings"
|
||||||
android:textAllCaps="false"
|
android:textAllCaps="false"
|
||||||
android:onClick="onStopTestDemoBindServiceNoSettings"/>
|
android:onClick="onStopTestDemoBindServiceNoSettings"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</HorizontalScrollView>
|
</HorizontalScrollView>
|
||||||
|
|
||||||
<Button
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="StartCenter"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:onClick="onStartCenter"/>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="StopCenter"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:onClick="onStopCenter"/>
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -171,19 +178,21 @@
|
|||||||
<Button
|
<Button
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="TestSOS"
|
android:text="TestDemoServiceSOS"
|
||||||
android:textAllCaps="false"
|
android:textAllCaps="false"
|
||||||
android:onClick="onTestSOS"/>
|
android:onClick="onTestDemoServiceSOS"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="TestOpenNewActivity"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:onClick="onTestOpenNewActivity"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
<cc.winboll.studio.libappbase.LogView
|
|
||||||
android:layout_height="500dp"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:id="@+id/activitymainLogView1"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
43
appbase/src/main/res/layout/activity_new.xml
Normal file
43
appbase/src/main/res/layout/activity_new.xml
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<?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">
|
||||||
|
|
||||||
|
<android.widget.Toolbar
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/toolbar"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="NewActivity"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="CloseThisActivity"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:onClick="onCloseThisActivity"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="CloseAllActivity"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:onClick="onCloseAllActivity"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="New2Activity"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:onClick="onNew2Activity"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
50
appbase/src/main/res/layout/activity_new2.xml
Normal file
50
appbase/src/main/res/layout/activity_new2.xml
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
<?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">
|
||||||
|
|
||||||
|
<android.widget.Toolbar
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/toolbar"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="New2Activity"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="CloseThisActivity"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:onClick="onCloseThisActivity"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="CloseAllActivity"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:onClick="onCloseAllActivity"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="CloseAllActivity"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:onClick="onCloseAllActivity"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="NewActivity"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:onClick="onNewActivity"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
9
appbase/src/main/res/menu/toolbar_main.xml
Normal file
9
appbase/src/main/res/menu/toolbar_main.xml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/item_log"
|
||||||
|
android:title="Log"/>
|
||||||
|
|
||||||
|
</menu>
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<color name="colorPrimary">#005800FF</color>
|
<color name="colorPrimary">#FF00B322</color>
|
||||||
<color name="colorPrimaryDark">#005800FF</color>
|
<color name="colorPrimaryDark">#FF005C12</color>
|
||||||
<color name="colorAccent">#005800FF</color>
|
<color name="colorAccent">#FF8DFFA2</color>
|
||||||
|
<color name="colorText">#FFFFFB8D</color>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<style name="MyAppTheme" parent="APPBaseTheme">
|
<style name="MyAPPBaseTheme" parent="APPBaseTheme">
|
||||||
<item name="attrColorPrimary">@color/colorPrimary</item>
|
<item name="attrColorPrimary">@color/colorPrimary</item>
|
||||||
<item name="themeGlobalCrashActivity">@style/MyGlobalCrashActivityTheme</item>
|
<item name="themeGlobalCrashActivity">@style/MyGlobalCrashActivityTheme</item>
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
28
build.gradle
28
build.gradle
@@ -1,6 +1,12 @@
|
|||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
|
// Nexus Maven 库地址
|
||||||
|
// "WinBoll Release"
|
||||||
|
maven { url "https://nexus.winboll.cc/repository/maven-public/" }
|
||||||
|
// "WinBoll Snapshot"
|
||||||
|
maven { url "https://nexus.winboll.cc/repository/maven-snapshots/" }
|
||||||
|
|
||||||
maven { url 'https://maven.aliyun.com/repository/public/' }
|
maven { url 'https://maven.aliyun.com/repository/public/' }
|
||||||
maven { url 'https://maven.aliyun.com/repository/google/' }
|
maven { url 'https://maven.aliyun.com/repository/google/' }
|
||||||
maven { url 'https://maven.aliyun.com/repository/gradle-plugin/' }
|
maven { url 'https://maven.aliyun.com/repository/gradle-plugin/' }
|
||||||
@@ -9,17 +15,10 @@ buildscript {
|
|||||||
maven { url "https://jitpack.io" }
|
maven { url "https://jitpack.io" }
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
google()
|
google()
|
||||||
|
|
||||||
// Nexus Maven 库地址
|
|
||||||
// "WinBoll Release"
|
|
||||||
maven { url "https://nexus.winboll.cc/repository/maven-public/" }
|
|
||||||
// "WinBoll Snapshot"
|
|
||||||
maven { url "https://nexus.winboll.cc/repository/maven-snapshots/" }
|
|
||||||
|
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:7.2.1'
|
classpath 'com.android.tools.build:gradle:7.2.1' // 对应 compileSdkVersion 32
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
}
|
}
|
||||||
@@ -27,6 +26,12 @@ buildscript {
|
|||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
|
// Nexus Maven 库地址
|
||||||
|
// "WinBoll Release"
|
||||||
|
maven { url "https://nexus.winboll.cc/repository/maven-public/" }
|
||||||
|
// "WinBoll Snapshot"
|
||||||
|
maven { url "https://nexus.winboll.cc/repository/maven-snapshots/" }
|
||||||
|
|
||||||
maven { url 'https://maven.aliyun.com/repository/public/' }
|
maven { url 'https://maven.aliyun.com/repository/public/' }
|
||||||
maven { url 'https://maven.aliyun.com/repository/google/' }
|
maven { url 'https://maven.aliyun.com/repository/google/' }
|
||||||
maven { url 'https://maven.aliyun.com/repository/gradle-plugin/' }
|
maven { url 'https://maven.aliyun.com/repository/gradle-plugin/' }
|
||||||
@@ -35,13 +40,6 @@ allprojects {
|
|||||||
maven { url "https://jitpack.io" }
|
maven { url "https://jitpack.io" }
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
google()
|
google()
|
||||||
|
|
||||||
// Nexus Maven 库地址
|
|
||||||
// "WinBoll Release"
|
|
||||||
maven { url "https://nexus.winboll.cc/repository/maven-public/" }
|
|
||||||
// "WinBoll Snapshot"
|
|
||||||
maven { url "https://nexus.winboll.cc/repository/maven-snapshots/" }
|
|
||||||
|
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
}
|
}
|
||||||
ext {
|
ext {
|
||||||
|
|||||||
@@ -17,3 +17,5 @@ org.gradle.jvmargs=-Xmx2048m
|
|||||||
android.useAndroidX=false
|
android.useAndroidX=false
|
||||||
# Automatically convert third-party libraries to use AndroidX
|
# Automatically convert third-party libraries to use AndroidX
|
||||||
android.enableJetifier=false
|
android.enableJetifier=false
|
||||||
|
# 保持与旧版Gradle插件的兼容
|
||||||
|
android.disableAutomaticComponentCreation=true
|
||||||
|
|||||||
@@ -17,3 +17,5 @@ org.gradle.jvmargs=-Xmx2048m
|
|||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
# Automatically convert third-party libraries to use AndroidX
|
# Automatically convert third-party libraries to use AndroidX
|
||||||
android.enableJetifier=true
|
android.enableJetifier=true
|
||||||
|
# 保持与旧版Gradle插件的兼容
|
||||||
|
android.disableAutomaticComponentCreation=true
|
||||||
|
|||||||
@@ -4,8 +4,9 @@ apply from: '../.winboll/winboll_lib_build.gradle'
|
|||||||
apply from: '../.winboll/winboll_lint_build.gradle'
|
apply from: '../.winboll/winboll_lint_build.gradle'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 30
|
|
||||||
buildToolsVersion "30.0.3"
|
compileSdkVersion 32
|
||||||
|
buildToolsVersion "32.0.0"
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 26
|
minSdkVersion 26
|
||||||
@@ -21,4 +22,21 @@ android {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api fileTree(dir: 'libs', include: ['*.jar'])
|
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
|
||||||
|
// Android 类库
|
||||||
|
api 'com.android.support:appcompat-v7:28.0.0' // 包含 AppCompatActivity
|
||||||
|
// https://mvnrepository.com/artifact/com.android.support/support-compat
|
||||||
|
api 'com.android.support:support-compat:28.0.0' // 保留原有依赖(可选)
|
||||||
|
// https://mvnrepository.com/artifact/com.android.support/support-v4
|
||||||
|
api 'com.android.support:support-v4:28.0.0'
|
||||||
|
// https://mvnrepository.com/artifact/com.android.support/support-media-compat
|
||||||
|
api 'com.android.support:support-media-compat:28.0.0'
|
||||||
|
// https://mvnrepository.com/artifact/com.android.support/support-core-utils
|
||||||
|
api 'com.android.support:support-core-utils:28.0.0'
|
||||||
|
// https://mvnrepository.com/artifact/com.android.support/support-core-ui
|
||||||
|
api 'com.android.support:support-core-ui:28.0.0'
|
||||||
|
// https://mvnrepository.com/artifact/com.android.support/support-fragment
|
||||||
|
api 'com.android.support:support-fragment:28.0.0'
|
||||||
|
// https://mvnrepository.com/artifact/com.android.support/recyclerview-v7
|
||||||
|
api 'com.android.support:recyclerview-v7:28.0.0'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Sat Mar 15 15:29:07 HKT 2025
|
#Wed Mar 26 15:43:05 HKT 2025
|
||||||
stageCount=3
|
stageCount=1
|
||||||
libraryProject=libappbase
|
libraryProject=libappbase
|
||||||
baseVersion=15.0
|
baseVersion=15.1
|
||||||
publishVersion=15.0.2
|
publishVersion=15.1.0
|
||||||
buildCount=0
|
buildCount=0
|
||||||
baseBetaVersion=15.0.3
|
baseBetaVersion=15.1.1
|
||||||
|
|||||||
@@ -21,7 +21,15 @@
|
|||||||
android:label="GlobalCrashActivity"
|
android:label="GlobalCrashActivity"
|
||||||
android:launchMode="standard"/>
|
android:launchMode="standard"/>
|
||||||
|
|
||||||
<activity android:name=".LogActivity"/>
|
<activity
|
||||||
|
android:theme="@android:style/Theme.Holo.Light.NoActionBar"
|
||||||
|
android:name="cc.winboll.studio.libappbase.winboll.LogActivity"
|
||||||
|
android:resizeableActivity="true"
|
||||||
|
android:launchMode="singleInstance"
|
||||||
|
android:taskAffinity="cc.winboll.studio.libappbase.task.log"
|
||||||
|
android:exported="true">
|
||||||
|
|
||||||
|
</activity>
|
||||||
|
|
||||||
<service
|
<service
|
||||||
android:name=".SimpleOperateSignalCenterService"
|
android:name=".SimpleOperateSignalCenterService"
|
||||||
@@ -33,7 +41,8 @@
|
|||||||
android:name=".services.TestService"
|
android:name=".services.TestService"
|
||||||
android:exported="true"/>
|
android:exported="true"/>
|
||||||
|
|
||||||
<receiver android:name=".receiver.MyBroadcastReceiver">
|
<receiver android:name=".receiver.MyBroadcastReceiver"
|
||||||
|
android:exported="true">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
|
||||||
@@ -75,7 +84,8 @@
|
|||||||
|
|
||||||
<service android:name="cc.winboll.studio.libappbase.sos.SOSCenter"/>
|
<service android:name="cc.winboll.studio.libappbase.sos.SOSCenter"/>
|
||||||
|
|
||||||
<receiver android:name="cc.winboll.studio.libappbase.sos.SOSCenterServiceReceiver">
|
<receiver android:name="cc.winboll.studio.libappbase.sos.SOSCenterServiceReceiver"
|
||||||
|
android:exported="true">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,73 @@
|
|||||||
|
package cc.winboll.studio.libappbase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
|
* @Date 2025/03/25 02:52:46
|
||||||
|
* @Describe 基础应用数据模型
|
||||||
|
*/
|
||||||
|
import android.util.JsonReader;
|
||||||
|
import android.util.JsonWriter;
|
||||||
|
import cc.winboll.studio.libappbase.BaseBean;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class APPBaseModel extends BaseBean {
|
||||||
|
|
||||||
|
public static final String TAG = "APPBaseModel";
|
||||||
|
|
||||||
|
// 应用是否处于正在调试状态
|
||||||
|
//
|
||||||
|
boolean isDebuging = false;
|
||||||
|
|
||||||
|
public APPBaseModel() {
|
||||||
|
this.isDebuging = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public APPBaseModel(boolean isDebuging) {
|
||||||
|
this.isDebuging = isDebuging;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsDebuging(boolean isDebuging) {
|
||||||
|
this.isDebuging = isDebuging;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isDebuging() {
|
||||||
|
return isDebuging;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return APPBaseModel.class.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeThisToJsonWriter(JsonWriter jsonWriter) throws IOException {
|
||||||
|
super.writeThisToJsonWriter(jsonWriter);
|
||||||
|
jsonWriter.name("isDebuging").value(isDebuging());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean initObjectsFromJsonReader(JsonReader jsonReader, String name) throws IOException {
|
||||||
|
if (super.initObjectsFromJsonReader(jsonReader, name)) { return true; } else {
|
||||||
|
if (name.equals("isDebuging")) {
|
||||||
|
setIsDebuging(jsonReader.nextBoolean());
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BaseBean readBeanFromJsonReader(JsonReader jsonReader) throws IOException {
|
||||||
|
jsonReader.beginObject();
|
||||||
|
while (jsonReader.hasNext()) {
|
||||||
|
String name = jsonReader.nextName();
|
||||||
|
if (!initObjectsFromJsonReader(jsonReader, name)) {
|
||||||
|
jsonReader.skipValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 结束 JSON 对象
|
||||||
|
jsonReader.endObject();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,12 +7,13 @@ package cc.winboll.studio.libappbase;
|
|||||||
*/
|
*/
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.content.pm.ApplicationInfo;
|
import android.content.pm.ApplicationInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import cc.winboll.studio.libappbase.utils.ToastUtils;
|
import cc.winboll.studio.libappbase.utils.ToastUtils;
|
||||||
|
import cc.winboll.studio.libappbase.winboll.WinBollActivityManager;
|
||||||
|
import cc.winboll.studio.libappbase.winboll.MyActivityLifecycleCallbacks;
|
||||||
|
|
||||||
public class GlobalApplication extends Application {
|
public class GlobalApplication extends Application {
|
||||||
|
|
||||||
@@ -21,22 +22,31 @@ public class GlobalApplication extends Application {
|
|||||||
final static String PREFS = GlobalApplication.class.getName() + "PREFS";
|
final static String PREFS = GlobalApplication.class.getName() + "PREFS";
|
||||||
final static String PREFS_ISDEBUGING = "PREFS_ISDEBUGING";
|
final static String PREFS_ISDEBUGING = "PREFS_ISDEBUGING";
|
||||||
|
|
||||||
|
|
||||||
private static Handler MAIN_HANDLER = new Handler(Looper.getMainLooper());
|
private static Handler MAIN_HANDLER = new Handler(Looper.getMainLooper());
|
||||||
|
|
||||||
|
volatile static GlobalApplication _GlobalApplication;
|
||||||
// 是否处于调试状态
|
// 是否处于调试状态
|
||||||
volatile static boolean isDebuging = false;
|
volatile static boolean isDebuging = false;
|
||||||
|
WinBollActivityManager mWinBollActivityManager;
|
||||||
|
MyActivityLifecycleCallbacks mMyActivityLifecycleCallbacks;
|
||||||
|
|
||||||
public static void setIsDebuging(Context context, boolean isDebuging) {
|
public static void setIsDebuging(boolean isDebuging) {
|
||||||
GlobalApplication.isDebuging = isDebuging;
|
if (_GlobalApplication != null) {
|
||||||
// 获取SharedPreferences实例
|
GlobalApplication.isDebuging = isDebuging;
|
||||||
SharedPreferences sharedPreferences = context.getSharedPreferences(PREFS, Context.MODE_PRIVATE);
|
APPBaseModel.saveBeanToFile(getAPPBaseModelFilePath(), new APPBaseModel(isDebuging));
|
||||||
// 获取编辑器
|
// 获取SharedPreferences实例
|
||||||
SharedPreferences.Editor editor = sharedPreferences.edit();
|
// SharedPreferences sharedPreferences = context.getSharedPreferences(PREFS, Context.MODE_PRIVATE);
|
||||||
// 保存数据
|
// // 获取编辑器
|
||||||
editor.putBoolean(PREFS_ISDEBUGING, GlobalApplication.isDebuging);
|
// SharedPreferences.Editor editor = sharedPreferences.edit();
|
||||||
// 提交更改
|
// // 保存数据
|
||||||
editor.apply();
|
// editor.putBoolean(PREFS_ISDEBUGING, GlobalApplication.isDebuging);
|
||||||
|
// // 提交更改
|
||||||
|
// editor.apply();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static String getAPPBaseModelFilePath() {
|
||||||
|
return _GlobalApplication.getDataDir().getPath() + "/APPBaseModel.json";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isDebuging() {
|
public static boolean isDebuging() {
|
||||||
@@ -55,8 +65,16 @@ public class GlobalApplication extends Application {
|
|||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
//GlobalApplication.isDebuging = true;
|
_GlobalApplication = this;
|
||||||
//GlobalApplication.setIsDebuging(this, true);
|
|
||||||
|
// 设置应用调试标志
|
||||||
|
APPBaseModel appBaseModel = APPBaseModel.loadBeanFromFile(getAPPBaseModelFilePath(), APPBaseModel.class);
|
||||||
|
if (appBaseModel == null) {
|
||||||
|
setIsDebuging(false);
|
||||||
|
} else {
|
||||||
|
setIsDebuging(appBaseModel.isDebuging());
|
||||||
|
}
|
||||||
|
|
||||||
LogUtils.init(this);
|
LogUtils.init(this);
|
||||||
//LogUtils.setLogLevel(LogUtils.LOG_LEVEL.Debug);
|
//LogUtils.setLogLevel(LogUtils.LOG_LEVEL.Debug);
|
||||||
//LogUtils.setTAGListEnable(GlobalApplication.TAG, true);
|
//LogUtils.setTAGListEnable(GlobalApplication.TAG, true);
|
||||||
@@ -66,16 +84,22 @@ public class GlobalApplication extends Application {
|
|||||||
// 设置应用异常处理窗口
|
// 设置应用异常处理窗口
|
||||||
CrashHandler.init(this);
|
CrashHandler.init(this);
|
||||||
|
|
||||||
// 设置应用调试状态
|
|
||||||
//SharedPreferences sharedPreferences = getSharedPreferences(PREFS, Context.MODE_PRIVATE);
|
|
||||||
//GlobalApplication.isDebuging = sharedPreferences.getBoolean(PREFS_ISDEBUGING, GlobalApplication.isDebuging);
|
|
||||||
|
|
||||||
// 初始化 Toast 框架
|
// 初始化 Toast 框架
|
||||||
ToastUtils.init(this);
|
ToastUtils.init(this);
|
||||||
// 设置 Toast 布局样式
|
|
||||||
//ToastUtils.setView(R.layout.toast_custom_view);
|
// mWinBollActivityManager = WinBollActivityManager.getInstance(this);
|
||||||
//ToastUtils.setStyle(new WhiteToastStyle());
|
// mWinBollActivityManager.setWinBollUI_TYPE(WinBollActivityManager.WinBollUI_TYPE.Service);
|
||||||
//ToastUtils.setGravity(Gravity.BOTTOM, 0, 200);
|
// // 注册回调
|
||||||
|
// mMyActivityLifecycleCallbacks = new MyActivityLifecycleCallbacks(mWinBollActivityManager);
|
||||||
|
// registerActivityLifecycleCallbacks(mMyActivityLifecycleCallbacks);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTerminate() {
|
||||||
|
super.onTerminate();
|
||||||
|
// 注销回调(非必须,但建议释放资源)
|
||||||
|
unregisterActivityLifecycleCallbacks(mMyActivityLifecycleCallbacks);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getAppName(Context context) {
|
public static String getAppName(Context context) {
|
||||||
|
|||||||
@@ -190,6 +190,7 @@ public class LogView extends RelativeLayout {
|
|||||||
|
|
||||||
// 加载标签表
|
// 加载标签表
|
||||||
mListViewTags = findViewById(cc.winboll.studio.libappbase.R.id.tags_listview);
|
mListViewTags = findViewById(cc.winboll.studio.libappbase.R.id.tags_listview);
|
||||||
|
mListViewTags.setVerticalOffset(10);
|
||||||
mTAGListAdapter = new TAGListAdapter(mContext, mapTAGList);
|
mTAGListAdapter = new TAGListAdapter(mContext, mapTAGList);
|
||||||
mListViewTags.setAdapter(mTAGListAdapter);
|
mListViewTags.setAdapter(mTAGListAdapter);
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,9 @@ import android.widget.ListView;
|
|||||||
import cc.winboll.studio.libappbase.LogUtils;
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
|
|
||||||
public class HorizontalListView extends ListView {
|
public class HorizontalListView extends ListView {
|
||||||
|
|
||||||
public static final String TAG = "HorizontalListView";
|
public static final String TAG = "HorizontalListView";
|
||||||
|
int verticalOffset = 0;
|
||||||
|
|
||||||
public HorizontalListView(Context context) {
|
public HorizontalListView(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
@@ -25,25 +27,10 @@ public class HorizontalListView extends ListView {
|
|||||||
public HorizontalListView(Context context, AttributeSet attrs, int defStyle) {
|
public HorizontalListView(Context context, AttributeSet attrs, int defStyle) {
|
||||||
super(context, attrs, defStyle);
|
super(context, attrs, defStyle);
|
||||||
}
|
}
|
||||||
// @Override
|
|
||||||
// protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
public void setVerticalOffset(int verticalOffset) {
|
||||||
// super.onLayout(changed, l, t, r, b);
|
this.verticalOffset = verticalOffset;
|
||||||
// int childCount = getChildCount();
|
}
|
||||||
// int left = getPaddingLeft();
|
|
||||||
// // 获取HorizontalListView的高度
|
|
||||||
// int viewHeight = getMeasuredHeight() - getPaddingTop() - getPaddingBottom();
|
|
||||||
// for (int i = 0; i < childCount; i++) {
|
|
||||||
// View child = getChildAt(i);
|
|
||||||
// int width = child.getMeasuredWidth();
|
|
||||||
// int height = child.getMeasuredHeight();
|
|
||||||
// // 计算子项在垂直方向上的居中偏移量
|
|
||||||
// int verticalOffset = (viewHeight - height) / 2;
|
|
||||||
// // 设置子视图的位置,实现水平布局并垂直居中
|
|
||||||
// child.layout(left, getPaddingTop() + verticalOffset, left + width, getPaddingTop() + verticalOffset + height);
|
|
||||||
// left += width;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
||||||
@@ -52,7 +39,7 @@ public class HorizontalListView extends ListView {
|
|||||||
int left = getPaddingLeft();
|
int left = getPaddingLeft();
|
||||||
int viewHeight = getMeasuredHeight() - getPaddingTop() - getPaddingBottom();
|
int viewHeight = getMeasuredHeight() - getPaddingTop() - getPaddingBottom();
|
||||||
LogUtils.d(TAG, String.format("HorizontalListView的高度 %d", viewHeight));
|
LogUtils.d(TAG, String.format("HorizontalListView的高度 %d", viewHeight));
|
||||||
int verticalOffset = 20;
|
|
||||||
for (int i = 0; i < childCount; i++) {
|
for (int i = 0; i < childCount; i++) {
|
||||||
View child = getChildAt(i);
|
View child = getChildAt(i);
|
||||||
// 计算每个子视图的宽度和高度
|
// 计算每个子视图的宽度和高度
|
||||||
@@ -68,15 +55,11 @@ public class HorizontalListView extends ListView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||||
|
|
||||||
int newHeightMeasureSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
|
int newHeightMeasureSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
|
||||||
//super.onMeasure(widthMeasureSpec, newHeightMeasureSpec);
|
//super.onMeasure(widthMeasureSpec, newHeightMeasureSpec);
|
||||||
int newWidthMeasureSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
|
int newWidthMeasureSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
|
||||||
//LogUtils.d(TAG, String.format("newWidthMeasureSpec %d, newHeightMeasureSpec %d", newWidthMeasureSpec, newHeightMeasureSpec));
|
//LogUtils.d(TAG, String.format("newWidthMeasureSpec %d, newHeightMeasureSpec %d", newWidthMeasureSpec, newHeightMeasureSpec));
|
||||||
super.onMeasure(newWidthMeasureSpec, newHeightMeasureSpec);
|
super.onMeasure(newWidthMeasureSpec, newHeightMeasureSpec);
|
||||||
|
|
||||||
// ViewGroup.LayoutParams params = getLayoutParams();
|
|
||||||
// params.width = getMeasuredWidth();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package cc.winboll.studio.libappbase.winboll;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
|
* @Date 2025/03/24 08:23:40
|
||||||
|
* @Describe WinBoll 活动窗口通用接口
|
||||||
|
*/
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.widget.Toolbar;
|
||||||
|
|
||||||
|
public interface IWinBollActivity {
|
||||||
|
|
||||||
|
public static final String TAG = "IWinBollActivity";
|
||||||
|
|
||||||
|
// 获取活动窗口
|
||||||
|
abstract public Activity getActivity();
|
||||||
|
abstract public String getTag();
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package cc.winboll.studio.libappbase.winboll;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
|
* @Date 2025/03/25 20:34:47
|
||||||
|
* @Describe 应用日志窗口
|
||||||
|
*/
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
import cc.winboll.studio.libappbase.LogView;
|
||||||
|
import cc.winboll.studio.libappbase.R;
|
||||||
|
import cc.winboll.studio.libappbase.utils.ToastUtils;
|
||||||
|
|
||||||
|
public class LogActivity extends Activity implements IWinBollActivity {
|
||||||
|
|
||||||
|
public static final String TAG = "LogActivity";
|
||||||
|
|
||||||
|
LogView mLogView;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Activity getActivity() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTag() {
|
||||||
|
return TAG;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_log);
|
||||||
|
//ToastUtils.show("LogActivity onCreate");
|
||||||
|
|
||||||
|
mLogView = findViewById(R.id.logview);
|
||||||
|
mLogView.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
mLogView.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,103 @@
|
|||||||
|
package cc.winboll.studio.libappbase.winboll;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
|
* @Date 2025/03/25 04:29:19
|
||||||
|
*/
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.app.Application;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
|
import cc.winboll.studio.libappbase.utils.ToastUtils;
|
||||||
|
|
||||||
|
public class MyActivityLifecycleCallbacks implements Application.ActivityLifecycleCallbacks {
|
||||||
|
|
||||||
|
public static final String TAG = "MyActivityLifecycleCallbacks";
|
||||||
|
|
||||||
|
WinBollActivityManager mWinBollActivityManager;
|
||||||
|
|
||||||
|
public String mInfo = "";
|
||||||
|
|
||||||
|
public MyActivityLifecycleCallbacks(WinBollActivityManager winBollActivityManager) {
|
||||||
|
mWinBollActivityManager = winBollActivityManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
void createActivityeInfo(Activity activity) {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
Intent receivedIntent = activity.getIntent();
|
||||||
|
sb.append("\nCallingActivity : \n");
|
||||||
|
if (activity.getCallingActivity() != null) {
|
||||||
|
sb.append(activity.getCallingActivity().getPackageName());
|
||||||
|
}
|
||||||
|
sb.append("\nReceived Intent Package : \n");
|
||||||
|
sb.append(receivedIntent.getPackage());
|
||||||
|
|
||||||
|
Bundle extras = receivedIntent.getExtras();
|
||||||
|
if (extras != null) {
|
||||||
|
for (String key : extras.keySet()) {
|
||||||
|
sb.append("\nIntentInfo");
|
||||||
|
sb.append("\n键: ");
|
||||||
|
sb.append(key);
|
||||||
|
sb.append(", 值: ");
|
||||||
|
sb.append(extras.get(key));
|
||||||
|
//Log.d("IntentInfo", "键: " + key + ", 值: " + extras.get(key));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mInfo = sb.toString();
|
||||||
|
//Log.d("IntentInfo", "发送Intent的应用包名: " + senderPackage);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void showActivityeInfo() {
|
||||||
|
ToastUtils.show("ActivityeInfo : " + mInfo);
|
||||||
|
LogUtils.d(TAG, "ActivityeInfo : " + mInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
|
||||||
|
// 在这里可以做一些初始化相关的操作,例如记录Activity的创建时间等
|
||||||
|
//System.out.println(activity.getLocalClassName() + " was created");
|
||||||
|
LogUtils.d(TAG, activity.getLocalClassName() + " was created");
|
||||||
|
createActivityeInfo(activity);
|
||||||
|
mWinBollActivityManager.add((IWinBollActivity)activity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onActivityStarted(Activity activity) {
|
||||||
|
//System.out.println(activity.getLocalClassName() + " was started");
|
||||||
|
LogUtils.d(TAG, activity.getLocalClassName() + " was started");
|
||||||
|
//createActivityeInfo(activity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onActivityResumed(Activity activity) {
|
||||||
|
//System.out.println(activity.getLocalClassName() + " was resumed");
|
||||||
|
LogUtils.d(TAG, activity.getLocalClassName() + " was resumed");
|
||||||
|
//createActivityeInfo(activity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onActivityPaused(Activity activity) {
|
||||||
|
//System.out.println(activity.getLocalClassName() + " was paused");
|
||||||
|
LogUtils.d(TAG, activity.getLocalClassName() + " was paused");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onActivityStopped(Activity activity) {
|
||||||
|
//System.out.println(activity.getLocalClassName() + " was stopped");
|
||||||
|
LogUtils.d(TAG, activity.getLocalClassName() + " was stopped");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
|
||||||
|
// 可以在这里添加保存状态的自定义逻辑
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onActivityDestroyed(Activity activity) {
|
||||||
|
//System.out.println(activity.getLocalClassName() + " was destroyed");
|
||||||
|
LogUtils.d(TAG, activity.getLocalClassName() + " was destroyed");
|
||||||
|
mWinBollActivityManager.registeRemove((IWinBollActivity)activity);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,318 @@
|
|||||||
|
package cc.winboll.studio.libappbase.winboll;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
|
* @Date 2025/03/24 08:25:43
|
||||||
|
* @Describe 应用活动窗口管理器
|
||||||
|
* 参考 :
|
||||||
|
* android 类似微信小程序多任务窗口 及 设置 TaskDescription 修改 icon 和 label
|
||||||
|
* https://blog.csdn.net/qq_29364417/article/details/109379915?app_version=6.4.2&code=app_1562916241&csdn_share_tail=%7B%22type%22%3A%22blog%22%2C%22rType%22%3A%22article%22%2C%22rId%22%3A%22109379915%22%2C%22source%22%3A%22weixin_38986226%22%7D&uLinkId=usr1mkqgl919blen&utm_source=app
|
||||||
|
*/
|
||||||
|
import android.app.ActivityManager;
|
||||||
|
import android.app.TaskStackBuilder;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class WinBollActivityManager {
|
||||||
|
|
||||||
|
public static final String TAG = "WinBollActivityManager";
|
||||||
|
public static final String EXTRA_TAG = "EXTRA_TAG";
|
||||||
|
|
||||||
|
public static enum WinBollUI_TYPE {
|
||||||
|
Aplication, // 退出应用后,保持最近任务栏任务记录主窗口
|
||||||
|
Service // 退出应用后,清理所有最近任务栏任务记录窗口
|
||||||
|
};
|
||||||
|
|
||||||
|
// 应用类型标志
|
||||||
|
volatile static WinBollUI_TYPE _mWinBollUI_TYPE = WinBollUI_TYPE.Service;
|
||||||
|
|
||||||
|
Context mContext;
|
||||||
|
MyActivityLifecycleCallbacks mMyActivityLifecycleCallbacks;
|
||||||
|
static WinBollActivityManager _mWinBollActivityManager;
|
||||||
|
static Map<String, IWinBollActivity> _mapIWinBollList;
|
||||||
|
IWinBollActivity firstIWinBollActivity;
|
||||||
|
|
||||||
|
public WinBollActivityManager(Context context) {
|
||||||
|
mContext = context;
|
||||||
|
LogUtils.d(TAG, "WinBollActivityManager()");
|
||||||
|
_mapIWinBollList = new HashMap<String, IWinBollActivity>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static synchronized WinBollActivityManager getInstance(Context context) {
|
||||||
|
LogUtils.d(TAG, "getInstance");
|
||||||
|
if (_mWinBollActivityManager == null) {
|
||||||
|
LogUtils.d(TAG, "_mWinBollActivityManager == null");
|
||||||
|
_mWinBollActivityManager = new WinBollActivityManager(context);
|
||||||
|
}
|
||||||
|
return _mWinBollActivityManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// 设置 WinBoll 应用 UI 类型
|
||||||
|
//
|
||||||
|
public synchronized static void setWinBollUI_TYPE(WinBollUI_TYPE mWinBollUI_TYPE) {
|
||||||
|
_mWinBollUI_TYPE = mWinBollUI_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// 获取 WinBoll 应用 UI 类型
|
||||||
|
//
|
||||||
|
public synchronized static WinBollUI_TYPE getWinBollUI_TYPE() {
|
||||||
|
return _mWinBollUI_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// 把Activity添加到管理中
|
||||||
|
//
|
||||||
|
public <T extends IWinBollActivity> void add(T iWinBoll) {
|
||||||
|
if (isActive(iWinBoll.getTag())) {
|
||||||
|
LogUtils.d(TAG, String.format("add(...) %s is active.", iWinBoll.getTag()));
|
||||||
|
} else {
|
||||||
|
// 设置起始活动窗口,以便最后退出时提问
|
||||||
|
if (firstIWinBollActivity == null && _mapIWinBollList.size() == 0) {
|
||||||
|
firstIWinBollActivity = iWinBoll;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加到活动窗口列表
|
||||||
|
_mapIWinBollList.put(iWinBoll.getTag(), iWinBoll);
|
||||||
|
LogUtils.d(TAG, String.format("Add activity : %s\n_mapActivityList.size() : %d", iWinBoll.getTag(), _mapIWinBollList.size()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// activity: 为 null 时,
|
||||||
|
// intent.putExtra 函数 EXTRA_TAG 参数为 tag
|
||||||
|
// activity: 不为 null 时,
|
||||||
|
// intent.putExtra 函数 "tag" 参数为 activity.getTag()
|
||||||
|
//
|
||||||
|
public <T extends IWinBollActivity> void startWinBollActivity(Context context, Class<T> clazz) {
|
||||||
|
try {
|
||||||
|
// 如果窗口已存在就重启窗口
|
||||||
|
String tag = clazz.newInstance().getTag();
|
||||||
|
if (isActive(tag)) {
|
||||||
|
resumeActivity(context, tag);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新建一个任务窗口
|
||||||
|
Intent intent = new Intent(context, clazz);
|
||||||
|
//打开多任务窗口 flags
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
intent.putExtra(EXTRA_TAG, tag);
|
||||||
|
mContext.startActivity(intent);
|
||||||
|
} catch (InstantiationException | IllegalAccessException e) {
|
||||||
|
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public <T extends IWinBollActivity> void startWinBollActivity(Context context, Intent intent, Class<T> clazz) {
|
||||||
|
try {
|
||||||
|
// 如果窗口已存在就重启窗口
|
||||||
|
String tag = clazz.newInstance().getTag();
|
||||||
|
if (isActive(tag)) {
|
||||||
|
resumeActivity(context, tag);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新建一个任务窗口
|
||||||
|
//Intent intent = new Intent(context, clazz);
|
||||||
|
//打开多任务窗口 flags
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
intent.putExtra(EXTRA_TAG, tag);
|
||||||
|
mContext.startActivity(intent);
|
||||||
|
} catch (InstantiationException | IllegalAccessException e) {
|
||||||
|
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isFirstIWinBollActivity(IWinBollActivity iWinBollActivity) {
|
||||||
|
return firstIWinBollActivity != null && firstIWinBollActivity == iWinBollActivity;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// 判断 tag绑定的 MyActivity是否存在
|
||||||
|
//
|
||||||
|
public boolean isActive(String tag) {
|
||||||
|
//printAvtivityListInfo();
|
||||||
|
IWinBollActivity iWinBoll = getIWinBoll(tag);
|
||||||
|
if (iWinBoll != null) {
|
||||||
|
LogUtils.d(TAG, "isActive(...) activity != null tag " + tag);
|
||||||
|
//ToastUtils.show("activity != null tag " + tag);
|
||||||
|
//判断是否为 BaseActivity,如果已经销毁,则移除
|
||||||
|
if (iWinBoll.getActivity().isFinishing() || iWinBoll.getActivity().isDestroyed()) {
|
||||||
|
_mapIWinBollList.remove(iWinBoll.getTag());
|
||||||
|
//_mWinBollActivityList.remove(activity);
|
||||||
|
LogUtils.d(TAG, String.format("isActive(...) remove activity.\ntag : %s", tag));
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
LogUtils.d(TAG, String.format("isActive(...) activity is exist.\ntag : %s", tag));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
LogUtils.d(TAG, String.format("isActive(...) activity == null\ntag : %s", tag));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static IWinBollActivity getIWinBoll(String tag) {
|
||||||
|
return _mapIWinBollList.get(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// 找到tag 绑定的 BaseActivity ,通过 getTaskId() 移动到前台
|
||||||
|
//
|
||||||
|
public <T extends IWinBollActivity> void resumeActivity(Context context, String tag) {
|
||||||
|
LogUtils.d(TAG, "resumeActivty");
|
||||||
|
T iWinBoll = (T)getIWinBoll(tag);
|
||||||
|
//LogUtils.d(TAG, "activity " + activity.getTag());
|
||||||
|
if (iWinBoll != null && !iWinBoll.getActivity().isFinishing() && !iWinBoll.getActivity().isDestroyed()) {
|
||||||
|
resumeActivity(context, iWinBoll);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// 找到tag 绑定的 BaseActivity ,通过 getTaskId() 移动到前台
|
||||||
|
//
|
||||||
|
public <T extends IWinBollActivity> void resumeActivity(Context context, T iWinBoll) {
|
||||||
|
ActivityManager am = (ActivityManager) iWinBoll.getActivity().getSystemService(Context.ACTIVITY_SERVICE);
|
||||||
|
//返回启动它的根任务(home 或者 MainActivity)
|
||||||
|
Intent intent = new Intent(context, iWinBoll.getClass());
|
||||||
|
TaskStackBuilder stackBuilder = TaskStackBuilder.create(context);
|
||||||
|
stackBuilder.addNextIntentWithParentStack(intent);
|
||||||
|
stackBuilder.startActivities();
|
||||||
|
//moveTaskToFront(YourTaskId, 0);
|
||||||
|
LogUtils.d(TAG, "am.moveTaskToFront");
|
||||||
|
//ToastUtils.show("resumeActivity am.moveTaskToFront");
|
||||||
|
am.moveTaskToFront(iWinBoll.getActivity().getTaskId(), ActivityManager.MOVE_TASK_NO_USER_ACTION);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// 结束所有 Activity
|
||||||
|
//
|
||||||
|
public void finishAll() {
|
||||||
|
try {
|
||||||
|
for (String key : _mapIWinBollList.keySet()) {
|
||||||
|
//System.out.println("Key: " + key + ", Value: " + _mapActivityList.get(key));
|
||||||
|
IWinBollActivity iWinBoll = _mapIWinBollList.get(key);
|
||||||
|
//ToastUtils.show("finishAll() activity");
|
||||||
|
if (iWinBoll != null && !iWinBoll.getActivity().isFinishing() && !iWinBoll.getActivity().isDestroyed()) {
|
||||||
|
//ToastUtils.show("activity != null ...");
|
||||||
|
if (getWinBollUI_TYPE() == WinBollUI_TYPE.Service) {
|
||||||
|
// 结束窗口和最近任务栏, 建议前台服务类应用使用,可以方便用户再次调用 UI 操作。
|
||||||
|
iWinBoll.getActivity().finishAndRemoveTask();
|
||||||
|
//ToastUtils.show("finishAll() activity.finishAndRemoveTask();");
|
||||||
|
} else if (getWinBollUI_TYPE() == WinBollUI_TYPE.Aplication) {
|
||||||
|
// 结束窗口保留最近任务栏,建议前台服务类应用使用,可以保持应用的系统自觉性。
|
||||||
|
iWinBoll.getActivity().finish();
|
||||||
|
//ToastUtils.show("finishAll() activity.finish();");
|
||||||
|
} else {
|
||||||
|
LogUtils.d(TAG, "WinBollApplication.WinBollUI_TYPE error.");
|
||||||
|
//ToastUtils.show("WinBollApplication.WinBollUI_TYPE error.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// 结束指定Activity
|
||||||
|
//
|
||||||
|
public <T extends IWinBollActivity> void finish(T iWinBoll) {
|
||||||
|
try {
|
||||||
|
if (iWinBoll != null && !iWinBoll.getActivity().isFinishing() && !iWinBoll.getActivity().isDestroyed()) {
|
||||||
|
//根据tag 移除 MyActivity
|
||||||
|
//String tag= activity.getTag();
|
||||||
|
//_mWinBollActivityList.remove(tag);
|
||||||
|
//ToastUtils.show("remove");
|
||||||
|
//ToastUtils.show("_mWinBollActivityArrayMap.size() " + Integer.toString(_mWinBollActivityArrayMap.size()));
|
||||||
|
|
||||||
|
// 窗口回调规则:
|
||||||
|
// [] 当前窗口位置 >> 调度出的窗口位置
|
||||||
|
// ★:[0] 1 2 3 4 >> 1
|
||||||
|
// ★:0 1 [2] 3 4 >> 1
|
||||||
|
// ★:0 1 2 [3] 4 >> 2
|
||||||
|
// ★:0 1 2 3 [4] >> 3
|
||||||
|
// ★:[0] >> 直接关闭当前窗口
|
||||||
|
LogUtils.d(TAG, "finish no yet.");
|
||||||
|
IWinBollActivity preIWinBoll = getPreIWinBoll(iWinBoll);
|
||||||
|
iWinBoll.getActivity().finish();
|
||||||
|
if (preIWinBoll != null) {
|
||||||
|
resumeActivity(mContext, preIWinBoll);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// 获取窗口队列中的前一个窗口
|
||||||
|
//
|
||||||
|
IWinBollActivity getPreIWinBoll(IWinBollActivity iWinBoll) {
|
||||||
|
try {
|
||||||
|
boolean bingo = false;
|
||||||
|
IWinBollActivity preIWinBoll = null;
|
||||||
|
for (Map.Entry<String, IWinBollActivity> entity : _mapIWinBollList.entrySet()) {
|
||||||
|
if (entity.getKey().equals(iWinBoll.getTag())) {
|
||||||
|
bingo = true;
|
||||||
|
LogUtils.d(TAG, "bingo");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
preIWinBoll = entity.getValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bingo) {
|
||||||
|
return preIWinBoll;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// 从管理列表中移除管理项
|
||||||
|
//
|
||||||
|
public <T extends IWinBollActivity> boolean registeRemove(T activity) {
|
||||||
|
IWinBollActivity iWinBollTest = _mapIWinBollList.get(activity.getTag());
|
||||||
|
if (iWinBollTest != null) {
|
||||||
|
_mapIWinBollList.remove(activity.getTag());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// 打印管理列表项列表里的信息
|
||||||
|
//
|
||||||
|
public static void printIWinBollListInfo() {
|
||||||
|
//LogUtils.d(TAG, "printAvtivityListInfo");
|
||||||
|
if (!_mapIWinBollList.isEmpty()) {
|
||||||
|
StringBuilder sb = new StringBuilder("Map entries : " + Integer.toString(_mapIWinBollList.size()));
|
||||||
|
Iterator<Map.Entry<String, IWinBollActivity>> iterator = _mapIWinBollList.entrySet().iterator();
|
||||||
|
while (iterator.hasNext()) {
|
||||||
|
Map.Entry<String, IWinBollActivity> entry = iterator.next();
|
||||||
|
sb.append("\nKey: " + entry.getKey() + ", \nValue: " + entry.getValue().getTag());
|
||||||
|
//ToastUtils.show("\nKey: " + entry.getKey() + ", Value: " + entry.getValue().getTag());
|
||||||
|
}
|
||||||
|
sb.append("\nMap entries end.");
|
||||||
|
LogUtils.d(TAG, sb.toString());
|
||||||
|
} else {
|
||||||
|
LogUtils.d(TAG, "The map is empty.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
13
libappbase/src/main/res/drawable/bg_border_round.xml
Normal file
13
libappbase/src/main/res/drawable/bg_border_round.xml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<?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" />
|
||||||
|
<corners
|
||||||
|
android:bottomLeftRadius="6dip"
|
||||||
|
android:bottomRightRadius="6dip"
|
||||||
|
android:topLeftRadius="6dip"
|
||||||
|
android:topRightRadius="6dip" />
|
||||||
|
</shape>
|
||||||
@@ -10,8 +10,8 @@
|
|||||||
<shape android:shape="rectangle" >
|
<shape android:shape="rectangle" >
|
||||||
<gradient
|
<gradient
|
||||||
android:angle="270"
|
android:angle="270"
|
||||||
android:endColor="#0F000000"
|
android:endColor="@color/colorAccent"
|
||||||
android:startColor="#0F000000" />
|
android:startColor="@color/colorAccent" />
|
||||||
<corners
|
<corners
|
||||||
android:bottomLeftRadius="6dip"
|
android:bottomLeftRadius="6dip"
|
||||||
android:bottomRightRadius="6dip"
|
android:bottomRightRadius="6dip"
|
||||||
|
|||||||
41
libappbase/src/main/res/drawable/bg_toolbar_log.xml
Normal file
41
libappbase/src/main/res/drawable/bg_toolbar_log.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="@color/colorPrimary"
|
||||||
|
android:startColor="@color/colorPrimary" />
|
||||||
|
<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/colorPrimary"
|
||||||
|
android:startColor="@color/colorPrimary" />
|
||||||
|
<corners
|
||||||
|
android:bottomLeftRadius="6dip"
|
||||||
|
android:bottomRightRadius="6dip"
|
||||||
|
android:topLeftRadius="6dip"
|
||||||
|
android:topRightRadius="6dip" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
||||||
@@ -1,16 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:orientation="vertical"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="match_parent">
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<cc.winboll.studio.libappbase.LogView
|
<cc.winboll.studio.libappbase.LogView
|
||||||
android:orientation="horizontal"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_height="0dp"
|
android:id="@+id/logview"/>
|
||||||
android:layout_weight="1.0"
|
|
||||||
android:id="@+id/logview"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -5,18 +5,18 @@
|
|||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="#FFEEEEEE">
|
android:background="@drawable/bg_border_round">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="24dp"
|
android:layout_height="@dimen/button_height"
|
||||||
android:layout_marginLeft="5dp"
|
android:layout_marginLeft="5dp"
|
||||||
android:id="@+id/viewlogtagTextView1"/>
|
android:id="@+id/viewlogtagTextView1"/>
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="24dp"
|
android:layout_height="@dimen/button_height"
|
||||||
android:id="@+id/viewlogtagCheckBox1"/>
|
android:id="@+id/viewlogtagCheckBox1"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:background="@drawable/bg_shadow"
|
android:background="@drawable/bg_toolbar_log"
|
||||||
android:id="@+id/viewlogRelativeLayoutToolbar">
|
android:id="@+id/viewlogRelativeLayoutToolbar">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
@@ -72,27 +72,29 @@
|
|||||||
android:layout_below="@+id/viewlogRelativeLayoutToolbar"
|
android:layout_below="@+id/viewlogRelativeLayoutToolbar"
|
||||||
android:id="@+id/viewlogLinearLayout1"
|
android:id="@+id/viewlogLinearLayout1"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:background="#FFC0F4C2">
|
android:background="@drawable/bg_toolbar_log">
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="@dimen/button_height"
|
||||||
android:text="ALL"
|
android:text="ALL"
|
||||||
android:id="@+id/viewlogCheckBox1"/>
|
android:id="@+id/viewlogCheckBox1"
|
||||||
|
android:background="@drawable/bg_border_round"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:layout_marginRight="5dp"/>
|
||||||
|
|
||||||
<HorizontalScrollView
|
<HorizontalScrollView
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:background="@drawable/bg_border"
|
||||||
android:scrollbars="none"
|
android:scrollbars="none"
|
||||||
android:layout_weight="1.0"
|
android:padding="5dp"
|
||||||
android:background="#FF97F2E3">
|
android:layout_weight="1.0">
|
||||||
|
|
||||||
<cc.winboll.studio.libappbase.views.HorizontalListView
|
<cc.winboll.studio.libappbase.views.HorizontalListView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@drawable/view_border"
|
android:id="@+id/tags_listview"/>
|
||||||
android:id="@+id/tags_listview"
|
|
||||||
android:paddingLeft="10dp"/>
|
|
||||||
|
|
||||||
</HorizontalScrollView>
|
</HorizontalScrollView>
|
||||||
|
|
||||||
|
|||||||
9
libappbase/src/main/res/values/dimens.xml
Normal file
9
libappbase/src/main/res/values/dimens.xml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<!-- 定义一个名为text_size_normal的尺寸,值为16sp -->
|
||||||
|
<dimen name="text_size_normal">16sp</dimen>
|
||||||
|
<!-- 定义一个名为margin_small的尺寸,值为8dp -->
|
||||||
|
<dimen name="margin_small">8dp</dimen>
|
||||||
|
<!-- 定义一个名为image_width的尺寸,值为200dp -->
|
||||||
|
<dimen name="button_height">24dp</dimen>
|
||||||
|
</resources>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<style name="APPBaseTheme" parent="@android:style/Theme.Holo.Light.NoActionBar">
|
<style name="APPBaseTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||||
<item name="themeGlobalCrashActivity">@style/GlobalCrashActivityTheme</item>
|
<item name="themeGlobalCrashActivity">@style/GlobalCrashActivityTheme</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user