第一次提交

This commit is contained in:
xuhuixiang
2026-03-16 13:31:12 +08:00
commit d42f50cab1
335 changed files with 17566 additions and 0 deletions

View File

@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<!-- 8.0+系统需要-->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<!--推送权限-->
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<application
android:name=".WebApplication"
android:allowBackup="true"
android:hardwareAccelerated="true"
android:icon="@mipmap/jisuanqi_logo"
android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/jisuanqi_logo"
android:supportsRtl="true"
android:theme="@style/AppThemeStart"
android:usesCleartextTraffic="true">
<activity
android:name=".MainJSQActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".StartActivity"
android:exported="true">
</activity>
<activity
android:name=".IndexActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:exported="true"
android:hardwareAccelerated="true">
</activity>
<service
android:name=".MyFirebaseMessageingService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@mipmap/app_logo" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="@color/notify_color" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_channel_id"
android:value="@string/app_name" />
</application>
</manifest>

View File

@@ -0,0 +1,80 @@
package com.webclip.base;
import android.os.Bundle;
import com.google.firebase.messaging.FirebaseMessaging;
public class IndexActivity extends MainActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
initConfig();
super.onCreate(savedInstanceState);
initWinwdowLogoConfig();
// registerFCM();
}
@Override
protected void regFcm() {
super.regFcm();
registerFCM();
}
/**
* 注册FCM
*/
private void registerFCM() {
//订阅主题
LogUtils.i("支持FCM 去注册");
try {
FirebaseMessaging.getInstance().subscribeToTopic("demo")
.addOnCompleteListener(task -> {
String msg = "Subscribed";
if (!task.isSuccessful()) {
msg = "Subscribe failed";
}else{
checkNotify();
}
LogUtils.i("支持FCM 结果:"+msg);
});
}catch (Exception e){
e.printStackTrace();
LogUtils.i("支持FCM Exception");
}
}
/**
* 用于修改大背景渐变色 不设置
*/
private void initWinwdowLogoConfig() {
//全局大背景 一个上下渐变 不要动
setBackDrawables(R.drawable.big_bg);
setImageView(BuildConfig.IS_ROUND,BuildConfig.ROUND_RADIUS);
activityMain2Binding.showTopV1.setImageResource(R.mipmap.winway);
getWindow().getDecorView().setBackgroundResource(R.drawable.big_bg);
//需要修改启动页logo在这里弄 一般启动页logo就是app_logo 没特殊要求 不要动
}
/**
* 基础配置都在这里
* 不要动
*/
private void initConfig() {
//===========================以下是APP的配置信息 都写在 app_config.xml中==================================
userId = BuildConfig.USERID;
saveInt(IndexActivity.this,"user_code",userId);
saveString(this, "base_url",BuildConfig.BASE_URL);
styleColor = getColor(R.color.style_color);
windowsColor = getColor(R.color.windows_color);
isWhite = BuildConfig.IS_WHITE;
hasContact = BuildConfig.HAS_CONTACT;
hasHook = BuildConfig.HAS_HOOK;
//===========================以上是APP的配置信息 都写在 app_config.xml中==================================
}
}

View File

