应用介绍页测试完成
This commit is contained in:
parent
17fa805a7f
commit
506d2619f2
@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Mon Jan 20 04:46:17 GMT 2025
|
#Mon Jan 20 06:50:11 GMT 2025
|
||||||
stageCount=2
|
stageCount=2
|
||||||
libraryProject=libapputils
|
libraryProject=libapputils
|
||||||
baseVersion=9.2
|
baseVersion=9.2
|
||||||
publishVersion=9.2.1
|
publishVersion=9.2.1
|
||||||
buildCount=15
|
buildCount=25
|
||||||
baseBetaVersion=9.2.2
|
baseBetaVersion=9.2.2
|
||||||
|
@ -14,6 +14,8 @@ import cc.winboll.studio.libapputils.app.WinBollActivityManager;
|
|||||||
import cc.winboll.studio.libapputils.log.LogActivity;
|
import cc.winboll.studio.libapputils.log.LogActivity;
|
||||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||||
import com.hjq.toast.ToastUtils;
|
import com.hjq.toast.ToastUtils;
|
||||||
|
import cc.winboll.studio.libapputils.activities.AboutActivity;
|
||||||
|
import cc.winboll.studio.libapputils.bean.APPInfo;
|
||||||
|
|
||||||
final public class MainActivity extends WinBollActivity {
|
final public class MainActivity extends WinBollActivity {
|
||||||
|
|
||||||
@ -161,6 +163,15 @@ final public class MainActivity extends WinBollActivity {
|
|||||||
}
|
}
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onTestAboutActivity(View view) {
|
||||||
|
Intent intent = new Intent(this, AboutActivity.class);
|
||||||
|
APPInfo appInfo = new APPInfo();
|
||||||
|
appInfo.setAppIcon(cc.winboll.studio.libapputils.R.drawable.ic_winboll);
|
||||||
|
appInfo.setAppName("Test APP");
|
||||||
|
intent.putExtra(AboutActivity.EXTRA_APPINFO, appInfo);
|
||||||
|
WinBollActivityManager.getInstance(this).startWinBollActivity(this, intent, AboutActivity.class);
|
||||||
|
}
|
||||||
|
|
||||||
public void onTestJavascriptHtmlActivity(View view) {
|
public void onTestJavascriptHtmlActivity(View view) {
|
||||||
Intent intent = new Intent(this, AssetsHtmlActivity.class);
|
Intent intent = new Intent(this, AssetsHtmlActivity.class);
|
||||||
|
@ -54,6 +54,21 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="right">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:text="Test AboutActivity"
|
||||||
|
android:onClick="onTestAboutActivity"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Mon Jan 20 04:46:17 GMT 2025
|
#Mon Jan 20 06:50:11 GMT 2025
|
||||||
stageCount=2
|
stageCount=2
|
||||||
libraryProject=libapputils
|
libraryProject=libapputils
|
||||||
baseVersion=9.2
|
baseVersion=9.2
|
||||||
publishVersion=9.2.1
|
publishVersion=9.2.1
|
||||||
buildCount=15
|
buildCount=25
|
||||||
baseBetaVersion=9.2.2
|
baseBetaVersion=9.2.2
|
||||||
|
@ -1,25 +1,31 @@
|
|||||||
package cc.winboll.studio.libapputils.activities;
|
package cc.winboll.studio.libapputils.activities;
|
||||||
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
import androidx.appcompat.widget.Toolbar;
|
|
||||||
import cc.winboll.studio.libapputils.R;
|
|
||||||
import cc.winboll.studio.libapputils.app.WinBollActivity;
|
|
||||||
import cc.winboll.studio.libapputils.app.WinBollActivityManager;
|
|
||||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author ZhanGSKen@QQ.COM
|
* @Author ZhanGSKen@QQ.COM
|
||||||
* @Date 2024/07/14 13:20:33
|
* @Date 2024/07/14 13:20:33
|
||||||
* @Describe AboutFragment Test
|
* @Describe 应用介绍页
|
||||||
*/
|
*/
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
import cc.winboll.studio.libapputils.R;
|
||||||
|
import cc.winboll.studio.libapputils.app.WinBollActivity;
|
||||||
|
import cc.winboll.studio.libapputils.app.WinBollActivityManager;
|
||||||
|
import cc.winboll.studio.libapputils.bean.APPInfo;
|
||||||
|
import cc.winboll.studio.libapputils.view.AboutView;
|
||||||
|
import com.hjq.toast.ToastUtils;
|
||||||
|
|
||||||
final public class AboutActivity extends WinBollActivity {
|
final public class AboutActivity extends WinBollActivity {
|
||||||
|
|
||||||
public static final String TAG = "AboutActivity";
|
public static final String TAG = "AboutActivity";
|
||||||
|
public static final String EXTRA_APPINFO = "EXTRA_APPINFO";
|
||||||
|
|
||||||
|
|
||||||
|
APPInfo mAPPInfo;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTag() {
|
public String getTag() {
|
||||||
return TAG;
|
return TAG;
|
||||||
@ -34,21 +40,19 @@ final public class AboutActivity extends WinBollActivity {
|
|||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_about);
|
setContentView(R.layout.activity_about);
|
||||||
|
Intent intent = getIntent();
|
||||||
/*AboutView aboutView = findViewById(R.id.activityaboutAboutView1);
|
if (intent != null) {
|
||||||
aboutView.setOnRequestDevUserInfoAutofillListener(new AboutView.OnRequestDevUserInfoAutofillListener(){
|
mAPPInfo = (APPInfo)intent.getSerializableExtra(EXTRA_APPINFO);
|
||||||
|
}
|
||||||
@Override
|
if (mAPPInfo == null) {
|
||||||
public void requestAutofill(EditText etDevUserName, EditText etDevUserPassword) {
|
mAPPInfo = new APPInfo();
|
||||||
AutofillManager autofillManager = (AutofillManager) getSystemService(AutofillManager.class);
|
}
|
||||||
if (autofillManager!= null) {
|
|
||||||
//ToastUtils.show("0");
|
AboutView aboutView = new AboutView(this, mAPPInfo);
|
||||||
autofillManager.requestAutofill(findViewById(R.id.usernameEditText));
|
LinearLayout llMain = findViewById(R.id.activityaboutLinearLayout1);
|
||||||
autofillManager.requestAutofill(findViewById(R.id.passwordEditText));
|
llMain.addView(aboutView);
|
||||||
}
|
|
||||||
}
|
ToastUtils.show(TAG);
|
||||||
});*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -79,9 +83,8 @@ final public class AboutActivity extends WinBollActivity {
|
|||||||
if (item.getItemId() == R.id.item_help) {
|
if (item.getItemId() == R.id.item_help) {
|
||||||
WinBollActivityManager.getInstance(this).startWinBollActivity(this, AssetsHtmlActivity.class);
|
WinBollActivityManager.getInstance(this).startWinBollActivity(this, AssetsHtmlActivity.class);
|
||||||
}
|
}
|
||||||
// else if (item.getItemId() == android.R.id.home) {
|
|
||||||
// WinBollActivityManager.getInstance(this).finish(this);
|
|
||||||
// }
|
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,107 @@
|
|||||||
|
package cc.winboll.studio.libapputils.bean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ZhanGSKen@QQ.COM
|
||||||
|
* @Date 2025/01/20 14:19:02
|
||||||
|
* @Describe 应用信息类
|
||||||
|
*/
|
||||||
|
import cc.winboll.studio.libapputils.R;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public class APPInfo implements Serializable {
|
||||||
|
|
||||||
|
public static final String TAG = "APPInfo";
|
||||||
|
|
||||||
|
// 应用名称
|
||||||
|
String appName;
|
||||||
|
// 应用图标
|
||||||
|
int appIcon;
|
||||||
|
// 应用描述
|
||||||
|
String appDescription;
|
||||||
|
// 应用Git仓库地址
|
||||||
|
String appGitName;
|
||||||
|
// 应用主页
|
||||||
|
String appHomePage;
|
||||||
|
// 应用包名称
|
||||||
|
String appAPKName;
|
||||||
|
// 应用包存储文件夹名称
|
||||||
|
String appAPKFolderName;
|
||||||
|
|
||||||
|
public APPInfo(String appName, int appIcon, String appDescription, String appGitName, String appHomePage, String appAPKName, String appAPKFolderName) {
|
||||||
|
this.appName = appName;
|
||||||
|
this.appIcon = appIcon;
|
||||||
|
this.appDescription = appDescription;
|
||||||
|
this.appGitName = appGitName;
|
||||||
|
this.appHomePage = appHomePage;
|
||||||
|
this.appAPKName = appAPKName;
|
||||||
|
this.appAPKFolderName = appAPKFolderName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public APPInfo() {
|
||||||
|
this.appName = "WinBoll-APP";
|
||||||
|
this.appIcon = R.drawable.ic_launcher;
|
||||||
|
this.appDescription = "WinBoll APP";
|
||||||
|
this.appGitName = "APP";
|
||||||
|
this.appHomePage = "https://www.winboll.cc/studio/details.php?app=APP";
|
||||||
|
this.appAPKName = "APP";
|
||||||
|
this.appAPKFolderName = "APP";
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAppIcon(int appIcon) {
|
||||||
|
this.appIcon = appIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getAppIcon() {
|
||||||
|
return appIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAppDescription(String appDescription) {
|
||||||
|
this.appDescription = appDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAppDescription() {
|
||||||
|
return appDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAppAPKFolderName(String appAPKFolderName) {
|
||||||
|
this.appAPKFolderName = appAPKFolderName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAppAPKFolderName() {
|
||||||
|
return appAPKFolderName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAppName(String appName) {
|
||||||
|
this.appName = appName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAppName() {
|
||||||
|
return appName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAppGitName(String appGitName) {
|
||||||
|
this.appGitName = appGitName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAppGitName() {
|
||||||
|
return appGitName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAppHomePage(String appHomePage) {
|
||||||
|
this.appHomePage = appHomePage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAppHomePage() {
|
||||||
|
return appHomePage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAppAPKName(String appAPKName) {
|
||||||
|
this.appAPKName = appAPKName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAppAPKName() {
|
||||||
|
return appAPKName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -20,6 +20,7 @@ import cc.winboll.studio.libapputils.R;
|
|||||||
import cc.winboll.studio.libapputils.app.AppVersionUtils;
|
import cc.winboll.studio.libapputils.app.AppVersionUtils;
|
||||||
import cc.winboll.studio.libapputils.app.WinBollActivityManager;
|
import cc.winboll.studio.libapputils.app.WinBollActivityManager;
|
||||||
import cc.winboll.studio.libapputils.app.WinBollApplication;
|
import cc.winboll.studio.libapputils.app.WinBollApplication;
|
||||||
|
import cc.winboll.studio.libapputils.bean.APPInfo;
|
||||||
import cc.winboll.studio.libapputils.bean.DebugBean;
|
import cc.winboll.studio.libapputils.bean.DebugBean;
|
||||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||||
import cc.winboll.studio.libapputils.util.PrefUtils;
|
import cc.winboll.studio.libapputils.util.PrefUtils;
|
||||||
@ -41,6 +42,8 @@ public class AboutView extends LinearLayout {
|
|||||||
public static final int MSG_APPUPDATE_CHECKED = 0;
|
public static final int MSG_APPUPDATE_CHECKED = 0;
|
||||||
|
|
||||||
Context mContext;
|
Context mContext;
|
||||||
|
APPInfo mAPPInfo;
|
||||||
|
|
||||||
WinBollServiceStatusView mWinBollServiceStatusView;
|
WinBollServiceStatusView mWinBollServiceStatusView;
|
||||||
OnRequestDevUserInfoAutofillListener mOnRequestDevUserInfoAutofillListener;
|
OnRequestDevUserInfoAutofillListener mOnRequestDevUserInfoAutofillListener;
|
||||||
String mszAppName = "";
|
String mszAppName = "";
|
||||||
@ -59,23 +62,46 @@ public class AboutView extends LinearLayout {
|
|||||||
EditText metDevUserName;
|
EditText metDevUserName;
|
||||||
EditText metDevUserPassword;
|
EditText metDevUserPassword;
|
||||||
|
|
||||||
|
public AboutView(Context context, APPInfo appInfo) {
|
||||||
|
super(context);
|
||||||
|
setAPPInfo(appInfo);
|
||||||
|
initView(context);
|
||||||
|
}
|
||||||
|
|
||||||
public AboutView(Context context, AttributeSet attrs) {
|
public AboutView(Context context, AttributeSet attrs) {
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
initView(context, attrs);
|
initView(context, attrs);
|
||||||
}
|
}
|
||||||
|
|
||||||
void initView(Context context, AttributeSet attrs) {
|
public void setAPPInfo(APPInfo appInfo) {
|
||||||
mContext = context;
|
mAPPInfo = appInfo;
|
||||||
mszWinBollServerHost = WinBollApplication.isDebug() ? "http://10.8.0.13": "https://www.winboll.cc";
|
}
|
||||||
|
|
||||||
|
APPInfo createAppInfo(Context context, AttributeSet attrs) {
|
||||||
|
APPInfo appInfo = new APPInfo();
|
||||||
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.AboutView);
|
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.AboutView);
|
||||||
mszAppName = typedArray.getString(R.styleable.AboutView_app_name);
|
appInfo.setAppName(typedArray.getString(R.styleable.AboutView_app_name));
|
||||||
mszAppAPKFolderName = typedArray.getString(R.styleable.AboutView_app_apkfoldername);
|
appInfo.setAppAPKFolderName(typedArray.getString(R.styleable.AboutView_app_apkfoldername));
|
||||||
mszAppAPKName = typedArray.getString(R.styleable.AboutView_app_apkname);
|
appInfo.setAppAPKName(typedArray.getString(R.styleable.AboutView_app_apkname));
|
||||||
mszAppGitName = typedArray.getString(R.styleable.AboutView_app_gitname);
|
appInfo.setAppGitName(typedArray.getString(R.styleable.AboutView_app_gitname));
|
||||||
mszAppDescription = typedArray.getString(R.styleable.AboutView_appdescription);
|
appInfo.setAppDescription(typedArray.getString(R.styleable.AboutView_appdescription));
|
||||||
mnAppIcon = typedArray.getResourceId(R.styleable.AboutView_appicon, R.drawable.ic_winboll);
|
appInfo.setAppIcon(typedArray.getResourceId(R.styleable.AboutView_appicon, R.drawable.ic_winboll));
|
||||||
// 返回一个绑定资源结束的信号给资源
|
// 返回一个绑定资源结束的信号给资源
|
||||||
typedArray.recycle();
|
typedArray.recycle();
|
||||||
|
return appInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
void initView(Context context) {
|
||||||
|
mContext = context;
|
||||||
|
|
||||||
|
mszAppName = mAPPInfo.getAppName();
|
||||||
|
mszAppAPKFolderName = mAPPInfo.getAppAPKFolderName();
|
||||||
|
mszAppAPKName = mAPPInfo.getAppAPKName();
|
||||||
|
mszAppGitName = mAPPInfo.getAppGitName();
|
||||||
|
mszAppDescription = mAPPInfo.getAppDescription();
|
||||||
|
mnAppIcon = mAPPInfo.getAppIcon();
|
||||||
|
|
||||||
|
mszWinBollServerHost = WinBollApplication.isDebug() ? "http://10.8.0.13": "https://www.winboll.cc";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
mszAppVersionName = mContext.getPackageManager().getPackageInfo(mContext.getPackageName(), 0).versionName;
|
mszAppVersionName = mContext.getPackageManager().getPackageInfo(mContext.getPackageName(), 0).versionName;
|
||||||
@ -131,6 +157,11 @@ public class AboutView extends LinearLayout {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void initView(Context context, AttributeSet attrs) {
|
||||||
|
mAPPInfo = createAppInfo(context, attrs);
|
||||||
|
initView(context);
|
||||||
|
}
|
||||||
|
|
||||||
public static String subBetaSuffix(String input) {
|
public static String subBetaSuffix(String input) {
|
||||||
if (input.endsWith(".beta")) {
|
if (input.endsWith(".beta")) {
|
||||||
return input.substring(0, input.length() - ".beta".length());
|
return input.substring(0, input.length() - ".beta".length());
|
||||||
|
@ -1,25 +1,22 @@
|
|||||||
<?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:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<androidx.appcompat.widget.Toolbar
|
<androidx.appcompat.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/activityaboutToolbar1"/>
|
android:id="@+id/activityaboutToolbar1"/>
|
||||||
|
|
||||||
<cc.winboll.studio.libapputils.view.AboutView
|
<LinearLayout
|
||||||
app:app_name= "APP"
|
android:orientation="vertical"
|
||||||
app:app_apkfoldername="APP"
|
android:layout_width="match_parent"
|
||||||
app:app_apkname="APP"
|
android:layout_height="0dp"
|
||||||
app:app_gitname="APP"
|
android:layout_weight="1.0"
|
||||||
app:appdescription="WinBoll.CC 网站客户端。"
|
android:id="@+id/activityaboutLinearLayout1"/>
|
||||||
app:appicon="@drawable/ic_winboll"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:id="@+id/activityaboutAboutView1"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user