Compare commits
No commits in common. "7b1838ff8eb667e41990fc6a4aee44be34bb1351" and "fa79c3f807c8d7018c01ab09b5faeda2b2d7d4cd" have entirely different histories.
7b1838ff8e
...
fa79c3f807
@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Tue Jun 10 21:14:15 GMT 2025
|
#Tue Jun 10 19:49:43 GMT 2025
|
||||||
stageCount=0
|
stageCount=0
|
||||||
libraryProject=
|
libraryProject=
|
||||||
baseVersion=15.0
|
baseVersion=15.0
|
||||||
publishVersion=15.0.0
|
publishVersion=15.0.0
|
||||||
buildCount=34
|
buildCount=19
|
||||||
baseBetaVersion=15.0.1
|
baseBetaVersion=15.0.1
|
||||||
|
@ -0,0 +1,22 @@
|
|||||||
|
package cc.winboll.studio.webpagesources;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ZhanGSKen<zhangsken@188.com>
|
||||||
|
* @Date 2025/06/10 15:04
|
||||||
|
* @Describe 外部数据接口主窗口类
|
||||||
|
*/
|
||||||
|
public abstract class Main2Activity extends MainActivity {
|
||||||
|
|
||||||
|
// public static final String TAG = "Main2Activity";
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
// super.onCreate(savedInstanceState);
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
}
|
@ -24,7 +24,6 @@ import cc.winboll.studio.webpagesources.R;
|
|||||||
import cc.winboll.studio.webpagesources.activities.AboutActivity;
|
import cc.winboll.studio.webpagesources.activities.AboutActivity;
|
||||||
import cc.winboll.studio.webpagesources.fragment.SourcesFragment;
|
import cc.winboll.studio.webpagesources.fragment.SourcesFragment;
|
||||||
import cc.winboll.studio.webpagesources.fragment.WebFragment;
|
import cc.winboll.studio.webpagesources.fragment.WebFragment;
|
||||||
import cc.winboll.studio.webpagesources.view.StatusBarView;
|
|
||||||
|
|
||||||
public class MainActivity extends AppCompatActivity implements IWinBoLLActivity {
|
public class MainActivity extends AppCompatActivity implements IWinBoLLActivity {
|
||||||
|
|
||||||
@ -35,8 +34,7 @@ public class MainActivity extends AppCompatActivity implements IWinBoLLActivity
|
|||||||
|
|
||||||
public static final String MSG_UPDATE_URL = "MSG_UPDATE_URL";
|
public static final String MSG_UPDATE_URL = "MSG_UPDATE_URL";
|
||||||
|
|
||||||
static MainActivity _MainActivity;
|
LogView mLogView;
|
||||||
StatusBarView mStatusBarView;
|
|
||||||
WebFragment mWebFragment;
|
WebFragment mWebFragment;
|
||||||
SourcesFragment mSourcesFragment;
|
SourcesFragment mSourcesFragment;
|
||||||
static boolean _mIsLoadedHomePage;
|
static boolean _mIsLoadedHomePage;
|
||||||
@ -57,6 +55,8 @@ public class MainActivity extends AppCompatActivity implements IWinBoLLActivity
|
|||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
|
mLogView = findViewById(R.id.logview);
|
||||||
|
mLogView.start();
|
||||||
|
|
||||||
FragmentTransaction ft = ((FragmentManager)getSupportFragmentManager()).beginTransaction();
|
FragmentTransaction ft = ((FragmentManager)getSupportFragmentManager()).beginTransaction();
|
||||||
mSourcesFragment = new SourcesFragment();
|
mSourcesFragment = new SourcesFragment();
|
||||||
@ -70,10 +70,6 @@ public class MainActivity extends AppCompatActivity implements IWinBoLLActivity
|
|||||||
|
|
||||||
// 处理 onCreate 时的 Intent
|
// 处理 onCreate 时的 Intent
|
||||||
handleIntent(getIntent());
|
handleIntent(getIntent());
|
||||||
|
|
||||||
mStatusBarView = findViewById(R.id.activitymainStatusBarView1);
|
|
||||||
_MainActivity = this;
|
|
||||||
postStatusBarMessage("主窗口加载完成。");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -102,12 +98,6 @@ public class MainActivity extends AppCompatActivity implements IWinBoLLActivity
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void postStatusBarMessage(String msg) {
|
|
||||||
if(_MainActivity != null) {
|
|
||||||
_MainActivity.mStatusBarView.postMessage(msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostCreate(Bundle savedInstanceState) {
|
protected void onPostCreate(Bundle savedInstanceState) {
|
||||||
super.onPostCreate(savedInstanceState);
|
super.onPostCreate(savedInstanceState);
|
||||||
@ -151,10 +141,6 @@ public class MainActivity extends AppCompatActivity implements IWinBoLLActivity
|
|||||||
mSourcesFragment.shareHtml();
|
mSourcesFragment.shareHtml();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case R.id.item_log : {
|
|
||||||
GlobalApplication.getWinBoLLActivityManager().startLogActivity(this);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case R.id.item_about : {
|
case R.id.item_about : {
|
||||||
GlobalApplication.getWinBoLLActivityManager().startWinBoLLActivity(this, AboutActivity.class);
|
GlobalApplication.getWinBoLLActivityManager().startWinBoLLActivity(this, AboutActivity.class);
|
||||||
break;
|
break;
|
||||||
@ -166,6 +152,7 @@ public class MainActivity extends AppCompatActivity implements IWinBoLLActivity
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
mLogView.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -196,7 +196,6 @@ public class BaseWebView extends WebView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadUrl(String url) {
|
public void loadUrl(String url) {
|
||||||
MainActivity.postStatusBarMessage(String.format("正在加载:%s", url));
|
|
||||||
Pattern patternHttp = Pattern.compile("(?i)^http[s]{0,1}://", Pattern.CASE_INSENSITIVE);
|
Pattern patternHttp = Pattern.compile("(?i)^http[s]{0,1}://", Pattern.CASE_INSENSITIVE);
|
||||||
Matcher matcherHttp = patternHttp.matcher(url);
|
Matcher matcherHttp = patternHttp.matcher(url);
|
||||||
if (matcherHttp.matches()) {
|
if (matcherHttp.matches()) {
|
||||||
@ -304,7 +303,6 @@ public class BaseWebView extends WebView {
|
|||||||
mIOnPageFinished.onPageFinished(url);
|
mIOnPageFinished.onPageFinished(url);
|
||||||
LogUtils.d(TAG, "Page load finished : " + url);
|
LogUtils.d(TAG, "Page load finished : " + url);
|
||||||
_mszLastUrl = url;
|
_mszLastUrl = url;
|
||||||
MainActivity.postStatusBarMessage(String.format("加载完成:%s", url));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,79 +0,0 @@
|
|||||||
package cc.winboll.studio.webpagesources.view;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.util.AttributeSet;
|
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import android.widget.TextView;
|
|
||||||
import cc.winboll.studio.webpagesources.R;
|
|
||||||
import android.os.Handler;
|
|
||||||
import android.os.Message;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author ZhanGSKen<zhangsken@188.com>
|
|
||||||
* @Date 2025/06/11 04:11
|
|
||||||
* @Describe 网页状态信息栏
|
|
||||||
*/
|
|
||||||
public class StatusBarView extends LinearLayout {
|
|
||||||
|
|
||||||
public static final String TAG = "StatusBar";
|
|
||||||
|
|
||||||
public static final int MESSAGE_NEWS = 0;
|
|
||||||
|
|
||||||
Context mContext;
|
|
||||||
TextView mtvMessage;
|
|
||||||
|
|
||||||
public StatusBarView(Context context) {
|
|
||||||
super(context);
|
|
||||||
initView(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
public StatusBarView(Context context, AttributeSet attrs) {
|
|
||||||
super(context, attrs);
|
|
||||||
initView(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
public StatusBarView(Context context, AttributeSet attrs, int defStyleAttr) {
|
|
||||||
super(context, attrs, defStyleAttr);
|
|
||||||
initView(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
public StatusBarView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
|
||||||
super(context, attrs, defStyleAttr, defStyleRes);
|
|
||||||
initView(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
void initView(Context context) {
|
|
||||||
mContext = context;
|
|
||||||
View viewMain = inflate(context, R.layout.view_statusbar, null);
|
|
||||||
mtvMessage = viewMain.findViewById(R.id.tv_message);
|
|
||||||
|
|
||||||
// 设置布局参数为MATCH_PARENT,并确保最大尺寸显示
|
|
||||||
ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(
|
|
||||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
|
||||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
|
||||||
);
|
|
||||||
addView(viewMain, params);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void postMessage(String msg) {
|
|
||||||
if (mContext != null) {
|
|
||||||
Message message = new Message();
|
|
||||||
message.what = MESSAGE_NEWS;
|
|
||||||
message.obj = msg;
|
|
||||||
mHandler.dispatchMessage(message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Handler mHandler = new Handler(){
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void handleMessage(Message msg) {
|
|
||||||
if (msg.what == MESSAGE_NEWS) {
|
|
||||||
mtvMessage.setText((String)msg.obj);
|
|
||||||
}
|
|
||||||
//super.handleMessage(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
}
|
|
@ -6,35 +6,42 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<com.google.android.material.appbar.AppBarLayout
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
|
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
|
||||||
|
|
||||||
<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/toolbar"/>
|
android:id="@+id/toolbar"/>
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1.0">
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:id="@+id/activitymainFrameLayout1"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="300dp">
|
||||||
android:layout_weight="1.0">
|
|
||||||
|
|
||||||
<FrameLayout
|
<cc.winboll.studio.libappbase.LogView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:id="@+id/activitymainFrameLayout1"/>
|
android:id="@+id/logview"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<cc.winboll.studio.webpagesources.view.StatusBarView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="36dp"
|
|
||||||
android:id="@+id/activitymainStatusBarView1"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
<?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:background="#FFCCCCCC">
|
|
||||||
|
|
||||||
<ScrollView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="Text"
|
|
||||||
android:id="@+id/tv_message"
|
|
||||||
android:textIsSelectable="true"/>
|
|
||||||
|
|
||||||
</ScrollView>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
@ -17,11 +17,6 @@
|
|||||||
android:title="Editor"
|
android:title="Editor"
|
||||||
android:icon="@drawable/ic_file_edit_outline"
|
android:icon="@drawable/ic_file_edit_outline"
|
||||||
app:showAsAction="ifRoom"/>
|
app:showAsAction="ifRoom"/>
|
||||||
<item
|
|
||||||
android:id="@+id/item_log"
|
|
||||||
android:title="Log"
|
|
||||||
android:icon="@drawable/ic_winboll"
|
|
||||||
app:showAsAction="ifRoom"/>
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/item_about"
|
android:id="@+id/item_about"
|
||||||
android:title="About"
|
android:title="About"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user