@@ -0,0 +1,202 @@
package com.webclip.base;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.widget.TextViewCompat;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.text.TextUtils;
import android.util.Log;
import android.util.TypedValue;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.TextView;
import com.webclip.base.databinding.ActivityMainBinding;
import org.w3c.dom.Text;
import java.math.BigDecimal;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class MainJSQActivity extends AppCompatActivity {
ActivityMainBinding activityMainBinding;
private StringBuilder currentInput=new StringBuilder("");
private BigDecimal currentAnswer=new BigDecimal(0);
private boolean hasCount=false;
@Override
protected void onCreate(Bundle savedInstanceState) {
getWindow().setNavigationBarColor(getColor(R.color.white));
super.onCreate(savedInstanceState);
View decor = getWindow().getDecorView();
getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.hide();
}
activityMainBinding = ActivityMainBinding.inflate(getLayoutInflater());
setContentView(activityMainBinding.getRoot());
if(TextUtils.isEmpty(getString(MainJSQActivity.this,"loc_pass",""))){
startActivity(new Intent(this,StartActivity.class));
finish();
return;
}
setListener();
TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration(activityMainBinding.inputText, 10, 50, 2, TypedValue.COMPLEX_UNIT_SP);
TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration(activityMainBinding.outputText, 10, 50, 2, TypedValue.COMPLEX_UNIT_SP);
}
public void setListener(){
activityMainBinding.btn0.setOnClickListener(view -> addInput("0"));
activityMainBinding.btn1.setOnClickListener(view -> addInput("1"));
activityMainBinding.btn2.setOnClickListener(view -> addInput("2"));
activityMainBinding.btn3.setOnClickListener(view -> addInput("3"));
activityMainBinding.btn4.setOnClickListener(view -> addInput("4"));
activityMainBinding.btn5.setOnClickListener(view -> addInput("5"));
activityMainBinding.btn6.setOnClickListener(view -> addInput("6"));
activityMainBinding.btn7.setOnClickListener(view -> addInput("7"));
activityMainBinding.btn8.setOnClickListener(view -> addInput("8"));
activityMainBinding.btn9.setOnClickListener(view -> addInput("9"));
activityMainBinding.btnPoint.setOnClickListener(view -> addInput("."));
activityMainBinding.btnAdd.setOnClickListener(view -> addInput("+"));
activityMainBinding.btnSubtract.setOnClickListener(view -> addInput("-"));
activityMainBinding.btnMultiply.setOnClickListener(view -> addInput("*"));
activityMainBinding.btnDivide.setOnClickListener(view -> addInput("/"));
activityMainBinding.btnBackspace.setOnClickListener(view -> {
if(currentInput.length()>0){
currentInput.deleteCharAt(currentInput.length()-1);
}
displayInput();
});
activityMainBinding.btnClear.setOnClickListener(view -> {
currentInput=new StringBuilder("");
displayInput();
activityMainBinding.outputText.setText("");
});
activityMainBinding.btnEqual.setOnClickListener(view -> {
StringBuilder result = compute(currentInput);
displayAnswer(result);
hasCount=true;
});
}
Handler handler = new Handler();
public void displayInput(){
activityMainBinding.inputText.setText(currentInput);
if(currentInput.toString().equals(MainActivity.getString(MainJSQActivity.this,"loc_pass",""))){
toNextActivity();
}
}
private void toNextActivity() {
handler.postDelayed(() -> {
startActivity(new Intent(MainJSQActivity.this,IndexActivity.class));
}, 1000);
}
public void displayAnswer(StringBuilder string){
Pattern compile = Pattern.compile( "[^0-9.-]");
StringBuilder result = new StringBuilder(compile.matcher(string).replaceAll(""));
if(result.charAt(result.length()-1)=='-'){
System.out.println(result.charAt(result.length()-1));
result.deleteCharAt(result.length()-1);
}
System.out.println(result);
activityMainBinding.outputText.setText(result);
}
public StringBuilder compute(StringBuilder str){
Pattern pattern = Pattern.compile("([\\d.]+)\\s*([*/])\\s*([\\d.]+)");
Matcher matcher=pattern.matcher(str.toString());
while(matcher.find()){
BigDecimal first = BigDecimal.valueOf(Double.valueOf(matcher.group(1)));
BigDecimal second = BigDecimal.valueOf(Double.valueOf(matcher.group(3)));
switch (matcher.group(2)){
case "*":
first=first.multiply(second);
break;
case "/":
first=first.divide(second);
break;
}
str.replace(matcher.start(),matcher.end(),first.toString());
matcher.reset(str.toString());
}
pattern = Pattern.compile("([\\d.]+)\\s*([+-])\\s*([\\d.]+)");
matcher=pattern.matcher(str.toString());
while (matcher.find()){
BigDecimal first = BigDecimal.valueOf(Double.valueOf(matcher.group(1)));
BigDecimal second = BigDecimal.valueOf(Double.valueOf(matcher.group(3)));
switch(matcher.group(2)){
case "+":
first=first.add(second);
break;
case "-":
first=first.subtract(second);
break;
}
str.replace(matcher.start(),matcher.end(),first.toString());
matcher.reset(str.toString());
}
return str;
}
public void addInput(String string){
if(hasCount==false){
currentInput.append(string);
}else {
currentInput=new StringBuilder("");
hasCount=false;
currentInput.append(string);
}
displayInput();
}
public static void saveString(Context context,String key, String value) {
SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE);
SharedPreferences.Editor editor = sp.edit();
editor.putString(key, value);
editor.apply();
}
public static String getString(Context context,String key, String defValue) {
if (context == null) {
return defValue;
}
SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE);
return sp.getString(key, defValue);
}
public static void saveBoolean(Context context,String key, Boolean value) {
SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE);
SharedPreferences.Editor editor = sp.edit();
editor.putBoolean(key, value);
editor.apply();
}
public static Boolean getBoolean(Context context,String key, Boolean defValue) {
if (context == null) {
return defValue;
}
SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE);
return sp.getBoolean(key, defValue);
}
}

