添加米盟广告
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Tue Dec 09 12:47:32 GMT 2025
|
#Tue Dec 09 13:15:55 GMT 2025
|
||||||
stageCount=0
|
stageCount=0
|
||||||
libraryProject=
|
libraryProject=
|
||||||
baseVersion=15.12
|
baseVersion=15.12
|
||||||
publishVersion=15.12.0
|
publishVersion=15.12.0
|
||||||
buildCount=9
|
buildCount=19
|
||||||
baseBetaVersion=15.12.1
|
baseBetaVersion=15.12.1
|
||||||
|
|||||||
@@ -62,6 +62,8 @@
|
|||||||
|
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
|
<activity android:name="cc.winboll.studio.timestamp.activities.SettingsActivity"/>
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
package cc.winboll.studio.timestamp;
|
package cc.winboll.studio.timestamp;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.Switch;
|
import android.widget.Switch;
|
||||||
@@ -9,10 +11,12 @@ import android.widget.TextView;
|
|||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
import cc.winboll.studio.libaes.views.ADsBannerView;
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
import cc.winboll.studio.libappbase.LogView;
|
import cc.winboll.studio.libappbase.LogView;
|
||||||
import cc.winboll.studio.timestamp.MainService;
|
import cc.winboll.studio.timestamp.MainService;
|
||||||
import cc.winboll.studio.timestamp.R;
|
import cc.winboll.studio.timestamp.R;
|
||||||
|
import cc.winboll.studio.timestamp.activities.SettingsActivity;
|
||||||
import cc.winboll.studio.timestamp.utils.AppConfigsUtil;
|
import cc.winboll.studio.timestamp.utils.AppConfigsUtil;
|
||||||
import cc.winboll.studio.timestamp.utils.ClipboardUtil;
|
import cc.winboll.studio.timestamp.utils.ClipboardUtil;
|
||||||
import cc.winboll.studio.timestamp.utils.TimeStampUtil;
|
import cc.winboll.studio.timestamp.utils.TimeStampUtil;
|
||||||
@@ -33,6 +37,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
LogView mLogView;
|
LogView mLogView;
|
||||||
Switch mswEnableMainService;
|
Switch mswEnableMainService;
|
||||||
|
ADsBannerView mADsBannerView;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -42,6 +47,8 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
Toolbar toolbar=(Toolbar)findViewById(R.id.toolbar);
|
Toolbar toolbar=(Toolbar)findViewById(R.id.toolbar);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
|
mADsBannerView = findViewById(R.id.adsbanner);
|
||||||
|
|
||||||
metTimeStampFormatString = findViewById(R.id.et_timestampformatstring);
|
metTimeStampFormatString = findViewById(R.id.et_timestampformatstring);
|
||||||
mtvTimeStampFormatString = findViewById(R.id.tv_timestampformatstring);
|
mtvTimeStampFormatString = findViewById(R.id.tv_timestampformatstring);
|
||||||
metTimeStampCopyFormatString = findViewById(R.id.et_timestampcopyformatstring);
|
metTimeStampCopyFormatString = findViewById(R.id.et_timestampcopyformatstring);
|
||||||
@@ -60,14 +67,23 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
//ToastUtils.show("onCreate");
|
//ToastUtils.show("onCreate");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
mLogView.start();
|
mLogView.start();
|
||||||
|
if (mADsBannerView != null) {
|
||||||
|
mADsBannerView.resumeADs(MainActivity.this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
if (mADsBannerView != null) {
|
||||||
|
mADsBannerView.releaseAdResources();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 1. 反射核心方法:强制显示菜单图标
|
// 1. 反射核心方法:强制显示菜单图标
|
||||||
private void forceShowMenuIcons(Menu menu) {
|
private void forceShowMenuIcons(Menu menu) {
|
||||||
if (menu == null) {
|
if (menu == null) {
|
||||||
@@ -105,6 +121,19 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
return super.onMenuOpened(featureId, menu);
|
return super.onMenuOpened(featureId, menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
if (item.getItemId() == R.id.item_settings) {
|
||||||
|
Intent intent = new Intent(this, SettingsActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
} else {
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void onSetMainServiceStatus(View view) {
|
public void onSetMainServiceStatus(View view) {
|
||||||
MainService.setMainServiceStatus(this, mswEnableMainService.isChecked());
|
MainService.setMainServiceStatus(this, mswEnableMainService.isChecked());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package cc.winboll.studio.timestamp.activities;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
|
import cc.winboll.studio.timestamp.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ZhanGSKen&豆包大模型<zhangsken@qq.com>
|
||||||
|
* @Date 2025/12/09 20:50
|
||||||
|
* @Describe SettingActivity
|
||||||
|
*/
|
||||||
|
public class SettingsActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
public static final String TAG = "SettingsActivity";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_settings);
|
||||||
|
Toolbar toolbar=(Toolbar)findViewById(R.id.toolbar);
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
// 显示后退按钮
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
getSupportActionBar().setSubtitle(TAG);
|
||||||
|
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
LogUtils.d(TAG, "【导航栏】点击返回");
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2,8 +2,8 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -171,10 +171,22 @@
|
|||||||
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
<cc.winboll.studio.libappbase.LogView
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="200dp"
|
android:layout_height="200dp">
|
||||||
android:id="@+id/logview"/>
|
|
||||||
|
<cc.winboll.studio.libappbase.LogView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:id="@+id/logview"/>
|
||||||
|
|
||||||
|
<cc.winboll.studio.libaes.views.ADsBannerView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:id="@+id/adsbanner"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
36
timestamp/src/main/res/layout/activity_settings.xml
Normal file
36
timestamp/src/main/res/layout/activity_settings.xml
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
<?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">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>
|
||||||
|
|
||||||
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1.0">
|
||||||
|
|
||||||
|
<cc.winboll.studio.libaes.views.ADsControlView
|
||||||
|
android:id="@+id/ads_control_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
Reference in New Issue
Block a user