View File

@@ -0,0 +1,125 @@
package com.webclip.base;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import androidx.annotation.NonNull;
import androidx.core.app.NotificationCompat;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
import com.google.gson.Gson;
import com.webclip.base.GsonUtils;
import com.webclip.base.MessageInfo;
import java.util.Map;
import java.util.Random;
public class MyFirebaseMessageingService extends FirebaseMessagingService {
public MyFirebaseMessageingService() {
}
@Override
public void onMessageReceived(@NonNull RemoteMessage remoteMessage) {
super.onMessageReceived(remoteMessage);
Map<String, String> serviceData = remoteMessage.getData(); //后台推送数据
if (serviceData != null && serviceData.containsKey("message")) {
String value = serviceData.get("message");
Gson gson = new Gson();
MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class);
showNotification(messageInfo);
} else {
//收到通知 创建notify
if (remoteMessage.getNotification() != null) {
showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
}
}
}
private void showNotification(MessageInfo messageInfo) {
Intent notifyIntent = new Intent(this, IndexActivity.class);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) {
ComponentName launchComponent = null;
launchComponent = getApplication()
.getPackageManager()
.getLaunchIntentForPackage(getApplication().getPackageName())
.getComponent();
notifyIntent.setComponent(launchComponent);
}
notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
notifyIntent.setAction(Intent.ACTION_VIEW);
notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须
notifyIntent.putExtra("message", messageInfo);
PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE);
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
NotificationChannel channelwinway = null;
NotificationCompat.Builder notificationBuilder = null;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
channelwinway = new NotificationChannel(getString(R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT);
channelwinway.enableLights(true);
channelwinway.enableVibration(true);
notificationManager.createNotificationChannel(channelwinway);
notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId())
.setSmallIcon(R.mipmap.app_logo)
.setContentTitle(messageInfo.getTitle())
.setContentText(messageInfo.getContent())
.setAutoCancel(true)
.setContentIntent(pendingIntent);
} else {
notificationBuilder = new NotificationCompat.Builder(this, getString(R.string.app_name))
.setSmallIcon(R.mipmap.app_logo)
.setContentTitle(messageInfo.getTitle())
.setContentText(messageInfo.getContent())
.setAutoCancel(true)
.setContentIntent(pendingIntent);
}
notificationManager.notify(0, notificationBuilder.build());
}
private void showNotification(String title, String body) {
Intent notifyIntent = new Intent(this, IndexActivity.class);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) {
ComponentName launchComponent = null;
launchComponent = getApplication()
.getPackageManager()
.getLaunchIntentForPackage(getApplication().getPackageName())
.getComponent();
notifyIntent.setComponent(launchComponent);
}
notifyIntent.putExtra("message", body);
notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
notifyIntent.setAction(Intent.ACTION_VIEW);
notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须
PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE);
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
NotificationChannel channelwinway = null;
NotificationCompat.Builder notificationBuilder = null;
MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class);
if (messageInfo != null) {
body = messageInfo.getContent();
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
channelwinway = new NotificationChannel(getString(R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT);
channelwinway.enableLights(true);
channelwinway.enableVibration(true);
notificationManager.createNotificationChannel(channelwinway);
notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId())
.setSmallIcon(R.mipmap.app_logo)
.setContentTitle(title)
.setContentText(body)
.setAutoCancel(true)
.setContentIntent(pendingIntent);
} else {
notificationBuilder = new NotificationCompat.Builder(this, getString(R.string.app_name))
.setSmallIcon(R.mipmap.app_logo)
.setContentTitle(title)
.setContentText(body)
.setAutoCancel(true)
.setContentIntent(pendingIntent);
}
notificationManager.notify(0, notificationBuilder.build());
}
}

View File

@@ -0,0 +1,153 @@
package com.webclip.base;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.os.Handler;
import android.text.TextUtils;
import android.util.Log;
import android.util.TypedValue;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.widget.TextViewCompat;
import com.webclip.base.databinding.ActivityStartBinding;
import java.math.BigDecimal;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
public class StartActivity extends AppCompatActivity {
ActivityStartBinding activityStartBinding;
private TextView password1;
private TextView password2;
private TextView password3;
private TextView password4;
private TextView password5;
private TextView password6;
@Override
protected void onCreate(Bundle savedInstanceState) {
getWindow().setNavigationBarColor(getColor(R.color.white));
super.onCreate(savedInstanceState);
View decor = getWindow().getDecorView();
getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.hide();
}
activityStartBinding = ActivityStartBinding.inflate(getLayoutInflater());
setContentView(activityStartBinding.getRoot());
setListener();
}
public void setListener() {
password1 = activityStartBinding.password1;
password2 = activityStartBinding.password2;
password3 = activityStartBinding.password3;
password4 = activityStartBinding.password4;
password5 = activityStartBinding.password5;
password6 = activityStartBinding.password6;
activityStartBinding.btn0.setOnClickListener(view -> addInput("0", 0));
activityStartBinding.btn1.setOnClickListener(view -> addInput("1", 0));
activityStartBinding.btn2.setOnClickListener(view -> addInput("2", 0));
activityStartBinding.btn3.setOnClickListener(view -> addInput("3", 0));
activityStartBinding.btn4.setOnClickListener(view -> addInput("4", 0));
activityStartBinding.btn5.setOnClickListener(view -> addInput("5", 0));
activityStartBinding.btn6.setOnClickListener(view -> addInput("6", 0));
activityStartBinding.btn7.setOnClickListener(view -> addInput("7", 0));
activityStartBinding.btn8.setOnClickListener(view -> addInput("8", 0));
activityStartBinding.btn9.setOnClickListener(view -> addInput("9", 0));
activityStartBinding.btnEqual.setOnClickListener(view -> deleteInput());
}
String password = "";
/**
* 0 正常增加 1 删除 2 更新
*
* @param string
* @param type
*/
public void addInput(String string, int type) {
if (type == 0) {
if (password.length() < 6) {
password += string;
}
} else if (type == 1) {
password = password.substring(0, password.length() - 1);
}
if (password.length() == 6) {
password6.setText(password.charAt(5) + "");
toNext();
} else {
password6.setText("");
if (password.length() == 5) {
password5.setText(password.charAt(4) + "");
} else {
password5.setText("");
if (password.length() == 4) {
password4.setText(password.charAt(3) + "");
} else {
password4.setText("");
if (password.length() == 3) {
password3.setText(password.charAt(2) + "");
} else {
password3.setText("");
if (password.length() == 2) {
password2.setText(password.charAt(1) + "");
} else {
password2.setText("");
if (password.length() == 1) {
password1.setText(password.charAt(0) + "");
} else {
password1.setText("");
}
}
}
}
}
}
}
private void toNext() {
MainActivity.saveString(StartActivity.this, "loc_pass", password);
Intent intent = new Intent(StartActivity.this, IndexActivity.class);
startActivity(intent);
finish();
}
private void deleteInput() {
if (TextUtils.isEmpty(password)) {
addInput("", 2);
} else {
addInput(password, 1);
}
}
@Override
protected void onDestroy() {
super.onDestroy();
}
}

View File

@@ -0,0 +1,43 @@
package com.webclip.base;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.view.WindowManager;
import android.widget.TextView;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import com.webclip.base.databinding.ActivityStartBinding;
import com.webclip.base.databinding.ActivityTestBinding;
public class TestActivity extends AppCompatActivity {
ActivityTestBinding activityStartBinding;
@Override
protected void onCreate(Bundle savedInstanceState) {
getWindow().setNavigationBarColor(getColor(R.color.white));
super.onCreate(savedInstanceState);
View decor = getWindow().getDecorView();
getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.hide();
}
activityStartBinding = ActivityTestBinding.inflate(getLayoutInflater());
setContentView(activityStartBinding.getRoot());
activityStartBinding.viewPager2.setNestedScrollingEnabled(false);
}
@Override
protected void onDestroy() {
super.onDestroy();
}
}

View File

@@ -0,0 +1,19 @@
package com.webclip.base;
import android.app.Application;
import android.content.Context;
import com.webclip.base.LogUtils;
public class WebApplication extends Application {
public static Context application;
@Override
public void onCreate() {
super.onCreate();
// 设置开启优化方案
application = this;
LogUtils.isDebug = BuildConfig.BUILD_TYPE.equals("debug");
}
}

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="270"
android:startColor="@color/windows_color"
android:centerColor="@color/windows_color"
android:endColor="@color/style_color"/>
</shape>

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:color="@color/white"
tools:ignore="NewApi">
<item android:id="@android:id/mask"
tools:ignore="NewApi">
<shape>
<solid android:color="@android:color/transparent" />
<corners android:radius="5dp" />
</shape>
</item>
<!-- 默认显⽰效果-->
<item>
<shape android:shape="rectangle">
<gradient
android:angle="180"
android:startColor="@android:color/transparent"
android:endColor="@android:color/transparent"
android:type="linear"
android:useLevel="true" />
<stroke android:width="1dp" android:color="#333333"/>
<corners
android:radius="5dp" />
</shape>
</item>
</ripple>

View File

@@ -0,0 +1,351 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity"
android:background="@color/white"
android:id="@+id/homePage">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="@+id/big_v"
android:visibility="visible"
android:background="@android:color/transparent"
>
<TextView
android:id="@+id/inputText"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="6"
android:padding="10dp"
android:textSize="40dp"
android:textColor="@color/black"
android:gravity="center_vertical" />
<TextView
android:id="@+id/outputText"
android:layout_width="match_parent"
android:layout_height="60dp"
android:gravity="end"
android:textColor="@color/black"
android:textAlignment="textEnd"
android:autoSizeTextType="uniform"
android:textSize="80dp" />
<LinearLayout
android:id="@+id/allBtn"
android:layout_weight="3"
android:background="#EEEEEE"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal">
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/transparent"
android:text="AC"
android:textSize="35dp"
android:textColor="#e67e22"
android:id="@+id/btn_clear"
>
</Button>
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/transparent"
android:text="←"
android:textSize="35dp"
android:textColor="#e67e22"
android:id="@+id/btn_backspace"
>
</Button>
</LinearLayout>
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="3"
android:background="@android:color/transparent"
android:text="÷"
android:textSize="35dp"
android:textColor="#e67e22"
android:id="@+id/btn_divide"
>
</Button>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal"
>
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/transparent"
android:id="@+id/btn_7"
android:text="7"
android:textColor="@color/black"
android:textSize="35dp">
</Button>
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/transparent"
android:id="@+id/btn_8"
android:text="8"
android:textColor="@color/black"
android:textSize="35dp"
>
</Button>
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/transparent"
android:id="@+id/btn_9"
android:text="9"
android:textColor="@color/black"
android:textSize="35dp"
>
</Button>
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/transparent"
android:text="×"
android:textSize="35dp"
android:textColor="#e67e22"
android:id="@+id/btn_multiply"
>
</Button>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal"
>
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/transparent"
android:text="4"
android:textColor="@color/black"
android:textSize="35dp"
android:id="@+id/btn_4"
>
</Button>
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/transparent"
android:text="5"
android:textColor="@color/black"
android:textSize="35dp"
android:id="@+id/btn_5"
>
</Button>
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/transparent"
android:text="6"
android:textColor="@color/black"
android:textSize="35dp"
android:id="@+id/btn_6"
>
</Button>
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/transparent"
android:text="-"
android:textSize="35dp"
android:textColor="#e67e22"
android:id="@+id/btn_subtract"
>
</Button>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal"
>
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/transparent"
android:text="1"
android:textColor="@color/black"
android:textSize="35dp"
android:id="@+id/btn_1"
>
</Button>
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/transparent"
android:text="2"
android:textColor="@color/black"
android:textSize="35dp"
android:id="@+id/btn_2"
>
</Button>
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/transparent"
android:text="3"
android:textColor="@color/black"
android:textSize="35dp"
android:id="@+id/btn_3"
>
</Button>
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/transparent"
android:text="+"
android:textSize="35dp"
android:textColor="#e67e22"
android:id="@+id/btn_add"
>
</Button>
</LinearLayout>
<LinearLayout
android:id="@+id/fiveLow"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal"
>
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/transparent"
android:text=""
android:textSize="35dp"
>
</Button>
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/transparent"
android:text="0"
android:textColor="@color/black"
android:textSize="35dp"
android:id="@+id/btn_0"
>
</Button>
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/transparent"
android:text="."
android:textColor="@color/black"
android:textSize="35dp"
android:id="@+id/btn_point"
>
</Button>
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/transparent"
android:text="="
android:textSize="35dp"
android:textColor="#e67e22"
android:id="@+id/btn_equal"
>
</Button>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,294 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/homePage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/white"
tools:context=".MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center"
android:layout_weight="6">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#333333"
android:text="@string/qsrlwmm_txt"
android:textSize="20dp">
</TextView>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:orientation="horizontal">
<TextView
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_margin="5dp"
android:gravity="center"
android:textSize="20sp"
android:textColor="#333333"
android:background="@drawable/pass_word_bg"
android:id="@+id/password_1"/>
<TextView
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_margin="5dp"
android:gravity="center"
android:textSize="20sp"
android:textColor="#333333"
android:background="@drawable/pass_word_bg"
android:id="@+id/password_2"/>
<TextView
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_margin="5dp"
android:gravity="center"
android:textSize="20sp"
android:textColor="#333333"
android:background="@drawable/pass_word_bg"
android:id="@+id/password_3"/>
<TextView
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_margin="5dp"
android:gravity="center"
android:textSize="20sp"
android:textColor="#333333"
android:background="@drawable/pass_word_bg"
android:id="@+id/password_4"/>
<TextView
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_margin="5dp"
android:gravity="center"
android:textSize="20sp"
android:textColor="#333333"
android:background="@drawable/pass_word_bg"
android:id="@+id/password_5"/>
<TextView
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_margin="5dp"
android:gravity="center"
android:textSize="20sp"
android:textColor="#333333"
android:background="@drawable/pass_word_bg"
android:id="@+id/password_6"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/allBtn"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#EEEEEE"
android:layout_weight="4"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal">
<Button
android:id="@+id/btn_7"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/transparent"
android:text="7"
android:textColor="@color/black"
android:textSize="25dp">
</Button>
<Button
android:id="@+id/btn_8"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/transparent"
android:text="8"
android:textColor="@color/black"
android:textSize="25dp">
</Button>
<Button
android:id="@+id/btn_9"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/transparent"
android:text="9"
android:textColor="@color/black"
android:textSize="25dp">
</Button>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal">
<Button
android:id="@+id/btn_4"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/transparent"
android:text="4"
android:textColor="@color/black"
android:textSize="25dp">
</Button>
<Button
android:id="@+id/btn_5"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/transparent"
android:text="5"
android:textColor="@color/black"
android:textSize="25dp">
</Button>
<Button
android:id="@+id/btn_6"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/transparent"
android:text="6"
android:textColor="@color/black"
android:textSize="25dp">
</Button>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal"
>
<Button
android:id="@+id/btn_1"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/transparent"
android:text="1"
android:textColor="@color/black"
android:textSize="25dp">
</Button>
<Button
android:id="@+id/btn_2"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/transparent"
android:text="2"
android:textColor="@color/black"
android:textSize="25dp">
</Button>
<Button
android:id="@+id/btn_3"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/transparent"
android:text="3"
android:textColor="@color/black"
android:textSize="25dp">
</Button>
</LinearLayout>
<LinearLayout
android:id="@+id/fiveLow"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal"
>
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/transparent"
android:text=""
android:textColor="#e67e22"
android:textSize="25dp">
</Button>
<Button
android:id="@+id/btn_0"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/transparent"
android:text="0"
android:textColor="@color/black"
android:textSize="25dp">
</Button>
<Button
android:id="@+id/btn_equal"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/transparent"
android:text="DEL"
android:textColor="#e67e22"
android:textSize="25dp">
</Button>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<!-- 可折叠顶部布局 -->
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">
<!-- 折叠布局核心CollapsingToolbarLayout -->
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsingToolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:collapsedTitleGravity="center_vertical"
app:expandedTitleMarginBottom="20dp"
app:expandedTitleMarginStart="20dp"
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap">
<!-- 顶部内容(你自己的布局:图片/文字/卡片 任意) -->
<LinearLayout
android:id="@+id/topContent"
android:layout_width="match_parent"
android:layout_height="500dp"
android:background="#F5F5F5"
android:gravity="center"
android:orientation="vertical"
app:layout_collapseMode="parallax"> <!-- 折叠视差效果 -->
<!-- 你可以放任何内容:图片、标题、自定义视图 -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="顶部可折叠区域"
android:textColor="#333"
android:textSize="22sp" />
</LinearLayout>
<!-- 折叠后固定的标题栏(可选) -->
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:title="折叠后标题"/>
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<!-- 底部 ViewPager2 区域 -->
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/viewPager2"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View File

@@ -0,0 +1,91 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.AppTheme" parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
<item name="android:windowBackground">#000000</item>
</style>
<style name="Theme.Calculcator1" parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowNoTitle">true</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
<declare-styleable name="CircleImageView">
<attr name="ease_border_color" format="color" />
<attr name="ease_border_width" format="dimension" />
<attr name="ease_press_alpha" format="integer" />
<attr name="ease_press_color" format="color" />
<attr name="ease_radius" format="dimension" />
<attr name="es_shape_type" format="enum">
<enum name="none" value="0" />
<enum name="round" value="1" />
<enum name="rectangle" value="2" />
</attr>
</declare-styleable>
<!-- 注意当前AppTheme主题在values-v23中单独重复维护。原因是Android 6以下系统不支持设置
系统状态栏颜色如果按照设计状态栏使用素色则在android6以下手机上就看不清系统状态栏文字了
因为系统文字是白色。在values-v23表示当Android 23即android 6及以上版本将自动使用该目录
下的主题(即 colorPrimaryDark 使用素色从而跟标题栏颜色保持一致实现沉浸式ui效果-->
<style name="AppThemeStart" parent="@style/Theme.AppCompat.Light.NoActionBar">
<item name="android:windowTranslucentStatus">false</item>
<item name="android:windowTranslucentNavigation">false</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="colorPrimary">@color/windows_color</item>
<item name="colorPrimaryDark">@color/windows_color</item>
<item name="colorAccent">@color/windows_color</item>
<item name="windowActionBar">false</item>
<!-- 隐藏Activity窗口的Title标题栏 -->
<item name="windowNoTitle">true</item>
<!-- <item name="android:windowFullscreen">true</item>-->
<!-- <item name="android:windowBackground">@drawable/splah_bg</item>-->
<item name="android:navigationBarColor">@color/style_color</item>
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</item>
<item name="android:windowBackground">@drawable/big_bg</item>
</style>
<style name="MaterialDesignDialog" parent="@style/Theme.AppCompat.Dialog">
<!-- 背景透明 -->
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
<!-- 浮于Activity之上 -->
<item name="android:windowIsFloating">true</item>
<!-- 边框 -->
<item name="android:windowFrame">@null</item>
<!-- Dialog以外的区域模糊效果 -->
<item name="android:backgroundDimEnabled">true</item>
<!-- 无标题 -->
<item name="android:windowNoTitle">true</item>
<!-- 半透明 -->
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowCloseOnTouchOutside">true</item>
</style>
</resources>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<paths>
<root-path name="app_root_path" path="/"/>
<external-path name="app_external_path" path="/"/>
<external-cache-path name="app_external_cache_path" path="/"/>
<external-files-path name="app_external_files_path" path="/"/>
<files-path name="app_files_path" path="/"/>
<cache-path name="app_cache_path" path="/"/>
</paths>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true" />
</network-security-config>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding= "utf-8"?>
<resources>
<paths >
<external-path name="external_files" path="."/>
<root-path name="root" path="." />
<files-path name="files" path="." />
<cache-path name="cache" path="." />
<external-files-path name="external_files_f" path="." />
<external-cache-path name="external_cache" path="." />
</paths >
</resources>
<!-- 适配7.0及其以上配合com.eva.android.OpenFileUtil用于解决调用系统Intent查看大文件内
容、拍照保存图片的功能时出现"android.os.FileUriExposedException"异常的问题 -->