第一次提交
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/.idea/
|
||||
/.gradle/
|
||||
/build/
|
||||
1
76Pokies/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
BIN
76Pokies/76pokies.jks
Normal file
84
76Pokies/build.gradle
Normal file
@@ -0,0 +1,84 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'com.google.gms.google-services'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 31
|
||||
buildToolsVersion "30.0.3"
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.web.pokies76"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 31
|
||||
versionCode 100
|
||||
versionName "v1.0.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
signingConfigs {
|
||||
debug {
|
||||
storeFile file('76pokies.jks')
|
||||
storePassword "android2025"
|
||||
keyAlias 'key0'
|
||||
keyPassword "android2025"
|
||||
}
|
||||
release {
|
||||
storeFile file('76pokies.jks')
|
||||
storePassword "android2025"
|
||||
keyAlias 'key0'
|
||||
keyPassword "android2025"
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'com.google.android.material:material:1.1.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
testImplementation 'junit:junit:4.+'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar')
|
||||
|
||||
// okhttp相关库
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
|
||||
implementation project(path: ':base')
|
||||
|
||||
// JSON解析库
|
||||
implementation 'com.google.code.gson:gson:2.9.0'
|
||||
implementation 'com.alibaba:fastjson:1.1.71.android'
|
||||
api 'com.squareup.retrofit2:retrofit:2.5.0'
|
||||
api 'com.squareup.retrofit2:converter-scalars:2.3.0'
|
||||
api 'com.squareup.retrofit2:converter-gson:2.4.0'
|
||||
api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
|
||||
api 'io.reactivex.rxjava2:rxjava:2.1.16'
|
||||
api 'io.reactivex.rxjava2:rxandroid:2.0.2'
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选)
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选)
|
||||
implementation 'com.github.Justson:Downloader:v5.0.4-androidx'
|
||||
//implementation 'com.tencent.tbs:tbssdk:44286'
|
||||
// sdk 33
|
||||
implementation platform('com.google.firebase:firebase-bom:32.7.0')
|
||||
// Firebase Cloud Messaging
|
||||
// implementation("com.google.firebase:firebase-messaging")
|
||||
// implementation("com.google.firebase:firebase-analytics")
|
||||
|
||||
implementation("com.google.firebase:firebase-messaging:24.0.3")
|
||||
// implementation("com.google.firebase:firebase-analytics:21.2.1")
|
||||
// implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式
|
||||
implementation("com.github.bumptech.glide:glide:4.13.1")
|
||||
}
|
||||
29
76Pokies/google-services.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "377488126355",
|
||||
"project_id": "pokies-b1a7d",
|
||||
"storage_bucket": "pokies-b1a7d.firebasestorage.app"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:377488126355:android:14b32fea378a2d1e89f866",
|
||||
"android_client_info": {
|
||||
"package_name": "com.web.pokies76"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyAfPWXu02324YRAnqepyGFHpofigTOMM7U"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
BIN
76Pokies/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar
Normal file
32
76Pokies/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
||||
-dontwarn dalvik.**
|
||||
-dontwarn com.tencent.smtt.**
|
||||
|
||||
-keep class com.tencent.smtt.** {
|
||||
*;
|
||||
}
|
||||
|
||||
-keep class com.tencent.tbs.** {
|
||||
*;
|
||||
}
|
||||
BIN
76Pokies/release/76pokies.apk
Normal file
18
76Pokies/release/output-metadata.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"version": 2,
|
||||
"artifactType": {
|
||||
"type": "APK",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "com.web.pokies76",
|
||||
"variantName": "processReleaseResources",
|
||||
"elements": [
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"versionCode": 100,
|
||||
"versionName": "v1.0.0",
|
||||
"outputFile": "app-release.apk"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("Tptogiar.calculcator", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
131
76Pokies/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,131 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.web.pokies76">
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera"
|
||||
android:required="false" />
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera2"
|
||||
android:required="false" />
|
||||
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS" /> <!-- 获取通讯录-->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<!-- 多媒体相关 -->
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
|
||||
<!-- 8.0+系统需要-->
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
|
||||
<!--推送权限-->
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_SECURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.RECORD_AUDIO" />-->
|
||||
<!-- 通知委托启用状态-->
|
||||
<meta-data
|
||||
android:name="delivery_metrics_exported_to_big_query_enabled"
|
||||
android:value="true" />
|
||||
|
||||
<!-- <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_AUDIO_OUTPUT" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.autofocus" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.front" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.level.full" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.capability.raw" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.any" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.microphone" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera2" android:required="true" />-->
|
||||
|
||||
<queries>
|
||||
<intent>
|
||||
<action android:name="android.media.action.IMAGE_CAPTURE" />
|
||||
</intent>
|
||||
</queries>
|
||||
<application
|
||||
android:name=".WebApplication"
|
||||
android:allowBackup="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:icon="@mipmap/app_logo"
|
||||
android:label="@string/app_name"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:roundIcon="@mipmap/app_logo"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.AppTheme"
|
||||
android:usesCleartextTraffic="true">
|
||||
|
||||
|
||||
<!-- <activity-alias-->
|
||||
<!-- android:name=".MainActivityNew"-->
|
||||
<!-- android:icon="@mipmap/winway"-->
|
||||
<!-- android:roundIcon="@mipmap/winway"-->
|
||||
<!-- android:label="@string/app_name1"-->
|
||||
<!-- android:targetActivity=".MainActivity"-->
|
||||
<!-- android:enabled="false"-->
|
||||
<!-- android:exported="true"-->
|
||||
<!-- android:configChanges="orientation|navigation|keyboardHidden"-->
|
||||
<!-- android:launchMode="singleTop"-->
|
||||
<!-- android:excludeFromRecents="true"-->
|
||||
<!-- android:screenOrientation="portrait">-->
|
||||
<!-- <intent-filter>-->
|
||||
<!-- <action android:name="android.intent.action.MAIN" />-->
|
||||
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
|
||||
<!-- </intent-filter>-->
|
||||
<!-- </activity-alias>-->
|
||||
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity2"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:exported="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:launchMode="singleTop"
|
||||
android:theme="@style/AppThemeStart">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
|
||||
<!-- android:directBootAware="true" 为应用启用消息处理直接启动模式-->
|
||||
<service
|
||||
android:name=".MyFirebaseMessageingService"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<!-- Set custom default icon. This is used when no icon is set for incoming notification messages.
|
||||
See README(https://goo.gl/l4GJaQ) for more. 设置推送默认图标 和颜色-->
|
||||
<meta-data
|
||||
android:name="com.google.firebase.messaging.default_notification_icon"
|
||||
android:resource="@mipmap/app_logo" />
|
||||
<!-- Set color used with incoming notification messages. This is used when no color is set for the incoming
|
||||
notification message. See README(https://goo.gl/6BKBk7) for more. -->
|
||||
<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" />
|
||||
<!-- 还可设置推送渠道 -->
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.google.firebase.messaging.default_notification_channel_id"-->
|
||||
<!-- android:value="@string/default_notification_channel_id" />-->
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
33
76Pokies/src/main/java/com/web/pokies76/MainActivity2.java
Normal file
@@ -0,0 +1,33 @@
|
||||
package com.web.pokies76;
|
||||
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.android.gms.tasks.OnCompleteListener;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.firebase.messaging.FirebaseMessaging;
|
||||
|
||||
public class MainActivity2 extends com.web.base.MainActivity2 {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
userId = 110;
|
||||
com.web.base.MainActivity2.saveInt(MainActivity2.this,"user_code",userId);
|
||||
super.onCreate(savedInstanceState);
|
||||
//订阅主题
|
||||
FirebaseMessaging.getInstance().subscribeToTopic("demo")
|
||||
.addOnCompleteListener(new OnCompleteListener<Void>() {
|
||||
@Override
|
||||
public void onComplete(@NonNull Task<Void> task) {
|
||||
String msg = "Subscribed";
|
||||
if (!task.isSuccessful()) {
|
||||
msg = "Subscribe failed";
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
package com.web.pokies76;
|
||||
|
||||
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.web.base.GsonUtils;
|
||||
import com.web.base.MainActivity2;
|
||||
import com.web.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);
|
||||
// if (remoteMessage.getNotification() != null) {
|
||||
// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
// }
|
||||
} else {
|
||||
//收到通知 创建notify
|
||||
if (remoteMessage.getNotification() != null) {
|
||||
showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void showNotification(MessageInfo messageInfo) {
|
||||
Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.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);
|
||||
|
||||
// Intent notifyIntent = new Intent(this, MainActivity2.class);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
// // notifyIntent.putExtra("message", messageInfo);
|
||||
// notifyIntent.setAction(Intent.ACTION_VIEW);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须
|
||||
// PendingIntent pendingIntent;
|
||||
// pendingIntent = PendingIntent.getActivity
|
||||
// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | 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(com.web.base.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(com.web.base.R.mipmap.app_logo)
|
||||
.setContentTitle(messageInfo.getTitle())
|
||||
.setContentText(messageInfo.getContent())
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.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, MainActivity2.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(com.web.base.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(com.web.base.R.mipmap.app_logo)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.R.mipmap.app_logo)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
}
|
||||
notificationManager.notify(0, notificationBuilder.build());
|
||||
//存储数据
|
||||
// saveNotifyMessage(body);
|
||||
}
|
||||
|
||||
|
||||
// public void saveNotifyMessage(String body) {
|
||||
// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class);
|
||||
// String savenotify = Utils.get(getApplication(),ApiService.savenotify,"");
|
||||
// if(messageInfo!=null){
|
||||
// if(TextUtils.isEmpty(savenotify)){
|
||||
// GsonUtils.getListFromJSON(savenotify,)
|
||||
// }
|
||||
// }
|
||||
// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @param key 要设置的key
|
||||
// */
|
||||
// public static void set(Context activity, String key, String is) {
|
||||
// SharedPreferences nameSetting = getConfigShared(activity);
|
||||
// SharedPreferences.Editor namePref = nameSetting.edit();
|
||||
// namePref.putString(key, is);
|
||||
// namePref.commit();
|
||||
// }
|
||||
}
|
||||
37
76Pokies/src/main/java/com/web/pokies76/WebApplication.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.web.pokies76;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
|
||||
import com.tencent.smtt.export.external.TbsCoreSettings;
|
||||
import com.tencent.smtt.sdk.QbSdk;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class WebApplication extends Application {
|
||||
|
||||
|
||||
public static Context application;
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
// 设置开启优化方案
|
||||
application = this;
|
||||
HashMap map = new HashMap();
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true);
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true);
|
||||
QbSdk.initTbsSettings(map);
|
||||
QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() {
|
||||
@Override
|
||||
public void onCoreInitFinished() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewInitFinished(boolean b) {
|
||||
|
||||
}
|
||||
});
|
||||
QbSdk.setDownloadWithoutWifi(true);
|
||||
}
|
||||
}
|
||||
11
76Pokies/src/main/res/drawable-anydpi/ic_action_back.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="#333333"
|
||||
android:alpha="0.8">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
|
||||
</vector>
|
||||
BIN
76Pokies/src/main/res/drawable-hdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 182 B |
BIN
76Pokies/src/main/res/drawable-mdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 150 B |
@@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
||||
BIN
76Pokies/src/main/res/drawable-xhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 212 B |
BIN
76Pokies/src/main/res/drawable-xxhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 324 B |
170
76Pokies/src/main/res/drawable/ic_launcher_background.xml
Normal file
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
||||
20
76Pokies/src/main/res/drawable/input_bg.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/white">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape>
|
||||
<solid android:color="@android:color/transparent" />
|
||||
<corners android:radius="23dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 默认显⽰效果-->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/dialog_input_bg"/>
|
||||
<corners
|
||||
android:radius="3dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
|
||||
28
76Pokies/src/main/res/drawable/pass_word_bg.xml
Normal 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>
|
||||
|
||||
23
76Pokies/src/main/res/drawable/pass_word_bg1.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#FF0000"
|
||||
android:centerColor="#FF5555"
|
||||
android:endColor="#FBD3D0"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
23
76Pokies/src/main/res/drawable/pass_word_bg2.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#000000"
|
||||
android:centerColor="#888888"
|
||||
android:endColor="#FFFFFF"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
5
76Pokies/src/main/res/drawable/shape_btn_bg.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="22dp" />
|
||||
<solid android:color="@color/jisuanqi" />
|
||||
</shape>
|
||||
6
76Pokies/src/main/res/drawable/shape_dialog_bg2.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:topRightRadius="12dp"
|
||||
android:topLeftRadius="12dp"/>
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
76Pokies/src/main/res/drawable/shape_dialog_bg3.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="12dp" />
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
76Pokies/src/main/res/drawable/shape_dialog_bg_new.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="20dp" />
|
||||
<solid android:color="@color/white" />
|
||||
</shape>
|
||||
5
76Pokies/src/main/res/drawable/shape_notify_typebg.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="2dp" />
|
||||
<solid android:color="@android:color/black" />
|
||||
</shape>
|
||||
5
76Pokies/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
BIN
76Pokies/src/main/res/mipmap-hdpi/ic_empty.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
76Pokies/src/main/res/mipmap-hdpi/ic_pull_down.png
Normal file
|
After Width: | Height: | Size: 271 B |
BIN
76Pokies/src/main/res/mipmap-xhdpi/ic_close.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
76Pokies/src/main/res/mipmap-xhdpi/ic_email.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
76Pokies/src/main/res/mipmap-xhdpi/ic_facebook.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
76Pokies/src/main/res/mipmap-xhdpi/ic_hometo.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
76Pokies/src/main/res/mipmap-xhdpi/ic_link.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
76Pokies/src/main/res/mipmap-xhdpi/ic_menu.png
Normal file
|
After Width: | Height: | Size: 779 B |
BIN
76Pokies/src/main/res/mipmap-xhdpi/ic_notify_email.png
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
BIN
76Pokies/src/main/res/mipmap-xhdpi/ic_notify_normal.png
Normal file
|
After Width: | Height: | Size: 9.0 KiB |
BIN
76Pokies/src/main/res/mipmap-xhdpi/ic_notify_shangla.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
76Pokies/src/main/res/mipmap-xhdpi/ic_notify_xiala.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
76Pokies/src/main/res/mipmap-xhdpi/ic_notifylogo.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
76Pokies/src/main/res/mipmap-xhdpi/ic_shousuo.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
76Pokies/src/main/res/mipmap-xhdpi/ic_tel.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
76Pokies/src/main/res/mipmap-xhdpi/ic_whatsapp.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
76Pokies/src/main/res/mipmap-xhdpi/ic_zhangkai.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
76Pokies/src/main/res/mipmap-xxhdpi/app_logo.png
Normal file
|
After Width: | Height: | Size: 444 KiB |
54
76Pokies/src/main/res/values-en/strings.xml
Normal file
@@ -0,0 +1,54 @@
|
||||
<resources>
|
||||
<string name="app_name">76POKIES</string>
|
||||
<string name="qsrlwmm_txt">Please Set Your Password</string>
|
||||
<string name="cancel_txt">Cancel</string>
|
||||
<string name="sure_txt">Sure</string>
|
||||
<string name="banbengengxin_txt">New Version Update</string>
|
||||
<string name="xiacigengxin_txt">Next Update</string>
|
||||
<string name="lijigengxin_txt">Update Immediately</string>
|
||||
<string name="app_updater_error_notification_content">Click to close notification</string>
|
||||
<string name="app_updater_error_notification_content_re_download">Click to re-download</string>
|
||||
<string name="app_updater_error_notification_title">Download failed</string>
|
||||
<string name="app_updater_finish_notification_content">Click to install</string>
|
||||
<string name="app_updater_finish_notification_title">Download completed</string>
|
||||
<string name="app_updater_progress_notification_content">Downloading...</string>
|
||||
<string name="app_updater_progress_notification_title">Version update</string>
|
||||
<string name="app_updater_progress_notification_title_2">Downloading game</string>
|
||||
<string name="app_updater_start_notification_content">Getting download data...</string>
|
||||
<string name="app_updater_start_notification_title">Version update</string>
|
||||
<string name="app_updater_start_notification_title_2">Downloading game</string>
|
||||
<string name="notification_title_txt">Need to turn on mobile phone notification permission</string>
|
||||
<string name="notification_cancel_txt">Exit</string>
|
||||
<string name="notification_setting_txt">Setting</string>
|
||||
<string name="app_tishi">Tip</string>
|
||||
<string name="app_hint">Please enter the invitation code</string>
|
||||
<string name="app_sharetitle">My invitation code:</string>
|
||||
<string name="app_sharetitle2">Superior invitation code:</string>
|
||||
<string name="app_totalinvite">Total number of invites:</string>
|
||||
<string name="app_sharecontent">App download link:</string>
|
||||
<string name="app_share">Share</string>
|
||||
<string name="app_checklist">Check Invitation Records</string>
|
||||
<string name="app_invitetitle">Invitation Records</string>
|
||||
<string name="app_checklist_number">Total number of invitees: %d</string>
|
||||
<string name="app_nodata">No Data</string>
|
||||
<string name="app_withdrawtitle">Withdrawal Record</string>
|
||||
<string name="app_withdrawapply_title">Withdrawal Application</string>
|
||||
<string name="app_bankinfo_title">Edit Bank Card Information</string>
|
||||
<string name="app_bankinfo_countrycode">60</string>
|
||||
<string name="app_bankinfo_name">Name:</string>
|
||||
<string name="app_bankinfo_name_hint">Please enter the bank card name</string>
|
||||
<string name="app_bankinfo_code">Bank card account:</string>
|
||||
<string name="app_bankinfo_code_hint">Please enter the bank card account</string>
|
||||
<string name="app_bankinfo_bankcountry">Country:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">Please select a country</string>
|
||||
<string name="app_bankinfo_bankname">Bank Name:</string>
|
||||
<string name="app_bankinfo_bankname_hint">Please select a bank name</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">Note: Please enter the country code before selecting the bank name!</string>
|
||||
<string name="app_balance">Balance: %s</string>
|
||||
<string name="app_totalearning">Total Earnings: %s</string>
|
||||
<string name="app_withdraw_amount">Amount: %s</string>
|
||||
<string name="app_withdraw_apply_hint">Please enter the withdrawal amount</string>
|
||||
<string name="app_toastapply">Withdrawal application has been submitted</string>
|
||||
<string name="app_toastloading">No additional data available for now</string>
|
||||
<string name="app_notify_title">NOTIFICATIONS</string>
|
||||
</resources>
|
||||
69
76Pokies/src/main/res/values-night/themes.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.Calculcator" parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_200</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/black</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_200</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</item>
|
||||
</style>
|
||||
</resources>
|
||||
22
76Pokies/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="purple_200">#FFFFFF</color>
|
||||
<color name="purple_500">#FFFFFF</color>
|
||||
<color name="purple_700">#FFFFFF</color>
|
||||
<color name="teal_200">#FF03DAC5</color>
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="jisuanqi">#EF4723</color>
|
||||
<color name="notify_color">#FFFFFFFF</color>
|
||||
|
||||
<color name="dialog_bg">#2C2C2E</color>
|
||||
<color name="dialog_textcolor">#FFA722</color>
|
||||
<color name="dialog_input_bg">#434343</color>
|
||||
<color name="dialog_dark">#BCBCBC</color>
|
||||
|
||||
<color name="notify_textcolor">#ACDFEE</color>
|
||||
<color name="notify_imagecolor">#BDDDB7</color>
|
||||
<color name="notify_jumplinkcolor">#C3B5D0</color>
|
||||
|
||||
</resources>
|
||||
76
76Pokies/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,76 @@
|
||||
<resources>
|
||||
<string name="app_name">76POKIES</string>
|
||||
<string name="qsrlwmm_txt">请输入6位密码</string>
|
||||
<string name="cancel_txt">取消</string>
|
||||
<string name="sure_txt">确定</string>
|
||||
<string name="banbengengxin_txt">版本更新</string>
|
||||
<string name="xiacigengxin_txt">下次更新</string>
|
||||
<string name="lijigengxin_txt">立即更新</string>
|
||||
<string name="app_updater_error_notification_content">点击关闭通知</string>
|
||||
<string name="app_updater_error_notification_content_re_download">点击重新下载</string>
|
||||
<string name="app_updater_error_notification_title">下载失败</string>
|
||||
<string name="app_updater_finish_notification_content">点击安装</string>
|
||||
<string name="app_updater_finish_notification_title">下载完成</string>
|
||||
<string name="app_updater_progress_notification_content">正在下载…</string>
|
||||
<string name="app_updater_progress_notification_title">版本更新</string>
|
||||
<string name="app_updater_progress_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_title">版本更新</string>
|
||||
<string name="app_updater_start_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_content">正在获取下载数据…</string>
|
||||
<string name="notification_title_txt">需要打开手机通知权限</string>
|
||||
<string name="notification_cancel_txt">退出</string>
|
||||
<string name="notification_setting_txt">设置</string>
|
||||
<string name="app_tishi">提示</string>
|
||||
<string name="app_hint">请输入邀请码</string>
|
||||
<string name="app_sharetitle">我的邀请码:</string>
|
||||
<string name="app_sharetitle2">上级邀请码:</string>
|
||||
<string name="app_totalinvite">总邀请人数:</string>
|
||||
<string name="app_sharecontent">邀请您下载:</string>
|
||||
<string name="app_share">分享</string>
|
||||
<string name="app_checklist">查看邀请记录</string>
|
||||
<string name="app_invitetitle">邀请记录</string>
|
||||
<string name="app_checklist_number">总邀请人数: %d</string>
|
||||
<string name="app_nodata">暂无数据</string>
|
||||
<string name="app_withdrawtitle">提现记录</string>
|
||||
<string name="app_withdrawapply_title">提现申请</string>
|
||||
<string name="app_bankinfo_title">编辑银行卡信息</string>
|
||||
<string name="app_bankinfo_countrycode">86</string>
|
||||
<string name="app_bankinfo_name">持卡人姓名:</string>
|
||||
<string name="app_bankinfo_name_hint">请输入持卡人姓名</string>
|
||||
<string name="app_bankinfo_bankcountry">国家地区:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">请选择国家地区</string>
|
||||
<string name="app_bankinfo_bankname">开户行名称:</string>
|
||||
<string name="app_bankinfo_bankname_hint">请选择开户行名称</string>
|
||||
<string name="app_bankinfo_code">银行户口:</string>
|
||||
<string name="app_bankinfo_code_hint">请输入银行卡户口</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">(注:请先输入国家区号再选择开户行名称!)</string>
|
||||
<string name="app_balance">余额: %s</string>
|
||||
<string name="app_totalearning">总收益: %s</string>
|
||||
<string name="app_withdraw_amount">金额: %s</string>
|
||||
<string name="app_withdraw_apply_hint">请输入提现金额</string>
|
||||
<string name="app_toastapply">提现申请已提交</string>
|
||||
<string name="app_toastloading">暂无更多数据</string>
|
||||
<string name="app_notify_title">通知</string>
|
||||
<!-- <string name="app_name">SPEEDAU</string>-->
|
||||
<!-- <string name="qsrlwmm_txt">Please Set Your Password</string>-->
|
||||
<!-- <string name="cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="sure_txt">Sure</string>-->
|
||||
<!-- <string name="banbengengxin_txt">New Version Update</string>-->
|
||||
<!-- <string name="xiacigengxin_txt">Next Update</string>-->
|
||||
<!-- <string name="lijigengxin_txt">Update Immediately</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content">Click to close notification</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content_re_download">Click to re-download</string>-->
|
||||
<!-- <string name="app_updater_error_notification_title">Download failed</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_content">Click to install</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_title">Download completed</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_content">Downloading...</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="app_updater_start_notification_content">Getting download data...</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="notification_title_txt">Need to turn on mobile phone notification permission</string>-->
|
||||
<!-- <string name="notification_cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="notification_setting_txt">Setting</string>-->
|
||||
|
||||
</resources>
|
||||
88
76Pokies/src/main/res/values/themes.xml
Normal file
@@ -0,0 +1,88 @@
|
||||
<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. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</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>
|
||||
10
76Pokies/src/main/res/xml/app_updater_paths.xml
Normal 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>
|
||||
4
76Pokies/src/main/res/xml/network_security_config.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<network-security-config>
|
||||
<base-config cleartextTrafficPermitted="true" />
|
||||
</network-security-config>
|
||||
13
76Pokies/src/main/res/xml/provider_paths.xml
Normal 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"异常的问题 -->
|
||||
@@ -0,0 +1,35 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void TestPattern(){
|
||||
//
|
||||
Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$");
|
||||
String a="+45.5";
|
||||
boolean matches = compile.matcher(a).matches();
|
||||
System.out.println(matches);
|
||||
String result = compile.matcher(a).replaceAll("");
|
||||
System.out.println(result);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
1
9kelab/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
BIN
9kelab/9kelab.jks
Normal file
93
9kelab/build.gradle
Normal file
@@ -0,0 +1,93 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'com.google.gms.google-services'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 31
|
||||
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.web.kelab9"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 31
|
||||
versionCode 106
|
||||
versionName "v1.0.6"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
signingConfigs {
|
||||
debug {
|
||||
storeFile file('9kelab.jks')
|
||||
storePassword "android2014"
|
||||
keyAlias 'key0'
|
||||
keyPassword "android2014"
|
||||
}
|
||||
release {
|
||||
storeFile file('9kelab.jks')
|
||||
storePassword "android2014"
|
||||
keyAlias 'key0'
|
||||
keyPassword "android2014"
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
|
||||
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'com.google.android.material:material:1.1.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
testImplementation 'junit:junit:4.+'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar')
|
||||
|
||||
// okhttp相关库
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
|
||||
|
||||
// JSON解析库
|
||||
implementation 'com.google.code.gson:gson:2.9.0'
|
||||
implementation 'com.alibaba:fastjson:1.1.71.android'
|
||||
api 'com.squareup.retrofit2:retrofit:2.5.0'
|
||||
api 'com.squareup.retrofit2:converter-scalars:2.3.0'
|
||||
api 'com.squareup.retrofit2:converter-gson:2.4.0'
|
||||
api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
|
||||
api 'io.reactivex.rxjava2:rxjava:2.1.16'
|
||||
api 'io.reactivex.rxjava2:rxandroid:2.0.2'
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选)
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选)
|
||||
implementation 'com.github.Justson:Downloader:v5.0.4-androidx'
|
||||
//implementation 'com.tencent.tbs:tbssdk:44286'
|
||||
// sdk 33
|
||||
// implementation platform('com.google.firebase:firebase-bom:32.7.0')
|
||||
// Firebase Cloud Messaging
|
||||
// implementation("com.google.firebase:firebase-messaging")
|
||||
// implementation("com.google.firebase:firebase-analytics")
|
||||
|
||||
implementation platform('com.google.firebase:firebase-bom:32.1.0')
|
||||
|
||||
// Add the dependencies for the Firebase Cloud Messaging and Analytics libraries
|
||||
// When using the BoM, you don't specify versions in Firebase library dependencies
|
||||
implementation 'com.google.firebase:firebase-messaging'
|
||||
implementation 'com.google.firebase:firebase-analytics'
|
||||
// implementation("com.google.firebase:firebase-messaging:23.2.1")
|
||||
// implementation("com.google.firebase:firebase-analytics:21.2.1")
|
||||
// implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式
|
||||
implementation("com.github.bumptech.glide:glide:4.13.1")
|
||||
implementation project(path: ':base')
|
||||
}
|
||||
29
9kelab/google-services.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "60742868930",
|
||||
"project_id": "kelab-e3c2b",
|
||||
"storage_bucket": "kelab-e3c2b.firebasestorage.app"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:60742868930:android:9d21cad56205c33b1dc05b",
|
||||
"android_client_info": {
|
||||
"package_name": "com.web.kelab9"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyDP2CKI721IENCj6ux4PBUyJftt7s8QsGI"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
BIN
9kelab/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar
Normal file
32
9kelab/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
||||
-dontwarn dalvik.**
|
||||
-dontwarn com.tencent.smtt.**
|
||||
|
||||
-keep class com.tencent.smtt.** {
|
||||
*;
|
||||
}
|
||||
|
||||
-keep class com.tencent.tbs.** {
|
||||
*;
|
||||
}
|
||||
BIN
9kelab/release/9kelab.apk
Normal file
18
9kelab/release/output-metadata.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"version": 2,
|
||||
"artifactType": {
|
||||
"type": "APK",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "com.web.kelab9",
|
||||
"variantName": "processReleaseResources",
|
||||
"elements": [
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"versionCode": 106,
|
||||
"versionName": "v1.0.6",
|
||||
"outputFile": "9kelab-release.apk"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("Tptogiar.calculcator", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
113
9kelab/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,113 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.web.kelab9">
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera"
|
||||
android:required="false" />
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera2"
|
||||
android:required="false" />
|
||||
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS" /> <!-- 获取通讯录-->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<!-- 多媒体相关 -->
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
|
||||
<!-- 8.0+系统需要-->
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
|
||||
<!--推送权限-->
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_SECURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.RECORD_AUDIO" />-->
|
||||
|
||||
|
||||
<!-- <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_AUDIO_OUTPUT" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.autofocus" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.front" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.level.full" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.capability.raw" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.any" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.microphone" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera2" android:required="true" />-->
|
||||
|
||||
<queries>
|
||||
<intent>
|
||||
<action android:name="android.media.action.IMAGE_CAPTURE" />
|
||||
</intent>
|
||||
</queries>
|
||||
<application
|
||||
android:name=".WebApplication"
|
||||
android:allowBackup="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:icon="@mipmap/app_logo"
|
||||
android:label="@string/app_name"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:roundIcon="@mipmap/app_logo"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.AppTheme"
|
||||
android:usesCleartextTraffic="true">
|
||||
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity2"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:exported="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:theme="@style/AppThemeStart">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
|
||||
<service
|
||||
android:name="com.tencent.smtt.export.external.DexClassLoaderProviderService"
|
||||
android:label="dexopt"
|
||||
android:process=":dexopt" />
|
||||
|
||||
|
||||
<!-- android:directBootAware="true" 为应用启用消息处理直接启动模式-->
|
||||
<service
|
||||
android:name=".MyFirebaseMessageingService"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<!-- Set custom default icon. This is used when no icon is set for incoming notification messages.
|
||||
See README(https://goo.gl/l4GJaQ) for more. 设置推送默认图标 和颜色-->
|
||||
<meta-data
|
||||
android:name="com.google.firebase.messaging.default_notification_icon"
|
||||
android:resource="@mipmap/app_logo" />
|
||||
<!-- Set color used with incoming notification messages. This is used when no color is set for the incoming
|
||||
notification message. See README(https://goo.gl/6BKBk7) for more. -->
|
||||
<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" />
|
||||
<!-- 还可设置推送渠道 -->
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.google.firebase.messaging.default_notification_channel_id"-->
|
||||
<!-- android:value="@string/default_notification_channel_id" />-->
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
54
9kelab/src/main/java/com/web/kelab9/MainActivity2.java
Normal file
@@ -0,0 +1,54 @@
|
||||
package com.web.kelab9;
|
||||
|
||||
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.android.gms.tasks.OnCompleteListener;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.firebase.messaging.FirebaseMessaging;
|
||||
import com.web.base.MainActivity;
|
||||
|
||||
public class MainActivity2 extends com.web.base.MainActivity2 {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
userId = 86;
|
||||
saveInt(MainActivity2.this,"user_code",userId);
|
||||
saveInt(MainActivity2.this,"version_code",getVersion());
|
||||
MainActivity.saveString(this, "base_url", "https://9kelab1.com/");
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
//订阅主题
|
||||
FirebaseMessaging.getInstance().subscribeToTopic("demo")
|
||||
.addOnCompleteListener(new OnCompleteListener<Void>() {
|
||||
@Override
|
||||
public void onComplete(@NonNull Task<Void> task) {
|
||||
String msg = "Subscribed";
|
||||
if (!task.isSuccessful()) {
|
||||
msg = "Subscribe failed";
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public int getVersion(){
|
||||
try {
|
||||
PackageManager packageManager = getPackageManager();
|
||||
PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0);
|
||||
String StringversionName = packageInfo.versionName; // 版本号
|
||||
int versionCode = packageInfo.versionCode; // 版本码
|
||||
// 在这里可以使用versionName和versionCode进行相关的操作
|
||||
// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode);
|
||||
return versionCode;
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
package com.web.kelab9;
|
||||
|
||||
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.web.base.GsonUtils;
|
||||
import com.web.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);
|
||||
// if (remoteMessage.getNotification() != null) {
|
||||
// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
// }
|
||||
} else {
|
||||
//收到通知 创建notify
|
||||
if (remoteMessage.getNotification() != null) {
|
||||
showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void showNotification(MessageInfo messageInfo) {
|
||||
Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.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);
|
||||
|
||||
// Intent notifyIntent = new Intent(this, MainActivity2.class);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
// // notifyIntent.putExtra("message", messageInfo);
|
||||
// notifyIntent.setAction(Intent.ACTION_VIEW);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须
|
||||
// PendingIntent pendingIntent;
|
||||
// pendingIntent = PendingIntent.getActivity
|
||||
// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | 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(com.web.base.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(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(messageInfo.getTitle())
|
||||
.setContentText(messageInfo.getContent())
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.R.mipmap.ic_launcher)
|
||||
.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, MainActivity2.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(com.web.base.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(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
}
|
||||
notificationManager.notify(0, notificationBuilder.build());
|
||||
//存储数据
|
||||
// saveNotifyMessage(body);
|
||||
}
|
||||
|
||||
|
||||
// public void saveNotifyMessage(String body) {
|
||||
// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class);
|
||||
// String savenotify = Utils.get(getApplication(),ApiService.savenotify,"");
|
||||
// if(messageInfo!=null){
|
||||
// if(TextUtils.isEmpty(savenotify)){
|
||||
// GsonUtils.getListFromJSON(savenotify,)
|
||||
// }
|
||||
// }
|
||||
// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @param key 要设置的key
|
||||
// */
|
||||
// public static void set(Context activity, String key, String is) {
|
||||
// SharedPreferences nameSetting = getConfigShared(activity);
|
||||
// SharedPreferences.Editor namePref = nameSetting.edit();
|
||||
// namePref.putString(key, is);
|
||||
// namePref.commit();
|
||||
// }
|
||||
}
|
||||
37
9kelab/src/main/java/com/web/kelab9/WebApplication.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.web.kelab9;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
|
||||
import com.tencent.smtt.export.external.TbsCoreSettings;
|
||||
import com.tencent.smtt.sdk.QbSdk;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class WebApplication extends Application {
|
||||
|
||||
|
||||
public static Context application;
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
// 设置开启优化方案
|
||||
application = this;
|
||||
HashMap map = new HashMap();
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true);
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true);
|
||||
QbSdk.initTbsSettings(map);
|
||||
QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() {
|
||||
@Override
|
||||
public void onCoreInitFinished() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewInitFinished(boolean b) {
|
||||
|
||||
}
|
||||
});
|
||||
QbSdk.setDownloadWithoutWifi(true);
|
||||
}
|
||||
}
|
||||
11
9kelab/src/main/res/drawable-anydpi/ic_action_back.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="#333333"
|
||||
android:alpha="0.8">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
|
||||
</vector>
|
||||
BIN
9kelab/src/main/res/drawable-hdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 182 B |
BIN
9kelab/src/main/res/drawable-mdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 150 B |
30
9kelab/src/main/res/drawable-v24/ic_launcher_foreground.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
||||
BIN
9kelab/src/main/res/drawable-xhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 212 B |
BIN
9kelab/src/main/res/drawable-xxhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 324 B |
170
9kelab/src/main/res/drawable/ic_launcher_background.xml
Normal file
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
||||
20
9kelab/src/main/res/drawable/input_bg.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/white">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape>
|
||||
<solid android:color="@android:color/transparent" />
|
||||
<corners android:radius="23dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 默认显⽰效果-->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/dialog_input_bg"/>
|
||||
<corners
|
||||
android:radius="3dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
|
||||
28
9kelab/src/main/res/drawable/pass_word_bg.xml
Normal 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>
|
||||
|
||||
23
9kelab/src/main/res/drawable/pass_word_bg1.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#FF0000"
|
||||
android:centerColor="#FF5555"
|
||||
android:endColor="#FBD3D0"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
23
9kelab/src/main/res/drawable/pass_word_bg2.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#000000"
|
||||
android:centerColor="#888888"
|
||||
android:endColor="#FFFFFF"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
5
9kelab/src/main/res/drawable/shape_btn_bg.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="22dp" />
|
||||
<solid android:color="@color/jisuanqi" />
|
||||
</shape>
|
||||
6
9kelab/src/main/res/drawable/shape_dialog_bg2.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:topRightRadius="12dp"
|
||||
android:topLeftRadius="12dp"/>
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
9kelab/src/main/res/drawable/shape_dialog_bg3.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="12dp" />
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
9kelab/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
BIN
9kelab/src/main/res/mipmap-hdpi/ic_empty.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
9kelab/src/main/res/mipmap-hdpi/ic_pull_down.png
Normal file
|
After Width: | Height: | Size: 271 B |
BIN
9kelab/src/main/res/mipmap-xhdpi/ic_close.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
9kelab/src/main/res/mipmap-xhdpi/ic_facebook.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
9kelab/src/main/res/mipmap-xhdpi/ic_hometo.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
9kelab/src/main/res/mipmap-xhdpi/ic_link.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
9kelab/src/main/res/mipmap-xhdpi/ic_menu.png
Normal file
|
After Width: | Height: | Size: 779 B |
BIN
9kelab/src/main/res/mipmap-xhdpi/ic_shousuo.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
9kelab/src/main/res/mipmap-xhdpi/ic_tel.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
9kelab/src/main/res/mipmap-xhdpi/ic_whatsapp.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
9kelab/src/main/res/mipmap-xhdpi/ic_zhangkai.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
9kelab/src/main/res/mipmap-xxhdpi/app_logo.png
Normal file
|
After Width: | Height: | Size: 50 KiB |
54
9kelab/src/main/res/values-en/strings.xml
Normal file
@@ -0,0 +1,54 @@
|
||||
<resources>
|
||||
<string name="app_name">9KELAB</string>
|
||||
<string name="qsrlwmm_txt">Please Set Your Password</string>
|
||||
<string name="cancel_txt">Cancel</string>
|
||||
<string name="sure_txt">Sure</string>
|
||||
<string name="banbengengxin_txt">New Version Update</string>
|
||||
<string name="xiacigengxin_txt">Next Update</string>
|
||||
<string name="lijigengxin_txt">Update Immediately</string>
|
||||
<string name="app_updater_error_notification_content">Click to close notification</string>
|
||||
<string name="app_updater_error_notification_content_re_download">Click to re-download</string>
|
||||
<string name="app_updater_error_notification_title">Download failed</string>
|
||||
<string name="app_updater_finish_notification_content">Click to install</string>
|
||||
<string name="app_updater_finish_notification_title">Download completed</string>
|
||||
<string name="app_updater_progress_notification_content">Downloading...</string>
|
||||
<string name="app_updater_progress_notification_title">Version update</string>
|
||||
<string name="app_updater_progress_notification_title_2">Downloading game</string>
|
||||
<string name="app_updater_start_notification_content">Getting download data...</string>
|
||||
<string name="app_updater_start_notification_title">Version update</string>
|
||||
<string name="app_updater_start_notification_title_2">Downloading game</string>
|
||||
<string name="notification_title_txt">Need to turn on mobile phone notification permission</string>
|
||||
<string name="notification_cancel_txt">Exit</string>
|
||||
<string name="notification_setting_txt">Setting</string>
|
||||
<string name="app_tishi">Tip</string>
|
||||
<string name="app_hint">Please enter the invitation code</string>
|
||||
<string name="app_sharetitle">My invitation code:</string>
|
||||
<string name="app_sharetitle2">Superior invitation code:</string>
|
||||
<string name="app_totalinvite">Total number of invites:</string>
|
||||
<string name="app_sharecontent">App download link:</string>
|
||||
<string name="app_share">Share</string>
|
||||
<string name="app_checklist">Check Invitation Records</string>
|
||||
<string name="app_invitetitle">Invitation Records</string>
|
||||
<string name="app_checklist_number">Total number of invitees: %d</string>
|
||||
<string name="app_nodata">No Data</string>
|
||||
<string name="app_withdrawtitle">Withdrawal Record</string>
|
||||
<string name="app_withdrawapply_title">Withdrawal Application</string>
|
||||
<string name="app_bankinfo_title">Edit Bank Card Information</string>
|
||||
<string name="app_bankinfo_countrycode">60</string>
|
||||
<string name="app_bankinfo_name">Name:</string>
|
||||
<string name="app_bankinfo_name_hint">Please enter the bank card name</string>
|
||||
<string name="app_bankinfo_code">Bank card account:</string>
|
||||
<string name="app_bankinfo_code_hint">Please enter the bank card account</string>
|
||||
<string name="app_bankinfo_bankcountry">Country:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">Please select a country</string>
|
||||
<string name="app_bankinfo_bankname">Bank Name:</string>
|
||||
<string name="app_bankinfo_bankname_hint">Please select a bank name</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">Note: Please enter the country code before selecting the bank name!</string>
|
||||
<string name="app_balance">Balance: %s</string>
|
||||
<string name="app_totalearning">Total Earnings: %s</string>
|
||||
<string name="app_withdraw_amount">Amount: %s</string>
|
||||
<string name="app_withdraw_apply_hint">Please enter the withdrawal amount</string>
|
||||
<string name="app_toastapply">Withdrawal application has been submitted</string>
|
||||
<string name="app_notinstall">App not installed</string>
|
||||
|
||||
</resources>
|
||||
69
9kelab/src/main/res/values-night/themes.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.Calculcator" parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_200</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/black</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_200</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</item>
|
||||
</style>
|
||||
</resources>
|
||||
19
9kelab/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="purple_200">#FFFFFF</color>
|
||||
<color name="purple_500">#FFFFFF</color>
|
||||
<color name="purple_700">#FFFFFF</color>
|
||||
<color name="teal_200">#FF03DAC5</color>
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="jisuanqi">#EF4723</color>
|
||||
<color name="notify_color">#FFFFFFFF</color>
|
||||
|
||||
<color name="dialog_bg">#2C2C2E</color>
|
||||
<color name="dialog_textcolor">#FFA722</color>
|
||||
<color name="dialog_input_bg">#434343</color>
|
||||
<color name="dialog_dark">#BCBCBC</color>
|
||||
<color name="color_red">#DC1927</color>
|
||||
|
||||
</resources>
|
||||
77
9kelab/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,77 @@
|
||||
<resources>
|
||||
<string name="app_name">9KELAB</string>
|
||||
<string name="qsrlwmm_txt">请输入6位密码</string>
|
||||
<string name="cancel_txt">取消</string>
|
||||
<string name="sure_txt">确定</string>
|
||||
<string name="banbengengxin_txt">版本更新</string>
|
||||
<string name="xiacigengxin_txt">下次更新</string>
|
||||
<string name="lijigengxin_txt">立即更新</string>
|
||||
<string name="app_updater_error_notification_content">点击关闭通知</string>
|
||||
<string name="app_updater_error_notification_content_re_download">点击重新下载</string>
|
||||
<string name="app_updater_error_notification_title">下载失败</string>
|
||||
<string name="app_updater_finish_notification_content">点击安装</string>
|
||||
<string name="app_updater_finish_notification_title">下载完成</string>
|
||||
<string name="app_updater_progress_notification_content">正在下载…</string>
|
||||
<string name="app_updater_progress_notification_title">版本更新</string>
|
||||
<string name="app_updater_progress_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_title">版本更新</string>
|
||||
<string name="app_updater_start_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_content">正在获取下载数据…</string>
|
||||
<string name="notification_title_txt">需要打开手机通知权限</string>
|
||||
<string name="notification_cancel_txt">退出</string>
|
||||
<string name="notification_setting_txt">设置</string>
|
||||
<string name="app_tishi">提示</string>
|
||||
<string name="app_hint">请输入邀请码</string>
|
||||
<string name="app_sharetitle">我的邀请码:</string>
|
||||
<string name="app_sharetitle2">上级邀请码:</string>
|
||||
<string name="app_totalinvite">总邀请人数:</string>
|
||||
<string name="app_sharecontent">邀请您下载:</string>
|
||||
<string name="app_share">分享</string>
|
||||
<string name="app_checklist">查看邀请记录</string>
|
||||
<string name="app_invitetitle">邀请记录</string>
|
||||
<string name="app_checklist_number">总邀请人数: %d</string>
|
||||
<string name="app_nodata">暂无数据</string>
|
||||
<string name="app_withdrawtitle">提现记录</string>
|
||||
<string name="app_withdrawapply_title">提现申请</string>
|
||||
<string name="app_bankinfo_title">编辑银行卡信息</string>
|
||||
<string name="app_bankinfo_countrycode">86</string>
|
||||
<string name="app_bankinfo_name">持卡人姓名:</string>
|
||||
<string name="app_bankinfo_name_hint">请输入持卡人姓名</string>
|
||||
<string name="app_bankinfo_bankcountry">国家地区:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">请选择国家地区</string>
|
||||
<string name="app_bankinfo_bankname">开户行名称:</string>
|
||||
<string name="app_bankinfo_bankname_hint">请选择开户行名称</string>
|
||||
<string name="app_bankinfo_code">银行户口:</string>
|
||||
<string name="app_bankinfo_code_hint">请输入银行卡户口</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">(注:请先输入国家区号再选择开户行名称!)</string>
|
||||
<string name="app_balance">余额: %s</string>
|
||||
<string name="app_totalearning">总收益: %s</string>
|
||||
<string name="app_withdraw_amount">金额: %s</string>
|
||||
<string name="app_withdraw_apply_hint">请输入提现金额</string>
|
||||
<string name="app_toastapply">提现申请已提交</string>
|
||||
<string name="app_notinstall">应用未安装</string>
|
||||
|
||||
|
||||
<!-- <string name="app_name">SPEEDAU</string>-->
|
||||
<!-- <string name="qsrlwmm_txt">Please Set Your Password</string>-->
|
||||
<!-- <string name="cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="sure_txt">Sure</string>-->
|
||||
<!-- <string name="banbengengxin_txt">New Version Update</string>-->
|
||||
<!-- <string name="xiacigengxin_txt">Next Update</string>-->
|
||||
<!-- <string name="lijigengxin_txt">Update Immediately</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content">Click to close notification</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content_re_download">Click to re-download</string>-->
|
||||
<!-- <string name="app_updater_error_notification_title">Download failed</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_content">Click to install</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_title">Download completed</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_content">Downloading...</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="app_updater_start_notification_content">Getting download data...</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="notification_title_txt">Need to turn on mobile phone notification permission</string>-->
|
||||
<!-- <string name="notification_cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="notification_setting_txt">Setting</string>-->
|
||||
|
||||
</resources>
|
||||
20
9kelab/src/main/res/values/style.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="AppThemeStart1" parent="@style/Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="android:windowTranslucentStatus">true</item>
|
||||
<item name="android:windowTranslucentNavigation">false</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="colorPrimary">@android:color/transparent</item>
|
||||
<item name="colorPrimaryDark">@android:color/transparent</item>
|
||||
<item name="colorAccent">@android:color/transparent</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<!-- 隐藏Activity窗口的Title标题栏 -->
|
||||
<item name="windowNoTitle">true</item>
|
||||
<!-- <item name="android:windowFullscreen">true</item>-->
|
||||
<item name="android:windowBackground">@color/white</item>
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</item>
|
||||
</style>
|
||||
</resources>
|
||||
89
9kelab/src/main/res/values/themes.xml
Normal file
@@ -0,0 +1,89 @@
|
||||
<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. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
<item name="android:enforceNavigationBarContrast" tools:ignore="NewApi">false</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</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>
|
||||
10
9kelab/src/main/res/xml/app_updater_paths.xml
Normal 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>
|
||||
4
9kelab/src/main/res/xml/network_security_config.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<network-security-config>
|
||||
<base-config cleartextTrafficPermitted="true" />
|
||||
</network-security-config>
|
||||
13
9kelab/src/main/res/xml/provider_paths.xml
Normal 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"异常的问题 -->
|
||||
@@ -0,0 +1,35 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void TestPattern(){
|
||||
//
|
||||
Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$");
|
||||
String a="+45.5";
|
||||
boolean matches = compile.matcher(a).matches();
|
||||
System.out.println(matches);
|
||||
String result = compile.matcher(a).replaceAll("");
|
||||
System.out.println(result);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
1
Bbj/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
BIN
Bbj/agn.jks
Normal file
BIN
Bbj/bbj.jks
Normal file
105
Bbj/build.gradle
Normal file
@@ -0,0 +1,105 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'com.google.gms.google-services'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 31
|
||||
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.web.bbj"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 31
|
||||
versionCode 106
|
||||
versionName "v1.0.6"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
signingConfigs {
|
||||
// debug {
|
||||
// storeFile file('bbj.jks')
|
||||
// storePassword "android2014"
|
||||
// keyAlias 'key0'
|
||||
// keyPassword "android2014"
|
||||
// }
|
||||
// release {
|
||||
// storeFile file('bbj.jks')
|
||||
// storePassword "android2014"
|
||||
// keyAlias 'key0'
|
||||
// keyPassword "android2014"
|
||||
// }
|
||||
|
||||
debug {
|
||||
storeFile file('agn.jks')
|
||||
storePassword "android2025"
|
||||
keyAlias 'key0'
|
||||
keyPassword "android2025"
|
||||
}
|
||||
release {
|
||||
storeFile file('agn.jks')
|
||||
storePassword "android2025"
|
||||
keyAlias 'key0'
|
||||
keyPassword "android2025"
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'com.google.android.material:material:1.1.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
testImplementation 'junit:junit:4.+'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar')
|
||||
|
||||
// okhttp相关库
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
|
||||
|
||||
// JSON解析库
|
||||
implementation 'com.google.code.gson:gson:2.9.0'
|
||||
implementation 'com.alibaba:fastjson:1.1.71.android'
|
||||
api 'com.squareup.retrofit2:retrofit:2.5.0'
|
||||
api 'com.squareup.retrofit2:converter-scalars:2.3.0'
|
||||
api 'com.squareup.retrofit2:converter-gson:2.4.0'
|
||||
api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
|
||||
api 'io.reactivex.rxjava2:rxjava:2.1.16'
|
||||
api 'io.reactivex.rxjava2:rxandroid:2.0.2'
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选)
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选)
|
||||
implementation 'com.github.Justson:Downloader:v5.0.4-androidx'
|
||||
//implementation 'com.tencent.tbs:tbssdk:44286'
|
||||
// sdk 33
|
||||
// implementation platform('com.google.firebase:firebase-bom:32.7.0')
|
||||
// Firebase Cloud Messaging
|
||||
// implementation("com.google.firebase:firebase-messaging")
|
||||
// implementation("com.google.firebase:firebase-analytics")
|
||||
|
||||
implementation platform('com.google.firebase:firebase-bom:32.1.0')
|
||||
|
||||
// Add the dependencies for the Firebase Cloud Messaging and Analytics libraries
|
||||
// When using the BoM, you don't specify versions in Firebase library dependencies
|
||||
implementation 'com.google.firebase:firebase-messaging'
|
||||
implementation 'com.google.firebase:firebase-analytics'
|
||||
// implementation("com.google.firebase:firebase-messaging:23.2.1")
|
||||
// implementation("com.google.firebase:firebase-analytics:21.2.1")
|
||||
// implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式
|
||||
implementation("com.github.bumptech.glide:glide:4.13.1")
|
||||
implementation project(path: ':base')
|
||||
|
||||
}
|
||||
29
Bbj/google-services.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "689386681720",
|
||||
"project_id": "bbj1-283eb",
|
||||
"storage_bucket": "bbj1-283eb.firebasestorage.app"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:689386681720:android:a83b2b83f6b57066e5848d",
|
||||
"android_client_info": {
|
||||
"package_name": "com.web.bbj"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyAa9G5cKqC0FPm15EHg9b-ZK7OjliRvNi8"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
BIN
Bbj/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar
Normal file
32
Bbj/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
||||
-dontwarn dalvik.**
|
||||
-dontwarn com.tencent.smtt.**
|
||||
|
||||
-keep class com.tencent.smtt.** {
|
||||
*;
|
||||
}
|
||||
|
||||
-keep class com.tencent.tbs.** {
|
||||
*;
|
||||
}
|
||||
BIN
Bbj/release/bbj.apk
Normal file
18
Bbj/release/output-metadata.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"version": 2,
|
||||
"artifactType": {
|
||||
"type": "APK",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "com.web.bbj",
|
||||
"variantName": "processReleaseResources",
|
||||
"elements": [
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"versionCode": 106,
|
||||
"versionName": "v1.0.6",
|
||||
"outputFile": "Bbj-release.apk"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("Tptogiar.calculcator", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
131
Bbj/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,131 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.web.bbj">
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera"
|
||||
android:required="false" />
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera2"
|
||||
android:required="false" />
|
||||
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS" /> <!-- 获取通讯录-->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<!-- 多媒体相关 -->
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
|
||||
<!-- 8.0+系统需要-->
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
|
||||
<!--推送权限-->
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_SECURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.RECORD_AUDIO" />-->
|
||||
|
||||
|
||||
<!-- <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_AUDIO_OUTPUT" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.autofocus" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.front" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.level.full" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.capability.raw" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.any" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.microphone" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera2" android:required="true" />-->
|
||||
|
||||
<queries>
|
||||
<intent>
|
||||
<action android:name="android.media.action.IMAGE_CAPTURE" />
|
||||
</intent>
|
||||
</queries>
|
||||
<application
|
||||
android:name=".WebApplication"
|
||||
android:allowBackup="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:icon="@mipmap/app_logo"
|
||||
android:label="@string/app_name"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:roundIcon="@mipmap/app_logo"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.AppTheme"
|
||||
android:usesCleartextTraffic="true">
|
||||
|
||||
|
||||
<!-- <activity-alias-->
|
||||
<!-- android:name=".MainActivityNew"-->
|
||||
<!-- android:icon="@mipmap/winway"-->
|
||||
<!-- android:roundIcon="@mipmap/winway"-->
|
||||
<!-- android:label="@string/app_name1"-->
|
||||
<!-- android:targetActivity=".MainActivity"-->
|
||||
<!-- android:enabled="false"-->
|
||||
<!-- android:exported="true"-->
|
||||
<!-- android:configChanges="orientation|navigation|keyboardHidden"-->
|
||||
<!-- android:launchMode="singleTop"-->
|
||||
<!-- android:excludeFromRecents="true"-->
|
||||
<!-- android:screenOrientation="portrait">-->
|
||||
<!-- <intent-filter>-->
|
||||
<!-- <action android:name="android.intent.action.MAIN" />-->
|
||||
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
|
||||
<!-- </intent-filter>-->
|
||||
<!-- </activity-alias>-->
|
||||
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity2"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:exported="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:theme="@style/AppThemeStart">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<service
|
||||
android:name="com.tencent.smtt.export.external.DexClassLoaderProviderService"
|
||||
android:label="dexopt"
|
||||
android:process=":dexopt" />
|
||||
|
||||
|
||||
<!-- android:directBootAware="true" 为应用启用消息处理直接启动模式-->
|
||||
<service
|
||||
android:name=".MyFirebaseMessageingService"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<!-- Set custom default icon. This is used when no icon is set for incoming notification messages.
|
||||
See README(https://goo.gl/l4GJaQ) for more. 设置推送默认图标 和颜色-->
|
||||
<meta-data
|
||||
android:name="com.google.firebase.messaging.default_notification_icon"
|
||||
android:resource="@mipmap/app_logo" />
|
||||
<!-- Set color used with incoming notification messages. This is used when no color is set for the incoming
|
||||
notification message. See README(https://goo.gl/6BKBk7) for more. -->
|
||||
<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" />
|
||||
<!-- 还可设置推送渠道 -->
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.google.firebase.messaging.default_notification_channel_id"-->
|
||||
<!-- android:value="@string/default_notification_channel_id" />-->
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
54
Bbj/src/main/java/com/web/bbj/MainActivity2.java
Normal file
@@ -0,0 +1,54 @@
|
||||
package com.web.bbj;
|
||||
|
||||
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.android.gms.tasks.OnCompleteListener;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.firebase.messaging.FirebaseMessaging;
|
||||
import com.web.base.MainActivity;
|
||||
|
||||
public class MainActivity2 extends com.web.base.MainActivity2 {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
userId = 87;
|
||||
saveInt(MainActivity2.this,"user_code",userId);
|
||||
saveInt(MainActivity2.this,"version_code",getVersion());
|
||||
MainActivity.saveString(this, "base_url", "https://bigbossjudi.online/");
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
//订阅主题
|
||||
FirebaseMessaging.getInstance().subscribeToTopic("demo")
|
||||
.addOnCompleteListener(new OnCompleteListener<Void>() {
|
||||
@Override
|
||||
public void onComplete(@NonNull Task<Void> task) {
|
||||
String msg = "Subscribed";
|
||||
if (!task.isSuccessful()) {
|
||||
msg = "Subscribe failed";
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public int getVersion(){
|
||||
try {
|
||||
PackageManager packageManager = getPackageManager();
|
||||
PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0);
|
||||
String StringversionName = packageInfo.versionName; // 版本号
|
||||
int versionCode = packageInfo.versionCode; // 版本码
|
||||
// 在这里可以使用versionName和versionCode进行相关的操作
|
||||
// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode);
|
||||
return versionCode;
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
171
Bbj/src/main/java/com/web/bbj/MyFirebaseMessageingService.java
Normal file
@@ -0,0 +1,171 @@
|
||||
package com.web.bbj;
|
||||
|
||||
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.web.base.GsonUtils;
|
||||
import com.web.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);
|
||||
// if (remoteMessage.getNotification() != null) {
|
||||
// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
// }
|
||||
} else {
|
||||
//收到通知 创建notify
|
||||
if (remoteMessage.getNotification() != null) {
|
||||
showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void showNotification(MessageInfo messageInfo) {
|
||||
Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.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);
|
||||
|
||||
// Intent notifyIntent = new Intent(this, MainActivity2.class);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
// // notifyIntent.putExtra("message", messageInfo);
|
||||
// notifyIntent.setAction(Intent.ACTION_VIEW);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须
|
||||
// PendingIntent pendingIntent;
|
||||
// pendingIntent = PendingIntent.getActivity
|
||||
// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | 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(com.web.base.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(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(messageInfo.getTitle())
|
||||
.setContentText(messageInfo.getContent())
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.R.mipmap.ic_launcher)
|
||||
.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, MainActivity2.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(com.web.base.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(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
}
|
||||
notificationManager.notify(0, notificationBuilder.build());
|
||||
//存储数据
|
||||
// saveNotifyMessage(body);
|
||||
}
|
||||
|
||||
|
||||
// public void saveNotifyMessage(String body) {
|
||||
// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class);
|
||||
// String savenotify = Utils.get(getApplication(),ApiService.savenotify,"");
|
||||
// if(messageInfo!=null){
|
||||
// if(TextUtils.isEmpty(savenotify)){
|
||||
// GsonUtils.getListFromJSON(savenotify,)
|
||||
// }
|
||||
// }
|
||||
// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @param key 要设置的key
|
||||
// */
|
||||
// public static void set(Context activity, String key, String is) {
|
||||
// SharedPreferences nameSetting = getConfigShared(activity);
|
||||
// SharedPreferences.Editor namePref = nameSetting.edit();
|
||||
// namePref.putString(key, is);
|
||||
// namePref.commit();
|
||||
// }
|
||||
}
|
||||
37
Bbj/src/main/java/com/web/bbj/WebApplication.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.web.bbj;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
|
||||
import com.tencent.smtt.export.external.TbsCoreSettings;
|
||||
import com.tencent.smtt.sdk.QbSdk;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class WebApplication extends Application {
|
||||
|
||||
|
||||
public static Context application;
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
// 设置开启优化方案
|
||||
application = this;
|
||||
HashMap map = new HashMap();
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true);
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true);
|
||||
QbSdk.initTbsSettings(map);
|
||||
QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() {
|
||||
@Override
|
||||
public void onCoreInitFinished() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewInitFinished(boolean b) {
|
||||
|
||||
}
|
||||
});
|
||||
QbSdk.setDownloadWithoutWifi(true);
|
||||
}
|
||||
}
|
||||
11
Bbj/src/main/res/drawable-anydpi/ic_action_back.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="#333333"
|
||||
android:alpha="0.8">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
|
||||
</vector>
|
||||
BIN
Bbj/src/main/res/drawable-hdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 182 B |
BIN
Bbj/src/main/res/drawable-mdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 150 B |
30
Bbj/src/main/res/drawable-v24/ic_launcher_foreground.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
||||
BIN
Bbj/src/main/res/drawable-xhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 212 B |
BIN
Bbj/src/main/res/drawable-xxhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 324 B |
170
Bbj/src/main/res/drawable/ic_launcher_background.xml
Normal file
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
||||
20
Bbj/src/main/res/drawable/input_bg.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/white">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape>
|
||||
<solid android:color="@android:color/transparent" />
|
||||
<corners android:radius="23dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 默认显⽰效果-->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/dialog_input_bg"/>
|
||||
<corners
|
||||
android:radius="3dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
|
||||
28
Bbj/src/main/res/drawable/pass_word_bg.xml
Normal 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>
|
||||
|
||||
23
Bbj/src/main/res/drawable/pass_word_bg1.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#FF0000"
|
||||
android:centerColor="#FF5555"
|
||||
android:endColor="#FBD3D0"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
23
Bbj/src/main/res/drawable/pass_word_bg2.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#000000"
|
||||
android:centerColor="#888888"
|
||||
android:endColor="#FFFFFF"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
5
Bbj/src/main/res/drawable/shape_btn_bg.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="22dp" />
|
||||
<solid android:color="@color/jisuanqi" />
|
||||
</shape>
|
||||
6
Bbj/src/main/res/drawable/shape_dialog_bg2.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:topRightRadius="12dp"
|
||||
android:topLeftRadius="12dp"/>
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
Bbj/src/main/res/drawable/shape_dialog_bg3.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="12dp" />
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
Bbj/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
5
Bbj/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
BIN
Bbj/src/main/res/mipmap-hdpi/ic_empty.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
Bbj/src/main/res/mipmap-hdpi/ic_pull_down.png
Normal file
|
After Width: | Height: | Size: 271 B |
BIN
Bbj/src/main/res/mipmap-xhdpi/ic_close.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
Bbj/src/main/res/mipmap-xhdpi/ic_facebook.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
Bbj/src/main/res/mipmap-xhdpi/ic_hometo.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
Bbj/src/main/res/mipmap-xhdpi/ic_link.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
Bbj/src/main/res/mipmap-xhdpi/ic_menu.png
Normal file
|
After Width: | Height: | Size: 779 B |
BIN
Bbj/src/main/res/mipmap-xhdpi/ic_shousuo.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
Bbj/src/main/res/mipmap-xhdpi/ic_tel.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
Bbj/src/main/res/mipmap-xhdpi/ic_whatsapp.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
Bbj/src/main/res/mipmap-xhdpi/ic_zhangkai.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
Bbj/src/main/res/mipmap-xxhdpi/app_logo.jpg
Normal file
|
After Width: | Height: | Size: 26 KiB |
54
Bbj/src/main/res/values-en/strings.xml
Normal file
@@ -0,0 +1,54 @@
|
||||
<resources>
|
||||
<string name="app_name">BBJ</string>
|
||||
<string name="qsrlwmm_txt">Please Set Your Password</string>
|
||||
<string name="cancel_txt">Cancel</string>
|
||||
<string name="sure_txt">Sure</string>
|
||||
<string name="banbengengxin_txt">New Version Update</string>
|
||||
<string name="xiacigengxin_txt">Next Update</string>
|
||||
<string name="lijigengxin_txt">Update Immediately</string>
|
||||
<string name="app_updater_error_notification_content">Click to close notification</string>
|
||||
<string name="app_updater_error_notification_content_re_download">Click to re-download</string>
|
||||
<string name="app_updater_error_notification_title">Download failed</string>
|
||||
<string name="app_updater_finish_notification_content">Click to install</string>
|
||||
<string name="app_updater_finish_notification_title">Download completed</string>
|
||||
<string name="app_updater_progress_notification_content">Downloading...</string>
|
||||
<string name="app_updater_progress_notification_title">Version update</string>
|
||||
<string name="app_updater_progress_notification_title_2">Downloading game</string>
|
||||
<string name="app_updater_start_notification_content">Getting download data...</string>
|
||||
<string name="app_updater_start_notification_title">Version update</string>
|
||||
<string name="app_updater_start_notification_title_2">Downloading game</string>
|
||||
<string name="notification_title_txt">Need to turn on mobile phone notification permission</string>
|
||||
<string name="notification_cancel_txt">Exit</string>
|
||||
<string name="notification_setting_txt">Setting</string>
|
||||
<string name="app_tishi">Tip</string>
|
||||
<string name="app_hint">Please enter the invitation code</string>
|
||||
<string name="app_sharetitle">My invitation code:</string>
|
||||
<string name="app_sharetitle2">Superior invitation code:</string>
|
||||
<string name="app_totalinvite">Total number of invites:</string>
|
||||
<string name="app_sharecontent">App download link:</string>
|
||||
<string name="app_share">Share</string>
|
||||
<string name="app_checklist">Check Invitation Records</string>
|
||||
<string name="app_invitetitle">Invitation Records</string>
|
||||
<string name="app_checklist_number">Total number of invitees: %d</string>
|
||||
<string name="app_nodata">No Data</string>
|
||||
<string name="app_withdrawtitle">Withdrawal Record</string>
|
||||
<string name="app_withdrawapply_title">Withdrawal Application</string>
|
||||
<string name="app_bankinfo_title">Edit Bank Card Information</string>
|
||||
<string name="app_bankinfo_countrycode">60</string>
|
||||
<string name="app_bankinfo_name">Name:</string>
|
||||
<string name="app_bankinfo_name_hint">Please enter the bank card name</string>
|
||||
<string name="app_bankinfo_code">Bank card account:</string>
|
||||
<string name="app_bankinfo_code_hint">Please enter the bank card account</string>
|
||||
<string name="app_bankinfo_bankcountry">Country:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">Please select a country</string>
|
||||
<string name="app_bankinfo_bankname">Bank Name:</string>
|
||||
<string name="app_bankinfo_bankname_hint">Please select a bank name</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">Note: Please enter the country code before selecting the bank name!</string>
|
||||
<string name="app_balance">Balance: %s</string>
|
||||
<string name="app_totalearning">Total Earnings: %s</string>
|
||||
<string name="app_withdraw_amount">Amount: %s</string>
|
||||
<string name="app_withdraw_apply_hint">Please enter the withdrawal amount</string>
|
||||
<string name="app_toastapply">Withdrawal application has been submitted</string>
|
||||
<string name="app_notinstall">App not installed</string>
|
||||
|
||||
</resources>
|
||||
69
Bbj/src/main/res/values-night/themes.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.Calculcator" parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_200</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/black</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_200</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</item>
|
||||
</style>
|
||||
</resources>
|
||||
19
Bbj/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="purple_200">#FFFFFF</color>
|
||||
<color name="purple_500">#FFFFFF</color>
|
||||
<color name="purple_700">#FFFFFF</color>
|
||||
<color name="teal_200">#FF03DAC5</color>
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="jisuanqi">#EF4723</color>
|
||||
<color name="notify_color">#FFFFFFFF</color>
|
||||
|
||||
<color name="dialog_bg">#2C2C2E</color>
|
||||
<color name="dialog_textcolor">#FFA722</color>
|
||||
<color name="dialog_input_bg">#434343</color>
|
||||
<color name="dialog_dark">#BCBCBC</color>
|
||||
<color name="color_red">#DC1927</color>
|
||||
|
||||
</resources>
|
||||
77
Bbj/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,77 @@
|
||||
<resources>
|
||||
<string name="app_name">BBJ</string>
|
||||
<string name="qsrlwmm_txt">请输入6位密码</string>
|
||||
<string name="cancel_txt">取消</string>
|
||||
<string name="sure_txt">确定</string>
|
||||
<string name="banbengengxin_txt">版本更新</string>
|
||||
<string name="xiacigengxin_txt">下次更新</string>
|
||||
<string name="lijigengxin_txt">立即更新</string>
|
||||
<string name="app_updater_error_notification_content">点击关闭通知</string>
|
||||
<string name="app_updater_error_notification_content_re_download">点击重新下载</string>
|
||||
<string name="app_updater_error_notification_title">下载失败</string>
|
||||
<string name="app_updater_finish_notification_content">点击安装</string>
|
||||
<string name="app_updater_finish_notification_title">下载完成</string>
|
||||
<string name="app_updater_progress_notification_content">正在下载…</string>
|
||||
<string name="app_updater_progress_notification_title">版本更新</string>
|
||||
<string name="app_updater_progress_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_title">版本更新</string>
|
||||
<string name="app_updater_start_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_content">正在获取下载数据…</string>
|
||||
<string name="notification_title_txt">需要打开手机通知权限</string>
|
||||
<string name="notification_cancel_txt">退出</string>
|
||||
<string name="notification_setting_txt">设置</string>
|
||||
<string name="app_tishi">提示</string>
|
||||
<string name="app_hint">请输入邀请码</string>
|
||||
<string name="app_sharetitle">我的邀请码:</string>
|
||||
<string name="app_sharetitle2">上级邀请码:</string>
|
||||
<string name="app_totalinvite">总邀请人数:</string>
|
||||
<string name="app_sharecontent">邀请您下载:</string>
|
||||
<string name="app_share">分享</string>
|
||||
<string name="app_checklist">查看邀请记录</string>
|
||||
<string name="app_invitetitle">邀请记录</string>
|
||||
<string name="app_checklist_number">总邀请人数: %d</string>
|
||||
<string name="app_nodata">暂无数据</string>
|
||||
<string name="app_withdrawtitle">提现记录</string>
|
||||
<string name="app_withdrawapply_title">提现申请</string>
|
||||
<string name="app_bankinfo_title">编辑银行卡信息</string>
|
||||
<string name="app_bankinfo_countrycode">86</string>
|
||||
<string name="app_bankinfo_name">持卡人姓名:</string>
|
||||
<string name="app_bankinfo_name_hint">请输入持卡人姓名</string>
|
||||
<string name="app_bankinfo_bankcountry">国家地区:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">请选择国家地区</string>
|
||||
<string name="app_bankinfo_bankname">开户行名称:</string>
|
||||
<string name="app_bankinfo_bankname_hint">请选择开户行名称</string>
|
||||
<string name="app_bankinfo_code">银行户口:</string>
|
||||
<string name="app_bankinfo_code_hint">请输入银行卡户口</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">(注:请先输入国家区号再选择开户行名称!)</string>
|
||||
<string name="app_balance">余额: %s</string>
|
||||
<string name="app_totalearning">总收益: %s</string>
|
||||
<string name="app_withdraw_amount">金额: %s</string>
|
||||
<string name="app_withdraw_apply_hint">请输入提现金额</string>
|
||||
<string name="app_toastapply">提现申请已提交</string>
|
||||
<string name="app_notinstall">应用未安装</string>
|
||||
|
||||
|
||||
<!-- <string name="app_name">SPEEDAU</string>-->
|
||||
<!-- <string name="qsrlwmm_txt">Please Set Your Password</string>-->
|
||||
<!-- <string name="cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="sure_txt">Sure</string>-->
|
||||
<!-- <string name="banbengengxin_txt">New Version Update</string>-->
|
||||
<!-- <string name="xiacigengxin_txt">Next Update</string>-->
|
||||
<!-- <string name="lijigengxin_txt">Update Immediately</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content">Click to close notification</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content_re_download">Click to re-download</string>-->
|
||||
<!-- <string name="app_updater_error_notification_title">Download failed</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_content">Click to install</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_title">Download completed</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_content">Downloading...</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="app_updater_start_notification_content">Getting download data...</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="notification_title_txt">Need to turn on mobile phone notification permission</string>-->
|
||||
<!-- <string name="notification_cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="notification_setting_txt">Setting</string>-->
|
||||
|
||||
</resources>
|
||||
20
Bbj/src/main/res/values/style.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="AppThemeStart1" parent="@style/Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="android:windowTranslucentStatus">true</item>
|
||||
<item name="android:windowTranslucentNavigation">false</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="colorPrimary">@android:color/transparent</item>
|
||||
<item name="colorPrimaryDark">@android:color/transparent</item>
|
||||
<item name="colorAccent">@android:color/transparent</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<!-- 隐藏Activity窗口的Title标题栏 -->
|
||||
<item name="windowNoTitle">true</item>
|
||||
<!-- <item name="android:windowFullscreen">true</item>-->
|
||||
<item name="android:windowBackground">@color/white</item>
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</item>
|
||||
</style>
|
||||
</resources>
|
||||
89
Bbj/src/main/res/values/themes.xml
Normal file
@@ -0,0 +1,89 @@
|
||||
<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. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
<item name="android:enforceNavigationBarContrast" tools:ignore="NewApi">false</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</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>
|
||||
10
Bbj/src/main/res/xml/app_updater_paths.xml
Normal 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>
|
||||
4
Bbj/src/main/res/xml/network_security_config.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<network-security-config>
|
||||
<base-config cleartextTrafficPermitted="true" />
|
||||
</network-security-config>
|
||||
13
Bbj/src/main/res/xml/provider_paths.xml
Normal 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"异常的问题 -->
|
||||
35
Bbj/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java
Normal file
@@ -0,0 +1,35 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void TestPattern(){
|
||||
//
|
||||
Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$");
|
||||
String a="+45.5";
|
||||
boolean matches = compile.matcher(a).matches();
|
||||
System.out.println(matches);
|
||||
String result = compile.matcher(a).replaceAll("");
|
||||
System.out.println(result);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
1
Bintang918/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
BIN
Bintang918/agn.jks
Normal file
BIN
Bintang918/bintang.jks
Normal file
98
Bintang918/build.gradle
Normal file
@@ -0,0 +1,98 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'com.google.gms.google-services'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 31
|
||||
buildToolsVersion "30.0.3"
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.web.bintang918"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 31
|
||||
versionCode 109
|
||||
versionName "v1.0.9"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
signingConfigs {
|
||||
// debug {
|
||||
// storeFile file('test.jks')
|
||||
// storePassword "android2025"
|
||||
// keyAlias 'key0'
|
||||
// keyPassword "android2025"
|
||||
// }
|
||||
// release {
|
||||
// storeFile file('test.jks')
|
||||
// storePassword "android2025"
|
||||
// keyAlias 'key0'
|
||||
// keyPassword "android2025"
|
||||
// }
|
||||
|
||||
debug {
|
||||
storeFile file('bintang.jks')
|
||||
storePassword "dskj123456"
|
||||
keyAlias 'key0'
|
||||
keyPassword "dskj123456"
|
||||
}
|
||||
release {
|
||||
storeFile file('bintang.jks')
|
||||
storePassword "dskj123456"
|
||||
keyAlias 'key0'
|
||||
keyPassword "dskj123456"
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'com.google.android.material:material:1.1.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
testImplementation 'junit:junit:4.+'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar')
|
||||
|
||||
// okhttp相关库
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
|
||||
|
||||
// JSON解析库
|
||||
implementation 'com.google.code.gson:gson:2.9.0'
|
||||
implementation 'com.alibaba:fastjson:1.1.71.android'
|
||||
api 'com.squareup.retrofit2:retrofit:2.5.0'
|
||||
api 'com.squareup.retrofit2:converter-scalars:2.3.0'
|
||||
api 'com.squareup.retrofit2:converter-gson:2.4.0'
|
||||
api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
|
||||
api 'io.reactivex.rxjava2:rxjava:2.1.16'
|
||||
api 'io.reactivex.rxjava2:rxandroid:2.0.2'
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选)
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选)
|
||||
implementation 'com.github.Justson:Downloader:v5.0.4-androidx'
|
||||
//implementation 'com.tencent.tbs:tbssdk:44286'
|
||||
// sdk 33
|
||||
implementation platform('com.google.firebase:firebase-bom:32.7.0')
|
||||
// Firebase Cloud Messaging
|
||||
// implementation("com.google.firebase:firebase-messaging")
|
||||
// implementation("com.google.firebase:firebase-analytics")
|
||||
|
||||
implementation("com.google.firebase:firebase-messaging:24.0.3")
|
||||
// implementation("com.google.firebase:firebase-analytics:21.2.1")
|
||||
// implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式
|
||||
implementation("com.github.bumptech.glide:glide:4.13.1")
|
||||
implementation project(path: ':base')
|
||||
|
||||
}
|
||||
29
Bintang918/google-services.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "985316013410",
|
||||
"project_id": "bintang918-ios",
|
||||
"storage_bucket": "bintang918-ios.firebasestorage.app"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:985316013410:android:1af4f1fec28e354cc6e83b",
|
||||
"android_client_info": {
|
||||
"package_name": "com.web.bintang918"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyAhLRvWS13LTqexIcRVWptbPSXwcLmmLzM"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
BIN
Bintang918/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar
Normal file
32
Bintang918/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
||||
-dontwarn dalvik.**
|
||||
-dontwarn com.tencent.smtt.**
|
||||
|
||||
-keep class com.tencent.smtt.** {
|
||||
*;
|
||||
}
|
||||
|
||||
-keep class com.tencent.tbs.** {
|
||||
*;
|
||||
}
|
||||
BIN
Bintang918/release/Bintang918.apk
Normal file
18
Bintang918/release/output-metadata.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"version": 2,
|
||||
"artifactType": {
|
||||
"type": "APK",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "com.web.bintang918",
|
||||
"variantName": "processReleaseResources",
|
||||
"elements": [
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"versionCode": 109,
|
||||
"versionName": "v1.0.9",
|
||||
"outputFile": "Bintang918-release.apk"
|
||||
}
|
||||
]
|
||||
}
|
||||
BIN
Bintang918/release/testweb.apk
Normal file
@@ -0,0 +1,26 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("Tptogiar.calculcator", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
129
Bintang918/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,129 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.web.bintang918">
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera"
|
||||
android:required="false" />
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera2"
|
||||
android:required="false" />
|
||||
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS" /> <!-- 获取通讯录-->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<!-- 多媒体相关 -->
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
|
||||
<!-- 8.0+系统需要-->
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
|
||||
<!--推送权限-->
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_SECURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.RECORD_AUDIO" />-->
|
||||
<!-- 通知委托启用状态-->
|
||||
<meta-data
|
||||
android:name="delivery_metrics_exported_to_big_query_enabled"
|
||||
android:value="true" />
|
||||
|
||||
<!-- <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_AUDIO_OUTPUT" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.autofocus" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.front" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.level.full" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.capability.raw" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.any" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.microphone" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera2" android:required="true" />-->
|
||||
|
||||
<queries>
|
||||
<intent>
|
||||
<action android:name="android.media.action.IMAGE_CAPTURE" />
|
||||
</intent>
|
||||
</queries>
|
||||
<application
|
||||
android:name=".WebApplication"
|
||||
android:allowBackup="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.AppTheme"
|
||||
android:usesCleartextTraffic="true">
|
||||
|
||||
|
||||
<!-- <activity-alias-->
|
||||
<!-- android:name=".MainActivityNew"-->
|
||||
<!-- android:icon="@mipmap/winway"-->
|
||||
<!-- android:roundIcon="@mipmap/winway"-->
|
||||
<!-- android:label="@string/app_name1"-->
|
||||
<!-- android:targetActivity=".MainActivity"-->
|
||||
<!-- android:enabled="false"-->
|
||||
<!-- android:exported="true"-->
|
||||
<!-- android:configChanges="orientation|navigation|keyboardHidden"-->
|
||||
<!-- android:launchMode="singleTop"-->
|
||||
<!-- android:excludeFromRecents="true"-->
|
||||
<!-- android:screenOrientation="portrait">-->
|
||||
<!-- <intent-filter>-->
|
||||
<!-- <action android:name="android.intent.action.MAIN" />-->
|
||||
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
|
||||
<!-- </intent-filter>-->
|
||||
<!-- </activity-alias>-->
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity2"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:exported="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:launchMode="singleTop"
|
||||
android:theme="@style/AppThemeStart">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
|
||||
<!-- android:directBootAware="true" 为应用启用消息处理直接启动模式-->
|
||||
<service
|
||||
android:name=".MyFirebaseMessageingService"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<!-- Set custom default icon. This is used when no icon is set for incoming notification messages.
|
||||
See README(https://goo.gl/l4GJaQ) for more. 设置推送默认图标 和颜色-->
|
||||
<meta-data
|
||||
android:name="com.google.firebase.messaging.default_notification_icon"
|
||||
android:resource="@mipmap/app_logo" />
|
||||
<!-- Set color used with incoming notification messages. This is used when no color is set for the incoming
|
||||
notification message. See README(https://goo.gl/6BKBk7) for more. -->
|
||||
<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" />
|
||||
<!-- 还可设置推送渠道 -->
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.google.firebase.messaging.default_notification_channel_id"-->
|
||||
<!-- android:value="@string/default_notification_channel_id" />-->
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
BIN
Bintang918/src/main/ic_launcher-playstore.png
Normal file
|
After Width: | Height: | Size: 80 KiB |
@@ -0,0 +1,54 @@
|
||||
package com.web.bintang918;
|
||||
|
||||
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.android.gms.tasks.OnCompleteListener;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.firebase.messaging.FirebaseMessaging;
|
||||
import com.web.base.MainActivity;
|
||||
|
||||
public class MainActivity2 extends com.web.base.MainActivity2 {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
userId = 112;
|
||||
saveInt(MainActivity2.this,"user_code",userId);
|
||||
saveInt(MainActivity2.this,"version_code",getVersion());
|
||||
MainActivity.saveString(this, "base_url", "https://m.bintang918.net/");
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
//订阅主题
|
||||
FirebaseMessaging.getInstance().subscribeToTopic("demo")
|
||||
.addOnCompleteListener(new OnCompleteListener<Void>() {
|
||||
@Override
|
||||
public void onComplete(@NonNull Task<Void> task) {
|
||||
String msg = "Subscribed";
|
||||
if (!task.isSuccessful()) {
|
||||
msg = "Subscribe failed";
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public int getVersion(){
|
||||
try {
|
||||
PackageManager packageManager = getPackageManager();
|
||||
PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0);
|
||||
String StringversionName = packageInfo.versionName; // 版本号
|
||||
int versionCode = packageInfo.versionCode; // 版本码
|
||||
// 在这里可以使用versionName和versionCode进行相关的操作
|
||||
// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode);
|
||||
return versionCode;
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
package com.web.bintang918;
|
||||
|
||||
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.web.base.GsonUtils;
|
||||
import com.web.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);
|
||||
// if (remoteMessage.getNotification() != null) {
|
||||
// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
// }
|
||||
} else {
|
||||
//收到通知 创建notify
|
||||
if (remoteMessage.getNotification() != null) {
|
||||
showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void showNotification(MessageInfo messageInfo) {
|
||||
Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.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);
|
||||
|
||||
// Intent notifyIntent = new Intent(this, MainActivity2.class);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
// // notifyIntent.putExtra("message", messageInfo);
|
||||
// notifyIntent.setAction(Intent.ACTION_VIEW);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须
|
||||
// PendingIntent pendingIntent;
|
||||
// pendingIntent = PendingIntent.getActivity
|
||||
// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | 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(com.web.base.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(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(messageInfo.getTitle())
|
||||
.setContentText(messageInfo.getContent())
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.R.mipmap.ic_launcher)
|
||||
.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, MainActivity2.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(com.web.base.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(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
}
|
||||
notificationManager.notify(0, notificationBuilder.build());
|
||||
//存储数据
|
||||
// saveNotifyMessage(body);
|
||||
}
|
||||
|
||||
|
||||
// public void saveNotifyMessage(String body) {
|
||||
// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class);
|
||||
// String savenotify = Utils.get(getApplication(),ApiService.savenotify,"");
|
||||
// if(messageInfo!=null){
|
||||
// if(TextUtils.isEmpty(savenotify)){
|
||||
// GsonUtils.getListFromJSON(savenotify,)
|
||||
// }
|
||||
// }
|
||||
// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @param key 要设置的key
|
||||
// */
|
||||
// public static void set(Context activity, String key, String is) {
|
||||
// SharedPreferences nameSetting = getConfigShared(activity);
|
||||
// SharedPreferences.Editor namePref = nameSetting.edit();
|
||||
// namePref.putString(key, is);
|
||||
// namePref.commit();
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.web.bintang918;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
|
||||
import com.tencent.smtt.export.external.TbsCoreSettings;
|
||||
import com.tencent.smtt.sdk.QbSdk;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class WebApplication extends Application {
|
||||
|
||||
|
||||
public static Context application;
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
// 设置开启优化方案
|
||||
application = this;
|
||||
HashMap map = new HashMap();
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true);
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true);
|
||||
QbSdk.initTbsSettings(map);
|
||||
QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() {
|
||||
@Override
|
||||
public void onCoreInitFinished() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewInitFinished(boolean b) {
|
||||
|
||||
}
|
||||
});
|
||||
QbSdk.setDownloadWithoutWifi(true);
|
||||
}
|
||||
}
|
||||
11
Bintang918/src/main/res/drawable-anydpi/ic_action_back.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="#333333"
|
||||
android:alpha="0.8">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
|
||||
</vector>
|
||||
BIN
Bintang918/src/main/res/drawable-hdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 182 B |
BIN
Bintang918/src/main/res/drawable-mdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 150 B |
@@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
||||
BIN
Bintang918/src/main/res/drawable-xhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 212 B |
BIN
Bintang918/src/main/res/drawable-xxhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 324 B |
170
Bintang918/src/main/res/drawable/ic_launcher_background.xml
Normal file
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
||||
20
Bintang918/src/main/res/drawable/input_bg.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/white">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape>
|
||||
<solid android:color="@android:color/transparent" />
|
||||
<corners android:radius="23dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 默认显⽰效果-->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/dialog_input_bg"/>
|
||||
<corners
|
||||
android:radius="3dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
|
||||
28
Bintang918/src/main/res/drawable/pass_word_bg.xml
Normal 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>
|
||||
|
||||
23
Bintang918/src/main/res/drawable/pass_word_bg1.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#4b007f"
|
||||
android:centerColor="#884b007f"
|
||||
android:endColor="#004b007f"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
23
Bintang918/src/main/res/drawable/pass_word_bg2.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#000000"
|
||||
android:centerColor="#888888"
|
||||
android:endColor="#FFFFFF"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
5
Bintang918/src/main/res/drawable/shape_btn_bg.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="22dp" />
|
||||
<solid android:color="@color/jisuanqi" />
|
||||
</shape>
|
||||
6
Bintang918/src/main/res/drawable/shape_dialog_bg2.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:topRightRadius="12dp"
|
||||
android:topLeftRadius="12dp"/>
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
Bintang918/src/main/res/drawable/shape_dialog_bg3.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="12dp" />
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
Bintang918/src/main/res/drawable/shape_dialog_bg_new.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="20dp" />
|
||||
<solid android:color="@color/white" />
|
||||
</shape>
|
||||
5
Bintang918/src/main/res/drawable/shape_notify_typebg.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="2dp" />
|
||||
<solid android:color="@android:color/black" />
|
||||
</shape>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
||||
BIN
Bintang918/src/main/res/mipmap-hdpi/ic_empty.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
Bintang918/src/main/res/mipmap-hdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
Bintang918/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
Bintang918/src/main/res/mipmap-hdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
Bintang918/src/main/res/mipmap-hdpi/ic_pull_down.png
Normal file
|
After Width: | Height: | Size: 271 B |
BIN
Bintang918/src/main/res/mipmap-mdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
Bintang918/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
Bintang918/src/main/res/mipmap-mdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
Bintang918/src/main/res/mipmap-xhdpi/ic_close.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
Bintang918/src/main/res/mipmap-xhdpi/ic_email.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
Bintang918/src/main/res/mipmap-xhdpi/ic_facebook.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
Bintang918/src/main/res/mipmap-xhdpi/ic_hometo.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
Bintang918/src/main/res/mipmap-xhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
Bintang918/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
BIN
Bintang918/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
Bintang918/src/main/res/mipmap-xhdpi/ic_link.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
Bintang918/src/main/res/mipmap-xhdpi/ic_menu.png
Normal file
|
After Width: | Height: | Size: 779 B |
BIN
Bintang918/src/main/res/mipmap-xhdpi/ic_notify_email.png
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
BIN
Bintang918/src/main/res/mipmap-xhdpi/ic_notify_normal.png
Normal file
|
After Width: | Height: | Size: 9.0 KiB |
BIN
Bintang918/src/main/res/mipmap-xhdpi/ic_notify_shangla.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
Bintang918/src/main/res/mipmap-xhdpi/ic_notify_xiala.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
Bintang918/src/main/res/mipmap-xhdpi/ic_notifylogo.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
Bintang918/src/main/res/mipmap-xhdpi/ic_shousuo.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
Bintang918/src/main/res/mipmap-xhdpi/ic_tel.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
Bintang918/src/main/res/mipmap-xhdpi/ic_whatsapp.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
Bintang918/src/main/res/mipmap-xhdpi/ic_zhangkai.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
Bintang918/src/main/res/mipmap-xxhdpi/app_logo.png
Normal file
|
After Width: | Height: | Size: 91 KiB |
BIN
Bintang918/src/main/res/mipmap-xxhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
|
After Width: | Height: | Size: 13 KiB |
BIN
Bintang918/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 9.6 KiB |
BIN
Bintang918/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 7.8 KiB |
|
After Width: | Height: | Size: 20 KiB |
BIN
Bintang918/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 14 KiB |
54
Bintang918/src/main/res/values-en/strings.xml
Normal file
@@ -0,0 +1,54 @@
|
||||
<resources>
|
||||
<string name="app_name">Bintang918</string>
|
||||
<string name="qsrlwmm_txt">Please Set Your Password</string>
|
||||
<string name="cancel_txt">Cancel</string>
|
||||
<string name="sure_txt">Sure</string>
|
||||
<string name="banbengengxin_txt">New Version Update</string>
|
||||
<string name="xiacigengxin_txt">Next Update</string>
|
||||
<string name="lijigengxin_txt">Update Immediately</string>
|
||||
<string name="app_updater_error_notification_content">Click to close notification</string>
|
||||
<string name="app_updater_error_notification_content_re_download">Click to re-download</string>
|
||||
<string name="app_updater_error_notification_title">Download failed</string>
|
||||
<string name="app_updater_finish_notification_content">Click to install</string>
|
||||
<string name="app_updater_finish_notification_title">Download completed</string>
|
||||
<string name="app_updater_progress_notification_content">Downloading...</string>
|
||||
<string name="app_updater_progress_notification_title">Version update</string>
|
||||
<string name="app_updater_progress_notification_title_2">Downloading game</string>
|
||||
<string name="app_updater_start_notification_content">Getting download data...</string>
|
||||
<string name="app_updater_start_notification_title">Version update</string>
|
||||
<string name="app_updater_start_notification_title_2">Downloading game</string>
|
||||
<string name="notification_title_txt">Need to turn on mobile phone notification permission</string>
|
||||
<string name="notification_cancel_txt">Exit</string>
|
||||
<string name="notification_setting_txt">Setting</string>
|
||||
<string name="app_tishi">Tip</string>
|
||||
<string name="app_hint">Please enter the invitation code</string>
|
||||
<string name="app_sharetitle">My invitation code:</string>
|
||||
<string name="app_sharetitle2">Superior invitation code:</string>
|
||||
<string name="app_totalinvite">Total number of invites:</string>
|
||||
<string name="app_sharecontent">App download link:</string>
|
||||
<string name="app_share">Share</string>
|
||||
<string name="app_checklist">Check Invitation Records</string>
|
||||
<string name="app_invitetitle">Invitation Records</string>
|
||||
<string name="app_checklist_number">Total number of invitees: %d</string>
|
||||
<string name="app_nodata">No Data</string>
|
||||
<string name="app_withdrawtitle">Withdrawal Record</string>
|
||||
<string name="app_withdrawapply_title">Withdrawal Application</string>
|
||||
<string name="app_bankinfo_title">Edit Bank Card Information</string>
|
||||
<string name="app_bankinfo_countrycode">60</string>
|
||||
<string name="app_bankinfo_name">Name:</string>
|
||||
<string name="app_bankinfo_name_hint">Please enter the bank card name</string>
|
||||
<string name="app_bankinfo_code">Bank card account:</string>
|
||||
<string name="app_bankinfo_code_hint">Please enter the bank card account</string>
|
||||
<string name="app_bankinfo_bankcountry">Country:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">Please select a country</string>
|
||||
<string name="app_bankinfo_bankname">Bank Name:</string>
|
||||
<string name="app_bankinfo_bankname_hint">Please select a bank name</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">Note: Please enter the country code before selecting the bank name!</string>
|
||||
<string name="app_balance">Balance: %s</string>
|
||||
<string name="app_totalearning">Total Earnings: %s</string>
|
||||
<string name="app_withdraw_amount">Amount: %s</string>
|
||||
<string name="app_withdraw_apply_hint">Please enter the withdrawal amount</string>
|
||||
<string name="app_toastapply">Withdrawal application has been submitted</string>
|
||||
<string name="app_toastloading">No additional data available for now</string>
|
||||
<string name="app_notify_title">NOTIFICATIONS</string>
|
||||
</resources>
|
||||
69
Bintang918/src/main/res/values-night/themes.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.Calculcator" parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_200</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/black</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_200</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</item>
|
||||
</style>
|
||||
</resources>
|
||||
22
Bintang918/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="purple_200">#FFFFFF</color>
|
||||
<color name="purple_500">#FFFFFF</color>
|
||||
<color name="purple_700">#FFFFFF</color>
|
||||
<color name="teal_200">#FF03DAC5</color>
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="jisuanqi">#EF4723</color>
|
||||
<color name="notify_color">#FFFFFFFF</color>
|
||||
|
||||
<color name="dialog_bg">#2C2C2E</color>
|
||||
<color name="dialog_textcolor">#FFA722</color>
|
||||
<color name="dialog_input_bg">#434343</color>
|
||||
<color name="dialog_dark">#BCBCBC</color>
|
||||
|
||||
<color name="notify_textcolor">#ACDFEE</color>
|
||||
<color name="notify_imagecolor">#BDDDB7</color>
|
||||
<color name="notify_jumplinkcolor">#C3B5D0</color>
|
||||
|
||||
</resources>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="ic_launcher_background">#4B007F</color>
|
||||
</resources>
|
||||
76
Bintang918/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,76 @@
|
||||
<resources>
|
||||
<string name="app_name">Bintang918</string>
|
||||
<string name="qsrlwmm_txt">请输入6位密码</string>
|
||||
<string name="cancel_txt">取消</string>
|
||||
<string name="sure_txt">确定</string>
|
||||
<string name="banbengengxin_txt">版本更新</string>
|
||||
<string name="xiacigengxin_txt">下次更新</string>
|
||||
<string name="lijigengxin_txt">立即更新</string>
|
||||
<string name="app_updater_error_notification_content">点击关闭通知</string>
|
||||
<string name="app_updater_error_notification_content_re_download">点击重新下载</string>
|
||||
<string name="app_updater_error_notification_title">下载失败</string>
|
||||
<string name="app_updater_finish_notification_content">点击安装</string>
|
||||
<string name="app_updater_finish_notification_title">下载完成</string>
|
||||
<string name="app_updater_progress_notification_content">正在下载…</string>
|
||||
<string name="app_updater_progress_notification_title">版本更新</string>
|
||||
<string name="app_updater_progress_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_title">版本更新</string>
|
||||
<string name="app_updater_start_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_content">正在获取下载数据…</string>
|
||||
<string name="notification_title_txt">需要打开手机通知权限</string>
|
||||
<string name="notification_cancel_txt">退出</string>
|
||||
<string name="notification_setting_txt">设置</string>
|
||||
<string name="app_tishi">提示</string>
|
||||
<string name="app_hint">请输入邀请码</string>
|
||||
<string name="app_sharetitle">我的邀请码:</string>
|
||||
<string name="app_sharetitle2">上级邀请码:</string>
|
||||
<string name="app_totalinvite">总邀请人数:</string>
|
||||
<string name="app_sharecontent">邀请您下载:</string>
|
||||
<string name="app_share">分享</string>
|
||||
<string name="app_checklist">查看邀请记录</string>
|
||||
<string name="app_invitetitle">邀请记录</string>
|
||||
<string name="app_checklist_number">总邀请人数: %d</string>
|
||||
<string name="app_nodata">暂无数据</string>
|
||||
<string name="app_withdrawtitle">提现记录</string>
|
||||
<string name="app_withdrawapply_title">提现申请</string>
|
||||
<string name="app_bankinfo_title">编辑银行卡信息</string>
|
||||
<string name="app_bankinfo_countrycode">86</string>
|
||||
<string name="app_bankinfo_name">持卡人姓名:</string>
|
||||
<string name="app_bankinfo_name_hint">请输入持卡人姓名</string>
|
||||
<string name="app_bankinfo_bankcountry">国家地区:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">请选择国家地区</string>
|
||||
<string name="app_bankinfo_bankname">开户行名称:</string>
|
||||
<string name="app_bankinfo_bankname_hint">请选择开户行名称</string>
|
||||
<string name="app_bankinfo_code">银行户口:</string>
|
||||
<string name="app_bankinfo_code_hint">请输入银行卡户口</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">(注:请先输入国家区号再选择开户行名称!)</string>
|
||||
<string name="app_balance">余额: %s</string>
|
||||
<string name="app_totalearning">总收益: %s</string>
|
||||
<string name="app_withdraw_amount">金额: %s</string>
|
||||
<string name="app_withdraw_apply_hint">请输入提现金额</string>
|
||||
<string name="app_toastapply">提现申请已提交</string>
|
||||
<string name="app_toastloading">暂无更多数据</string>
|
||||
<string name="app_notify_title">通知</string>
|
||||
<!-- <string name="app_name">SPEEDAU</string>-->
|
||||
<!-- <string name="qsrlwmm_txt">Please Set Your Password</string>-->
|
||||
<!-- <string name="cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="sure_txt">Sure</string>-->
|
||||
<!-- <string name="banbengengxin_txt">New Version Update</string>-->
|
||||
<!-- <string name="xiacigengxin_txt">Next Update</string>-->
|
||||
<!-- <string name="lijigengxin_txt">Update Immediately</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content">Click to close notification</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content_re_download">Click to re-download</string>-->
|
||||
<!-- <string name="app_updater_error_notification_title">Download failed</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_content">Click to install</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_title">Download completed</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_content">Downloading...</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="app_updater_start_notification_content">Getting download data...</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="notification_title_txt">Need to turn on mobile phone notification permission</string>-->
|
||||
<!-- <string name="notification_cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="notification_setting_txt">Setting</string>-->
|
||||
|
||||
</resources>
|
||||
88
Bintang918/src/main/res/values/themes.xml
Normal file
@@ -0,0 +1,88 @@
|
||||
<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. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</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>
|
||||
10
Bintang918/src/main/res/xml/app_updater_paths.xml
Normal 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>
|
||||
4
Bintang918/src/main/res/xml/network_security_config.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<network-security-config>
|
||||
<base-config cleartextTrafficPermitted="true" />
|
||||
</network-security-config>
|
||||
13
Bintang918/src/main/res/xml/provider_paths.xml
Normal 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"异常的问题 -->
|
||||
@@ -0,0 +1,35 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void TestPattern(){
|
||||
//
|
||||
Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$");
|
||||
String a="+45.5";
|
||||
boolean matches = compile.matcher(a).matches();
|
||||
System.out.println(matches);
|
||||
String result = compile.matcher(a).replaceAll("");
|
||||
System.out.println(result);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
BIN
Bintang918/test.jks
Normal file
1
Candy916/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
92
Candy916/build.gradle
Normal file
@@ -0,0 +1,92 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'com.google.gms.google-services'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 31
|
||||
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.web.candy916"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 31
|
||||
versionCode 106
|
||||
versionName "v1.0.6"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
signingConfigs {
|
||||
debug {
|
||||
storeFile file('candy916.jks')
|
||||
storePassword "android2014"
|
||||
keyAlias 'key0'
|
||||
keyPassword "android2014"
|
||||
}
|
||||
release {
|
||||
storeFile file('candy916.jks')
|
||||
storePassword "android2014"
|
||||
keyAlias 'key0'
|
||||
keyPassword "android2014"
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'com.google.android.material:material:1.1.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
testImplementation 'junit:junit:4.+'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar')
|
||||
|
||||
// okhttp相关库
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
|
||||
|
||||
// JSON解析库
|
||||
implementation 'com.google.code.gson:gson:2.9.0'
|
||||
implementation 'com.alibaba:fastjson:1.1.71.android'
|
||||
api 'com.squareup.retrofit2:retrofit:2.5.0'
|
||||
api 'com.squareup.retrofit2:converter-scalars:2.3.0'
|
||||
api 'com.squareup.retrofit2:converter-gson:2.4.0'
|
||||
api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
|
||||
api 'io.reactivex.rxjava2:rxjava:2.1.16'
|
||||
api 'io.reactivex.rxjava2:rxandroid:2.0.2'
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选)
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选)
|
||||
implementation 'com.github.Justson:Downloader:v5.0.4-androidx'
|
||||
//implementation 'com.tencent.tbs:tbssdk:44286'
|
||||
// sdk 33
|
||||
// implementation platform('com.google.firebase:firebase-bom:32.7.0')
|
||||
// Firebase Cloud Messaging
|
||||
// implementation("com.google.firebase:firebase-messaging")
|
||||
// implementation("com.google.firebase:firebase-analytics")
|
||||
|
||||
implementation platform('com.google.firebase:firebase-bom:32.1.0')
|
||||
|
||||
// Add the dependencies for the Firebase Cloud Messaging and Analytics libraries
|
||||
// When using the BoM, you don't specify versions in Firebase library dependencies
|
||||
implementation 'com.google.firebase:firebase-messaging'
|
||||
implementation 'com.google.firebase:firebase-analytics'
|
||||
// implementation("com.google.firebase:firebase-messaging:23.2.1")
|
||||
// implementation("com.google.firebase:firebase-analytics:21.2.1")
|
||||
// implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式
|
||||
implementation("com.github.bumptech.glide:glide:4.13.1")
|
||||
implementation project(path: ':base')
|
||||
|
||||
}
|
||||
BIN
Candy916/candy916.jks
Normal file
29
Candy916/google-services.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "781378266710",
|
||||
"project_id": "candy916-c855f",
|
||||
"storage_bucket": "candy916-c855f.firebasestorage.app"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:781378266710:android:f3e21536744371fef37df7",
|
||||
"android_client_info": {
|
||||
"package_name": "com.web.candy916"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyCkuJb0casxAIwDznLfbuUpnHytxPyvRxs"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
BIN
Candy916/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar
Normal file
32
Candy916/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
||||
-dontwarn dalvik.**
|
||||
-dontwarn com.tencent.smtt.**
|
||||
|
||||
-keep class com.tencent.smtt.** {
|
||||
*;
|
||||
}
|
||||
|
||||
-keep class com.tencent.tbs.** {
|
||||
*;
|
||||
}
|
||||
BIN
Candy916/release/candy916.apk
Normal file
18
Candy916/release/output-metadata.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"version": 2,
|
||||
"artifactType": {
|
||||
"type": "APK",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "com.web.candy916",
|
||||
"variantName": "processReleaseResources",
|
||||
"elements": [
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"versionCode": 106,
|
||||
"versionName": "v1.0.6",
|
||||
"outputFile": "Candy916-release.apk"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("Tptogiar.calculcator", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
114
Candy916/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.web.candy916">
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera"
|
||||
android:required="false" />
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera2"
|
||||
android:required="false" />
|
||||
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS" /> <!-- 获取通讯录-->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<!-- 多媒体相关 -->
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
|
||||
<!-- 8.0+系统需要-->
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
|
||||
<!--推送权限-->
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_SECURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.RECORD_AUDIO" />-->
|
||||
|
||||
|
||||
<!-- <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_AUDIO_OUTPUT" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.autofocus" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.front" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.level.full" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.capability.raw" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.any" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.microphone" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera2" android:required="true" />-->
|
||||
|
||||
<queries>
|
||||
<intent>
|
||||
<action android:name="android.media.action.IMAGE_CAPTURE" />
|
||||
</intent>
|
||||
</queries>
|
||||
<application
|
||||
android:name=".WebApplication"
|
||||
android:allowBackup="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:icon="@mipmap/app_logo"
|
||||
android:label="@string/app_name"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:roundIcon="@mipmap/app_logo"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.AppTheme"
|
||||
android:usesCleartextTraffic="true">
|
||||
|
||||
|
||||
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity2"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:exported="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:theme="@style/AppThemeStart">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<service
|
||||
android:name="com.tencent.smtt.export.external.DexClassLoaderProviderService"
|
||||
android:label="dexopt"
|
||||
android:process=":dexopt" />
|
||||
|
||||
|
||||
<!-- android:directBootAware="true" 为应用启用消息处理直接启动模式-->
|
||||
<service
|
||||
android:name=".MyFirebaseMessageingService"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<!-- Set custom default icon. This is used when no icon is set for incoming notification messages.
|
||||
See README(https://goo.gl/l4GJaQ) for more. 设置推送默认图标 和颜色-->
|
||||
<meta-data
|
||||
android:name="com.google.firebase.messaging.default_notification_icon"
|
||||
android:resource="@mipmap/app_logo" />
|
||||
<!-- Set color used with incoming notification messages. This is used when no color is set for the incoming
|
||||
notification message. See README(https://goo.gl/6BKBk7) for more. -->
|
||||
<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" />
|
||||
<!-- 还可设置推送渠道 -->
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.google.firebase.messaging.default_notification_channel_id"-->
|
||||
<!-- android:value="@string/default_notification_channel_id" />-->
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
54
Candy916/src/main/java/com/web/candy916/MainActivity2.java
Normal file
@@ -0,0 +1,54 @@
|
||||
package com.web.candy916;
|
||||
|
||||
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.android.gms.tasks.OnCompleteListener;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.firebase.messaging.FirebaseMessaging;
|
||||
import com.web.base.MainActivity;
|
||||
|
||||
public class MainActivity2 extends com.web.base.MainActivity2 {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
userId = 84;
|
||||
saveInt(MainActivity2.this,"user_code",userId);
|
||||
saveInt(MainActivity2.this,"version_code",getVersion());
|
||||
MainActivity.saveString(this, "base_url", "https://candy916.co/");
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
//订阅主题
|
||||
FirebaseMessaging.getInstance().subscribeToTopic("demo")
|
||||
.addOnCompleteListener(new OnCompleteListener<Void>() {
|
||||
@Override
|
||||
public void onComplete(@NonNull Task<Void> task) {
|
||||
String msg = "Subscribed";
|
||||
if (!task.isSuccessful()) {
|
||||
msg = "Subscribe failed";
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public int getVersion(){
|
||||
try {
|
||||
PackageManager packageManager = getPackageManager();
|
||||
PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0);
|
||||
String StringversionName = packageInfo.versionName; // 版本号
|
||||
int versionCode = packageInfo.versionCode; // 版本码
|
||||
// 在这里可以使用versionName和versionCode进行相关的操作
|
||||
// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode);
|
||||
return versionCode;
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
package com.web.candy916;
|
||||
|
||||
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.web.base.GsonUtils;
|
||||
import com.web.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);
|
||||
// if (remoteMessage.getNotification() != null) {
|
||||
// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
// }
|
||||
} else {
|
||||
//收到通知 创建notify
|
||||
if (remoteMessage.getNotification() != null) {
|
||||
showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void showNotification(MessageInfo messageInfo) {
|
||||
Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.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);
|
||||
|
||||
// Intent notifyIntent = new Intent(this, MainActivity2.class);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
// // notifyIntent.putExtra("message", messageInfo);
|
||||
// notifyIntent.setAction(Intent.ACTION_VIEW);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须
|
||||
// PendingIntent pendingIntent;
|
||||
// pendingIntent = PendingIntent.getActivity
|
||||
// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | 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(com.web.base.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(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(messageInfo.getTitle())
|
||||
.setContentText(messageInfo.getContent())
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.R.mipmap.ic_launcher)
|
||||
.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, MainActivity2.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(com.web.base.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(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
}
|
||||
notificationManager.notify(0, notificationBuilder.build());
|
||||
//存储数据
|
||||
// saveNotifyMessage(body);
|
||||
}
|
||||
|
||||
|
||||
// public void saveNotifyMessage(String body) {
|
||||
// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class);
|
||||
// String savenotify = Utils.get(getApplication(),ApiService.savenotify,"");
|
||||
// if(messageInfo!=null){
|
||||
// if(TextUtils.isEmpty(savenotify)){
|
||||
// GsonUtils.getListFromJSON(savenotify,)
|
||||
// }
|
||||
// }
|
||||
// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @param key 要设置的key
|
||||
// */
|
||||
// public static void set(Context activity, String key, String is) {
|
||||
// SharedPreferences nameSetting = getConfigShared(activity);
|
||||
// SharedPreferences.Editor namePref = nameSetting.edit();
|
||||
// namePref.putString(key, is);
|
||||
// namePref.commit();
|
||||
// }
|
||||
}
|
||||
37
Candy916/src/main/java/com/web/candy916/WebApplication.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.web.candy916;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
|
||||
import com.tencent.smtt.export.external.TbsCoreSettings;
|
||||
import com.tencent.smtt.sdk.QbSdk;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class WebApplication extends Application {
|
||||
|
||||
|
||||
public static Context application;
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
// 设置开启优化方案
|
||||
application = this;
|
||||
HashMap map = new HashMap();
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true);
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true);
|
||||
QbSdk.initTbsSettings(map);
|
||||
QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() {
|
||||
@Override
|
||||
public void onCoreInitFinished() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewInitFinished(boolean b) {
|
||||
|
||||
}
|
||||
});
|
||||
QbSdk.setDownloadWithoutWifi(true);
|
||||
}
|
||||
}
|
||||
11
Candy916/src/main/res/drawable-anydpi/ic_action_back.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="#333333"
|
||||
android:alpha="0.8">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
|
||||
</vector>
|
||||
BIN
Candy916/src/main/res/drawable-hdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 182 B |
BIN
Candy916/src/main/res/drawable-mdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 150 B |
@@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
||||
BIN
Candy916/src/main/res/drawable-xhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 212 B |
BIN
Candy916/src/main/res/drawable-xxhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 324 B |
170
Candy916/src/main/res/drawable/ic_launcher_background.xml
Normal file
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
||||
20
Candy916/src/main/res/drawable/input_bg.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/white">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape>
|
||||
<solid android:color="@android:color/transparent" />
|
||||
<corners android:radius="23dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 默认显⽰效果-->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/dialog_input_bg"/>
|
||||
<corners
|
||||
android:radius="3dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
|
||||
28
Candy916/src/main/res/drawable/pass_word_bg.xml
Normal 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>
|
||||
|
||||
23
Candy916/src/main/res/drawable/pass_word_bg1.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#FF0000"
|
||||
android:centerColor="#FF5555"
|
||||
android:endColor="#FBD3D0"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
23
Candy916/src/main/res/drawable/pass_word_bg2.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#000000"
|
||||
android:centerColor="#888888"
|
||||
android:endColor="#FFFFFF"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
5
Candy916/src/main/res/drawable/shape_btn_bg.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="22dp" />
|
||||
<solid android:color="@color/jisuanqi" />
|
||||
</shape>
|
||||
6
Candy916/src/main/res/drawable/shape_dialog_bg2.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:topRightRadius="12dp"
|
||||
android:topLeftRadius="12dp"/>
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
Candy916/src/main/res/drawable/shape_dialog_bg3.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="12dp" />
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
Candy916/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
BIN
Candy916/src/main/res/mipmap-hdpi/ic_empty.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
Candy916/src/main/res/mipmap-hdpi/ic_pull_down.png
Normal file
|
After Width: | Height: | Size: 271 B |
BIN
Candy916/src/main/res/mipmap-xhdpi/ic_close.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
Candy916/src/main/res/mipmap-xhdpi/ic_facebook.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
Candy916/src/main/res/mipmap-xhdpi/ic_hometo.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
Candy916/src/main/res/mipmap-xhdpi/ic_link.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
Candy916/src/main/res/mipmap-xhdpi/ic_menu.png
Normal file
|
After Width: | Height: | Size: 779 B |
BIN
Candy916/src/main/res/mipmap-xhdpi/ic_shousuo.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
Candy916/src/main/res/mipmap-xhdpi/ic_tel.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
Candy916/src/main/res/mipmap-xhdpi/ic_whatsapp.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
Candy916/src/main/res/mipmap-xhdpi/ic_zhangkai.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
Candy916/src/main/res/mipmap-xxhdpi/app_logo.png
Normal file
|
After Width: | Height: | Size: 1.4 MiB |
54
Candy916/src/main/res/values-en/strings.xml
Normal file
@@ -0,0 +1,54 @@
|
||||
<resources>
|
||||
<string name="app_name">CANDY916</string>
|
||||
<string name="qsrlwmm_txt">Please Set Your Password</string>
|
||||
<string name="cancel_txt">Cancel</string>
|
||||
<string name="sure_txt">Sure</string>
|
||||
<string name="banbengengxin_txt">New Version Update</string>
|
||||
<string name="xiacigengxin_txt">Next Update</string>
|
||||
<string name="lijigengxin_txt">Update Immediately</string>
|
||||
<string name="app_updater_error_notification_content">Click to close notification</string>
|
||||
<string name="app_updater_error_notification_content_re_download">Click to re-download</string>
|
||||
<string name="app_updater_error_notification_title">Download failed</string>
|
||||
<string name="app_updater_finish_notification_content">Click to install</string>
|
||||
<string name="app_updater_finish_notification_title">Download completed</string>
|
||||
<string name="app_updater_progress_notification_content">Downloading...</string>
|
||||
<string name="app_updater_progress_notification_title">Version update</string>
|
||||
<string name="app_updater_progress_notification_title_2">Downloading game</string>
|
||||
<string name="app_updater_start_notification_content">Getting download data...</string>
|
||||
<string name="app_updater_start_notification_title">Version update</string>
|
||||
<string name="app_updater_start_notification_title_2">Downloading game</string>
|
||||
<string name="notification_title_txt">Need to turn on mobile phone notification permission</string>
|
||||
<string name="notification_cancel_txt">Exit</string>
|
||||
<string name="notification_setting_txt">Setting</string>
|
||||
<string name="app_tishi">Tip</string>
|
||||
<string name="app_hint">Please enter the invitation code</string>
|
||||
<string name="app_sharetitle">My invitation code:</string>
|
||||
<string name="app_sharetitle2">Superior invitation code:</string>
|
||||
<string name="app_totalinvite">Total number of invites:</string>
|
||||
<string name="app_sharecontent">App download link:</string>
|
||||
<string name="app_share">Share</string>
|
||||
<string name="app_checklist">Check Invitation Records</string>
|
||||
<string name="app_invitetitle">Invitation Records</string>
|
||||
<string name="app_checklist_number">Total number of invitees: %d</string>
|
||||
<string name="app_nodata">No Data</string>
|
||||
<string name="app_withdrawtitle">Withdrawal Record</string>
|
||||
<string name="app_withdrawapply_title">Withdrawal Application</string>
|
||||
<string name="app_bankinfo_title">Edit Bank Card Information</string>
|
||||
<string name="app_bankinfo_countrycode">60</string>
|
||||
<string name="app_bankinfo_name">Name:</string>
|
||||
<string name="app_bankinfo_name_hint">Please enter the bank card name</string>
|
||||
<string name="app_bankinfo_code">Bank card account:</string>
|
||||
<string name="app_bankinfo_code_hint">Please enter the bank card account</string>
|
||||
<string name="app_bankinfo_bankcountry">Country:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">Please select a country</string>
|
||||
<string name="app_bankinfo_bankname">Bank Name:</string>
|
||||
<string name="app_bankinfo_bankname_hint">Please select a bank name</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">Note: Please enter the country code before selecting the bank name!</string>
|
||||
<string name="app_balance">Balance: %s</string>
|
||||
<string name="app_totalearning">Total Earnings: %s</string>
|
||||
<string name="app_withdraw_amount">Amount: %s</string>
|
||||
<string name="app_withdraw_apply_hint">Please enter the withdrawal amount</string>
|
||||
<string name="app_toastapply">Withdrawal application has been submitted</string>
|
||||
<string name="app_notinstall">App not installed</string>
|
||||
|
||||
</resources>
|
||||
69
Candy916/src/main/res/values-night/themes.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.Calculcator" parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_200</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/black</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_200</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</item>
|
||||
</style>
|
||||
</resources>
|
||||
19
Candy916/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="purple_200">#FFFFFF</color>
|
||||
<color name="purple_500">#FFFFFF</color>
|
||||
<color name="purple_700">#FFFFFF</color>
|
||||
<color name="teal_200">#FF03DAC5</color>
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="jisuanqi">#EF4723</color>
|
||||
<color name="notify_color">#FFFFFFFF</color>
|
||||
|
||||
<color name="dialog_bg">#2C2C2E</color>
|
||||
<color name="dialog_textcolor">#FFA722</color>
|
||||
<color name="dialog_input_bg">#434343</color>
|
||||
<color name="dialog_dark">#BCBCBC</color>
|
||||
<color name="color_red">#DC1927</color>
|
||||
|
||||
</resources>
|
||||
77
Candy916/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,77 @@
|
||||
<resources>
|
||||
<string name="app_name">CANDY916</string>
|
||||
<string name="qsrlwmm_txt">请输入6位密码</string>
|
||||
<string name="cancel_txt">取消</string>
|
||||
<string name="sure_txt">确定</string>
|
||||
<string name="banbengengxin_txt">版本更新</string>
|
||||
<string name="xiacigengxin_txt">下次更新</string>
|
||||
<string name="lijigengxin_txt">立即更新</string>
|
||||
<string name="app_updater_error_notification_content">点击关闭通知</string>
|
||||
<string name="app_updater_error_notification_content_re_download">点击重新下载</string>
|
||||
<string name="app_updater_error_notification_title">下载失败</string>
|
||||
<string name="app_updater_finish_notification_content">点击安装</string>
|
||||
<string name="app_updater_finish_notification_title">下载完成</string>
|
||||
<string name="app_updater_progress_notification_content">正在下载…</string>
|
||||
<string name="app_updater_progress_notification_title">版本更新</string>
|
||||
<string name="app_updater_progress_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_title">版本更新</string>
|
||||
<string name="app_updater_start_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_content">正在获取下载数据…</string>
|
||||
<string name="notification_title_txt">需要打开手机通知权限</string>
|
||||
<string name="notification_cancel_txt">退出</string>
|
||||
<string name="notification_setting_txt">设置</string>
|
||||
<string name="app_tishi">提示</string>
|
||||
<string name="app_hint">请输入邀请码</string>
|
||||
<string name="app_sharetitle">我的邀请码:</string>
|
||||
<string name="app_sharetitle2">上级邀请码:</string>
|
||||
<string name="app_totalinvite">总邀请人数:</string>
|
||||
<string name="app_sharecontent">邀请您下载:</string>
|
||||
<string name="app_share">分享</string>
|
||||
<string name="app_checklist">查看邀请记录</string>
|
||||
<string name="app_invitetitle">邀请记录</string>
|
||||
<string name="app_checklist_number">总邀请人数: %d</string>
|
||||
<string name="app_nodata">暂无数据</string>
|
||||
<string name="app_withdrawtitle">提现记录</string>
|
||||
<string name="app_withdrawapply_title">提现申请</string>
|
||||
<string name="app_bankinfo_title">编辑银行卡信息</string>
|
||||
<string name="app_bankinfo_countrycode">86</string>
|
||||
<string name="app_bankinfo_name">持卡人姓名:</string>
|
||||
<string name="app_bankinfo_name_hint">请输入持卡人姓名</string>
|
||||
<string name="app_bankinfo_bankcountry">国家地区:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">请选择国家地区</string>
|
||||
<string name="app_bankinfo_bankname">开户行名称:</string>
|
||||
<string name="app_bankinfo_bankname_hint">请选择开户行名称</string>
|
||||
<string name="app_bankinfo_code">银行户口:</string>
|
||||
<string name="app_bankinfo_code_hint">请输入银行卡户口</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">(注:请先输入国家区号再选择开户行名称!)</string>
|
||||
<string name="app_balance">余额: %s</string>
|
||||
<string name="app_totalearning">总收益: %s</string>
|
||||
<string name="app_withdraw_amount">金额: %s</string>
|
||||
<string name="app_withdraw_apply_hint">请输入提现金额</string>
|
||||
<string name="app_toastapply">提现申请已提交</string>
|
||||
<string name="app_notinstall">应用未安装</string>
|
||||
|
||||
|
||||
<!-- <string name="app_name">SPEEDAU</string>-->
|
||||
<!-- <string name="qsrlwmm_txt">Please Set Your Password</string>-->
|
||||
<!-- <string name="cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="sure_txt">Sure</string>-->
|
||||
<!-- <string name="banbengengxin_txt">New Version Update</string>-->
|
||||
<!-- <string name="xiacigengxin_txt">Next Update</string>-->
|
||||
<!-- <string name="lijigengxin_txt">Update Immediately</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content">Click to close notification</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content_re_download">Click to re-download</string>-->
|
||||
<!-- <string name="app_updater_error_notification_title">Download failed</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_content">Click to install</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_title">Download completed</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_content">Downloading...</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="app_updater_start_notification_content">Getting download data...</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="notification_title_txt">Need to turn on mobile phone notification permission</string>-->
|
||||
<!-- <string name="notification_cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="notification_setting_txt">Setting</string>-->
|
||||
|
||||
</resources>
|
||||
20
Candy916/src/main/res/values/style.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="AppThemeStart1" parent="@style/Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="android:windowTranslucentStatus">true</item>
|
||||
<item name="android:windowTranslucentNavigation">false</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="colorPrimary">@android:color/transparent</item>
|
||||
<item name="colorPrimaryDark">@android:color/transparent</item>
|
||||
<item name="colorAccent">@android:color/transparent</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<!-- 隐藏Activity窗口的Title标题栏 -->
|
||||
<item name="windowNoTitle">true</item>
|
||||
<!-- <item name="android:windowFullscreen">true</item>-->
|
||||
<item name="android:windowBackground">@color/white</item>
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</item>
|
||||
</style>
|
||||
</resources>
|
||||
89
Candy916/src/main/res/values/themes.xml
Normal file
@@ -0,0 +1,89 @@
|
||||
<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. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
<item name="android:enforceNavigationBarContrast" tools:ignore="NewApi">false</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</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>
|
||||
10
Candy916/src/main/res/xml/app_updater_paths.xml
Normal 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>
|
||||
4
Candy916/src/main/res/xml/network_security_config.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<network-security-config>
|
||||
<base-config cleartextTrafficPermitted="true" />
|
||||
</network-security-config>
|
||||
13
Candy916/src/main/res/xml/provider_paths.xml
Normal 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"异常的问题 -->
|
||||
@@ -0,0 +1,35 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void TestPattern(){
|
||||
//
|
||||
Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$");
|
||||
String a="+45.5";
|
||||
boolean matches = compile.matcher(a).matches();
|
||||
System.out.println(matches);
|
||||
String result = compile.matcher(a).replaceAll("");
|
||||
System.out.println(result);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
1
Cashsweep/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
92
Cashsweep/build.gradle
Normal file
@@ -0,0 +1,92 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'com.google.gms.google-services'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 31
|
||||
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.web.cashsweep"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 31
|
||||
versionCode 106
|
||||
versionName "v1.0.6"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
signingConfigs {
|
||||
debug {
|
||||
storeFile file('cashsweep.jks')
|
||||
storePassword "android2014"
|
||||
keyAlias 'key0'
|
||||
keyPassword "android2014"
|
||||
}
|
||||
release {
|
||||
storeFile file('cashsweep.jks')
|
||||
storePassword "android2014"
|
||||
keyAlias 'key0'
|
||||
keyPassword "android2014"
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'com.google.android.material:material:1.1.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
testImplementation 'junit:junit:4.+'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar')
|
||||
|
||||
// okhttp相关库
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
|
||||
|
||||
// JSON解析库
|
||||
implementation 'com.google.code.gson:gson:2.9.0'
|
||||
implementation 'com.alibaba:fastjson:1.1.71.android'
|
||||
api 'com.squareup.retrofit2:retrofit:2.5.0'
|
||||
api 'com.squareup.retrofit2:converter-scalars:2.3.0'
|
||||
api 'com.squareup.retrofit2:converter-gson:2.4.0'
|
||||
api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
|
||||
api 'io.reactivex.rxjava2:rxjava:2.1.16'
|
||||
api 'io.reactivex.rxjava2:rxandroid:2.0.2'
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选)
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选)
|
||||
implementation 'com.github.Justson:Downloader:v5.0.4-androidx'
|
||||
//implementation 'com.tencent.tbs:tbssdk:44286'
|
||||
// sdk 33
|
||||
// implementation platform('com.google.firebase:firebase-bom:32.7.0')
|
||||
// Firebase Cloud Messaging
|
||||
// implementation("com.google.firebase:firebase-messaging")
|
||||
// implementation("com.google.firebase:firebase-analytics")
|
||||
|
||||
implementation platform('com.google.firebase:firebase-bom:32.1.0')
|
||||
|
||||
// Add the dependencies for the Firebase Cloud Messaging and Analytics libraries
|
||||
// When using the BoM, you don't specify versions in Firebase library dependencies
|
||||
implementation 'com.google.firebase:firebase-messaging'
|
||||
implementation 'com.google.firebase:firebase-analytics'
|
||||
// implementation("com.google.firebase:firebase-messaging:23.2.1")
|
||||
// implementation("com.google.firebase:firebase-analytics:21.2.1")
|
||||
// implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式
|
||||
implementation("com.github.bumptech.glide:glide:4.13.1")
|
||||
implementation project(path: ':base')
|
||||
|
||||
}
|
||||
BIN
Cashsweep/cashsweep.jks
Normal file
29
Cashsweep/google-services.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "1031748028680",
|
||||
"project_id": "cashsweep-beb4b",
|
||||
"storage_bucket": "cashsweep-beb4b.firebasestorage.app"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:1031748028680:android:a1a4f6c28e4a8154b904bd",
|
||||
"android_client_info": {
|
||||
"package_name": "com.web.cashsweep"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyDh-TxSgmb0mESS7ge9knRaePZgyJWmx4w"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
BIN
Cashsweep/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar
Normal file
32
Cashsweep/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
||||
-dontwarn dalvik.**
|
||||
-dontwarn com.tencent.smtt.**
|
||||
|
||||
-keep class com.tencent.smtt.** {
|
||||
*;
|
||||
}
|
||||
|
||||
-keep class com.tencent.tbs.** {
|
||||
*;
|
||||
}
|
||||
BIN
Cashsweep/release/Cashsweep.apk
Normal file
18
Cashsweep/release/output-metadata.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"version": 2,
|
||||
"artifactType": {
|
||||
"type": "APK",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "com.web.cashsweep",
|
||||
"variantName": "processReleaseResources",
|
||||
"elements": [
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"versionCode": 106,
|
||||
"versionName": "v1.0.6",
|
||||
"outputFile": "Cashsweep-release.apk"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("Tptogiar.calculcator", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
115
Cashsweep/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,115 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.web.cashsweep">
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera"
|
||||
android:required="false" />
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera2"
|
||||
android:required="false" />
|
||||
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS" /> <!-- 获取通讯录-->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<!-- 多媒体相关 -->
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
|
||||
<!-- 8.0+系统需要-->
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
|
||||
<!--推送权限-->
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_SECURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.RECORD_AUDIO" />-->
|
||||
|
||||
|
||||
<!-- <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_AUDIO_OUTPUT" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.autofocus" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.front" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.level.full" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.capability.raw" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.any" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.microphone" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera2" android:required="true" />-->
|
||||
|
||||
<queries>
|
||||
<intent>
|
||||
<action android:name="android.media.action.IMAGE_CAPTURE" />
|
||||
</intent>
|
||||
</queries>
|
||||
<application
|
||||
android:name=".WebApplication"
|
||||
android:allowBackup="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:icon="@mipmap/app_logo"
|
||||
android:label="@string/app_name"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:roundIcon="@mipmap/app_logo"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.AppTheme"
|
||||
android:usesCleartextTraffic="true">
|
||||
|
||||
|
||||
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity2"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:exported="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:theme="@style/AppThemeStart">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
|
||||
<service
|
||||
android:name="com.tencent.smtt.export.external.DexClassLoaderProviderService"
|
||||
android:label="dexopt"
|
||||
android:process=":dexopt" />
|
||||
|
||||
|
||||
<!-- android:directBootAware="true" 为应用启用消息处理直接启动模式-->
|
||||
<service
|
||||
android:name=".MyFirebaseMessageingService"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<!-- Set custom default icon. This is used when no icon is set for incoming notification messages.
|
||||
See README(https://goo.gl/l4GJaQ) for more. 设置推送默认图标 和颜色-->
|
||||
<meta-data
|
||||
android:name="com.google.firebase.messaging.default_notification_icon"
|
||||
android:resource="@mipmap/app_logo" />
|
||||
<!-- Set color used with incoming notification messages. This is used when no color is set for the incoming
|
||||
notification message. See README(https://goo.gl/6BKBk7) for more. -->
|
||||
<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" />
|
||||
<!-- 还可设置推送渠道 -->
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.google.firebase.messaging.default_notification_channel_id"-->
|
||||
<!-- android:value="@string/default_notification_channel_id" />-->
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
54
Cashsweep/src/main/java/com/web/cashsweep/MainActivity2.java
Normal file
@@ -0,0 +1,54 @@
|
||||
package com.web.cashsweep;
|
||||
|
||||
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.android.gms.tasks.OnCompleteListener;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.firebase.messaging.FirebaseMessaging;
|
||||
import com.web.base.MainActivity;
|
||||
|
||||
public class MainActivity2 extends com.web.base.MainActivity2 {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
userId = 88;
|
||||
saveInt(MainActivity2.this,"user_code",userId);
|
||||
saveInt(MainActivity2.this,"version_code",getVersion());
|
||||
MainActivity.saveString(this, "base_url", "https://www.cashsweep3.com/");
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
//订阅主题
|
||||
FirebaseMessaging.getInstance().subscribeToTopic("demo")
|
||||
.addOnCompleteListener(new OnCompleteListener<Void>() {
|
||||
@Override
|
||||
public void onComplete(@NonNull Task<Void> task) {
|
||||
String msg = "Subscribed";
|
||||
if (!task.isSuccessful()) {
|
||||
msg = "Subscribe failed";
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public int getVersion(){
|
||||
try {
|
||||
PackageManager packageManager = getPackageManager();
|
||||
PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0);
|
||||
String StringversionName = packageInfo.versionName; // 版本号
|
||||
int versionCode = packageInfo.versionCode; // 版本码
|
||||
// 在这里可以使用versionName和versionCode进行相关的操作
|
||||
// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode);
|
||||
return versionCode;
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
package com.web.cashsweep;
|
||||
|
||||
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.web.base.GsonUtils;
|
||||
import com.web.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);
|
||||
// if (remoteMessage.getNotification() != null) {
|
||||
// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
// }
|
||||
} else {
|
||||
//收到通知 创建notify
|
||||
if (remoteMessage.getNotification() != null) {
|
||||
showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void showNotification(MessageInfo messageInfo) {
|
||||
Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.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);
|
||||
|
||||
// Intent notifyIntent = new Intent(this, MainActivity2.class);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
// // notifyIntent.putExtra("message", messageInfo);
|
||||
// notifyIntent.setAction(Intent.ACTION_VIEW);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须
|
||||
// PendingIntent pendingIntent;
|
||||
// pendingIntent = PendingIntent.getActivity
|
||||
// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | 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(com.web.base.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(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(messageInfo.getTitle())
|
||||
.setContentText(messageInfo.getContent())
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.R.mipmap.ic_launcher)
|
||||
.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, MainActivity2.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(com.web.base.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(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
}
|
||||
notificationManager.notify(0, notificationBuilder.build());
|
||||
//存储数据
|
||||
// saveNotifyMessage(body);
|
||||
}
|
||||
|
||||
|
||||
// public void saveNotifyMessage(String body) {
|
||||
// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class);
|
||||
// String savenotify = Utils.get(getApplication(),ApiService.savenotify,"");
|
||||
// if(messageInfo!=null){
|
||||
// if(TextUtils.isEmpty(savenotify)){
|
||||
// GsonUtils.getListFromJSON(savenotify,)
|
||||
// }
|
||||
// }
|
||||
// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @param key 要设置的key
|
||||
// */
|
||||
// public static void set(Context activity, String key, String is) {
|
||||
// SharedPreferences nameSetting = getConfigShared(activity);
|
||||
// SharedPreferences.Editor namePref = nameSetting.edit();
|
||||
// namePref.putString(key, is);
|
||||
// namePref.commit();
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.web.cashsweep;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
|
||||
import com.tencent.smtt.export.external.TbsCoreSettings;
|
||||
import com.tencent.smtt.sdk.QbSdk;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class WebApplication extends Application {
|
||||
|
||||
|
||||
public static Context application;
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
// 设置开启优化方案
|
||||
application = this;
|
||||
HashMap map = new HashMap();
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true);
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true);
|
||||
QbSdk.initTbsSettings(map);
|
||||
QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() {
|
||||
@Override
|
||||
public void onCoreInitFinished() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewInitFinished(boolean b) {
|
||||
|
||||
}
|
||||
});
|
||||
QbSdk.setDownloadWithoutWifi(true);
|
||||
}
|
||||
}
|
||||
11
Cashsweep/src/main/res/drawable-anydpi/ic_action_back.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="#333333"
|
||||
android:alpha="0.8">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
|
||||
</vector>
|
||||
BIN
Cashsweep/src/main/res/drawable-hdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 182 B |
BIN
Cashsweep/src/main/res/drawable-mdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 150 B |
@@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
||||
BIN
Cashsweep/src/main/res/drawable-xhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 212 B |
BIN
Cashsweep/src/main/res/drawable-xxhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 324 B |
170
Cashsweep/src/main/res/drawable/ic_launcher_background.xml
Normal file
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
||||
20
Cashsweep/src/main/res/drawable/input_bg.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/white">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape>
|
||||
<solid android:color="@android:color/transparent" />
|
||||
<corners android:radius="23dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 默认显⽰效果-->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/dialog_input_bg"/>
|
||||
<corners
|
||||
android:radius="3dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
|
||||
28
Cashsweep/src/main/res/drawable/pass_word_bg.xml
Normal 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>
|
||||
|
||||
23
Cashsweep/src/main/res/drawable/pass_word_bg1.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#FF0000"
|
||||
android:centerColor="#FF5555"
|
||||
android:endColor="#FBD3D0"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
23
Cashsweep/src/main/res/drawable/pass_word_bg2.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#000000"
|
||||
android:centerColor="#888888"
|
||||
android:endColor="#FFFFFF"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
5
Cashsweep/src/main/res/drawable/shape_btn_bg.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="22dp" />
|
||||
<solid android:color="@color/jisuanqi" />
|
||||
</shape>
|
||||
6
Cashsweep/src/main/res/drawable/shape_dialog_bg2.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:topRightRadius="12dp"
|
||||
android:topLeftRadius="12dp"/>
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
Cashsweep/src/main/res/drawable/shape_dialog_bg3.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="12dp" />
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
Cashsweep/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
BIN
Cashsweep/src/main/res/mipmap-hdpi/ic_empty.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
Cashsweep/src/main/res/mipmap-hdpi/ic_pull_down.png
Normal file
|
After Width: | Height: | Size: 271 B |
BIN
Cashsweep/src/main/res/mipmap-xhdpi/ic_close.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
Cashsweep/src/main/res/mipmap-xhdpi/ic_facebook.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
Cashsweep/src/main/res/mipmap-xhdpi/ic_hometo.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
Cashsweep/src/main/res/mipmap-xhdpi/ic_link.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
Cashsweep/src/main/res/mipmap-xhdpi/ic_menu.png
Normal file
|
After Width: | Height: | Size: 779 B |
BIN
Cashsweep/src/main/res/mipmap-xhdpi/ic_shousuo.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
Cashsweep/src/main/res/mipmap-xhdpi/ic_tel.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
Cashsweep/src/main/res/mipmap-xhdpi/ic_whatsapp.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
Cashsweep/src/main/res/mipmap-xhdpi/ic_zhangkai.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
Cashsweep/src/main/res/mipmap-xxhdpi/app_logo.png
Normal file
|
After Width: | Height: | Size: 160 KiB |
54
Cashsweep/src/main/res/values-en/strings.xml
Normal file
@@ -0,0 +1,54 @@
|
||||
<resources>
|
||||
<string name="app_name">CashSweep888</string>
|
||||
<string name="qsrlwmm_txt">Please Set Your Password</string>
|
||||
<string name="cancel_txt">Cancel</string>
|
||||
<string name="sure_txt">Sure</string>
|
||||
<string name="banbengengxin_txt">New Version Update</string>
|
||||
<string name="xiacigengxin_txt">Next Update</string>
|
||||
<string name="lijigengxin_txt">Update Immediately</string>
|
||||
<string name="app_updater_error_notification_content">Click to close notification</string>
|
||||
<string name="app_updater_error_notification_content_re_download">Click to re-download</string>
|
||||
<string name="app_updater_error_notification_title">Download failed</string>
|
||||
<string name="app_updater_finish_notification_content">Click to install</string>
|
||||
<string name="app_updater_finish_notification_title">Download completed</string>
|
||||
<string name="app_updater_progress_notification_content">Downloading...</string>
|
||||
<string name="app_updater_progress_notification_title">Version update</string>
|
||||
<string name="app_updater_progress_notification_title_2">Downloading game</string>
|
||||
<string name="app_updater_start_notification_content">Getting download data...</string>
|
||||
<string name="app_updater_start_notification_title">Version update</string>
|
||||
<string name="app_updater_start_notification_title_2">Downloading game</string>
|
||||
<string name="notification_title_txt">Need to turn on mobile phone notification permission</string>
|
||||
<string name="notification_cancel_txt">Exit</string>
|
||||
<string name="notification_setting_txt">Setting</string>
|
||||
<string name="app_tishi">Tip</string>
|
||||
<string name="app_hint">Please enter the invitation code</string>
|
||||
<string name="app_sharetitle">My invitation code:</string>
|
||||
<string name="app_sharetitle2">Superior invitation code:</string>
|
||||
<string name="app_totalinvite">Total number of invites:</string>
|
||||
<string name="app_sharecontent">App download link:</string>
|
||||
<string name="app_share">Share</string>
|
||||
<string name="app_checklist">Check Invitation Records</string>
|
||||
<string name="app_invitetitle">Invitation Records</string>
|
||||
<string name="app_checklist_number">Total number of invitees: %d</string>
|
||||
<string name="app_nodata">No Data</string>
|
||||
<string name="app_withdrawtitle">Withdrawal Record</string>
|
||||
<string name="app_withdrawapply_title">Withdrawal Application</string>
|
||||
<string name="app_bankinfo_title">Edit Bank Card Information</string>
|
||||
<string name="app_bankinfo_countrycode">60</string>
|
||||
<string name="app_bankinfo_name">Name:</string>
|
||||
<string name="app_bankinfo_name_hint">Please enter the bank card name</string>
|
||||
<string name="app_bankinfo_code">Bank card account:</string>
|
||||
<string name="app_bankinfo_code_hint">Please enter the bank card account</string>
|
||||
<string name="app_bankinfo_bankcountry">Country:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">Please select a country</string>
|
||||
<string name="app_bankinfo_bankname">Bank Name:</string>
|
||||
<string name="app_bankinfo_bankname_hint">Please select a bank name</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">Note: Please enter the country code before selecting the bank name!</string>
|
||||
<string name="app_balance">Balance: %s</string>
|
||||
<string name="app_totalearning">Total Earnings: %s</string>
|
||||
<string name="app_withdraw_amount">Amount: %s</string>
|
||||
<string name="app_withdraw_apply_hint">Please enter the withdrawal amount</string>
|
||||
<string name="app_toastapply">Withdrawal application has been submitted</string>
|
||||
<string name="app_notinstall">App not installed</string>
|
||||
|
||||
</resources>
|
||||
69
Cashsweep/src/main/res/values-night/themes.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.Calculcator" parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_200</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/black</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_200</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</item>
|
||||
</style>
|
||||
</resources>
|
||||
19
Cashsweep/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="purple_200">#FFFFFF</color>
|
||||
<color name="purple_500">#FFFFFF</color>
|
||||
<color name="purple_700">#FFFFFF</color>
|
||||
<color name="teal_200">#FF03DAC5</color>
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="jisuanqi">#EF4723</color>
|
||||
<color name="notify_color">#FFFFFFFF</color>
|
||||
|
||||
<color name="dialog_bg">#2C2C2E</color>
|
||||
<color name="dialog_textcolor">#FFA722</color>
|
||||
<color name="dialog_input_bg">#434343</color>
|
||||
<color name="dialog_dark">#BCBCBC</color>
|
||||
<color name="color_red">#DC1927</color>
|
||||
|
||||
</resources>
|
||||
77
Cashsweep/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,77 @@
|
||||
<resources>
|
||||
<string name="app_name">CashSweep888</string>
|
||||
<string name="qsrlwmm_txt">请输入6位密码</string>
|
||||
<string name="cancel_txt">取消</string>
|
||||
<string name="sure_txt">确定</string>
|
||||
<string name="banbengengxin_txt">版本更新</string>
|
||||
<string name="xiacigengxin_txt">下次更新</string>
|
||||
<string name="lijigengxin_txt">立即更新</string>
|
||||
<string name="app_updater_error_notification_content">点击关闭通知</string>
|
||||
<string name="app_updater_error_notification_content_re_download">点击重新下载</string>
|
||||
<string name="app_updater_error_notification_title">下载失败</string>
|
||||
<string name="app_updater_finish_notification_content">点击安装</string>
|
||||
<string name="app_updater_finish_notification_title">下载完成</string>
|
||||
<string name="app_updater_progress_notification_content">正在下载…</string>
|
||||
<string name="app_updater_progress_notification_title">版本更新</string>
|
||||
<string name="app_updater_progress_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_title">版本更新</string>
|
||||
<string name="app_updater_start_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_content">正在获取下载数据…</string>
|
||||
<string name="notification_title_txt">需要打开手机通知权限</string>
|
||||
<string name="notification_cancel_txt">退出</string>
|
||||
<string name="notification_setting_txt">设置</string>
|
||||
<string name="app_tishi">提示</string>
|
||||
<string name="app_hint">请输入邀请码</string>
|
||||
<string name="app_sharetitle">我的邀请码:</string>
|
||||
<string name="app_sharetitle2">上级邀请码:</string>
|
||||
<string name="app_totalinvite">总邀请人数:</string>
|
||||
<string name="app_sharecontent">邀请您下载:</string>
|
||||
<string name="app_share">分享</string>
|
||||
<string name="app_checklist">查看邀请记录</string>
|
||||
<string name="app_invitetitle">邀请记录</string>
|
||||
<string name="app_checklist_number">总邀请人数: %d</string>
|
||||
<string name="app_nodata">暂无数据</string>
|
||||
<string name="app_withdrawtitle">提现记录</string>
|
||||
<string name="app_withdrawapply_title">提现申请</string>
|
||||
<string name="app_bankinfo_title">编辑银行卡信息</string>
|
||||
<string name="app_bankinfo_countrycode">86</string>
|
||||
<string name="app_bankinfo_name">持卡人姓名:</string>
|
||||
<string name="app_bankinfo_name_hint">请输入持卡人姓名</string>
|
||||
<string name="app_bankinfo_bankcountry">国家地区:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">请选择国家地区</string>
|
||||
<string name="app_bankinfo_bankname">开户行名称:</string>
|
||||
<string name="app_bankinfo_bankname_hint">请选择开户行名称</string>
|
||||
<string name="app_bankinfo_code">银行户口:</string>
|
||||
<string name="app_bankinfo_code_hint">请输入银行卡户口</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">(注:请先输入国家区号再选择开户行名称!)</string>
|
||||
<string name="app_balance">余额: %s</string>
|
||||
<string name="app_totalearning">总收益: %s</string>
|
||||
<string name="app_withdraw_amount">金额: %s</string>
|
||||
<string name="app_withdraw_apply_hint">请输入提现金额</string>
|
||||
<string name="app_toastapply">提现申请已提交</string>
|
||||
<string name="app_notinstall">应用未安装</string>
|
||||
|
||||
|
||||
<!-- <string name="app_name">SPEEDAU</string>-->
|
||||
<!-- <string name="qsrlwmm_txt">Please Set Your Password</string>-->
|
||||
<!-- <string name="cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="sure_txt">Sure</string>-->
|
||||
<!-- <string name="banbengengxin_txt">New Version Update</string>-->
|
||||
<!-- <string name="xiacigengxin_txt">Next Update</string>-->
|
||||
<!-- <string name="lijigengxin_txt">Update Immediately</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content">Click to close notification</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content_re_download">Click to re-download</string>-->
|
||||
<!-- <string name="app_updater_error_notification_title">Download failed</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_content">Click to install</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_title">Download completed</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_content">Downloading...</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="app_updater_start_notification_content">Getting download data...</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="notification_title_txt">Need to turn on mobile phone notification permission</string>-->
|
||||
<!-- <string name="notification_cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="notification_setting_txt">Setting</string>-->
|
||||
|
||||
</resources>
|
||||
20
Cashsweep/src/main/res/values/style.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="AppThemeStart1" parent="@style/Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="android:windowTranslucentStatus">true</item>
|
||||
<item name="android:windowTranslucentNavigation">false</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="colorPrimary">@android:color/transparent</item>
|
||||
<item name="colorPrimaryDark">@android:color/transparent</item>
|
||||
<item name="colorAccent">@android:color/transparent</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<!-- 隐藏Activity窗口的Title标题栏 -->
|
||||
<item name="windowNoTitle">true</item>
|
||||
<!-- <item name="android:windowFullscreen">true</item>-->
|
||||
<item name="android:windowBackground">@color/white</item>
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</item>
|
||||
</style>
|
||||
</resources>
|
||||
89
Cashsweep/src/main/res/values/themes.xml
Normal file
@@ -0,0 +1,89 @@
|
||||
<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. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
<item name="android:enforceNavigationBarContrast" tools:ignore="NewApi">false</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</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>
|
||||
10
Cashsweep/src/main/res/xml/app_updater_paths.xml
Normal 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>
|
||||
4
Cashsweep/src/main/res/xml/network_security_config.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<network-security-config>
|
||||
<base-config cleartextTrafficPermitted="true" />
|
||||
</network-security-config>
|
||||
13
Cashsweep/src/main/res/xml/provider_paths.xml
Normal 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"异常的问题 -->
|
||||
@@ -0,0 +1,35 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void TestPattern(){
|
||||
//
|
||||
Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$");
|
||||
String a="+45.5";
|
||||
boolean matches = compile.matcher(a).matches();
|
||||
System.out.println(matches);
|
||||
String result = compile.matcher(a).replaceAll("");
|
||||
System.out.println(result);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
1
Dmcslot/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
83
Dmcslot/build.gradle
Normal file
@@ -0,0 +1,83 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'com.google.gms.google-services'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 31
|
||||
buildToolsVersion "30.0.3"
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.web.dmcslot"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 31
|
||||
versionCode 100
|
||||
versionName "v1.0.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
signingConfigs {
|
||||
debug {
|
||||
storeFile file('dmcslot.jks')
|
||||
storePassword "android2025"
|
||||
keyAlias 'key0'
|
||||
keyPassword "android2025"
|
||||
}
|
||||
release {
|
||||
storeFile file('dmcslot.jks')
|
||||
storePassword "android2025"
|
||||
keyAlias 'key0'
|
||||
keyPassword "android2025"
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'com.google.android.material:material:1.1.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
testImplementation 'junit:junit:4.+'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar')
|
||||
|
||||
// okhttp相关库
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
|
||||
|
||||
// JSON解析库
|
||||
implementation 'com.google.code.gson:gson:2.9.0'
|
||||
implementation 'com.alibaba:fastjson:1.1.71.android'
|
||||
api 'com.squareup.retrofit2:retrofit:2.5.0'
|
||||
api 'com.squareup.retrofit2:converter-scalars:2.3.0'
|
||||
api 'com.squareup.retrofit2:converter-gson:2.4.0'
|
||||
api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
|
||||
api 'io.reactivex.rxjava2:rxjava:2.1.16'
|
||||
api 'io.reactivex.rxjava2:rxandroid:2.0.2'
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选)
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选)
|
||||
implementation 'com.github.Justson:Downloader:v5.0.4-androidx'
|
||||
//implementation 'com.tencent.tbs:tbssdk:44286'
|
||||
// sdk 33
|
||||
implementation platform('com.google.firebase:firebase-bom:32.7.0')
|
||||
// Firebase Cloud Messaging
|
||||
// implementation("com.google.firebase:firebase-messaging")
|
||||
// implementation("com.google.firebase:firebase-analytics")
|
||||
|
||||
implementation("com.google.firebase:firebase-messaging:24.0.3")
|
||||
// implementation("com.google.firebase:firebase-analytics:21.2.1")
|
||||
// implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式
|
||||
implementation("com.github.bumptech.glide:glide:4.13.1")
|
||||
}
|
||||
BIN
Dmcslot/dmcslot.jks
Normal file
29
Dmcslot/google-services.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "184962620137",
|
||||
"project_id": "dmcslot-edbc0",
|
||||
"storage_bucket": "dmcslot-edbc0.firebasestorage.app"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:184962620137:android:3d0ae8c24859e74df8ae78",
|
||||
"android_client_info": {
|
||||
"package_name": "com.web.dmcslot"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyB8-HvXapf4L-yB16Kmun17j3PlYMcbh5w"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
BIN
Dmcslot/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar
Normal file
32
Dmcslot/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
||||
-dontwarn dalvik.**
|
||||
-dontwarn com.tencent.smtt.**
|
||||
|
||||
-keep class com.tencent.smtt.** {
|
||||
*;
|
||||
}
|
||||
|
||||
-keep class com.tencent.tbs.** {
|
||||
*;
|
||||
}
|
||||
BIN
Dmcslot/release/dmcslot.apk
Normal file
18
Dmcslot/release/output-metadata.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"version": 2,
|
||||
"artifactType": {
|
||||
"type": "APK",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "com.web.dmcslot",
|
||||
"variantName": "processReleaseResources",
|
||||
"elements": [
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"versionCode": 100,
|
||||
"versionName": "v1.0.0",
|
||||
"outputFile": "app-release.apk"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("Tptogiar.calculcator", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
169
Dmcslot/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,169 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.web.dmcslot">
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera"
|
||||
android:required="false" />
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera2"
|
||||
android:required="false" />
|
||||
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS" /> <!-- 获取通讯录-->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<!-- 多媒体相关 -->
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
|
||||
<!-- 8.0+系统需要-->
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
|
||||
<!--推送权限-->
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_SECURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.RECORD_AUDIO" />-->
|
||||
<!-- 通知委托启用状态-->
|
||||
<meta-data
|
||||
android:name="delivery_metrics_exported_to_big_query_enabled"
|
||||
android:value="true" />
|
||||
|
||||
<!-- <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_AUDIO_OUTPUT" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.autofocus" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.front" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.level.full" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.capability.raw" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.any" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.microphone" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera2" android:required="true" />-->
|
||||
|
||||
<queries>
|
||||
<intent>
|
||||
<action android:name="android.media.action.IMAGE_CAPTURE" />
|
||||
</intent>
|
||||
</queries>
|
||||
<application
|
||||
android:name=".WebApplication"
|
||||
android:allowBackup="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:icon="@mipmap/app_logo"
|
||||
android:label="@string/app_name"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:roundIcon="@mipmap/app_logo"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.AppTheme"
|
||||
android:usesCleartextTraffic="true">
|
||||
|
||||
|
||||
<!-- <activity-alias-->
|
||||
<!-- android:name=".MainActivityNew"-->
|
||||
<!-- android:icon="@mipmap/winway"-->
|
||||
<!-- android:roundIcon="@mipmap/winway"-->
|
||||
<!-- android:label="@string/app_name1"-->
|
||||
<!-- android:targetActivity=".MainActivity"-->
|
||||
<!-- android:enabled="false"-->
|
||||
<!-- android:exported="true"-->
|
||||
<!-- android:configChanges="orientation|navigation|keyboardHidden"-->
|
||||
<!-- android:launchMode="singleTop"-->
|
||||
<!-- android:excludeFromRecents="true"-->
|
||||
<!-- android:screenOrientation="portrait">-->
|
||||
<!-- <intent-filter>-->
|
||||
<!-- <action android:name="android.intent.action.MAIN" />-->
|
||||
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
|
||||
<!-- </intent-filter>-->
|
||||
<!-- </activity-alias>-->
|
||||
|
||||
<activity android:name=".StartActivity" />
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity2"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:exported="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:launchMode="singleTop"
|
||||
android:theme="@style/AppThemeStart">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".WebViewActivity"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:exported="false"
|
||||
android:hardwareAccelerated="true" />
|
||||
|
||||
<activity
|
||||
android:name=".WebView2Activity"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:exported="false"
|
||||
android:hardwareAccelerated="true" />
|
||||
<activity
|
||||
android:name=".NotifyDetailsActivity"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:exported="false"
|
||||
android:hardwareAccelerated="true" />
|
||||
<activity
|
||||
android:name=".NotifyListActivity"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:exported="false"
|
||||
android:hardwareAccelerated="true" />
|
||||
|
||||
<service android:name=".appdown.service.DownloadService" />
|
||||
|
||||
<provider
|
||||
android:name=".appdown.provider.AppUpdaterFileProvider"
|
||||
android:authorities="com.web.dmcslot.appdown.provider.AppUpdaterFileProvider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/app_updater_paths" />
|
||||
</provider>
|
||||
|
||||
<service
|
||||
android:name="com.tencent.smtt.export.external.DexClassLoaderProviderService"
|
||||
android:label="dexopt"
|
||||
android:process=":dexopt" />
|
||||
|
||||
|
||||
<!-- android:directBootAware="true" 为应用启用消息处理直接启动模式-->
|
||||
<service
|
||||
android:name=".MyFirebaseMessageingService"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<!-- Set custom default icon. This is used when no icon is set for incoming notification messages.
|
||||
See README(https://goo.gl/l4GJaQ) for more. 设置推送默认图标 和颜色-->
|
||||
<meta-data
|
||||
android:name="com.google.firebase.messaging.default_notification_icon"
|
||||
android:resource="@mipmap/app_logo" />
|
||||
<!-- Set color used with incoming notification messages. This is used when no color is set for the incoming
|
||||
notification message. See README(https://goo.gl/6BKBk7) for more. -->
|
||||
<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" />
|
||||
<!-- 还可设置推送渠道 -->
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.google.firebase.messaging.default_notification_channel_id"-->
|
||||
<!-- android:value="@string/default_notification_channel_id" />-->
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
214
Dmcslot/src/main/java/com/web/dmcslot/ActionBankInfoDialog.java
Normal file
@@ -0,0 +1,214 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
|
||||
/**
|
||||
* 填写银行卡信息
|
||||
*/
|
||||
public class ActionBankInfoDialog extends Dialog {
|
||||
private final Context context;
|
||||
private TextView tvBankNameCountry;
|
||||
private TextView tvbankName;
|
||||
private EditText bankInfoName;
|
||||
private EditText bankInfoCode;
|
||||
private TextView cancelTv;
|
||||
private TextView sumbitTv;
|
||||
private String myInviteCode;
|
||||
private BankInfo itemSelector;
|
||||
private RecyclerView recyclerView;
|
||||
private RecyclerView recyclerViewCountry;
|
||||
private List<BankInfo> listdata = new ArrayList<>();
|
||||
private List<String> listcountry = new ArrayList<>();
|
||||
private MyBankListAdapter adapter;
|
||||
private MyListAdapter listCountryAdapter;
|
||||
|
||||
public ActionBankInfoDialog(Context context, String myInviteCode) {
|
||||
super(context, R.style.MaterialDesignDialog);
|
||||
this.context = context;
|
||||
this.myInviteCode = myInviteCode;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.dialog_action_bankinfo);
|
||||
findViewById(R.id.ic_dialog_close).setOnClickListener(view -> dismiss());
|
||||
tvBankNameCountry = findViewById(R.id.inputcountry_tv);
|
||||
tvbankName = findViewById(R.id.inputbankname_tv);
|
||||
bankInfoName = findViewById(R.id.inputname_tv);
|
||||
bankInfoCode = findViewById(R.id.inputcode_tv);
|
||||
getBankInfoList();
|
||||
sumbitTv = findViewById(R.id.sumbit_tv);
|
||||
recyclerViewCountry = findViewById(R.id.recycler_bankcountry);
|
||||
recyclerViewCountry.setLayoutManager(new LinearLayoutManager(context));
|
||||
listCountryAdapter = new MyListAdapter(listcountry);
|
||||
recyclerViewCountry.setAdapter(listCountryAdapter);
|
||||
listCountryAdapter.setOnItemClick(new MyListAdapter.onItemClickPostionListener() {
|
||||
@Override
|
||||
public void item(int position) {
|
||||
tvBankNameCountry.setText(listcountry.get(position));
|
||||
recyclerViewCountry.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
recyclerView = findViewById(R.id.recycler_bankname);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
||||
adapter = new MyBankListAdapter(listdata);
|
||||
recyclerView.setAdapter(adapter);
|
||||
adapter.setOnItemClick(new MyBankListAdapter.onItemClickPostionListener() {
|
||||
@Override
|
||||
public void item(int position) {
|
||||
itemSelector = listdata.get(position);
|
||||
tvbankName.setText(itemSelector.getBankName());
|
||||
recyclerView.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
|
||||
tvbankName.setText(MainActivity.getString(context, "bankname", ""));
|
||||
tvBankNameCountry.setText(MainActivity.getString(context, "bankcode", context.getString(R.string.app_bankinfo_countrycode)));
|
||||
bankInfoName.setText(MainActivity.getString(context, "name", ""));
|
||||
|
||||
bankInfoCode.setText(MainActivity.getString(context, "bankno", ""));
|
||||
tvBankNameCountry.setOnClickListener(view -> {
|
||||
recyclerView.setVisibility(View.GONE);
|
||||
if (recyclerViewCountry.getVisibility() == View.VISIBLE) {
|
||||
recyclerViewCountry.setVisibility(View.GONE);
|
||||
return;
|
||||
}
|
||||
recyclerViewCountry.setVisibility(View.VISIBLE);
|
||||
});
|
||||
tvbankName.setOnClickListener(view -> {
|
||||
if (TextUtils.isEmpty(tvBankNameCountry.getText().toString())) {
|
||||
Toast.makeText(context, context.getString(R.string.app_bankinfo_bankcountry_hint), Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
recyclerViewCountry.setVisibility(View.GONE);
|
||||
if (recyclerView.getVisibility() == View.VISIBLE) {
|
||||
recyclerView.setVisibility(View.GONE);
|
||||
return;
|
||||
}
|
||||
recyclerView.setVisibility(View.VISIBLE);
|
||||
});
|
||||
|
||||
sumbitTv.setOnClickListener(view -> {
|
||||
if (TextUtils.isEmpty(tvBankNameCountry.getText().toString())) {
|
||||
Toast.makeText(context, context.getString(R.string.app_bankinfo_bankname_hint), Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (TextUtils.isEmpty(bankInfoName.getText().toString())) {
|
||||
Toast.makeText(context, context.getString(R.string.app_bankinfo_name_hint), Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (TextUtils.isEmpty(bankInfoCode.getText().toString())) {
|
||||
Toast.makeText(context, context.getString(R.string.app_bankinfo_code_hint), Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
toSubmit(tvbankName.getText().toString(), bankInfoName.getText().toString(), bankInfoCode.getText().toString());
|
||||
|
||||
});
|
||||
setCanceledOnTouchOutside(false);
|
||||
Window window = getWindow();
|
||||
WindowManager.LayoutParams wlp = window.getAttributes();
|
||||
wlp.gravity = Gravity.CENTER;
|
||||
wlp.width = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
wlp.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
|
||||
window.setAttributes(wlp);
|
||||
}
|
||||
|
||||
public void getBankInfoList() {
|
||||
Api.getInstance().getBankInfoList()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver<Result<Map<String, List<BankInfo>>>>() {
|
||||
@Override
|
||||
public void onSuccess(Result<Map<String, List<BankInfo>>> o) {
|
||||
|
||||
listdata.clear();
|
||||
listcountry.clear();
|
||||
if (o.data != null) {
|
||||
for (Map.Entry<String, List<BankInfo>> entry : o.data.entrySet()) {
|
||||
listdata.addAll(entry.getValue());
|
||||
listcountry.add(entry.getKey());
|
||||
}
|
||||
adapter.setListdata(listdata);
|
||||
listCountryAdapter.setListdata(listcountry);
|
||||
}
|
||||
// if (o.data != null && o.data.size() > 0) {
|
||||
// listdata.clear();
|
||||
// listdata.addAll(o.data);
|
||||
// adapter.setListdata(listdata);
|
||||
// recyclerView.setVisibility(View.VISIBLE);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError2(Result<Map<String, List<BankInfo>>> o) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void toSubmit(String bankname, String bankinfoname, String bankinfocode) {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("inviteCode", myInviteCode);
|
||||
map.put("name", bankinfoname);
|
||||
map.put("bankNo", bankinfocode);
|
||||
map.put("bankId", itemSelector.getId());
|
||||
map.put("bankName", bankname);
|
||||
Api.getInstance().sendBankInfo(map)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver<Result>() {
|
||||
@Override
|
||||
public void onSuccess(Result o) {
|
||||
dismiss();
|
||||
MainActivity.saveString(context, "bankname", bankname);
|
||||
MainActivity.saveString(context, "name", bankinfoname);
|
||||
MainActivity.saveString(context, "bankno", bankinfocode);
|
||||
MainActivity.saveString(context, "bankcode", itemSelector.getBankCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError2(Result o) {
|
||||
Toast.makeText(context, o.error, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
124
Dmcslot/src/main/java/com/web/dmcslot/ActionConfirmDialog.java
Normal file
@@ -0,0 +1,124 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.TextView;
|
||||
|
||||
|
||||
/**
|
||||
* 通用弹窗
|
||||
*/
|
||||
public class ActionConfirmDialog extends Dialog {
|
||||
private final Context context;
|
||||
private View lineV;
|
||||
|
||||
private TextView contentTv;
|
||||
private TextView cancelTv;
|
||||
private TextView sumbitTv;
|
||||
String title;
|
||||
String content;
|
||||
String cancel = null;
|
||||
String sure = null;
|
||||
boolean showCancel = true;
|
||||
OnToActionListener onToActionListener;
|
||||
|
||||
public interface OnToActionListener {
|
||||
void toSumbit();
|
||||
void toCancel();
|
||||
|
||||
}
|
||||
|
||||
public void setOnToActionListener(OnToActionListener onNextCallListener) {
|
||||
this.onToActionListener = onNextCallListener;
|
||||
}
|
||||
|
||||
|
||||
public ActionConfirmDialog(Context context, String content,boolean showCancel) {
|
||||
super(context, R.style.MaterialDesignDialog);
|
||||
this.context = context;
|
||||
this.content = content;
|
||||
this.showCancel = showCancel;
|
||||
}
|
||||
public ActionConfirmDialog(Context context, String content, String cancel, String sure) {
|
||||
super(context, R.style.MaterialDesignDialog);
|
||||
this.context = context;
|
||||
this.content = content;
|
||||
this.cancel = cancel;
|
||||
this.sure = sure;
|
||||
}
|
||||
|
||||
public ActionConfirmDialog(Context context, String content, String cancel, String sure,boolean showCancel) {
|
||||
super(context, R.style.MaterialDesignDialog);
|
||||
this.context = context;
|
||||
this.content = content;
|
||||
this.cancel = cancel;
|
||||
this.sure = sure;
|
||||
this.showCancel = showCancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.dialog_action_confirm);
|
||||
|
||||
contentTv = (TextView) findViewById(R.id.content_tv);
|
||||
cancelTv = (TextView) findViewById(R.id.cancel_tv);
|
||||
sumbitTv = (TextView) findViewById(R.id.sumbit_tv);
|
||||
|
||||
lineV = (View) findViewById(R.id.line_v);
|
||||
|
||||
contentTv.setText(content);
|
||||
contentTv.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
|
||||
@Override
|
||||
public boolean onPreDraw() {
|
||||
//这个监听的回调是异步的,在监听完以后一定要把绘制监听移除,不然这个会一直回调,导致界面错乱
|
||||
contentTv.getViewTreeObserver().removeOnPreDrawListener(this);
|
||||
int line = contentTv.getLineCount();
|
||||
if(line>1){
|
||||
contentTv.setGravity(Gravity.LEFT|Gravity.CENTER_VERTICAL);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
if(!TextUtils.isEmpty(cancel)){
|
||||
cancelTv.setText(cancel);
|
||||
}
|
||||
if(!TextUtils.isEmpty(sure)){
|
||||
sumbitTv.setText(sure);
|
||||
}
|
||||
if(!showCancel){
|
||||
cancelTv.setVisibility(View.GONE);
|
||||
lineV.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
sumbitTv.setOnClickListener(v -> {
|
||||
dismiss();
|
||||
if(onToActionListener!=null){
|
||||
onToActionListener.toSumbit();
|
||||
}
|
||||
});
|
||||
cancelTv.setOnClickListener(v -> {
|
||||
dismiss();
|
||||
if(onToActionListener!=null){
|
||||
onToActionListener.toCancel();
|
||||
}
|
||||
});
|
||||
|
||||
Window window = getWindow();
|
||||
WindowManager.LayoutParams wlp = window.getAttributes();
|
||||
wlp.gravity = Gravity.CENTER;
|
||||
wlp.width = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
wlp.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
|
||||
window.setAttributes(wlp);
|
||||
}
|
||||
|
||||
}
|
||||
105
Dmcslot/src/main/java/com/web/dmcslot/ActionInviteDialog.java
Normal file
@@ -0,0 +1,105 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
|
||||
/**
|
||||
* 填写邀请码
|
||||
*/
|
||||
public class ActionInviteDialog extends Dialog {
|
||||
private final Context context;
|
||||
private View lineV;
|
||||
|
||||
|
||||
private EditText inputTxt;
|
||||
private TextView cancelTv;
|
||||
private TextView sumbitTv;
|
||||
String content;
|
||||
String cancel = null;
|
||||
String sure = null;
|
||||
boolean showCancel = true;
|
||||
OnToActionListener onToActionListener;
|
||||
|
||||
public interface OnToActionListener {
|
||||
void toSumbit(String content);
|
||||
|
||||
void toCancel();
|
||||
|
||||
}
|
||||
|
||||
public void setOnToActionListener(OnToActionListener onNextCallListener) {
|
||||
this.onToActionListener = onNextCallListener;
|
||||
}
|
||||
|
||||
|
||||
public ActionInviteDialog(Context context, boolean showCancel) {
|
||||
super(context, R.style.MaterialDesignDialog);
|
||||
this.context = context;
|
||||
this.showCancel = showCancel;
|
||||
}
|
||||
|
||||
public ActionInviteDialog(Context context, String cancel, String sure, boolean showCancel) {
|
||||
super(context, R.style.MaterialDesignDialog);
|
||||
this.context = context;
|
||||
this.cancel = cancel;
|
||||
this.sure = sure;
|
||||
this.showCancel = showCancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.dialog_action_invite);
|
||||
cancelTv = (TextView) findViewById(R.id.cancel_tv);
|
||||
sumbitTv = (TextView) findViewById(R.id.sumbit_tv);
|
||||
lineV = (View) findViewById(R.id.line_v);
|
||||
inputTxt = findViewById(R.id.input_tv);
|
||||
if (!TextUtils.isEmpty(cancel)) {
|
||||
cancelTv.setText(cancel);
|
||||
}
|
||||
if (!TextUtils.isEmpty(sure)) {
|
||||
sumbitTv.setText(sure);
|
||||
}
|
||||
if (!showCancel) {
|
||||
cancelTv.setVisibility(View.GONE);
|
||||
lineV.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
sumbitTv.setOnClickListener(v -> {
|
||||
if (TextUtils.isEmpty(inputTxt.getText().toString())) {
|
||||
Toast.makeText(context, context.getString(R.string.app_hint), Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (onToActionListener != null) {
|
||||
onToActionListener.toSumbit(inputTxt.getText().toString());
|
||||
}
|
||||
});
|
||||
cancelTv.setOnClickListener(v -> {
|
||||
dismiss();
|
||||
if (onToActionListener != null) {
|
||||
onToActionListener.toCancel();
|
||||
}
|
||||
});
|
||||
|
||||
setCanceledOnTouchOutside(false);
|
||||
Window window = getWindow();
|
||||
WindowManager.LayoutParams wlp = window.getAttributes();
|
||||
wlp.gravity = Gravity.CENTER;
|
||||
wlp.width = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
wlp.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
|
||||
window.setAttributes(wlp);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.database.DataSetObserver;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ListAdapter;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.web.dmcslot.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
|
||||
/**
|
||||
* 展示邀请记录
|
||||
*/
|
||||
public class ActionInviteRecordsDialog extends Dialog {
|
||||
private Context context;
|
||||
private String myInviteCode;
|
||||
private List<String> listdata = new ArrayList<>();
|
||||
|
||||
private RecyclerView recyclerView;
|
||||
private MyListAdapter listAdapter;
|
||||
private TextView tvTitle;
|
||||
private TextView tvBalance;
|
||||
private TextView tvTotalEarning;
|
||||
private int page = 1;
|
||||
|
||||
|
||||
public ActionInviteRecordsDialog(Context context, String myInviteCode) {
|
||||
super(context, R.style.MaterialDesignDialog);
|
||||
this.context = context;
|
||||
this.myInviteCode = myInviteCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.dialog_action_invite_records);
|
||||
recyclerView = findViewById(R.id.recycler_list);
|
||||
tvTitle = findViewById(R.id.content_tv);
|
||||
tvBalance = findViewById(R.id.balance_tv);
|
||||
tvTotalEarning = findViewById(R.id.totalearnings_tv);
|
||||
tvTitle.setText(context.getString(R.string.app_invitetitle));
|
||||
findViewById(R.id.layout_balance).setVisibility(View.GONE);
|
||||
getRecords();
|
||||
findViewById(R.id.ic_dialog_close).setOnClickListener(view -> {
|
||||
dismiss();
|
||||
});
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
||||
listAdapter = new MyListAdapter(listdata);
|
||||
recyclerView.setAdapter(listAdapter);
|
||||
setCanceledOnTouchOutside(false);
|
||||
setCancelable(false);
|
||||
Window window = getWindow();
|
||||
WindowManager.LayoutParams wlp = window.getAttributes();
|
||||
wlp.gravity = Gravity.CENTER;
|
||||
wlp.width = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
wlp.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
|
||||
window.setAttributes(wlp);
|
||||
}
|
||||
|
||||
public void getRecords() {
|
||||
Api.getInstance().getRecords(myInviteCode, page, 20)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver<Result<InviteListInfo>>() {
|
||||
@Override
|
||||
public void onSuccess(Result<InviteListInfo> o) {
|
||||
if(o.data!=null){
|
||||
findViewById(R.id.layout_balance).setVisibility(View.VISIBLE);
|
||||
InviteListInfo inviteInfo = o.data;
|
||||
tvBalance.setText(String.format(context.getString(R.string.app_balance), inviteInfo.getInviteCode().getBalance()));
|
||||
tvTotalEarning.setText(String.format(context.getString(R.string.app_totalearning), inviteInfo.getInviteCode().getIncome()));
|
||||
if (page == 1) {
|
||||
listdata = inviteInfo.getList();
|
||||
} else {
|
||||
listdata.addAll(inviteInfo.getList());
|
||||
}
|
||||
if (listdata.size() > 0) {
|
||||
listAdapter.setListdata(listdata);
|
||||
recyclerView.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
recyclerView.setVisibility(View.GONE);
|
||||
}
|
||||
tvTitle.setText(context.getString(R.string.app_invitetitle) + " (" + inviteInfo.getTotal() + ")");
|
||||
if (listdata.size() < inviteInfo.getTotal()) {
|
||||
page++;
|
||||
getRecords();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
LogUtils.d("dddd" + msg);
|
||||
if (page == 1) {
|
||||
recyclerView.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError2(Result<InviteListInfo> o) {
|
||||
if (page == 1) {
|
||||
recyclerView.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
119
Dmcslot/src/main/java/com/web/dmcslot/ActionSelectDialog.java
Normal file
@@ -0,0 +1,119 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.TextView;
|
||||
|
||||
|
||||
public class ActionSelectDialog extends Dialog {
|
||||
|
||||
private TextView shareTv;
|
||||
private TextView checkTv;
|
||||
OnToActionListener onToLoginListener;
|
||||
private Context mContext;
|
||||
|
||||
public interface OnToActionListener {
|
||||
void toShare();
|
||||
|
||||
void toCheck();
|
||||
|
||||
void toWithDrawRecords();
|
||||
|
||||
void toWithDrawApply();
|
||||
|
||||
void toBankInfo();
|
||||
}
|
||||
|
||||
public void setOnToActionListener(OnToActionListener onNextCallListener) {
|
||||
this.onToLoginListener = onNextCallListener;
|
||||
}
|
||||
|
||||
|
||||
public ActionSelectDialog(Context context) {
|
||||
super(context, R.style.MaterialDesignDialog);
|
||||
this.mContext = context;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.dialog_select_action);
|
||||
|
||||
shareTv = (TextView) findViewById(R.id.share);
|
||||
checkTv = (TextView) findViewById(R.id.check);
|
||||
|
||||
shareTv.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
dismiss();
|
||||
if (onToLoginListener != null) {
|
||||
onToLoginListener.toShare();
|
||||
}
|
||||
}
|
||||
});
|
||||
checkTv.setOnClickListener(view -> {
|
||||
dismiss();
|
||||
if (onToLoginListener != null) {
|
||||
onToLoginListener.toCheck();
|
||||
}
|
||||
});
|
||||
//提现记录
|
||||
findViewById(R.id.withdraw).setOnClickListener(view -> {
|
||||
dismiss();
|
||||
if (onToLoginListener != null) {
|
||||
onToLoginListener.toWithDrawRecords();
|
||||
}
|
||||
});
|
||||
//提现申请
|
||||
findViewById(R.id.withdraw_apply).setOnClickListener(view -> {
|
||||
dismiss();
|
||||
if (onToLoginListener != null) {
|
||||
onToLoginListener.toWithDrawApply();
|
||||
}
|
||||
});
|
||||
//银行卡信息
|
||||
findViewById(R.id.bankinfo).setOnClickListener(view -> {
|
||||
dismiss();
|
||||
if (onToLoginListener != null) {
|
||||
onToLoginListener.toBankInfo();
|
||||
}
|
||||
});
|
||||
Window window = getWindow();
|
||||
WindowManager.LayoutParams wlp = window.getAttributes();
|
||||
wlp.gravity = Gravity.BOTTOM;
|
||||
wlp.width = WindowManager.LayoutParams.MATCH_PARENT;
|
||||
wlp.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
window.setAttributes(wlp);
|
||||
}
|
||||
|
||||
// private void fullScreenImmersive(View view) {
|
||||
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
// int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||
// | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
||||
// | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||
// | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
||||
// | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||
// | View.SYSTEM_UI_FLAG_FULLSCREEN;
|
||||
// view.setSystemUiVisibility(uiOptions);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void show() {
|
||||
// this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE);
|
||||
// super.show();
|
||||
// fullScreenImmersive(getWindow().getDecorView());
|
||||
// this.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE);
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
|
||||
/**
|
||||
* 提现申请
|
||||
*/
|
||||
public class ActionWithDrawApplyDialog extends Dialog {
|
||||
private final Context context;
|
||||
private View lineV;
|
||||
|
||||
|
||||
private EditText inputTxt;
|
||||
private TextView cancelTv;
|
||||
private TextView sumbitTv;
|
||||
private TextView balanceTv;
|
||||
String content;
|
||||
String cancel = null;
|
||||
String sure = null;
|
||||
String myInviteCode;
|
||||
private boolean showCancel = true;
|
||||
OnToActionListener onToActionListener;
|
||||
|
||||
public interface OnToActionListener {
|
||||
void toSumbit(String content);
|
||||
|
||||
void toCancel();
|
||||
|
||||
}
|
||||
|
||||
public void setOnToActionListener(OnToActionListener onNextCallListener) {
|
||||
this.onToActionListener = onNextCallListener;
|
||||
}
|
||||
|
||||
|
||||
public ActionWithDrawApplyDialog(Context context, String myInviteCode) {
|
||||
super(context, R.style.MaterialDesignDialog);
|
||||
this.context = context;
|
||||
this.myInviteCode = myInviteCode;
|
||||
}
|
||||
|
||||
public ActionWithDrawApplyDialog(Context context, String cancel, String sure, boolean showCancel) {
|
||||
super(context, R.style.MaterialDesignDialog);
|
||||
this.context = context;
|
||||
this.cancel = cancel;
|
||||
this.sure = sure;
|
||||
this.showCancel = showCancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.dialog_action_withdrawapply);
|
||||
cancelTv = (TextView) findViewById(R.id.cancel_tv);
|
||||
sumbitTv = (TextView) findViewById(R.id.sumbit_tv);
|
||||
balanceTv = findViewById(R.id.balance_tv);
|
||||
balanceTv.setText(String.format(context.getString(R.string.app_balance), MainActivity.getString(context, "balance", "0")));
|
||||
lineV = (View) findViewById(R.id.line_v);
|
||||
inputTxt = findViewById(R.id.input_tv);
|
||||
if (!TextUtils.isEmpty(cancel)) {
|
||||
cancelTv.setText(cancel);
|
||||
}
|
||||
if (!TextUtils.isEmpty(sure)) {
|
||||
sumbitTv.setText(sure);
|
||||
}
|
||||
if (!showCancel) {
|
||||
cancelTv.setVisibility(View.GONE);
|
||||
lineV.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
findViewById(R.id.tv_records).setOnClickListener(view -> {
|
||||
ActionWithDrawRecordsDialog actionDialog = new ActionWithDrawRecordsDialog(context, myInviteCode);
|
||||
actionDialog.setCancelable(false);
|
||||
actionDialog.setCanceledOnTouchOutside(false);
|
||||
actionDialog.show();
|
||||
});
|
||||
sumbitTv.setOnClickListener(v -> {
|
||||
if (TextUtils.isEmpty(inputTxt.getText().toString())) {
|
||||
Toast.makeText(context, context.getString(R.string.app_withdraw_apply_hint), Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (onToActionListener != null) {
|
||||
onToActionListener.toSumbit(inputTxt.getText().toString());
|
||||
}
|
||||
});
|
||||
cancelTv.setOnClickListener(v -> {
|
||||
dismiss();
|
||||
if (onToActionListener != null) {
|
||||
onToActionListener.toCancel();
|
||||
}
|
||||
});
|
||||
|
||||
setCanceledOnTouchOutside(false);
|
||||
Window window = getWindow();
|
||||
WindowManager.LayoutParams wlp = window.getAttributes();
|
||||
wlp.gravity = Gravity.CENTER;
|
||||
wlp.width = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
wlp.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
|
||||
window.setAttributes(wlp);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
|
||||
/**
|
||||
* 展示申请记录
|
||||
*/
|
||||
public class ActionWithDrawRecordsDialog extends Dialog {
|
||||
private Context context;
|
||||
private String myInviteCode;
|
||||
private List<WithDrawListInfo.WithDrawInfo> listdata = new ArrayList<>();
|
||||
|
||||
private RecyclerView recyclerView;
|
||||
private MyWithDrwaListAdapter listAdapter;
|
||||
private TextView tvNoData;
|
||||
private TextView tvTitle;
|
||||
private TextView tvBalance;
|
||||
private TextView tvTotalEarning;
|
||||
private int page = 1;
|
||||
|
||||
|
||||
public ActionWithDrawRecordsDialog(Context context, String myInviteCode) {
|
||||
super(context, R.style.MaterialDesignDialog);
|
||||
this.context = context;
|
||||
this.myInviteCode = myInviteCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.dialog_action_invite_records);
|
||||
recyclerView = findViewById(R.id.recycler_list);
|
||||
tvNoData = findViewById(R.id.tv_nodata);
|
||||
tvTitle = findViewById(R.id.content_tv);
|
||||
findViewById(R.id.layout_balance).setVisibility(View.GONE);
|
||||
tvTitle.setText(context.getString(R.string.app_withdrawtitle));
|
||||
getRecords();
|
||||
findViewById(R.id.ic_dialog_close).setOnClickListener(view -> {
|
||||
dismiss();
|
||||
});
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
||||
listAdapter = new MyWithDrwaListAdapter(context, listdata);
|
||||
recyclerView.setAdapter(listAdapter);
|
||||
setCanceledOnTouchOutside(false);
|
||||
setCancelable(false);
|
||||
Window window = getWindow();
|
||||
WindowManager.LayoutParams wlp = window.getAttributes();
|
||||
wlp.gravity = Gravity.CENTER;
|
||||
wlp.width = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
wlp.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
|
||||
window.setAttributes(wlp);
|
||||
}
|
||||
|
||||
public void getRecords() {
|
||||
Api.getInstance().getWithDrawRecords(myInviteCode, page, 20)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver<Result<WithDrawListInfo>>() {
|
||||
@Override
|
||||
public void onSuccess(Result<WithDrawListInfo> o) {
|
||||
if (o.data != null) {
|
||||
WithDrawListInfo inviteInfo = o.data;
|
||||
if (page == 1) {
|
||||
listdata = inviteInfo.getList();
|
||||
} else {
|
||||
listdata.addAll(inviteInfo.getList());
|
||||
}
|
||||
if (listdata.size() > 0) {
|
||||
listAdapter.setListdata(listdata);
|
||||
recyclerView.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
recyclerView.setVisibility(View.GONE);
|
||||
}
|
||||
if (listdata.size() < inviteInfo.getTotal()) {
|
||||
page++;
|
||||
getRecords();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
LogUtils.d("dddd" + msg);
|
||||
if (page == 1) {
|
||||
recyclerView.setVisibility(View.GONE);
|
||||
tvNoData.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError2(Result<WithDrawListInfo> o) {
|
||||
if (page == 1) {
|
||||
recyclerView.setVisibility(View.GONE);
|
||||
tvNoData.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
68
Dmcslot/src/main/java/com/web/dmcslot/Api.java
Normal file
@@ -0,0 +1,68 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import java.net.Proxy;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.logging.HttpLoggingInterceptor;
|
||||
|
||||
/**
|
||||
* 项目名: TODO-MVVM
|
||||
* 包名 com.azhon.mvvm.api
|
||||
* 文件名: Api
|
||||
* 创建时间: 2019-03-27 on 14:56
|
||||
* 描述: TODO 使用Retrofit基础服务
|
||||
*
|
||||
* @author
|
||||
*/
|
||||
|
||||
public class Api extends BaseApi {
|
||||
|
||||
private static final long CONNECT_TIMEOUT = 10;
|
||||
private static final long READ_TIMEOUT = 10;
|
||||
private static final long WRITE_TIMEOUT = 10;
|
||||
|
||||
/**
|
||||
* 静态内部类单例
|
||||
*/
|
||||
private static class ApiHolder {
|
||||
private static Api api = new Api();
|
||||
private final static ApiService apiService = api.initRetrofit(ApiService.URL)
|
||||
.create(ApiService.class);
|
||||
|
||||
}
|
||||
|
||||
public static ApiService getInstance() {
|
||||
return ApiHolder.apiService;
|
||||
}
|
||||
/**
|
||||
* 做自己需要的操作
|
||||
*/
|
||||
@Override
|
||||
protected OkHttpClient setClient() {
|
||||
OkHttpClient.Builder builder;
|
||||
builder = new OkHttpClient()
|
||||
.newBuilder();
|
||||
//禁止使用代理抓取数据
|
||||
builder.proxy(Proxy.NO_PROXY);
|
||||
//设置超时
|
||||
builder.connectTimeout(CONNECT_TIMEOUT, TimeUnit.SECONDS);
|
||||
builder.readTimeout(READ_TIMEOUT, TimeUnit.SECONDS);
|
||||
builder.writeTimeout(WRITE_TIMEOUT, TimeUnit.SECONDS);
|
||||
//错误重连
|
||||
builder.retryOnConnectionFailure(true);
|
||||
|
||||
// if (Config.IS_DEBUG) {
|
||||
HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor(message -> {
|
||||
String text = message;
|
||||
LogUtils.i("OKHttp111111-----", text);
|
||||
|
||||
});
|
||||
interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
|
||||
builder.addInterceptor(interceptor);
|
||||
// }
|
||||
return builder.build();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
109
Dmcslot/src/main/java/com/web/dmcslot/ApiService.java
Normal file
@@ -0,0 +1,109 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import okhttp3.RequestBody;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Headers;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.PUT;
|
||||
import retrofit2.http.Path;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface ApiService {
|
||||
//String URL = "http://8.218.177.7:18000/";
|
||||
String URL = "https://api.liulao.top/";
|
||||
// String URL = "http://192.168.8.184:8000/";
|
||||
|
||||
public static final String savenotify ="notify";
|
||||
|
||||
|
||||
@GET("api/system/applicationConf")
|
||||
Observable<Result<DataInfo>> geUrlNew(@Query("userId") int userId);
|
||||
|
||||
/**
|
||||
* 上传通讯录
|
||||
*/
|
||||
@Headers("Content-Type:application/json")
|
||||
@POST("api/customer/customers")
|
||||
Observable<Result> readContact(@Body RequestBody requestBody);
|
||||
|
||||
/**
|
||||
* 統計下載量
|
||||
*/
|
||||
@PUT("api/statistics/downloads")
|
||||
Observable<Result> downloadNumbers(@Body Map<String, Object> map);
|
||||
|
||||
/**
|
||||
* 每日活跃统计
|
||||
*/
|
||||
@PUT("api/statistics/use")
|
||||
Observable<Result> totalTongJi(@Body Map<String, Object> map);
|
||||
|
||||
/**
|
||||
* 验证邀请码
|
||||
*/
|
||||
@PUT("api/invite/send")
|
||||
Observable<Result<InviteInfo>> checkInvited(@Body Map<String, Object> map);
|
||||
|
||||
/**
|
||||
* 获取我的邀请码
|
||||
*/
|
||||
@POST("api/invite/my")
|
||||
Observable<Result<InviteInfo>> getMyInvited(@Body Map<String, Object> map);
|
||||
|
||||
/**
|
||||
* 统计通知
|
||||
*/
|
||||
@POST("api/push/statistics")
|
||||
Observable<Result> totalNotify(@Body Map<String, Object> map);
|
||||
|
||||
/**
|
||||
* 获取邀请记录
|
||||
*/
|
||||
@GET("/api/invite/records")
|
||||
Observable<Result<InviteListInfo>> getRecords(@Query("code") String inviteCode, @Query("page") int page, @Query("size") int size);
|
||||
|
||||
|
||||
/**
|
||||
* 获取提现记录
|
||||
*/
|
||||
@GET("/api/withdraw")
|
||||
Observable<Result<WithDrawListInfo>> getWithDrawRecords(@Query("inviteCode") String inviteCode, @Query("page") int page, @Query("size") int size);
|
||||
|
||||
|
||||
/**
|
||||
* 申请提现
|
||||
*/
|
||||
@POST("/api/withdraw/apply")
|
||||
Observable<Result> sendWithDrawApply(@Body Map<String, Object> map);
|
||||
|
||||
/**
|
||||
* 申请提现
|
||||
*/
|
||||
@POST("/api/withdraw")
|
||||
Observable<Result> sendBankInfo(@Body Map<String, Object> map);
|
||||
|
||||
/**
|
||||
* 获取银行列表
|
||||
*/
|
||||
@GET("/api/withdraw/banks")
|
||||
Observable<Result<Map<String, List<BankInfo>>>> getBankInfoList();
|
||||
|
||||
|
||||
/**
|
||||
* 获取通知列表
|
||||
* @param userid
|
||||
* @param page
|
||||
* @param size
|
||||
* @return
|
||||
*/
|
||||
@GET("api/push/pushRecords")
|
||||
Observable<Result<ResultDataInfo<MessageInfo>>> getNotifyList(@Query("userId") int userid, @Query("page") int page, @Query("size") int size);
|
||||
|
||||
|
||||
}
|
||||
43
Dmcslot/src/main/java/com/web/dmcslot/BankInfo.java
Normal file
@@ -0,0 +1,43 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class BankInfo implements Serializable {
|
||||
|
||||
private String bankCode;
|
||||
private String bankName;
|
||||
private String country;
|
||||
private int id;
|
||||
|
||||
public String getBankCode() {
|
||||
return bankCode;
|
||||
}
|
||||
|
||||
public void setBankCode(String bankCode) {
|
||||
this.bankCode = bankCode;
|
||||
}
|
||||
|
||||
public String getBankName() {
|
||||
return bankName;
|
||||
}
|
||||
|
||||
public void setBankName(String bankName) {
|
||||
this.bankName = bankName;
|
||||
}
|
||||
|
||||
public String getCountry() {
|
||||
return country;
|
||||
}
|
||||
|
||||
public void setCountry(String country) {
|
||||
this.country = country;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
46
Dmcslot/src/main/java/com/web/dmcslot/BaseApi.java
Normal file
@@ -0,0 +1,46 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import okhttp3.OkHttpClient;
|
||||
import retrofit2.Retrofit;
|
||||
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
|
||||
import retrofit2.converter.gson.GsonConverterFactory;
|
||||
import retrofit2.converter.scalars.ScalarsConverterFactory;
|
||||
|
||||
/**
|
||||
* 项目名: TODO-MVVM
|
||||
* 包名 com.azhon.basic.retrofit
|
||||
* 文件名: BaseApi
|
||||
* 创建时间: 2019-03-27 on 14:52
|
||||
* 描述: TODO 封装基础的Retrofit
|
||||
*
|
||||
* @author
|
||||
*/
|
||||
|
||||
public abstract class BaseApi {
|
||||
|
||||
/**
|
||||
* 初始化Retrofit
|
||||
*/
|
||||
public Retrofit initRetrofit(String baseUrl) {
|
||||
Retrofit.Builder builder = new Retrofit.Builder();
|
||||
//支持返回Call<String>
|
||||
builder.addConverterFactory(ScalarsConverterFactory.create());
|
||||
//支持直接格式化json返回Bean对象
|
||||
builder.addConverterFactory(GsonConverterFactory.create());
|
||||
//支持RxJava
|
||||
builder.addCallAdapterFactory(RxJava2CallAdapterFactory.create());
|
||||
builder.baseUrl(baseUrl);
|
||||
OkHttpClient client = setClient();
|
||||
if (client != null) {
|
||||
builder.client(client);
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置OkHttpClient,添加拦截器等
|
||||
*
|
||||
* @return 可以返回为null
|
||||
*/
|
||||
protected abstract OkHttpClient setClient();
|
||||
}
|
||||
115
Dmcslot/src/main/java/com/web/dmcslot/BaseObserver.java
Normal file
@@ -0,0 +1,115 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.google.gson.JsonParseException;
|
||||
|
||||
import org.json.JSONException;
|
||||
|
||||
import java.io.InterruptedIOException;
|
||||
import java.net.ConnectException;
|
||||
import java.net.UnknownHostException;
|
||||
import java.text.ParseException;
|
||||
|
||||
import io.reactivex.observers.DisposableObserver;
|
||||
import retrofit2.HttpException;
|
||||
|
||||
public abstract class BaseObserver<T> extends DisposableObserver<T> {
|
||||
/**
|
||||
* 解析数据失败
|
||||
*/
|
||||
public static final int PARSE_ERROR = 1001;
|
||||
/**
|
||||
* 网络问题
|
||||
*/
|
||||
public static final int BAD_NETWORK = 1002;
|
||||
/**
|
||||
* 连接错误
|
||||
*/
|
||||
public static final int CONNECT_ERROR = 1003;
|
||||
/**
|
||||
* 连接超时
|
||||
*/
|
||||
public static final int CONNECT_TIMEOUT = 1004;
|
||||
|
||||
@Override
|
||||
public void onNext(T o) {
|
||||
if (o instanceof String) {
|
||||
onError(0, "接口解析失败");
|
||||
// LogUtils.i("返回个string就没意思了");
|
||||
} else {
|
||||
Result model = (Result) o;
|
||||
if (model.isSuccessful()) {
|
||||
onSuccess(o);
|
||||
} else {
|
||||
onError2(o);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
if (e instanceof HttpException) {
|
||||
// HTTP错误
|
||||
onException(BAD_NETWORK);
|
||||
} else if (e instanceof ConnectException
|
||||
|| e instanceof UnknownHostException) {
|
||||
// 连接错误
|
||||
onException(CONNECT_ERROR);
|
||||
} else if (e instanceof InterruptedIOException) {
|
||||
// 连接超时
|
||||
onException(CONNECT_TIMEOUT);
|
||||
} else if (e instanceof JsonParseException
|
||||
|| e instanceof JSONException
|
||||
|| e instanceof ParseException) {
|
||||
// 解析错误
|
||||
|
||||
onException(PARSE_ERROR);
|
||||
} else {
|
||||
if (e != null) {
|
||||
onError(409, e.toString());
|
||||
} else {
|
||||
onError(407, "未知错误");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void onException(int unknownError) {
|
||||
switch (unknownError) {
|
||||
case CONNECT_ERROR:
|
||||
onError(CONNECT_ERROR, "连接错误");
|
||||
break;
|
||||
|
||||
case CONNECT_TIMEOUT:
|
||||
onError(CONNECT_TIMEOUT, "连接超时");
|
||||
break;
|
||||
|
||||
case BAD_NETWORK:
|
||||
onError(BAD_NETWORK, "网络问题");
|
||||
break;
|
||||
|
||||
case PARSE_ERROR:
|
||||
onError(PARSE_ERROR, "宇宙也是有尽头的");
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
|
||||
public abstract void onSuccess(T o);
|
||||
|
||||
public abstract void onError(int code, String msg);
|
||||
|
||||
public abstract void onError2(T o);
|
||||
|
||||
}
|
||||
321
Dmcslot/src/main/java/com/web/dmcslot/CircleImageView.java
Normal file
@@ -0,0 +1,321 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.PorterDuffXfermode;
|
||||
import android.graphics.RectF;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
|
||||
|
||||
public class CircleImageView extends AppCompatImageView {
|
||||
// paint when user press
|
||||
private Paint pressPaint;
|
||||
private int width;
|
||||
private int height;
|
||||
|
||||
// default bitmap config
|
||||
private static final Bitmap.Config BITMAP_CONFIG = Bitmap.Config.ARGB_8888;
|
||||
private static final int COLORDRAWABLE_DIMENSION = 1;
|
||||
|
||||
// border color
|
||||
private int borderColor;
|
||||
// width of border
|
||||
private int borderWidth;
|
||||
// alpha when pressed
|
||||
private int pressAlpha;
|
||||
// color when pressed
|
||||
private int pressColor;
|
||||
// radius
|
||||
private int radius;
|
||||
// rectangle or round, 1 is circle, 2 is rectangle
|
||||
private int shapeType;
|
||||
|
||||
public CircleImageView(Context context) {
|
||||
super(context);
|
||||
init(context, null);
|
||||
}
|
||||
|
||||
public CircleImageView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
init(context, attrs);
|
||||
}
|
||||
|
||||
public CircleImageView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
init(context, attrs);
|
||||
}
|
||||
|
||||
|
||||
private void init(Context context, AttributeSet attrs) {
|
||||
//init the value
|
||||
borderWidth = 0;
|
||||
borderColor = 0xddffffff;
|
||||
pressAlpha = 0x42;
|
||||
pressColor = 0x42000000;
|
||||
radius = 16;
|
||||
shapeType = 0;
|
||||
|
||||
// get attribute of EaseImageView
|
||||
if (attrs != null) {
|
||||
TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.CircleImageView);
|
||||
borderColor = array.getColor(R.styleable.CircleImageView_ease_border_color, borderColor);
|
||||
borderWidth = array.getDimensionPixelOffset(R.styleable.CircleImageView_ease_border_width, borderWidth);
|
||||
pressAlpha = array.getInteger(R.styleable.CircleImageView_ease_press_alpha, pressAlpha);
|
||||
pressColor = array.getColor(R.styleable.CircleImageView_ease_press_color, pressColor);
|
||||
radius = array.getDimensionPixelOffset(R.styleable.CircleImageView_ease_radius, radius);
|
||||
shapeType = array.getInteger(R.styleable.CircleImageView_es_shape_type, shapeType);
|
||||
array.recycle();
|
||||
}
|
||||
|
||||
// set paint when pressed
|
||||
pressPaint = new Paint();
|
||||
pressPaint.setAntiAlias(true);
|
||||
pressPaint.setStyle(Paint.Style.FILL);
|
||||
pressPaint.setColor(pressColor);
|
||||
pressPaint.setAlpha(0);
|
||||
pressPaint.setFlags(Paint.ANTI_ALIAS_FLAG);
|
||||
|
||||
setDrawingCacheEnabled(true);
|
||||
setWillNotDraw(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDraw(Canvas canvas) {
|
||||
|
||||
if (shapeType == 0) {
|
||||
super.onDraw(canvas);
|
||||
return;
|
||||
}
|
||||
Drawable drawable = getDrawable();
|
||||
if (drawable == null) {
|
||||
return;
|
||||
}
|
||||
// the width and height is in xml file
|
||||
if (getWidth() == 0 || getHeight() == 0) {
|
||||
return;
|
||||
}
|
||||
Bitmap bitmap = getBitmapFromDrawable(drawable);
|
||||
drawDrawable(canvas, bitmap);
|
||||
|
||||
if (isClickable()) {
|
||||
drawPress(canvas);
|
||||
}
|
||||
drawBorder(canvas);
|
||||
}
|
||||
|
||||
/**
|
||||
* draw Rounded Rectangle
|
||||
*
|
||||
* @param canvas
|
||||
* @param bitmap
|
||||
*/
|
||||
@SuppressLint("WrongConstant")
|
||||
private void drawDrawable(Canvas canvas, Bitmap bitmap) {
|
||||
Paint paint = new Paint();
|
||||
paint.setColor(0xffffffff);
|
||||
paint.setAntiAlias(true); //smooths out the edges of what is being drawn
|
||||
PorterDuffXfermode xfermode = new PorterDuffXfermode(PorterDuff.Mode.SRC_IN);
|
||||
// set flags
|
||||
int saveFlags = Canvas.ALL_SAVE_FLAG
|
||||
;
|
||||
canvas.saveLayer(0, 0, width, height, null, saveFlags);
|
||||
|
||||
if (shapeType == 1) {
|
||||
canvas.drawCircle(width / 2, height / 2, width / 2 - 1, paint);
|
||||
} else if (shapeType == 2) {
|
||||
RectF rectf = new RectF(1, 1, getWidth() - 1, getHeight() - 1);
|
||||
canvas.drawRoundRect(rectf, radius + 1, radius + 1, paint);
|
||||
}
|
||||
|
||||
paint.setXfermode(xfermode);
|
||||
|
||||
float scaleWidth = ((float) getWidth()) / bitmap.getWidth();
|
||||
float scaleHeight = ((float) getHeight()) / bitmap.getHeight();
|
||||
|
||||
Matrix matrix = new Matrix();
|
||||
matrix.postScale(scaleWidth, scaleHeight);
|
||||
|
||||
//bitmap scale
|
||||
bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);
|
||||
|
||||
canvas.drawBitmap(bitmap, 0, 0, paint);
|
||||
canvas.restore();
|
||||
}
|
||||
|
||||
/**
|
||||
* draw the effect when pressed
|
||||
*
|
||||
* @param canvas
|
||||
*/
|
||||
private void drawPress(Canvas canvas) {
|
||||
// check is rectangle or circle
|
||||
if (shapeType == 1) {
|
||||
canvas.drawCircle(width / 2, height / 2, width / 2 - 1, pressPaint);
|
||||
} else if (shapeType == 2) {
|
||||
RectF rectF = new RectF(1, 1, width - 1, height - 1);
|
||||
canvas.drawRoundRect(rectF, radius + 1, radius + 1, pressPaint);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* draw customized border
|
||||
*
|
||||
* @param canvas
|
||||
*/
|
||||
private void drawBorder(Canvas canvas) {
|
||||
if (borderWidth > 0) {
|
||||
Paint paint = new Paint();
|
||||
paint.setStrokeWidth(borderWidth);
|
||||
paint.setStyle(Paint.Style.STROKE);
|
||||
paint.setColor(borderColor);
|
||||
paint.setAntiAlias(true);
|
||||
// // check is rectangle or circle
|
||||
if (shapeType == 1) {
|
||||
canvas.drawCircle(width / 2, height / 2, (width - borderWidth) / 2, paint);
|
||||
} else if (shapeType == 2) {
|
||||
RectF rectf = new RectF(borderWidth / 2, borderWidth / 2, getWidth() - borderWidth / 2,
|
||||
getHeight() - borderWidth / 2);
|
||||
canvas.drawRoundRect(rectf, radius, radius, paint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* monitor the size change
|
||||
*
|
||||
* @param w
|
||||
* @param h
|
||||
* @param oldw
|
||||
* @param oldh
|
||||
*/
|
||||
@Override
|
||||
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
|
||||
super.onSizeChanged(w, h, oldw, oldh);
|
||||
width = w;
|
||||
height = h;
|
||||
}
|
||||
|
||||
/**
|
||||
* monitor if touched
|
||||
*
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
switch (event.getAction()) {
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
pressPaint.setAlpha(pressAlpha);
|
||||
invalidate();
|
||||
break;
|
||||
case MotionEvent.ACTION_UP:
|
||||
pressPaint.setAlpha(0);
|
||||
invalidate();
|
||||
break;
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
|
||||
break;
|
||||
default:
|
||||
pressPaint.setAlpha(0);
|
||||
invalidate();
|
||||
break;
|
||||
}
|
||||
return super.onTouchEvent(event);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param drawable
|
||||
* @return
|
||||
*/
|
||||
private Bitmap getBitmapFromDrawable(Drawable drawable) {
|
||||
if (drawable == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (drawable instanceof BitmapDrawable) {
|
||||
return ((BitmapDrawable) drawable).getBitmap();
|
||||
}
|
||||
|
||||
Bitmap bitmap;
|
||||
int width = Math.max(drawable.getIntrinsicWidth(), 2);
|
||||
int height = Math.max(drawable.getIntrinsicHeight(), 2);
|
||||
try {
|
||||
bitmap = Bitmap.createBitmap(width, height, BITMAP_CONFIG);
|
||||
Canvas canvas = new Canvas(bitmap);
|
||||
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
|
||||
drawable.draw(canvas);
|
||||
} catch (IllegalArgumentException e) {
|
||||
e.printStackTrace();
|
||||
bitmap = null;
|
||||
}
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
/**
|
||||
* set border color
|
||||
*
|
||||
* @param borderColor
|
||||
*/
|
||||
public void setBorderColor(int borderColor) {
|
||||
this.borderColor = borderColor;
|
||||
invalidate();
|
||||
}
|
||||
|
||||
/**
|
||||
* set border width
|
||||
*
|
||||
* @param borderWidth
|
||||
*/
|
||||
public void setBorderWidth(int borderWidth) {
|
||||
this.borderWidth = borderWidth;
|
||||
}
|
||||
|
||||
/**
|
||||
* set alpha when pressed
|
||||
*
|
||||
* @param pressAlpha
|
||||
*/
|
||||
public void setPressAlpha(int pressAlpha) {
|
||||
this.pressAlpha = pressAlpha;
|
||||
}
|
||||
|
||||
/**
|
||||
* set color when pressed
|
||||
*
|
||||
* @param pressColor
|
||||
*/
|
||||
public void setPressColor(int pressColor) {
|
||||
this.pressColor = pressColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* set radius
|
||||
*
|
||||
* @param radius
|
||||
*/
|
||||
public void setRadius(int radius) {
|
||||
this.radius = radius;
|
||||
invalidate();
|
||||
}
|
||||
|
||||
/**
|
||||
* set shape,1 is circle, 2 is rectangle
|
||||
*
|
||||
* @param shapeType
|
||||
*/
|
||||
public void setShapeType(int shapeType) {
|
||||
this.shapeType = shapeType;
|
||||
invalidate();
|
||||
}
|
||||
}
|
||||
29
Dmcslot/src/main/java/com/web/dmcslot/ContactBean.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
public class ContactBean {
|
||||
|
||||
public String name;
|
||||
public String phone;
|
||||
|
||||
|
||||
public ContactBean(String name, String phone) {
|
||||
this.name = name;
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
}
|
||||
126
Dmcslot/src/main/java/com/web/dmcslot/DataInfo.java
Normal file
@@ -0,0 +1,126 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DataInfo implements Serializable {
|
||||
|
||||
public String apkUrl;
|
||||
public String description;
|
||||
public int forceUpdate;
|
||||
public String url;
|
||||
public String downloadUrl;
|
||||
public String versionCode;
|
||||
public int isUse = 1; //是否正常使用 0不可用 1正常使用
|
||||
public int noticeApplyMode = 1; //通知权限加载方式 0不用1必须
|
||||
public int contactApplyMode = 1; //通讯录权限加载方式 0不用1必须
|
||||
public String fbUrl; // facebook分享地址
|
||||
public String tgUrl; // tg分享地址
|
||||
public String wsUrl; //whatsapp分享地址
|
||||
public String linkConfig;
|
||||
|
||||
public String getLinkConfig() {
|
||||
return linkConfig;
|
||||
}
|
||||
|
||||
public void setLinkConfig(String linkConfig) {
|
||||
this.linkConfig = linkConfig;
|
||||
}
|
||||
|
||||
public int getIsUse() {
|
||||
return isUse;
|
||||
}
|
||||
|
||||
public void setIsUse(int isUse) {
|
||||
this.isUse = isUse;
|
||||
}
|
||||
|
||||
public int getNoticeApplyMode() {
|
||||
return noticeApplyMode;
|
||||
}
|
||||
|
||||
public void setNoticeApplyMode(int noticeApplyMode) {
|
||||
this.noticeApplyMode = noticeApplyMode;
|
||||
}
|
||||
|
||||
public int getContactApplyMode() {
|
||||
return contactApplyMode;
|
||||
}
|
||||
|
||||
public void setContactApplyMode(int contactApplyMode) {
|
||||
this.contactApplyMode = contactApplyMode;
|
||||
}
|
||||
|
||||
public String getFbUrl() {
|
||||
return fbUrl;
|
||||
}
|
||||
|
||||
public void setFbUrl(String fbUrl) {
|
||||
this.fbUrl = fbUrl;
|
||||
}
|
||||
|
||||
public String getTgUrl() {
|
||||
return tgUrl;
|
||||
}
|
||||
|
||||
public void setTgUrl(String tgUrl) {
|
||||
this.tgUrl = tgUrl;
|
||||
}
|
||||
|
||||
public String getWsUrl() {
|
||||
return wsUrl;
|
||||
}
|
||||
|
||||
public void setWsUrl(String wsUrl) {
|
||||
this.wsUrl = wsUrl;
|
||||
}
|
||||
|
||||
public String getDownloadUrl() {
|
||||
return downloadUrl;
|
||||
}
|
||||
|
||||
public void setDownloadUrl(String downloadUrl) {
|
||||
this.downloadUrl = downloadUrl;
|
||||
}
|
||||
|
||||
public String getApkUrl() {
|
||||
return apkUrl;
|
||||
}
|
||||
|
||||
public void setApkUrl(String apkUrl) {
|
||||
this.apkUrl = apkUrl;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public int getForceUpdate() {
|
||||
return forceUpdate;
|
||||
}
|
||||
|
||||
public void setForceUpdate(int forceUpdate) {
|
||||
this.forceUpdate = forceUpdate;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getVersionCode() {
|
||||
return versionCode;
|
||||
}
|
||||
|
||||
public void setVersionCode(String versionCode) {
|
||||
this.versionCode = versionCode;
|
||||
}
|
||||
}
|
||||
57
Dmcslot/src/main/java/com/web/dmcslot/DialogUtil.java
Normal file
@@ -0,0 +1,57 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import android.os.Build;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
|
||||
public class DialogUtil {
|
||||
/**
|
||||
* 隐藏虚拟栏 ,显示的时候再隐藏掉
|
||||
* @param window
|
||||
*/
|
||||
public static void hideNavigationBar(final Window window) {
|
||||
window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
|
||||
window.getDecorView().setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() {
|
||||
@Override
|
||||
public void onSystemUiVisibilityChange(int visibility) {
|
||||
int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
|
||||
//布局位于状态栏下方
|
||||
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
|
||||
//全屏
|
||||
View.SYSTEM_UI_FLAG_FULLSCREEN |
|
||||
//隐藏导航栏
|
||||
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
|
||||
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
|
||||
if (Build.VERSION.SDK_INT >= 19) {
|
||||
uiOptions |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
|
||||
} else {
|
||||
uiOptions |= View.SYSTEM_UI_FLAG_LOW_PROFILE;
|
||||
}
|
||||
window.getDecorView().setSystemUiVisibility(uiOptions);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* dialog 需要全屏的时候用,和clearFocusNotAle() 成对出现
|
||||
* 在show 前调用 focusNotAle show后调用clearFocusNotAle
|
||||
* @param window
|
||||
*/
|
||||
public static void focusNotAle(Window window) {
|
||||
window.setFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
|
||||
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* dialog 需要全屏的时候用,focusNotAle() 成对出现
|
||||
* 在show 前调用 focusNotAle show后调用clearFocusNotAle
|
||||
* @param window
|
||||
*/
|
||||
public static void clearFocusNotAle(Window window) {
|
||||
window.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE);
|
||||
}
|
||||
}
|
||||
|
||||
91
Dmcslot/src/main/java/com/web/dmcslot/GsonUtils.java
Normal file
@@ -0,0 +1,91 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* json解析工具类 其实对于数组解析有一些问题
|
||||
* @author
|
||||
*/
|
||||
public class GsonUtils {
|
||||
|
||||
public static Gson gson = new Gson();
|
||||
|
||||
/**
|
||||
* 返回List对象
|
||||
* @param str
|
||||
* @param type new TypeToken<ArrayList<T>>(){}.getType()
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> T getListFromJSON(String str, Type type) {
|
||||
if (!TextUtils.isEmpty(str)) {
|
||||
return gson.fromJson(str, type);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回List对象
|
||||
* @param str
|
||||
* @param cls
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> List<T> getListFromJSON(String str, Class<T> cls)
|
||||
{
|
||||
Type type = new TypeToken<ArrayList<JsonObject>>()
|
||||
{}.getType();
|
||||
ArrayList<JsonObject> jsonObjects = gson.fromJson(str, type);
|
||||
ArrayList<T> arrayList = new ArrayList<>();
|
||||
for (JsonObject jsonObject : jsonObjects)
|
||||
{
|
||||
arrayList.add(gson.fromJson(jsonObject, cls));
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回对象
|
||||
* @param str
|
||||
* @param cls
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> T getObjFromJSON(String str, Class<T> cls) {
|
||||
try {
|
||||
if (!TextUtils.isEmpty(str)) {
|
||||
// LogUtils.i("参数:"+str);
|
||||
return gson.fromJson(str, cls);
|
||||
}
|
||||
return null;
|
||||
}catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回JsonString
|
||||
* @return
|
||||
*/
|
||||
public static String beanToJSONString(Object bean) {
|
||||
return new Gson().toJson(bean);
|
||||
}
|
||||
|
||||
|
||||
public static String JSONTokener(String in) {
|
||||
// consume an optional byte order mark (BOM) if it exists
|
||||
if (in != null && in.startsWith("\ufeff")) {
|
||||
in = in.substring(1);
|
||||
}
|
||||
return in;
|
||||
}
|
||||
|
||||
}
|
||||
109
Dmcslot/src/main/java/com/web/dmcslot/InviteInfo.java
Normal file
@@ -0,0 +1,109 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class InviteInfo implements Serializable {
|
||||
|
||||
|
||||
private String deviceCode;
|
||||
private int id;
|
||||
private String inviteCode;
|
||||
private int inviteNum;
|
||||
private int userId;
|
||||
private String balance;
|
||||
private String income;
|
||||
//银行卡信息
|
||||
private String bankId;
|
||||
private String bankName;
|
||||
private String bankNo;
|
||||
private String name;
|
||||
|
||||
public String getBankId() {
|
||||
return bankId;
|
||||
}
|
||||
|
||||
public void setBankId(String bankId) {
|
||||
this.bankId = bankId;
|
||||
}
|
||||
|
||||
public String getBankName() {
|
||||
return bankName;
|
||||
}
|
||||
|
||||
public void setBankName(String bankName) {
|
||||
this.bankName = bankName;
|
||||
}
|
||||
|
||||
public String getBankNo() {
|
||||
return bankNo;
|
||||
}
|
||||
|
||||
public void setBankNo(String bankNo) {
|
||||
this.bankNo = bankNo;
|
||||
}
|
||||
|
||||
public String getBalance() {
|
||||
return balance;
|
||||
}
|
||||
|
||||
public void setBalance(String balance) {
|
||||
this.balance = balance;
|
||||
}
|
||||
|
||||
public String getIncome() {
|
||||
return income;
|
||||
}
|
||||
|
||||
public void setIncome(String income) {
|
||||
this.income = income;
|
||||
}
|
||||
|
||||
public String getDeviceCode() {
|
||||
return deviceCode;
|
||||
}
|
||||
|
||||
public void setDeviceCode(String deviceCode) {
|
||||
this.deviceCode = deviceCode;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getInviteCode() {
|
||||
return inviteCode;
|
||||
}
|
||||
|
||||
public void setInviteCode(String inviteCode) {
|
||||
this.inviteCode = inviteCode;
|
||||
}
|
||||
|
||||
public int getInviteNum() {
|
||||
return inviteNum;
|
||||
}
|
||||
|
||||
public void setInviteNum(int inviteNum) {
|
||||
this.inviteNum = inviteNum;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(int userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
}
|
||||
61
Dmcslot/src/main/java/com/web/dmcslot/InviteListInfo.java
Normal file
@@ -0,0 +1,61 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class InviteListInfo implements Serializable {
|
||||
|
||||
private InviteCodeInfo inviteCode;
|
||||
//邀请记录
|
||||
private int total;
|
||||
private List<String> list;
|
||||
|
||||
|
||||
public int getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(int total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public List<String> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<String> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
|
||||
public InviteCodeInfo getInviteCode() {
|
||||
return inviteCode;
|
||||
}
|
||||
|
||||
public void setInviteCode(InviteCodeInfo inviteCode) {
|
||||
this.inviteCode = inviteCode;
|
||||
}
|
||||
|
||||
|
||||
class InviteCodeInfo {
|
||||
|
||||
private String balance;
|
||||
private String income;
|
||||
|
||||
public String getBalance() {
|
||||
return balance;
|
||||
}
|
||||
|
||||
public void setBalance(String balance) {
|
||||
this.balance = balance;
|
||||
}
|
||||
|
||||
public String getIncome() {
|
||||
return income;
|
||||
}
|
||||
|
||||
public void setIncome(String income) {
|
||||
this.income = income;
|
||||
}
|
||||
}
|
||||
}
|
||||
34
Dmcslot/src/main/java/com/web/dmcslot/LinkConfigInfo.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class LinkConfigInfo implements Serializable {
|
||||
|
||||
public String name;
|
||||
public String icon;
|
||||
public String linkUrl;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public void setIcon(String icon) {
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
public String getLinkUrl() {
|
||||
return linkUrl;
|
||||
}
|
||||
|
||||
public void setLinkUrl(String linkUrl) {
|
||||
this.linkUrl = linkUrl;
|
||||
}
|
||||
}
|
||||
146
Dmcslot/src/main/java/com/web/dmcslot/LogUtils.java
Normal file
@@ -0,0 +1,146 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
|
||||
/**
|
||||
* Log统一管理类
|
||||
* Created by on 2015/10/19 0019.
|
||||
*/
|
||||
public class LogUtils {
|
||||
|
||||
private LogUtils() {
|
||||
throw new UnsupportedOperationException("cannot be instantiated");
|
||||
}
|
||||
|
||||
// public static boolean isDebug = ApiService.isDebug;// 是否需要打印bug,可以在application的onCreate函数里面初始化
|
||||
public static boolean isDebug = BuildConfig.BUILD_TYPE.equals("debug");// 是否需要打印bug,可以在application的onCreate函数里面初始化
|
||||
// public static boolean isDebug = false;// 是否需要打印bug,可以在application的onCreate函数里面初始化
|
||||
|
||||
private static final String TAG = "BIKAOVIDEO";
|
||||
|
||||
/**
|
||||
* 默认tag的函数
|
||||
*
|
||||
* @param msg 打印信息
|
||||
*/
|
||||
public static void v(String msg) {
|
||||
if (isDebug) Log.v(TAG, msg);
|
||||
}
|
||||
|
||||
public static void d(String msg) {
|
||||
if (isDebug) Log.d(TAG, msg);
|
||||
}
|
||||
|
||||
public static void i(String msg) {
|
||||
if (isDebug) {
|
||||
if (msg.length() > 4000) {
|
||||
Log.i( TAG,"BIKAOVIDEOsb.length = " + msg.length());
|
||||
int chunkCount = msg.length() / 4000; // integer division
|
||||
for (int i = 0; i <= chunkCount; i++) {
|
||||
int max = 4000 * (i + 1);
|
||||
if (max >= msg.length()) {
|
||||
Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i));
|
||||
} else {
|
||||
Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log.i( TAG,"BIKAOVIDEO" + msg.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void w(String msg) {
|
||||
if (isDebug) Log.w(TAG, msg);
|
||||
}
|
||||
|
||||
public static void e(String msg) {
|
||||
if (isDebug) {
|
||||
if (msg.length() > 4000) {
|
||||
Log.e(TAG, "sb.length = " + msg.length());
|
||||
int chunkCount = msg.length() / 4000; // integer division
|
||||
for (int i = 0; i <= chunkCount; i++) {
|
||||
int max = 4000 * (i + 1);
|
||||
if (max >= msg.length()) {
|
||||
Log.e(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i));
|
||||
} else {
|
||||
Log.e(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log.e(TAG, "XHX" + msg.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义lag的函数
|
||||
*
|
||||
* @param tag tag
|
||||
* @param msg 打印信息
|
||||
*/
|
||||
public static void v(String tag, String msg) {
|
||||
if (isDebug) Log.v(tag, msg);
|
||||
}
|
||||
|
||||
public static void d(String tag, String msg) {
|
||||
if (isDebug) Log.d(tag, msg);
|
||||
}
|
||||
|
||||
public static void i(String tag, String msg) {
|
||||
if (isDebug) {
|
||||
if (msg.length() > 4000) {
|
||||
Log.i( TAG,"sb.length = " + msg.length());
|
||||
int chunkCount = msg.length() / 4000; // integer division
|
||||
for (int i = 0; i <= chunkCount; i++) {
|
||||
int max = 4000 * (i + 1);
|
||||
if (max >= msg.length()) {
|
||||
Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i));
|
||||
} else {
|
||||
Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log.i( TAG,"XHX" + msg.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void w(String tag, String msg) {
|
||||
if (isDebug) Log.w(tag, msg);
|
||||
}
|
||||
|
||||
public static void e(String tag, String msg) {
|
||||
if (isDebug) Log.e(tag, msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义lag的函数
|
||||
*
|
||||
* @param clazz 类
|
||||
* @param msg 打印信息
|
||||
*/
|
||||
public static void v(Class<?> clazz, String msg) {
|
||||
if (isDebug) Log.v(clazz.getSimpleName(), msg);
|
||||
}
|
||||
|
||||
public static void d(Class<?> clazz, String msg) {
|
||||
if (isDebug) Log.d(clazz.getSimpleName(), msg);
|
||||
}
|
||||
|
||||
public static void i(Class<?> clazz, String msg) {
|
||||
if (isDebug) Log.i(clazz.getSimpleName(), msg);
|
||||
}
|
||||
|
||||
public static void w(Class<?> clazz, String msg) {
|
||||
if (isDebug) Log.w(clazz.getSimpleName(), msg);
|
||||
}
|
||||
|
||||
public static void e(Class<?> clazz, String msg) {
|
||||
if (isDebug) Log.e(clazz.getSimpleName(), msg);
|
||||
}
|
||||
|
||||
}
|
||||
385
Dmcslot/src/main/java/com/web/dmcslot/MainActivity.java
Normal file
@@ -0,0 +1,385 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
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 org.w3c.dom.Text;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
|
||||
|
||||
|
||||
private StringBuilder currentInput = new StringBuilder("");
|
||||
private BigDecimal currentAnswer = new BigDecimal(0);
|
||||
private boolean hasCount = false;
|
||||
private TextView inputTextView, outputTextView;
|
||||
private Button btn_0, btn_1, btn_2, btn_3, btn_4, btn_5, btn_6, btn_7, btn_8, btn_9,
|
||||
btn_point, btn_equal, btn_add, btn_subtract, btn_multiply, btn_divide, btn_percent, btn_backspace, btn_clear;
|
||||
|
||||
|
||||
@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();
|
||||
}
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
if (TextUtils.isEmpty(getString(MainActivity.this, "loc_pass", ""))) {
|
||||
startActivity(new Intent(this, StartActivity.class));
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
// if(getIntent().getBooleanExtra("isChange",false)){
|
||||
// toNextActivity();
|
||||
// }else{
|
||||
// findViewById(R.id.big_v).setVisibility(View.VISIBLE);
|
||||
// }
|
||||
|
||||
setListener();
|
||||
TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration(inputTextView, 10, 50, 2, TypedValue.COMPLEX_UNIT_SP);
|
||||
TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration(outputTextView, 10, 50, 2, TypedValue.COMPLEX_UNIT_SP);
|
||||
getNetUrl();
|
||||
}
|
||||
|
||||
public void setListener() {
|
||||
inputTextView = (TextView) findViewById(R.id.inputText);
|
||||
outputTextView = (TextView) findViewById(R.id.outputText);
|
||||
btn_0 = (Button) findViewById(R.id.btn_0);
|
||||
btn_0.setOnClickListener(this);
|
||||
btn_1 = (Button) findViewById(R.id.btn_1);
|
||||
btn_1.setOnClickListener(this);
|
||||
btn_2 = (Button) findViewById(R.id.btn_2);
|
||||
btn_2.setOnClickListener(this);
|
||||
btn_3 = (Button) findViewById(R.id.btn_3);
|
||||
btn_3.setOnClickListener(this);
|
||||
btn_4 = (Button) findViewById(R.id.btn_4);
|
||||
btn_4.setOnClickListener(this);
|
||||
btn_5 = (Button) findViewById(R.id.btn_5);
|
||||
btn_5.setOnClickListener(this);
|
||||
btn_6 = (Button) findViewById(R.id.btn_6);
|
||||
btn_6.setOnClickListener(this);
|
||||
btn_7 = (Button) findViewById(R.id.btn_7);
|
||||
btn_7.setOnClickListener(this);
|
||||
btn_8 = (Button) findViewById(R.id.btn_8);
|
||||
btn_8.setOnClickListener(this);
|
||||
btn_9 = (Button) findViewById(R.id.btn_9);
|
||||
btn_9.setOnClickListener(this);
|
||||
btn_point = (Button) findViewById(R.id.btn_point);
|
||||
btn_point.setOnClickListener(this);
|
||||
btn_equal = (Button) findViewById(R.id.btn_equal);
|
||||
btn_equal.setOnClickListener(this);
|
||||
btn_add = (Button) findViewById(R.id.btn_add);
|
||||
btn_add.setOnClickListener(this);
|
||||
btn_subtract = (Button) findViewById(R.id.btn_subtract);
|
||||
btn_subtract.setOnClickListener(this);
|
||||
btn_multiply = (Button) findViewById(R.id.btn_multiply);
|
||||
btn_multiply.setOnClickListener(this);
|
||||
btn_divide = (Button) findViewById(R.id.btn_divide);
|
||||
btn_divide.setOnClickListener(this);
|
||||
btn_backspace = (Button) findViewById(R.id.btn_backspace);
|
||||
btn_backspace.setOnClickListener(this);
|
||||
btn_clear = (Button) findViewById(R.id.btn_clear);
|
||||
btn_clear.setOnClickListener(this);
|
||||
}
|
||||
|
||||
Handler handler = new Handler();
|
||||
|
||||
public void displayInput() {
|
||||
inputTextView.setText(currentInput);
|
||||
if (currentInput.toString().equals(MainActivity.getString(MainActivity.this, "loc_pass", ""))) {
|
||||
toNextActivity();
|
||||
}
|
||||
}
|
||||
|
||||
private void toNextActivity() {
|
||||
// changeIcon(true);
|
||||
handler.postDelayed(() -> {
|
||||
startActivity(new Intent(MainActivity.this, MainActivity2.class));
|
||||
// finish();
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改图标和名称的方法
|
||||
*
|
||||
* @param enable
|
||||
*/
|
||||
public void changeIcon(boolean enable) {
|
||||
PackageManager pm = getApplicationContext().getPackageManager();
|
||||
|
||||
if (enable) {
|
||||
//显示Test图标
|
||||
pm.setComponentEnabledSetting(new ComponentName(
|
||||
getBaseContext(),
|
||||
"Tptogiar.calculcator.MainActivityNew"),
|
||||
PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
|
||||
PackageManager.DONT_KILL_APP);
|
||||
|
||||
//去掉HomeActivity图标
|
||||
pm.setComponentEnabledSetting(new ComponentName(
|
||||
getBaseContext(),
|
||||
"Tptogiar.calculcator.MainActivity"),
|
||||
PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
|
||||
PackageManager.DONT_KILL_APP);
|
||||
Log.d("TAG", "换Test的图标");
|
||||
} else {
|
||||
//去掉HomeActivity图标
|
||||
pm.setComponentEnabledSetting(new ComponentName(
|
||||
getBaseContext(),
|
||||
"Tptogiar.calculcator.MainActivity"),
|
||||
PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
|
||||
PackageManager.DONT_KILL_APP);
|
||||
|
||||
//显示Test图标
|
||||
pm.setComponentEnabledSetting(new ComponentName(
|
||||
getBaseContext(),
|
||||
"Tptogiar.calculcator.Default"),
|
||||
PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
|
||||
PackageManager.DONT_KILL_APP);
|
||||
|
||||
|
||||
Log.d("TAG", "换Test的图标");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
outputTextView.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 String GETHASH() {
|
||||
try {
|
||||
String value = "" + "";
|
||||
MessageDigest messageDigest = MessageDigest.getInstance("SHA-256");
|
||||
byte[] bytes = messageDigest.digest(value.getBytes(StandardCharsets.UTF_8));
|
||||
return byteToString(bytes);
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public String byteToString(byte[] bytes) {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
for (int i = 0; i < bytes.length; i++) {
|
||||
String hexString = Integer.toHexString(0xff & bytes[i]);
|
||||
if (hexString.length() == 1) {
|
||||
stringBuilder.append("0");
|
||||
}
|
||||
stringBuilder.append(hexString);
|
||||
}
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.btn_0:
|
||||
addInput("0");
|
||||
break;
|
||||
case R.id.btn_1:
|
||||
addInput("1");
|
||||
break;
|
||||
case R.id.btn_2:
|
||||
addInput("2");
|
||||
break;
|
||||
case R.id.btn_3:
|
||||
addInput("3");
|
||||
break;
|
||||
case R.id.btn_4:
|
||||
addInput("4");
|
||||
break;
|
||||
case R.id.btn_5:
|
||||
addInput("5");
|
||||
break;
|
||||
case R.id.btn_6:
|
||||
addInput("6");
|
||||
break;
|
||||
case R.id.btn_7:
|
||||
addInput("7");
|
||||
break;
|
||||
case R.id.btn_8:
|
||||
addInput("8");
|
||||
break;
|
||||
case R.id.btn_9:
|
||||
addInput("9");
|
||||
break;
|
||||
case R.id.btn_point:
|
||||
addInput(".");
|
||||
break;
|
||||
case R.id.btn_add:
|
||||
addInput("+");
|
||||
break;
|
||||
case R.id.btn_subtract:
|
||||
addInput("-");
|
||||
break;
|
||||
case R.id.btn_multiply:
|
||||
addInput("*");
|
||||
break;
|
||||
case R.id.btn_divide:
|
||||
addInput("/");
|
||||
break;
|
||||
case R.id.btn_backspace:
|
||||
if (currentInput.length() > 0) {
|
||||
currentInput.deleteCharAt(currentInput.length() - 1);
|
||||
}
|
||||
displayInput();
|
||||
break;
|
||||
case R.id.btn_clear:
|
||||
currentInput = new StringBuilder("");
|
||||
displayInput();
|
||||
outputTextView.setText("");
|
||||
break;
|
||||
case R.id.btn_equal:
|
||||
StringBuilder result = compute(currentInput);
|
||||
displayAnswer(result);
|
||||
hasCount = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void getNetUrl() {
|
||||
// Api.getInstance().geUrl(System.currentTimeMillis())
|
||||
// .subscribeOn(Schedulers.io())
|
||||
// .observeOn(AndroidSchedulers.mainThread())
|
||||
// .subscribe(new BaseObserver<Result>() {
|
||||
// @Override
|
||||
// public void onSuccess(Result o) {
|
||||
// LogUtils.i("获取的文件地址:"+o.url);
|
||||
// if(!TextUtils.isEmpty(o.url)){
|
||||
// saveString(MainActivity.this,"base_url",o.url);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(int code, String msg) {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
1728
Dmcslot/src/main/java/com/web/dmcslot/MainActivity2.java
Normal file
@@ -0,0 +1,1728 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.app.NotificationManager;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Resources;
|
||||
import android.database.Cursor;
|
||||
import android.graphics.Color;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.provider.ContactsContract;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.cardview.widget.CardView;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.view.WindowCompat;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.google.android.gms.tasks.OnCompleteListener;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.google.firebase.messaging.FirebaseMessaging;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.tencent.smtt.export.external.interfaces.PermissionRequest;
|
||||
import com.tencent.smtt.export.external.interfaces.WebResourceError;
|
||||
import com.tencent.smtt.export.external.interfaces.WebResourceRequest;
|
||||
import com.tencent.smtt.sdk.DownloadListener;
|
||||
import com.tencent.smtt.sdk.ValueCallback;
|
||||
import com.tencent.smtt.sdk.WebChromeClient;
|
||||
import com.tencent.smtt.sdk.WebSettings;
|
||||
import com.tencent.smtt.sdk.WebView;
|
||||
import com.tencent.smtt.sdk.WebViewClient;
|
||||
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.RequestBody;
|
||||
|
||||
import com.web.dmcslot.appdown.AppUpdater;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
import com.web.dmcslot.appdown.constant.Constants;
|
||||
|
||||
public class MainActivity2 extends AppCompatActivity {
|
||||
WebView webView;
|
||||
TextView tvErrorMsg;
|
||||
LinearLayout layoutError;
|
||||
ImageView show_top_v;
|
||||
ImageView menu_iv;
|
||||
private ImageView helpIv;
|
||||
private LinearLayout showTopLy;
|
||||
FloatingActionButton floatingActionButton;
|
||||
CardView otherApp;
|
||||
CardView notifyCardView;
|
||||
CardView ivNotify;
|
||||
ImageView ivotherApp;
|
||||
LinearLayout layoutOtherApp;
|
||||
CardView ivFaceBook;
|
||||
CardView ivTelG;
|
||||
CardView ivWhatsApp;
|
||||
CardView ivLink;
|
||||
TextView tvLink;
|
||||
ImageView ivLinkBg;
|
||||
CardView ivHome;
|
||||
|
||||
String downloadImageUrl = "";
|
||||
private int requestCode;
|
||||
private String[] permissions;
|
||||
private int[] grantResults;
|
||||
private View topVvvv;
|
||||
private int index = 0;
|
||||
private FrameLayout videoContainer;
|
||||
|
||||
private ImageView backIv;
|
||||
private ProgressBar progressBar;
|
||||
//https://m.xiannvtu.com/
|
||||
//https://m.xiannvtu.com/
|
||||
public static String url = "https://dmcslot1.com/";
|
||||
//先定义
|
||||
private static final int REQUEST_EXTERNAL_STORAGE = 1;
|
||||
|
||||
private int userId = 110;
|
||||
private int notifyVisible = View.GONE;
|
||||
|
||||
private String shareUrl;
|
||||
private String myInviteCode;
|
||||
private int myInviteNum;
|
||||
|
||||
private int contactApply = 1;
|
||||
private int notifyApply = 1;
|
||||
|
||||
private String facebookUrl = "";
|
||||
private String whatsappUrl = "";
|
||||
private String telegramUrl = "";
|
||||
private List<LinkConfigInfo> linkconfiglist;
|
||||
|
||||
float lastX, lastY;
|
||||
float initX, initY;
|
||||
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
setIntent(intent);
|
||||
Bundle bundle = intent.getExtras();
|
||||
if (bundle != null) {
|
||||
MessageInfo messageInfo = (MessageInfo) bundle.getSerializable("message");
|
||||
startNotify(messageInfo);
|
||||
}
|
||||
}
|
||||
|
||||
public void startNotify(MessageInfo messageInfo) {
|
||||
if (messageInfo != null) {
|
||||
startActivity(new Intent(MainActivity2.this, NotifyListActivity.class).putExtra("message", messageInfo));
|
||||
recordNotify(messageInfo.getPushId());
|
||||
}
|
||||
// if (messageInfo != null && (messageInfo.getType() == 2 || messageInfo.getType() == 3)) {
|
||||
// startActivity(new Intent(MainActivity2.this, NotifyDetailsActivity.class).putExtra("message", messageInfo));
|
||||
// } else {
|
||||
// recordNotify(messageInfo.getPushId());
|
||||
// }
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
// if (Build.VERSION.SDK_INT >= 30) {
|
||||
// } else {
|
||||
// setTheme(R.style.AppThemeStart1);
|
||||
// getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
|
||||
// getWindow().setStatusBarColor(Color.TRANSPARENT);
|
||||
// }
|
||||
// if (Build.VERSION.SDK_INT >= 33) {
|
||||
// getWindow().setDecorFitsSystemWindows(false);
|
||||
// } else {
|
||||
// getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
|
||||
// }
|
||||
// super.onCreate(savedInstanceState);
|
||||
|
||||
getWindow().setNavigationBarColor(getColor(R.color.white));
|
||||
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
|
||||
|
||||
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();
|
||||
}
|
||||
setContentView(R.layout.activity_main2);
|
||||
// View bottomV = findViewById(R.id.bottom_v);
|
||||
// if (Build.VERSION.SDK_INT >= 30) {
|
||||
// ViewGroup.LayoutParams layoutParams = bottomV.getLayoutParams();
|
||||
// layoutParams.height = getNavigationBarHeight(this);
|
||||
// bottomV.setLayoutParams(layoutParams);
|
||||
// getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
|
||||
// }
|
||||
String body = getIntent().getStringExtra("message");
|
||||
if (!TextUtils.isEmpty(body)) {
|
||||
MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class);
|
||||
startNotify(messageInfo);
|
||||
}
|
||||
//订阅主题
|
||||
FirebaseMessaging.getInstance().subscribeToTopic("demo")
|
||||
.addOnCompleteListener(new OnCompleteListener<Void>() {
|
||||
@Override
|
||||
public void onComplete(@NonNull Task<Void> task) {
|
||||
String msg = "Subscribed";
|
||||
if (!task.isSuccessful()) {
|
||||
msg = "Subscribe failed";
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
// FirebaseMessaging.getInstance().getToken()
|
||||
// .addOnCompleteListener(new OnCompleteListener<String>() {
|
||||
// @Override
|
||||
// public void onComplete(@NonNull Task<String> task) {
|
||||
// if (!task.isSuccessful()) {
|
||||
// LogUtils.d("Fetching FCM registration token failed" + task.getException());
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// // Get new FCM registration token
|
||||
// String token = task.getResult();
|
||||
//
|
||||
// // Log and toast
|
||||
//
|
||||
// LogUtils.d("token=="+token);
|
||||
// }
|
||||
// });
|
||||
boolean isDownload = MainActivity.getBoolean(MainActivity2.this, "download", false);
|
||||
if (!isDownload) {
|
||||
setDownloadNumbers();
|
||||
}
|
||||
initView();
|
||||
// setopHeight();
|
||||
findViewById(R.id.back_iv).setOnClickListener(view -> onBackPressed());
|
||||
|
||||
floatingActionButton = findViewById(R.id.bt_menu);
|
||||
otherApp = findViewById(R.id.bt_otherapp);
|
||||
ivotherApp = findViewById(R.id.iv_otherApp);
|
||||
notifyCardView = findViewById(R.id.bt_notify);
|
||||
ivNotify = findViewById(R.id.bt_notifyitem);
|
||||
layoutOtherApp = findViewById(R.id.layout_otherapp);
|
||||
ivFaceBook = findViewById(R.id.iv_facebook);
|
||||
ivTelG = findViewById(R.id.iv_tel);
|
||||
ivWhatsApp = findViewById(R.id.iv_whatsapp);
|
||||
ivLink = findViewById(R.id.iv_link);
|
||||
tvLink = findViewById(R.id.tv_link);
|
||||
ivLinkBg = findViewById(R.id.iv_linkbg);
|
||||
ivHome = findViewById(R.id.iv_home);
|
||||
// List<String> telpacks = new ArrayList<>();
|
||||
// telpacks.add("org.telegram.messenger");
|
||||
// telpacks.add("org.telegram.messenger.web");
|
||||
ivNotify.setOnClickListener(view -> {
|
||||
notifyclick();
|
||||
});
|
||||
ivFaceBook.setOnClickListener(view -> {
|
||||
//isLuncher = false;
|
||||
toOtherApp(facebookUrl, "com.facebook.katana", 1);
|
||||
});
|
||||
ivTelG.setOnClickListener(view -> {
|
||||
// isLuncher = false;
|
||||
toOtherApp(telegramUrl, "org.telegram.messenger", 2);
|
||||
});
|
||||
ivWhatsApp.setOnClickListener(view -> {
|
||||
//isLuncher = false;
|
||||
toOtherApp(whatsappUrl, "com.whatsapp", 3);
|
||||
});
|
||||
ivLink.setOnClickListener(view -> {
|
||||
//isLuncher = false;
|
||||
webView.loadUrl(linkconfiglist.get(0).getLinkUrl());
|
||||
});
|
||||
ivHome.setOnClickListener(view -> {
|
||||
//isLuncher = false;
|
||||
webView.loadUrl(url);
|
||||
});
|
||||
floatingActionButton.setOnClickListener(view -> {
|
||||
showBottomDialog();
|
||||
});
|
||||
otherApp.setOnClickListener(view -> {
|
||||
layoutOtherApp.setVisibility(layoutOtherApp.getVisibility() == View.VISIBLE ? View.GONE : View.VISIBLE);
|
||||
int visi = layoutOtherApp.getVisibility();
|
||||
if (visi == 0) {
|
||||
ivotherApp.setImageResource(R.mipmap.ic_shousuo);
|
||||
} else {
|
||||
ivotherApp.setImageResource(R.mipmap.ic_zhangkai);
|
||||
}
|
||||
});
|
||||
|
||||
notifyCardView.setOnTouchListener((v, event) -> {
|
||||
|
||||
switch (event.getAction()) {
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
lastX = event.getRawX();
|
||||
lastY = event.getRawY();
|
||||
initX = event.getRawX();
|
||||
initY = event.getRawY();
|
||||
LogUtils.d("touchevent", "lastX=" + lastX + " lastY" + lastY);
|
||||
break;
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
float dx = event.getRawX() - lastX;
|
||||
float dy = event.getRawY() - lastY;
|
||||
int left = v.getLeft() + (int) dx;
|
||||
int top = v.getTop() + (int) dy;
|
||||
int right = v.getRight() + (int) dx;
|
||||
int bottom = v.getBottom() + (int) dy;
|
||||
v.layout(left, top, right, bottom);
|
||||
lastX = event.getRawX();
|
||||
lastY = event.getRawY();
|
||||
break;
|
||||
case MotionEvent.ACTION_UP:
|
||||
float upx = event.getRawX();
|
||||
float upy = event.getRawY();
|
||||
if (upx == initX && upy == initY) {
|
||||
notifyclick();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
// getMyInvite(false);
|
||||
setTotalTongJi(); //每日活跃统计
|
||||
|
||||
// findViewById(R.id.home).setOnClickListener(view -> {
|
||||
// webView.loadUrl(url);
|
||||
// });
|
||||
// findViewById(R.id.tv_other).setOnClickListener(view -> {
|
||||
// if (TextUtils.isEmpty(linkconfig)) {
|
||||
// linkconfig = "https://missav.com/dm37";
|
||||
// }
|
||||
// webView.loadUrl(linkconfig);
|
||||
// });
|
||||
|
||||
}
|
||||
|
||||
//跳转通知列表
|
||||
private void notifyclick() {
|
||||
startActivity(new Intent(this, NotifyListActivity.class));
|
||||
}
|
||||
|
||||
private void toOtherApp(String uri, String packagenames, int type) {
|
||||
|
||||
// if (type == 1) {
|
||||
// try {
|
||||
// // 跳转到 Facebook 应用的页面(使用 URI 的页面 ID 或用户名)
|
||||
// Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("fb://page/<" + uri + ">")); // 替换 <PAGE_ID>
|
||||
// startActivity(intent);
|
||||
// } catch (Exception e) {
|
||||
// // 如果没有安装 Facebook 应用,跳转到网页
|
||||
// Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.facebook.com/<" + uri + ">")); // 替换 <PAGE_ID>
|
||||
// startActivity(intent);
|
||||
// }
|
||||
// }
|
||||
// if (type == 2) {
|
||||
// try {
|
||||
// // 跳转到 Telegram 应用中的特定用户
|
||||
// Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("tg://resolve?domain=<" + uri + ">")); // 替换 <USERNAME>
|
||||
// startActivity(intent);
|
||||
// } catch (Exception e) {
|
||||
// // 如果 Telegram 未安装,跳转到网页版
|
||||
// Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://t.me/<" + uri + ">")); // 替换 <USERNAME>
|
||||
// startActivity(intent);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// if (type == 3) {
|
||||
// Intent intent = getPackageManager().getLaunchIntentForPackage("com.whatsapp");
|
||||
// if (intent != null) {
|
||||
// startActivity(intent);
|
||||
// } else {
|
||||
// // WhatsApp 未安装,跳转到 Google Play 商店
|
||||
// Intent playStoreIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=com.whatsapp"));
|
||||
// startActivity(playStoreIntent);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//https://www.facebook.com/profile.php?id=61568556460025
|
||||
try {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.setData(Uri.parse(uri));
|
||||
intent.setPackage(packagenames);
|
||||
startActivity(intent);
|
||||
} catch (Exception e) {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.setData(Uri.parse(uri));
|
||||
startActivity(intent);
|
||||
}
|
||||
layoutOtherApp.setVisibility(View.GONE);
|
||||
ivotherApp.setImageResource(R.mipmap.ic_zhangkai);
|
||||
}
|
||||
|
||||
private boolean isLuncher = false;
|
||||
|
||||
//多个APPName
|
||||
private void toOtherApps(String uri, List<String> packagenames) {
|
||||
int i = 0;
|
||||
while (i < packagenames.size() && !isLuncher) {
|
||||
try {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.setData(Uri.parse(uri));
|
||||
intent.setPackage(packagenames.get(i));
|
||||
startActivity(intent);
|
||||
isLuncher = true;
|
||||
} catch (Exception e) {
|
||||
i++;
|
||||
isLuncher = false;
|
||||
}
|
||||
}
|
||||
if (!isLuncher) {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.setData(Uri.parse(uri));
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
|
||||
// if (intent.resolveActivity(getPackageManager()) != null) {
|
||||
// startActivity(intent);
|
||||
// } else {
|
||||
// Toast.makeText(this, getString(R.string.app_notinstall), Toast.LENGTH_SHORT).show();
|
||||
// }
|
||||
}
|
||||
|
||||
public int getNavigationBarHeight(Context context) {
|
||||
Resources resources = context.getResources();
|
||||
int resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android");
|
||||
return resources.getDimensionPixelSize(resourceId);
|
||||
}
|
||||
|
||||
private boolean isAppInstall(String packagename) {
|
||||
PackageManager packageManager = getPackageManager();
|
||||
try {
|
||||
PackageInfo packageInfo = packageManager.getPackageInfo(packagename, PackageManager.GET_ACTIVITIES);
|
||||
if (packageInfo != null) {
|
||||
return true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void showBottomDialog() {
|
||||
ActionSelectDialog actionDialog = new ActionSelectDialog(MainActivity2.this);
|
||||
actionDialog.setOnToActionListener(new ActionSelectDialog.OnToActionListener() {
|
||||
@Override
|
||||
public void toShare() {
|
||||
if (TextUtils.isEmpty(myInviteCode)) {
|
||||
getMyInvite(true);
|
||||
} else {
|
||||
goShare();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toCheck() {
|
||||
showRecordDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toWithDrawRecords() {
|
||||
showWithDrawRecordDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toWithDrawApply() {
|
||||
goWithDrawApply();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBankInfo() {
|
||||
showBankInfoDialog();
|
||||
}
|
||||
});
|
||||
actionDialog.setCancelable(true);
|
||||
actionDialog.setCanceledOnTouchOutside(true);
|
||||
actionDialog.show();
|
||||
}
|
||||
|
||||
public void goShare() {
|
||||
Intent shareTextIntent = new Intent();
|
||||
shareTextIntent.setAction(Intent.ACTION_SEND);
|
||||
String title = getString(R.string.app_sharetitle) + myInviteCode;
|
||||
String parentCode = MainActivity.getString(this, "code", "");
|
||||
shareTextIntent.putExtra(Intent.EXTRA_TITLE, title + (TextUtils.isEmpty(parentCode) ? "" : "\n" + getString(R.string.app_sharetitle2) + parentCode));
|
||||
shareTextIntent.putExtra(Intent.EXTRA_TEXT, getString(R.string.app_name) + getString(R.string.app_sharecontent) + shareUrl + " \n" + title);
|
||||
shareTextIntent.setType("text/plain");
|
||||
startActivity(Intent.createChooser(shareTextIntent, getString(R.string.app_name) + getString(R.string.app_sharecontent)));
|
||||
}
|
||||
|
||||
private ActionWithDrawApplyDialog drawApplyDialog;
|
||||
|
||||
public void goWithDrawApply() {
|
||||
drawApplyDialog = new ActionWithDrawApplyDialog(MainActivity2.this, myInviteCode);
|
||||
drawApplyDialog.setOnToActionListener(new ActionWithDrawApplyDialog.OnToActionListener() {
|
||||
@Override
|
||||
public void toSumbit(String content) {
|
||||
sendApply(content);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toCancel() {
|
||||
|
||||
}
|
||||
});
|
||||
drawApplyDialog.setCancelable(false);
|
||||
drawApplyDialog.setCanceledOnTouchOutside(false);
|
||||
drawApplyDialog.show();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑银行卡信息
|
||||
*/
|
||||
public void showBankInfoDialog() {
|
||||
ActionBankInfoDialog bankInfoDialog = new ActionBankInfoDialog(MainActivity2.this, myInviteCode);
|
||||
bankInfoDialog.setCancelable(false);
|
||||
bankInfoDialog.setCanceledOnTouchOutside(false);
|
||||
bankInfoDialog.show();
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送申请记录
|
||||
*/
|
||||
public void sendApply(String amount) {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("userId", userId);
|
||||
map.put("amount", amount);
|
||||
map.put("inviteCode", myInviteCode);
|
||||
Api.getInstance().sendWithDrawApply(map)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver<Result>() {
|
||||
@Override
|
||||
public void onSuccess(Result o) {
|
||||
Toast.makeText(MainActivity2.this, getString(R.string.app_toastapply), Toast.LENGTH_SHORT).show();
|
||||
if (drawApplyDialog != null) {
|
||||
drawApplyDialog.dismiss();
|
||||
}
|
||||
getMyInvite(false);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
LogUtils.d("dddd" + msg);
|
||||
Toast.makeText(MainActivity2.this, msg, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError2(Result o) {
|
||||
Toast.makeText(MainActivity2.this, o.error, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void showRecordDialog() {
|
||||
ActionInviteRecordsDialog actionDialog = new ActionInviteRecordsDialog(MainActivity2.this, myInviteCode);
|
||||
actionDialog.setCancelable(false);
|
||||
actionDialog.setCanceledOnTouchOutside(false);
|
||||
actionDialog.show();
|
||||
}
|
||||
|
||||
public void showWithDrawRecordDialog() {
|
||||
ActionWithDrawRecordsDialog actionDialog = new ActionWithDrawRecordsDialog(MainActivity2.this, myInviteCode);
|
||||
actionDialog.setCancelable(false);
|
||||
actionDialog.setCanceledOnTouchOutside(false);
|
||||
actionDialog.show();
|
||||
}
|
||||
|
||||
ActionConfirmDialog actionDialog;
|
||||
|
||||
private void checkNotify() {
|
||||
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
if (!notificationManager.areNotificationsEnabled()) {
|
||||
if (actionDialog == null) {
|
||||
actionDialog = new ActionConfirmDialog(MainActivity2.this,
|
||||
getString(R.string.notification_title_txt), getString(R.string.notification_cancel_txt),
|
||||
getString(R.string.notification_setting_txt));
|
||||
}
|
||||
actionDialog.setOnToActionListener(new ActionConfirmDialog.OnToActionListener() {
|
||||
@Override
|
||||
public void toSumbit() {
|
||||
jumpNotificationSetting();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toCancel() {
|
||||
if (notifyApply == 1) {
|
||||
MainActivity2.this.finish();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
actionDialog.setCanceledOnTouchOutside(false);
|
||||
actionDialog.setCancelable(false);
|
||||
actionDialog.show();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void jumpNotificationSetting() {
|
||||
final ApplicationInfo applicationInfo = getApplicationInfo();
|
||||
try {
|
||||
Intent intent = new Intent();
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
intent.setAction("android.settings.APP_NOTIFICATION_SETTINGS");
|
||||
intent.putExtra("app_package", applicationInfo.packageName);
|
||||
intent.putExtra("android.provider.extra.APP_PACKAGE", applicationInfo.packageName);
|
||||
intent.putExtra("app_uid", applicationInfo.uid);
|
||||
startActivity(intent);
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
Intent intent = new Intent();
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
intent.setAction("android.settings.APPLICATION_DETAILS_SETTINGS");
|
||||
intent.setData(Uri.fromParts("package", applicationInfo.packageName, null));
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// // Declare the launcher at the top of your Activity/Fragment:
|
||||
// private final ActivityResultLauncher<String> requestPermissionLauncher =
|
||||
// registerForActivityResult(new ActivityResultContracts.RequestPermission(), isGranted -> {
|
||||
// if (isGranted) {
|
||||
// // FCM SDK (and your app) can post notifications.
|
||||
// } else {
|
||||
// // TODO: Inform user that that your app will not show notifications.
|
||||
// }
|
||||
// });
|
||||
|
||||
// private void askNotificationPermission() {
|
||||
// // This is only necessary for API level >= 33 (TIRAMISU)
|
||||
// if (Build.VERSION.SDK_INT >= 33) {
|
||||
// if (ContextCompat.checkSelfPermission(this, Manifest.permission.POST_NOTIFICATIONS) ==
|
||||
// PackageManager.PERMISSION_GRANTED) {
|
||||
// // FCM SDK (and your app) can post notifications.
|
||||
// } else if (shouldShowRequestPermissionRationale(Manifest.permission.POST_NOTIFICATIONS)) {
|
||||
// // TODO: display an educational UI explaining to the user the features that will be enabled
|
||||
// // by them granting the POST_NOTIFICATION permission. This UI should provide the user
|
||||
// // "OK" and "No thanks" buttons. If the user selects "OK," directly request the permission.
|
||||
// // If the user selects "No thanks," allow the user to continue without notifications.
|
||||
// } else {
|
||||
// // Directly ask for the permission
|
||||
// requestPermissionLauncher.launch(Manifest.permission.POST_NOTIFICATIONS);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
|
||||
if (webView.canGoBack()) {//当webview有多级能返回的时候
|
||||
String url = webView.getUrl();
|
||||
// 在首页 就退出这个页面
|
||||
if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) {
|
||||
super.onBackPressed();
|
||||
} else { //不在首页 回到首页
|
||||
if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) {
|
||||
isAtGame = false;
|
||||
}
|
||||
topVvvv.setVisibility(View.GONE);
|
||||
progressBar.setVisibility(View.VISIBLE);
|
||||
//当有条过登录页面 只能重载 不然逻辑会异常
|
||||
if (hasSignIn) {
|
||||
onShowNetView();
|
||||
webView.loadUrl(url);
|
||||
} else {
|
||||
while (webView.canGoBack()) {
|
||||
webView.goBack();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} else {//不能返回了 关闭进程 退出程序
|
||||
Intent homeIntent = new Intent(Intent.ACTION_MAIN);
|
||||
homeIntent.addCategory(Intent.CATEGORY_HOME);
|
||||
homeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
startActivity(homeIntent);
|
||||
android.os.Process.killProcess(android.os.Process.myPid());
|
||||
System.exit(1);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void removeChildView(int child) {
|
||||
WebView childView = (WebView) webView.getChildAt(child - 1);
|
||||
webView.removeView(childView);
|
||||
if (webView.canGoBack()) {
|
||||
webView.goBack();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改图标和名称的方法
|
||||
*/
|
||||
public void changeIcon() {
|
||||
PackageManager pm = getApplicationContext().getPackageManager();
|
||||
|
||||
pm.setComponentEnabledSetting(new ComponentName(
|
||||
this,
|
||||
"com.web.dmcslot.MainActivity"),
|
||||
PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
|
||||
PackageManager.DONT_KILL_APP);
|
||||
Log.d("TAG", "换Test的图标");
|
||||
|
||||
pm.setComponentEnabledSetting(new ComponentName(
|
||||
this,
|
||||
"com.web.dmcslot.MainActivityNew"),
|
||||
PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
|
||||
PackageManager.DONT_KILL_APP);
|
||||
|
||||
}
|
||||
|
||||
private void setopHeight() {
|
||||
RelativeLayout.LayoutParams linearParams = (RelativeLayout.LayoutParams) topVvvv.getLayoutParams(); //取控件textView当前的布局参数
|
||||
linearParams.height = getStatusBarHeight();// 控件的宽强制设成30
|
||||
|
||||
topVvvv.setLayoutParams(linearParams);
|
||||
}
|
||||
|
||||
|
||||
private static String[] PERMISSIONS_STORAGE = {
|
||||
"android.permission.READ_EXTERNAL_STORAGE",
|
||||
"android.permission.WRITE_EXTERNAL_STORAGE"};
|
||||
|
||||
private static String[] PERMISSIONS_CAMERA = {
|
||||
Manifest.permission.CAMERA};
|
||||
|
||||
//然后通过一个函数来申请
|
||||
public static void verifyStoragePermissions(Activity activity) {
|
||||
|
||||
// 没有写的权限,去申请写的权限,会弹出对话框
|
||||
ActivityCompat.requestPermissions(activity, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@SuppressLint({"NewApi", "WrongConstant"})
|
||||
protected void initView() {
|
||||
topVvvv = (View) findViewById(R.id.top_vvvv);
|
||||
webView = findViewById(R.id.webview);
|
||||
show_top_v = findViewById(R.id.show_top_v);
|
||||
showTopLy = findViewById(R.id.show_top_ly);
|
||||
videoContainer = (FrameLayout) findViewById(R.id.videoContainer);
|
||||
backIv = (ImageView) findViewById(R.id.back_iv);
|
||||
progressBar = (ProgressBar) findViewById(R.id.progressbar);
|
||||
tvErrorMsg = findViewById(R.id.errormsg);
|
||||
layoutError = findViewById(R.id.layoutError);
|
||||
WebSettings settings = webView.getSettings();
|
||||
settings.setDomStorageEnabled(true);
|
||||
settings.setAppCacheEnabled(true);
|
||||
settings.setCacheMode(WebSettings.LOAD_DEFAULT);
|
||||
settings.setJavaScriptEnabled(true);
|
||||
settings.setLoadWithOverviewMode(true);
|
||||
// 设置允许访问文件数据
|
||||
settings.setAllowFileAccess(true);
|
||||
settings.setAllowContentAccess(true);
|
||||
settings.setDatabaseEnabled(true);
|
||||
settings.setSavePassword(false);
|
||||
settings.setSaveFormData(false);
|
||||
settings.setUseWideViewPort(true);
|
||||
settings.setBuiltInZoomControls(true);
|
||||
settings.setPluginState(WebSettings.PluginState.ON);
|
||||
settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS);
|
||||
webView.setFocusable(true);
|
||||
webView.setFocusableInTouchMode(true);
|
||||
webView.getSettings().setSupportMultipleWindows(true);
|
||||
|
||||
settings.setSupportZoom(true);
|
||||
webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
|
||||
// webView.setHorizontalScrollbarOverlay(true);
|
||||
webView.setHorizontalScrollBarEnabled(true);
|
||||
webView.requestFocus();
|
||||
// webView.setBackgroundColor(getColor(R.color.black));
|
||||
settings.setJavaScriptCanOpenWindowsAutomatically(true);
|
||||
settings.setMediaPlaybackRequiresUserGesture(false);
|
||||
// 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件
|
||||
// Android 4.1前默认允许,4.1后默认禁止
|
||||
settings.setAllowFileAccessFromFileURLs(true);
|
||||
// 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源)
|
||||
// Android 4.1前默认允许,4.1后默认禁止
|
||||
settings.setAllowUniversalAccessFromFileURLs(true);
|
||||
|
||||
|
||||
webView.setWebChromeClient(webChromeClient);
|
||||
webView.setWebViewClient(webViewClient);
|
||||
Log.i("XHXDEBUG", "XHXDEBUGURL:::" + url);
|
||||
|
||||
// new Handler().postDelayed(() -> showTopLy.setVisibility(View.GONE), 3000);
|
||||
// verifyStoragePermissions(this);
|
||||
|
||||
webView.setDownloadListener(new DownloadListener() {
|
||||
@Override
|
||||
public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) {
|
||||
LogUtils.i("URL是啥onDownloadStart:" + url);
|
||||
|
||||
try {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(Intent.ACTION_VIEW);
|
||||
intent.setData(Uri.parse(url));
|
||||
startActivity(intent);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
getNetUrl();
|
||||
|
||||
}
|
||||
|
||||
public void getNotifyList() {
|
||||
|
||||
Api.getInstance().getNotifyList(userId, 1, 1)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver<Result<ResultDataInfo<MessageInfo>>>() {
|
||||
@Override
|
||||
public void onSuccess(Result<ResultDataInfo<MessageInfo>> o) {
|
||||
if (o.data != null && o.data.getTotal() > 0) {
|
||||
// notifyVisible = View.VISIBLE;
|
||||
otherApp.setVisibility(View.VISIBLE);
|
||||
ivNotify.setVisibility(View.VISIBLE);
|
||||
ivotherApp.setImageResource(R.mipmap.ic_shousuo);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
LogUtils.i("获取的结果error" + msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError2(Result<ResultDataInfo<MessageInfo>> o) {
|
||||
LogUtils.i("获取的结果error");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void getNetUrl() {
|
||||
Api.getInstance().geUrlNew(userId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver<Result<DataInfo>>() {
|
||||
@Override
|
||||
public void onSuccess(Result<DataInfo> o) {
|
||||
|
||||
DataInfo dataInfo = o.data;
|
||||
if (dataInfo != null) {
|
||||
if (dataInfo.getIsUse() == 0) {
|
||||
MainActivity2.this.finish();
|
||||
return;
|
||||
}
|
||||
if (!TextUtils.isEmpty(dataInfo.getUrl())) {
|
||||
MainActivity.saveString(MainActivity2.this, "base_url", dataInfo.getUrl());
|
||||
webView.loadUrl(dataInfo.getUrl());
|
||||
}
|
||||
shareUrl = dataInfo.getDownloadUrl();
|
||||
String link = dataInfo.getLinkConfig();
|
||||
if (!TextUtils.isEmpty(link)) {
|
||||
try {
|
||||
linkconfiglist = GsonUtils.getListFromJSON(link, LinkConfigInfo.class);
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
if (!TextUtils.isEmpty(dataInfo.getVersionCode())) {
|
||||
if (Integer.parseInt(dataInfo.getVersionCode()) > BuildConfig.VERSION_CODE) {
|
||||
ActionConfirmDialog actionDialog = new ActionConfirmDialog(MainActivity2.this,
|
||||
getString(R.string.banbengengxin_txt), getString(R.string.xiacigengxin_txt),
|
||||
getString(R.string.lijigengxin_txt));
|
||||
actionDialog.setOnToActionListener(new ActionConfirmDialog.OnToActionListener() {
|
||||
@Override
|
||||
public void toSumbit() {
|
||||
checkUpdate(dataInfo.getApkUrl());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toCancel() {
|
||||
if (dataInfo.getForceUpdate() == 1) {
|
||||
MainActivity2.this.finish();
|
||||
}
|
||||
}
|
||||
});
|
||||
actionDialog.show();
|
||||
}
|
||||
}
|
||||
contactApply = dataInfo.getContactApplyMode();
|
||||
notifyApply = dataInfo.getNoticeApplyMode();
|
||||
if (contactApply == 0 || contactApply == 1) {
|
||||
readContact();
|
||||
}
|
||||
if (notifyApply == 0 || notifyApply == 1) {
|
||||
checkNotify();
|
||||
}
|
||||
facebookUrl = dataInfo.getFbUrl().trim();
|
||||
telegramUrl = dataInfo.getTgUrl().trim();
|
||||
whatsappUrl = dataInfo.getWsUrl().trim();
|
||||
if (!TextUtils.isEmpty(facebookUrl)) {
|
||||
otherApp.setVisibility(View.VISIBLE);
|
||||
ivFaceBook.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if (!TextUtils.isEmpty(telegramUrl)) {
|
||||
otherApp.setVisibility(View.VISIBLE);
|
||||
ivTelG.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if (!TextUtils.isEmpty(whatsappUrl)) {
|
||||
otherApp.setVisibility(View.VISIBLE);
|
||||
ivWhatsApp.setVisibility(View.VISIBLE);
|
||||
}
|
||||
// if (linkconfiglist != null && linkconfiglist.size() > 0) {
|
||||
// otherApp.setVisibility(View.VISIBLE);
|
||||
// ivLink.setVisibility(View.VISIBLE);
|
||||
// tvLink.setText(linkconfiglist.get(0).getName());
|
||||
// ivHome.setVisibility(View.VISIBLE);
|
||||
// Glide.with(MainActivity2.this).load(linkconfiglist.get(0).getIcon()).error(R.color.dialog_bg).into(ivLinkBg);
|
||||
// }
|
||||
} else {
|
||||
url = MainActivity.getString(MainActivity2.this, "base_url", url);
|
||||
webView.loadUrl(url);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
url = MainActivity.getString(MainActivity2.this, "base_url", url);
|
||||
webView.loadUrl(url);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError2(Result<DataInfo> o) {
|
||||
url = MainActivity.getString(MainActivity2.this, "base_url", url);
|
||||
webView.loadUrl(url);
|
||||
}
|
||||
});
|
||||
// Api.getInstance().geUrlNew(userId)
|
||||
// .subscribeOn(Schedulers.io())
|
||||
// .observeOn(AndroidSchedulers.mainThread())
|
||||
// .subscribe(new BaseObserver<Result>() {
|
||||
// @Override
|
||||
// public void onSuccess(Result o) {
|
||||
// LogUtils.i("URL是啥获取的文件地址:" + o.url);
|
||||
// if (!TextUtils.isEmpty(o.url)) {
|
||||
// MainActivity.saveString(MainActivity2.this, "base_url", o.url);
|
||||
// url = MainActivity.getString(MainActivity2.this, "base_url", url);
|
||||
// webView.loadUrl(url);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(int code, String msg) {
|
||||
// url = MainActivity.getString(MainActivity2.this, "base_url", url);
|
||||
// webView.loadUrl(url);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
public void getVersionUrl() {
|
||||
// Api.getInstance().getVersion(System.currentTimeMillis())
|
||||
// .subscribeOn(Schedulers.io())
|
||||
// .observeOn(AndroidSchedulers.mainThread())
|
||||
// .subscribe(new BaseObserver<Result>() {
|
||||
// @Override
|
||||
// public void onSuccess(Result o) {
|
||||
// if (!TextUtils.isEmpty(o.version_code)) {
|
||||
// if (Integer.parseInt(o.version_code) > com.web.dmcslot.BuildConfig.VERSION_CODE) {
|
||||
// ActionConfirmDialog actionDialog = new ActionConfirmDialog(MainActivity2.this,
|
||||
// getString(R.string.banbengengxin_txt), getString(R.string.xiacigengxin_txt),
|
||||
// getString(R.string.lijigengxin_txt));
|
||||
// actionDialog.setOnToActionListener(new ActionConfirmDialog.OnToActionListener() {
|
||||
// @Override
|
||||
// public void toSumbit() {
|
||||
// checkUpdate(o.url);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void toCancel() {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
// actionDialog.show();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(int code, String msg) {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
private void checkUpdate(String url) {
|
||||
Constants.isUpdate = true;
|
||||
new AppUpdater(this, url).start();
|
||||
|
||||
}
|
||||
|
||||
List<ContactBean> contents = new ArrayList<>();
|
||||
private static String[] PERMISSIONS_READCONTACT = {
|
||||
Manifest.permission.READ_CONTACTS};
|
||||
|
||||
public void readContact() {
|
||||
if (ContextCompat.checkSelfPermission(MainActivity2.this, Manifest.permission.READ_CONTACTS) != 0) {
|
||||
ActivityCompat.requestPermissions(MainActivity2.this, PERMISSIONS_READCONTACT, 2222);
|
||||
} else {
|
||||
//开启线程上传数据
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
//获取通讯录
|
||||
contents = new ArrayList<>();
|
||||
Cursor cursor = null;
|
||||
try {
|
||||
cursor = getContentResolver().query(
|
||||
ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
|
||||
null, null, null, null);
|
||||
while (cursor.moveToNext()) {
|
||||
int i_name = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME);
|
||||
String displayName = cursor.getString(i_name);
|
||||
int i_number = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER);
|
||||
String number = cursor.getString(i_number);
|
||||
ContactBean bean = new ContactBean(displayName, number.trim());
|
||||
contents.add(bean);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (cursor != null) {
|
||||
cursor.close();
|
||||
postReadContact(contents);
|
||||
}
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public List<ContactBean> removeSameContact(List<ContactBean> contents) {
|
||||
List<String> contactBeans = new ArrayList<String>();
|
||||
for (int i = 0; i < contents.size(); i++) {
|
||||
String phone = contents.get(i).getPhone();
|
||||
if (contactBeans.contains(phone)) {
|
||||
contents.remove(i);
|
||||
} else {
|
||||
contactBeans.add(phone);
|
||||
}
|
||||
}
|
||||
return contents;
|
||||
}
|
||||
|
||||
public void postReadContact(List<ContactBean> contents) {
|
||||
Gson gson = new Gson();
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("userId", userId);
|
||||
map.put("customers", contents);
|
||||
String result = gson.toJson(map);
|
||||
MediaType mediaType = MediaType.parse("application/json; charset=utf-8");
|
||||
Api.getInstance().readContact(RequestBody.create(mediaType, result))
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver<Result>() {
|
||||
@Override
|
||||
public void onSuccess(Result o) {
|
||||
LogUtils.i("URL是啥获取的文件地址:");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
LogUtils.i("error:" + msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError2(Result o) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void setDownloadNumbers() {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("userId", userId);
|
||||
Api.getInstance().downloadNumbers(map)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver<Result>() {
|
||||
@Override
|
||||
public void onSuccess(Result o) {
|
||||
LogUtils.i("URL是啥获取的文件地址:");
|
||||
MainActivity.saveBoolean(MainActivity2.this, "download", true);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
LogUtils.i("error:" + msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError2(Result o) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ActionInviteDialog invitedDialog;
|
||||
|
||||
//展示邀请码
|
||||
public void showInviteCode() {
|
||||
invitedDialog = new ActionInviteDialog(MainActivity2.this,
|
||||
false);
|
||||
invitedDialog.setOnToActionListener(new ActionInviteDialog.OnToActionListener() {
|
||||
@Override
|
||||
public void toSumbit(String content) {
|
||||
checkInvited(content);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toCancel() {
|
||||
|
||||
}
|
||||
});
|
||||
invitedDialog.setCanceledOnTouchOutside(false);
|
||||
invitedDialog.setCancelable(false);
|
||||
invitedDialog.show();
|
||||
|
||||
}
|
||||
|
||||
public void checkInvited(String code) {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("userId", userId);
|
||||
map.put("code", code);
|
||||
map.put("deviceCode", Utils.getUniqueId(MainActivity2.this));
|
||||
Api.getInstance().checkInvited(map)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver<Result<InviteInfo>>() {
|
||||
@Override
|
||||
public void onSuccess(Result<InviteInfo> o) {
|
||||
if (o.isSuccessful() && invitedDialog != null) {
|
||||
invitedDialog.dismiss();
|
||||
MainActivity.saveBoolean(MainActivity2.this, "invited", true);
|
||||
MainActivity.saveString(MainActivity2.this, "code", code);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
Toast.makeText(MainActivity2.this, msg + "", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError2(Result<InviteInfo> o) {
|
||||
if (o.code == 40001) {
|
||||
invitedDialog.dismiss();
|
||||
MainActivity.saveBoolean(MainActivity2.this, "invited", true);
|
||||
MainActivity.saveString(MainActivity2.this, "code", o.data.getInviteCode());
|
||||
}
|
||||
Toast.makeText(MainActivity2.this, TextUtils.isEmpty(o.message) ? o.error : o.message, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void setTotalTongJi() {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("userId", userId);
|
||||
Api.getInstance().totalTongJi(map)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver<Result>() {
|
||||
@Override
|
||||
public void onSuccess(Result o) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError2(Result o) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void recordNotify(int pushId) {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("pushId", pushId);
|
||||
Api.getInstance().totalNotify(map)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver<Result>() {
|
||||
@Override
|
||||
public void onSuccess(Result o) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
LogUtils.d("dddd" + msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError2(Result o) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void getMyInvite(boolean isShare) {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("userId", userId);
|
||||
map.put("deviceCode", Utils.getUniqueId(MainActivity2.this));
|
||||
Api.getInstance().getMyInvited(map)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver<Result<InviteInfo>>() {
|
||||
@Override
|
||||
public void onSuccess(Result<InviteInfo> o) {
|
||||
if (o.data != null) {
|
||||
myInviteCode = o.data.getInviteCode();
|
||||
myInviteNum = o.data.getInviteNum();
|
||||
MainActivity.saveString(MainActivity2.this, "balance", o.data.getBalance());
|
||||
MainActivity.saveString(MainActivity2.this, "income", o.data.getIncome());
|
||||
MainActivity.saveString(MainActivity2.this, "bankname", o.data.getBankName());
|
||||
MainActivity.saveString(MainActivity2.this, "name", o.data.getName());
|
||||
MainActivity.saveString(MainActivity2.this, "bankno", o.data.getBankNo());
|
||||
}
|
||||
if (isShare) {
|
||||
goShare();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
LogUtils.d("dddd" + msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError2(Result<InviteInfo> o) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
boolean hasSignIn = false;
|
||||
|
||||
WebViewClient webViewClient = new WebViewClient() {
|
||||
|
||||
|
||||
@Override
|
||||
public void onPageFinished(WebView webView, String s) {
|
||||
super.onPageFinished(webView, s);
|
||||
LogUtils.i("URL是啥加载完成:" + webView.getUrl());
|
||||
if (webView.getUrl().contains("hasSignIn")) {
|
||||
hasSignIn = true;
|
||||
}
|
||||
|
||||
int w = View.MeasureSpec.makeMeasureSpec(0,
|
||||
View.MeasureSpec.UNSPECIFIED);
|
||||
int h = View.MeasureSpec.makeMeasureSpec(0,
|
||||
View.MeasureSpec.UNSPECIFIED);
|
||||
// 重新测量
|
||||
webView.measure(w, h);
|
||||
showTopLy.setVisibility(View.GONE);
|
||||
// notifyCardView.setVisibility(notifyVisible);
|
||||
if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) {
|
||||
isAtGame = false;
|
||||
topVvvv.setVisibility(View.GONE);
|
||||
} else {
|
||||
if (isAtGame) {
|
||||
topVvvv.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
topVvvv.setVisibility(View.GONE);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// if (isNetError&&isAtGame) {
|
||||
// topVvvv.setVisibility(View.VISIBLE);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
|
||||
super.onReceivedError(view, request, error);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
int errorCode = error.getErrorCode();
|
||||
String errorMessage = error.getDescription().toString();
|
||||
String currentUrl = request.getUrl().toString();
|
||||
if ((errorCode == -2 || errorCode == -6) && currentUrl.contains(url)) {
|
||||
onShowErrorView(errorMessage);
|
||||
} else {
|
||||
onShowNetView();
|
||||
}
|
||||
}
|
||||
progressBar.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
|
||||
super.onReceivedError(view, errorCode, description, failingUrl);
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
|
||||
if ((errorCode == -2 || errorCode == -6) && failingUrl.contains(url)) {
|
||||
onShowErrorView(description);
|
||||
} else {
|
||||
onShowNetView();
|
||||
}
|
||||
}
|
||||
progressBar.setVisibility(View.GONE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView webView, String url1) {
|
||||
|
||||
LogUtils.i("URL是啥:" + url1);
|
||||
if (url1.equals(url + "index") || url1.equals(url + "/index")) {
|
||||
isAtGame = false;
|
||||
topVvvv.setVisibility(View.GONE);
|
||||
} else {
|
||||
progressBar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
if (!(url1.startsWith("http") || url1.startsWith("https"))) {
|
||||
try {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(Intent.ACTION_VIEW);
|
||||
intent.setData(Uri.parse(url1));
|
||||
startActivity(intent);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
|
||||
if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) {
|
||||
return false;
|
||||
} else {
|
||||
//其它的该怎么处理就怎么处理
|
||||
webView.loadUrl(url1);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
|
||||
Uri uri;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
uri = request.getUrl();
|
||||
} else {
|
||||
uri = Uri.parse(request.toString());
|
||||
}
|
||||
String url1 = uri.toString();
|
||||
if (url1.equals(url + "index") || url1.equals(url + "/index")) {
|
||||
isAtGame = false;
|
||||
topVvvv.setVisibility(View.GONE);
|
||||
} else {
|
||||
progressBar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
if (!(url1.startsWith("http") || url1.startsWith("https"))) {
|
||||
try {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(Intent.ACTION_VIEW);
|
||||
intent.setData(Uri.parse(url1));
|
||||
startActivity(intent);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
|
||||
if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) {
|
||||
return false;
|
||||
} else {
|
||||
//其它的该怎么处理就怎么处理
|
||||
webView.loadUrl(url1);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
private boolean isNetError = false;
|
||||
|
||||
public void onShowErrorView(String errorMsg) { //网络不可用的情况
|
||||
// topVvvv.setVisibility(View.GONE);
|
||||
webView.setVisibility(View.GONE);
|
||||
layoutError.setVisibility(View.VISIBLE);
|
||||
tvErrorMsg.setText(errorMsg);
|
||||
showTopLy.setVisibility(View.GONE);
|
||||
isNetError = true;
|
||||
|
||||
}
|
||||
|
||||
public void onShowNetView() {
|
||||
// topVvvv.setVisibility(View.GONE);
|
||||
webView.setVisibility(View.VISIBLE);
|
||||
layoutError.setVisibility(View.GONE);
|
||||
showTopLy.setVisibility(View.GONE);
|
||||
isNetError = false;
|
||||
}
|
||||
|
||||
|
||||
boolean isAtGame = false;
|
||||
// String uuid = "", uuid1 = "";
|
||||
private static final int REQUEST_CODE_FILE_CHOOSER = 1;
|
||||
private ValueCallback<Uri> mUploadCallbackForLowApi;
|
||||
private ValueCallback<Uri[]> mUploadCallbackForHighApi;
|
||||
WebChromeClient webChromeClient = new WebChromeClient() {
|
||||
@Override
|
||||
public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) {
|
||||
LogUtils.i("URL是啥onCreateWindow:" + webView.getUrl());
|
||||
// WebView newWebView = new WebView(MainActivity2.this);
|
||||
// topVvvv.setVisibility(View.VISIBLE);
|
||||
// webView.addView(newWebView);
|
||||
// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;
|
||||
// transport.setWebView(newWebView);
|
||||
// resultMsg.sendToTarget();
|
||||
//
|
||||
// newWebView.setWebViewClient(new WebViewClient() {
|
||||
// @Override
|
||||
// public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
// isAtGame = true;
|
||||
// webView.loadUrl(url);
|
||||
// return false;
|
||||
// }
|
||||
// });
|
||||
|
||||
WebView newWebView = new WebView(webViewdd.getContext());
|
||||
newWebView.setWebViewClient(new WebViewClient() {
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
if (!(url.startsWith("http") || url.startsWith("https"))) {
|
||||
try {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(Intent.ACTION_VIEW);
|
||||
intent.setData(Uri.parse(url));
|
||||
startActivity(intent);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
Intent browserIntent = new Intent(MainActivity2.this, WebViewActivity.class);
|
||||
browserIntent.putExtra("url", url);
|
||||
startActivity(browserIntent);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;
|
||||
transport.setWebView(newWebView);
|
||||
resultMsg.sendToTarget();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCloseWindow(WebView window) {
|
||||
super.onCloseWindow(window);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProgressChanged(WebView view, int newProgress) {
|
||||
super.onProgressChanged(view, newProgress);
|
||||
// 更新进度条的进度
|
||||
progressBar.setProgress(newProgress);
|
||||
// 如果加载完成,隐藏进度条
|
||||
if (newProgress == 100) {
|
||||
progressBar.setVisibility(View.GONE);
|
||||
} else {
|
||||
progressBar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// @TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
@Override
|
||||
public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathCallback, FileChooserParams fileChooserParams) {
|
||||
LogUtils.i("数据接口:onShowFileChooser");
|
||||
mUploadCallbackForHighApi = filePathCallback;
|
||||
Intent intent = fileChooserParams.createIntent();
|
||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER);
|
||||
// try {
|
||||
// startActivityForResult(intent, REQUEST_CODE_FILE_CHOOSER);
|
||||
// } catch (ActivityNotFoundException e) {
|
||||
//// mUploadCallbackForHighApi = null;
|
||||
//// WidgetUtils.showToast(JsBridgeActivity.this, "未知错误", WidgetUtils.ToastType.ERROR);
|
||||
// // Toast.makeText(MainActivity2.this, "未知错误", Toast.LENGTH_SHORT).show();
|
||||
// startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER);
|
||||
// return true;
|
||||
// }
|
||||
return true;
|
||||
}
|
||||
|
||||
// For 3.0+
|
||||
protected void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType) {
|
||||
LogUtils.i("数据接口:openFileChooseracceptType");
|
||||
|
||||
openFilerChooser(uploadMsg);
|
||||
}
|
||||
|
||||
|
||||
private void openFilerChooser(ValueCallback<Uri> uploadMsg) {
|
||||
LogUtils.i("数据接口:openFileChooser");
|
||||
|
||||
mUploadCallbackForLowApi = uploadMsg;
|
||||
startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER);
|
||||
}
|
||||
|
||||
|
||||
private Intent getFilerChooserIntent() {
|
||||
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
|
||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
return intent;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onPermissionRequest(PermissionRequest request) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
MainActivity2.this.runOnUiThread(new Runnable() {
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
@Override
|
||||
public void run() {
|
||||
for (String permisson : request.getResources()) {
|
||||
permissionRequest = request;
|
||||
if (permisson.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) {
|
||||
if (ContextCompat.checkSelfPermission(MainActivity2.this, Manifest.permission.CAMERA) != 0) {
|
||||
ActivityCompat.requestPermissions(MainActivity2.this, PERMISSIONS_CAMERA, 1111);
|
||||
} else {
|
||||
request.grant(request.getResources());
|
||||
request.getOrigin();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
private PermissionRequest permissionRequest;
|
||||
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.Q)
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
switch (requestCode) {
|
||||
case REQUEST_CODE_FILE_CHOOSER:
|
||||
if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) {
|
||||
afterFileChooseGoing(resultCode, data);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* onActivityResult方法
|
||||
*/
|
||||
|
||||
private void afterFileChooseGoing(int resultCode, Intent data) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
if (mUploadCallbackForHighApi == null) {
|
||||
return;
|
||||
}
|
||||
mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data));
|
||||
mUploadCallbackForHighApi = null;
|
||||
} else {
|
||||
if (mUploadCallbackForLowApi == null) {
|
||||
return;
|
||||
}
|
||||
Uri result = data == null ? null : data.getData();
|
||||
mUploadCallbackForLowApi.onReceiveValue(result);
|
||||
mUploadCallbackForLowApi = null;
|
||||
}
|
||||
}
|
||||
|
||||
public class JavaScriptinterface {
|
||||
Context context;
|
||||
|
||||
public JavaScriptinterface(Context c) {
|
||||
context = c;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode,
|
||||
String permissions[], int[] grantResults) {
|
||||
if (grantResults.length == 0) {
|
||||
return;
|
||||
}
|
||||
switch (requestCode) {
|
||||
case REQUEST_EXTERNAL_STORAGE:
|
||||
if (grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED) {
|
||||
}
|
||||
break;
|
||||
case 1111:
|
||||
if (grantResults[0] == PackageManager.PERMISSION_GRANTED && permissionRequest != null) {
|
||||
permissionRequest.grant(permissionRequest.getResources());
|
||||
}
|
||||
break;
|
||||
case 2222:
|
||||
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
||||
readContact();
|
||||
} else {
|
||||
//没同意
|
||||
if (contactApply == 1) {
|
||||
MainActivity2.this.finish();
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置网页中图片的点击事件
|
||||
*
|
||||
* @param view
|
||||
*/
|
||||
public static void setWebImageClick(WebView view, String method) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
|
||||
if (webView != null) {
|
||||
//加载null内容
|
||||
webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null);
|
||||
//清除历史记录
|
||||
webView.clearHistory();
|
||||
//移除WebView
|
||||
// ((ViewGroup) webView.getParent()).removeView(webView);
|
||||
//销毁VebView
|
||||
webView.destroy();
|
||||
}
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
if (notifyApply == 0 || notifyApply == 1) {
|
||||
checkNotify();
|
||||
}
|
||||
getNotifyList();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取状态栏高度
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public int getStatusBarHeight() {
|
||||
int result = 0;
|
||||
//获取状态栏高度的资源id
|
||||
int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
|
||||
if (resourceId > 0) {
|
||||
result = getResources().getDimensionPixelSize(resourceId);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
//wp-caption alignnone
|
||||
|
||||
|
||||
}
|
||||
568
Dmcslot/src/main/java/com/web/dmcslot/MainActivity3.java
Normal file
@@ -0,0 +1,568 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.app.DownloadManager;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.webkit.DownloadListener;
|
||||
import android.webkit.ValueCallback;
|
||||
import com.just.agentweb.WebChromeClient;
|
||||
import android.webkit.WebResourceError;
|
||||
import android.webkit.WebResourceRequest;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
import com.just.agentweb.WebViewClient;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
import com.just.agentweb.AgentWeb;
|
||||
//import com.tencent.smtt.export.external.interfaces.WebResourceRequest;
|
||||
//import com.tencent.smtt.sdk.DownloadListener;
|
||||
//import com.tencent.smtt.sdk.URLUtil;
|
||||
//import com.tencent.smtt.sdk.ValueCallback;
|
||||
//import com.tencent.smtt.sdk.WebChromeClient;
|
||||
//import com.tencent.smtt.sdk.WebSettings;
|
||||
//import com.tencent.smtt.sdk.WebView;
|
||||
//import com.tencent.smtt.sdk.WebViewClient;
|
||||
|
||||
|
||||
public class MainActivity3 extends AppCompatActivity {
|
||||
LinearLayout webView;
|
||||
ImageView show_top_v;
|
||||
ImageView menu_iv;
|
||||
private ImageView helpIv;
|
||||
private LinearLayout showTopLy;
|
||||
|
||||
String downloadImageUrl = "";
|
||||
private int requestCode;
|
||||
private String[] permissions;
|
||||
private int[] grantResults;
|
||||
private View topVvvv;
|
||||
private int index = 0;
|
||||
private FrameLayout videoContainer;
|
||||
|
||||
private ImageView backIv;
|
||||
private ProgressBar progressBar;
|
||||
|
||||
AgentWeb mAgentWeb;
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
||||
getWindow().setNavigationBarColor(getColor(R.color.white));
|
||||
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
|
||||
|
||||
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();
|
||||
}
|
||||
setContentView(R.layout.activity_main3);
|
||||
initView();
|
||||
// setopHeight();
|
||||
findViewById(R.id.back_iv).setOnClickListener(view -> onBackPressed());
|
||||
}
|
||||
|
||||
public void hideStatusBar(Activity activity) {
|
||||
if (activity == null) return;
|
||||
Window window = activity.getWindow();
|
||||
if (window == null) return;
|
||||
window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
|
||||
WindowManager.LayoutParams lp = window.getAttributes();
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
lp.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
|
||||
}
|
||||
window.setAttributes(lp);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
|
||||
// if (mAgentWeb.canGoBack()) {//当webview有多级能返回的时候
|
||||
// // 在首页 就退出这个页面
|
||||
// if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) {
|
||||
//
|
||||
// Intent intent = new Intent(this, MainActivity.class);
|
||||
// startActivity(intent);
|
||||
// super.onBackPressed();
|
||||
// } else { //不在首页 回到首页
|
||||
// if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) {
|
||||
// isAtGame = false;
|
||||
// }
|
||||
// topVvvv.setVisibility(View.GONE);
|
||||
// progressBar.setVisibility(View.VISIBLE);
|
||||
// webView.loadUrl(url);
|
||||
// }
|
||||
// } else {//不能返回了
|
||||
//
|
||||
// //返回计算器
|
||||
// Intent intent = new Intent(this, MainActivity.class);
|
||||
// startActivity(intent);
|
||||
//// }
|
||||
super.onBackPressed();
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改图标和名称的方法
|
||||
*/
|
||||
public void changeIcon() {
|
||||
PackageManager pm = getApplicationContext().getPackageManager();
|
||||
|
||||
pm.setComponentEnabledSetting(new ComponentName(
|
||||
this,
|
||||
"com.web.dmcslot.MainActivity"),
|
||||
PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
|
||||
PackageManager.DONT_KILL_APP);
|
||||
Log.d("TAG", "换Test的图标");
|
||||
|
||||
pm.setComponentEnabledSetting(new ComponentName(
|
||||
this,
|
||||
"com.web.dmcslot.MainActivityNew"),
|
||||
PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
|
||||
PackageManager.DONT_KILL_APP);
|
||||
|
||||
}
|
||||
|
||||
private void setopHeight() {
|
||||
RelativeLayout.LayoutParams linearParams = (RelativeLayout.LayoutParams) topVvvv.getLayoutParams(); //取控件textView当前的布局参数
|
||||
linearParams.height = getStatusBarHeight();// 控件的宽强制设成30
|
||||
|
||||
topVvvv.setLayoutParams(linearParams);
|
||||
}
|
||||
|
||||
//https://m.xiannvtu.com/
|
||||
public static String url = "http://winway33.com/";
|
||||
|
||||
// https://telegram.2ltop.com/url.json?rand=111111111
|
||||
//先定义
|
||||
private static final int REQUEST_EXTERNAL_STORAGE = 1;
|
||||
|
||||
private static String[] PERMISSIONS_STORAGE = {
|
||||
"android.permission.READ_EXTERNAL_STORAGE",
|
||||
"android.permission.WRITE_EXTERNAL_STORAGE"};
|
||||
|
||||
//然后通过一个函数来申请
|
||||
public static void verifyStoragePermissions(Activity activity) {
|
||||
|
||||
// 没有写的权限,去申请写的权限,会弹出对话框
|
||||
ActivityCompat.requestPermissions(activity, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@SuppressLint({"NewApi", "WrongConstant"})
|
||||
protected void initView() {
|
||||
topVvvv = (View) findViewById(R.id.top_vvvv);
|
||||
webView = findViewById(R.id.webview);
|
||||
show_top_v = findViewById(R.id.show_top_v);
|
||||
showTopLy = findViewById(R.id.show_top_ly);
|
||||
videoContainer = (FrameLayout) findViewById(R.id.videoContainer);
|
||||
// topVvvvf = (RelativeLayout) findViewById(R.id.top_vvvvf);
|
||||
// topVvvv1 = (StatusLayout) findViewById(R.id.top_vvvv1);
|
||||
backIv = (ImageView) findViewById(R.id.back_iv);
|
||||
progressBar = (ProgressBar) findViewById(R.id.progressbar);
|
||||
|
||||
// WebSettings settings = webView.getSettings();
|
||||
// settings.setDomStorageEnabled(true);
|
||||
// settings.setAppCacheEnabled(true);
|
||||
// settings.setCacheMode(WebSettings.LOAD_DEFAULT);
|
||||
// settings.setJavaScriptEnabled(true);
|
||||
// settings.setLoadWithOverviewMode(true);
|
||||
// // 设置允许访问文件数据
|
||||
// settings.setAllowFileAccess(true);
|
||||
// settings.setAllowContentAccess(true);
|
||||
// settings.setDatabaseEnabled(true);
|
||||
// settings.setSavePassword(false);
|
||||
// settings.setSaveFormData(false);
|
||||
// settings.setUseWideViewPort(true);
|
||||
// settings.setBuiltInZoomControls(true);
|
||||
// settings.setPluginState(WebSettings.PluginState.ON);
|
||||
// settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS);
|
||||
// webView.setFocusable(true);
|
||||
// webView.setFocusableInTouchMode(true);
|
||||
// webView.getSettings().setSupportMultipleWindows(true);
|
||||
//
|
||||
// settings.setSupportZoom(false);
|
||||
// webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
|
||||
//// webView.setHorizontalScrollbarOverlay(true);
|
||||
// webView.setHorizontalScrollBarEnabled(true);
|
||||
// webView.requestFocus();
|
||||
//// webView.setBackgroundColor(getColor(R.color.black));
|
||||
// settings.setJavaScriptCanOpenWindowsAutomatically(true);
|
||||
//
|
||||
// // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件
|
||||
// // Android 4.1前默认允许,4.1后默认禁止
|
||||
// settings.setAllowFileAccessFromFileURLs(true);
|
||||
// // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源)
|
||||
// // Android 4.1前默认允许,4.1后默认禁止
|
||||
// settings.setAllowUniversalAccessFromFileURLs(true);
|
||||
//
|
||||
//
|
||||
// webView.setWebChromeClient(webChromeClient);
|
||||
// webView.setWebViewClient(webViewClient);
|
||||
// Log.i("XHXDEBUG", "XHXDEBUGURL:::" + url);
|
||||
//
|
||||
//// new Handler().postDelayed(() -> showTopLy.setVisibility(View.GONE), 3000);
|
||||
//// verifyStoragePermissions(this);
|
||||
//
|
||||
// webView.setDownloadListener(new DownloadListener() {
|
||||
// @Override
|
||||
// public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) {
|
||||
// LogUtils.i("URL是啥onDownloadStart:" + url);
|
||||
//
|
||||
// try {
|
||||
// Intent intent = new Intent();
|
||||
// intent.setAction(Intent.ACTION_VIEW);
|
||||
// intent.setData(Uri.parse(url));
|
||||
// startActivity(intent);
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// });
|
||||
getNetUrl();
|
||||
}
|
||||
public void getNetUrl(){
|
||||
// Api.getInstance().geUrl(System.currentTimeMillis())
|
||||
// .subscribeOn(Schedulers.io())
|
||||
// .observeOn(AndroidSchedulers.mainThread())
|
||||
// .subscribe(new BaseObserver<Result>() {
|
||||
// @Override
|
||||
// public void onSuccess(Result o) {
|
||||
// LogUtils.i("URL是啥获取的文件地址:"+o.url);
|
||||
// if(!TextUtils.isEmpty(o.url)){
|
||||
// MainActivity.saveString(MainActivity3.this,"base_url",o.url);
|
||||
// url = MainActivity.getString(MainActivity3.this, "base_url", url);
|
||||
// toUrl(url);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(int code, String msg) {
|
||||
// url = MainActivity.getString(MainActivity3.this, "base_url", url);
|
||||
// toUrl(url);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
private void toUrl(String url) {
|
||||
mAgentWeb = AgentWeb.with(this)
|
||||
.setAgentWebParent( webView, new LinearLayout.LayoutParams(-1, -1))
|
||||
.useDefaultIndicator()
|
||||
.setWebViewClient(webViewClient)
|
||||
.setWebChromeClient(webChromeClient)
|
||||
.createAgentWeb()
|
||||
|
||||
.ready()
|
||||
.go(url);
|
||||
|
||||
}
|
||||
|
||||
|
||||
WebViewClient webViewClient = new WebViewClient() {
|
||||
|
||||
@Override
|
||||
public void onPageFinished(WebView webView, String s) {
|
||||
super.onPageFinished(webView, s);
|
||||
LogUtils.i("URL是啥加载完成:" + webView.getUrl());
|
||||
|
||||
int w = View.MeasureSpec.makeMeasureSpec(0,
|
||||
View.MeasureSpec.UNSPECIFIED);
|
||||
int h = View.MeasureSpec.makeMeasureSpec(0,
|
||||
View.MeasureSpec.UNSPECIFIED);
|
||||
// 重新测量
|
||||
webView.measure(w, h);
|
||||
showTopLy.setVisibility(View.GONE);
|
||||
|
||||
if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) {
|
||||
isAtGame = false;
|
||||
topVvvv.setVisibility(View.GONE);
|
||||
|
||||
} else {
|
||||
if (isAtGame) {
|
||||
topVvvv.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
topVvvv.setVisibility(View.GONE);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// @Override
|
||||
// public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
|
||||
// super.onReceivedError(view, request, error);
|
||||
// if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
// int errorCode = error.getErrorCode();
|
||||
// String errorMessage = error.getDescription().toString();
|
||||
// Log.i("CustomWebViewClient", "onReceivedError errorCode : " + errorCode + " errorMessage : " + errorMessage);
|
||||
// }
|
||||
// progressBar.setVisibility(View.GONE);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
|
||||
super.onReceivedError(view, errorCode, description, failingUrl);
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
|
||||
Log.i("CustomWebViewClient", "onReceivedError errorCode : " + errorCode + " description : " + description);
|
||||
}
|
||||
progressBar.setVisibility(View.GONE);
|
||||
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public boolean shouldOverrideUrlLoading(WebView webView, String s) {
|
||||
// LogUtils.i("URL是啥:"+s);
|
||||
// return super.shouldOverrideUrlLoading(webView, s);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView webView, String url1) {
|
||||
|
||||
LogUtils.i("URL是啥:" + url1);
|
||||
if (url1.equals(url + "index") || url1.equals(url + "/index")) {
|
||||
isAtGame = false;
|
||||
topVvvv.setVisibility(View.GONE);
|
||||
}else{
|
||||
progressBar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
if (!(url1.startsWith("http") || url1.startsWith("https"))) {
|
||||
try {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(Intent.ACTION_VIEW);
|
||||
intent.setData(Uri.parse(url1));
|
||||
startActivity(intent);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
//其它的该怎么处理就怎么处理
|
||||
webView.loadUrl(url1);
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
boolean isAtGame = false;
|
||||
// String uuid = "", uuid1 = "";
|
||||
private static final int REQUEST_CODE_FILE_CHOOSER = 1;
|
||||
private ValueCallback<Uri> mUploadCallbackForLowApi;
|
||||
private ValueCallback<Uri[]> mUploadCallbackForHighApi;
|
||||
WebChromeClient webChromeClient = new WebChromeClient() {
|
||||
// @Override
|
||||
// public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) {
|
||||
// LogUtils.i("URL是啥onCreateWindow:" + webViewdd.getUrl());
|
||||
//
|
||||
// WebView newWebView = new WebView(MainActivity3.this);
|
||||
// newWebView.setWebViewClient(new WebViewClient() {
|
||||
// @Override
|
||||
// public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
// isAtGame = true;
|
||||
// mAgentWeb.getUrlLoader().loadUrl(url);
|
||||
// return true;
|
||||
// }
|
||||
// });
|
||||
// return true;
|
||||
// }
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) {
|
||||
return super.onCreateWindow(view, isDialog, isUserGesture, resultMsg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProgressChanged(WebView view, int newProgress) {
|
||||
super.onProgressChanged(view, newProgress);
|
||||
// 更新进度条的进度
|
||||
progressBar.setProgress(newProgress);
|
||||
// 如果加载完成,隐藏进度条
|
||||
if (newProgress == 100) {
|
||||
progressBar.setVisibility(View.GONE);
|
||||
} else {
|
||||
progressBar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.Q)
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
switch (requestCode) {
|
||||
case REQUEST_CODE_FILE_CHOOSER:
|
||||
if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) {
|
||||
afterFileChooseGoing(resultCode, data);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* onActivityResult方法
|
||||
*/
|
||||
|
||||
private void afterFileChooseGoing(int resultCode, Intent data) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
if (mUploadCallbackForHighApi == null) {
|
||||
return;
|
||||
}
|
||||
mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data));
|
||||
mUploadCallbackForHighApi = null;
|
||||
} else {
|
||||
if (mUploadCallbackForLowApi == null) {
|
||||
return;
|
||||
}
|
||||
Uri result = data == null ? null : data.getData();
|
||||
mUploadCallbackForLowApi.onReceiveValue(result);
|
||||
mUploadCallbackForLowApi = null;
|
||||
}
|
||||
}
|
||||
public class JavaScriptinterface {
|
||||
Context context;
|
||||
|
||||
public JavaScriptinterface(Context c) {
|
||||
context = c;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode,
|
||||
String permissions[], int[] grantResults) {
|
||||
switch (requestCode) {
|
||||
case REQUEST_EXTERNAL_STORAGE:
|
||||
if (grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED) {
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置网页中图片的点击事件
|
||||
*
|
||||
* @param view
|
||||
*/
|
||||
public static void setWebImageClick(WebView view, String method) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// @Override
|
||||
// public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
//
|
||||
// if (keyCode == KeyEvent.KEYCODE_BACK) {
|
||||
//
|
||||
// if (webView.canGoBack()) {
|
||||
// webView.goBack();
|
||||
// return true;
|
||||
// } else {
|
||||
// return super.onKeyDown(keyCode, event);
|
||||
//
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// return super.onKeyDown(keyCode, event);
|
||||
// }
|
||||
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
|
||||
if (webView != null) {
|
||||
//加载null内容
|
||||
// webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null);
|
||||
// //清除历史记录
|
||||
// webView.clearHistory();
|
||||
//移除WebView
|
||||
// ((ViewGroup) webView.getParent()).removeView(webView);
|
||||
//销毁VebView
|
||||
mAgentWeb.destroy();
|
||||
}
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取状态栏高度
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public int getStatusBarHeight() {
|
||||
int result = 0;
|
||||
//获取状态栏高度的资源id
|
||||
int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
|
||||
if (resourceId > 0) {
|
||||
result = getResources().getDimensionPixelSize(resourceId);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
//wp-caption alignnone
|
||||
|
||||
|
||||
}
|
||||
96
Dmcslot/src/main/java/com/web/dmcslot/MessageInfo.java
Normal file
@@ -0,0 +1,96 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class MessageInfo implements Serializable {
|
||||
private String title;
|
||||
private String content;
|
||||
private String image = "";
|
||||
private int type; // 1:文字 2:图片 3:链接跳转
|
||||
private int pushId;
|
||||
private String createTime;
|
||||
private int recordId;
|
||||
public int status;
|
||||
private String jumpUrl;
|
||||
private boolean isShowAll = false;
|
||||
|
||||
public String getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(String createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public int getRecordId() {
|
||||
return recordId;
|
||||
}
|
||||
|
||||
public void setRecordId(int recordId) {
|
||||
this.recordId = recordId;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public boolean isShowAll() {
|
||||
return isShowAll;
|
||||
}
|
||||
|
||||
public void setShowAll(boolean showAll) {
|
||||
isShowAll = showAll;
|
||||
}
|
||||
|
||||
public String getJumpUrl() {
|
||||
return jumpUrl;
|
||||
}
|
||||
|
||||
public void setJumpUrl(String jumpUrl) {
|
||||
this.jumpUrl = jumpUrl;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getPushId() {
|
||||
return pushId;
|
||||
}
|
||||
|
||||
public void setPushId(int pushId) {
|
||||
this.pushId = pushId;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getImage() {
|
||||
return image;
|
||||
}
|
||||
|
||||
public void setImage(String image) {
|
||||
this.image = image;
|
||||
}
|
||||
}
|
||||
74
Dmcslot/src/main/java/com/web/dmcslot/MyBankListAdapter.java
Normal file
@@ -0,0 +1,74 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class MyBankListAdapter extends RecyclerView.Adapter<MyBankListAdapter.ViewHolder> {
|
||||
|
||||
private List<BankInfo> listdata;
|
||||
private onItemClickPostionListener itemClickPostionListener;
|
||||
|
||||
public MyBankListAdapter(List<BankInfo> listdata) {
|
||||
this.listdata = listdata;
|
||||
}
|
||||
|
||||
public void setListdata(List<BankInfo> listdata) {
|
||||
this.listdata = listdata;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
|
||||
public void setOnItemClick(onItemClickPostionListener onItemClick) {
|
||||
this.itemClickPostionListener = onItemClick;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_invite_records, parent, false);
|
||||
return new ViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
holder.getTextView().setText(listdata.get(position).getBankName());
|
||||
|
||||
holder.itemView.setOnClickListener(view -> {
|
||||
if (itemClickPostionListener != null) {
|
||||
itemClickPostionListener.item(position);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return listdata != null ? listdata.size() : 0;
|
||||
}
|
||||
|
||||
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
private final TextView textView;
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
textView = itemView.findViewById(R.id.tv_invitecode);
|
||||
}
|
||||
|
||||
public TextView getTextView() {
|
||||
return textView;
|
||||
}
|
||||
}
|
||||
|
||||
public interface onItemClickPostionListener {
|
||||
void item(int position);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,174 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.ComponentName;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.text.TextUtils;
|
||||
|
||||
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 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);
|
||||
// if (remoteMessage.getNotification() != null) {
|
||||
// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
// }
|
||||
} else {
|
||||
//收到通知 创建notify
|
||||
if (remoteMessage.getNotification() != null) {
|
||||
showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void showNotification(MessageInfo messageInfo) {
|
||||
Intent notifyIntent = new Intent(this, MainActivity2.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);
|
||||
|
||||
// Intent notifyIntent = new Intent(this, MainActivity2.class);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
// // notifyIntent.putExtra("message", messageInfo);
|
||||
// notifyIntent.setAction(Intent.ACTION_VIEW);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须
|
||||
// PendingIntent pendingIntent;
|
||||
// pendingIntent = PendingIntent.getActivity
|
||||
// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | 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, MainActivity2.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());
|
||||
//存储数据
|
||||
// saveNotifyMessage(body);
|
||||
}
|
||||
|
||||
|
||||
// public void saveNotifyMessage(String body) {
|
||||
// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class);
|
||||
// String savenotify = Utils.get(getApplication(),ApiService.savenotify,"");
|
||||
// if(messageInfo!=null){
|
||||
// if(TextUtils.isEmpty(savenotify)){
|
||||
// GsonUtils.getListFromJSON(savenotify,)
|
||||
// }
|
||||
// }
|
||||
// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @param key 要设置的key
|
||||
// */
|
||||
// public static void set(Context activity, String key, String is) {
|
||||
// SharedPreferences nameSetting = getConfigShared(activity);
|
||||
// SharedPreferences.Editor namePref = nameSetting.edit();
|
||||
// namePref.putString(key, is);
|
||||
// namePref.commit();
|
||||
// }
|
||||
}
|
||||
75
Dmcslot/src/main/java/com/web/dmcslot/MyListAdapter.java
Normal file
@@ -0,0 +1,75 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class MyListAdapter extends RecyclerView.Adapter<MyListAdapter.ViewHolder> {
|
||||
|
||||
|
||||
private List<String> listdata;
|
||||
private onItemClickPostionListener itemClickPostionListener;
|
||||
|
||||
|
||||
public MyListAdapter(List<String> listdata) {
|
||||
this.listdata = listdata;
|
||||
}
|
||||
|
||||
public void setListdata(List<String> listdata) {
|
||||
this.listdata = listdata;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void setOnItemClick(onItemClickPostionListener onItemClick) {
|
||||
this.itemClickPostionListener = onItemClick;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_invite_records, parent, false);
|
||||
return new ViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
holder.getTextView().setText(listdata.get(position));
|
||||
holder.itemView.setOnClickListener(view -> {
|
||||
if (itemClickPostionListener != null) {
|
||||
itemClickPostionListener.item(position);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return listdata != null ? listdata.size() : 0;
|
||||
}
|
||||
|
||||
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
private final TextView textView;
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
textView = itemView.findViewById(R.id.tv_invitecode);
|
||||
}
|
||||
|
||||
public TextView getTextView() {
|
||||
return textView;
|
||||
}
|
||||
}
|
||||
|
||||
public interface onItemClickPostionListener {
|
||||
void item(int position);
|
||||
}
|
||||
}
|
||||
154
Dmcslot/src/main/java/com/web/dmcslot/MyNotifyListAdapter.java
Normal file
@@ -0,0 +1,154 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 通知列表适配器
|
||||
*/
|
||||
public class MyNotifyListAdapter extends RecyclerView.Adapter<MyNotifyListAdapter.ViewHolder> {
|
||||
|
||||
private List<MessageInfo> listdata;
|
||||
private onItemClickPostionListener itemClickPostionListener;
|
||||
private Context context;
|
||||
private MessageInfo messageItem;
|
||||
|
||||
|
||||
public MyNotifyListAdapter(Context context, List<MessageInfo> listdata, MessageInfo messageItem) {
|
||||
this.context = context;
|
||||
this.listdata = listdata;
|
||||
this.messageItem = messageItem;
|
||||
}
|
||||
|
||||
public void setListdata(List<MessageInfo> listdata) {
|
||||
this.listdata = listdata;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
|
||||
public void setOnItemClick(onItemClickPostionListener onItemClick) {
|
||||
this.itemClickPostionListener = onItemClick;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_notify_list, parent, false);
|
||||
return new ViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
|
||||
// holder.itemView.setOnClickListener(view -> {
|
||||
// if (itemClickPostionListener != null) {
|
||||
// itemClickPostionListener.item(position);
|
||||
// }
|
||||
// });
|
||||
|
||||
MessageInfo messageInfo = listdata.get(position);
|
||||
if (messageItem != null && messageInfo.getRecordId() == messageItem.getPushId()) {
|
||||
messageInfo.setShowAll(true);
|
||||
messageItem = null;
|
||||
}
|
||||
int type = messageInfo.getType();
|
||||
if (type == 1) {
|
||||
holder.root.setBackgroundColor(context.getColor(R.color.notify_textcolor));
|
||||
holder.tvType.setText("Text");
|
||||
}
|
||||
if (type == 2) {
|
||||
holder.root.setBackgroundColor(context.getColor(R.color.notify_imagecolor));
|
||||
holder.tvType.setText("Image");
|
||||
}
|
||||
if (type == 3) {
|
||||
holder.root.setBackgroundColor(context.getColor(R.color.notify_jumplinkcolor));
|
||||
holder.tvType.setText("Jump link");
|
||||
}
|
||||
holder.tvTitle.setText(messageInfo.getTitle());
|
||||
holder.layoutMore.setVisibility(View.GONE);
|
||||
holder.tvContent.setText(messageInfo.getContent());
|
||||
holder.ivMsg.setVisibility(View.GONE);
|
||||
holder.tvTime.setText(messageInfo.getCreateTime());
|
||||
holder.tvJumpLink.setVisibility(View.GONE);
|
||||
if (!TextUtils.isEmpty(messageInfo.getImage())) {
|
||||
holder.ivMsg.setVisibility(View.VISIBLE);
|
||||
Glide.with(context).load(messageInfo.getImage()).into(holder.ivMsg);
|
||||
}
|
||||
if (!TextUtils.isEmpty(messageInfo.getJumpUrl())) {
|
||||
holder.tvJumpLink.setVisibility(View.VISIBLE);
|
||||
holder.tvJumpLink.setText(messageInfo.getJumpUrl());
|
||||
holder.tvJumpLink.setOnClickListener(view -> {
|
||||
if (itemClickPostionListener != null) {
|
||||
itemClickPostionListener.item(position);
|
||||
}
|
||||
});
|
||||
}
|
||||
if (messageInfo.isShowAll()) {
|
||||
holder.ivNotifyPull.setBackgroundResource(R.mipmap.ic_notify_shangla);
|
||||
holder.layoutMore.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
holder.ivNotifyPull.setBackgroundResource(R.mipmap.ic_notify_xiala);
|
||||
holder.layoutMore.setVisibility(View.GONE);
|
||||
}
|
||||
holder.itemView.setOnClickListener(view -> {
|
||||
messageInfo.setShowAll(!messageInfo.isShowAll());
|
||||
notifyItemChanged(position);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return listdata != null ? listdata.size() : 0;
|
||||
}
|
||||
|
||||
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
|
||||
private final TextView tvType;
|
||||
private final TextView tvTime;
|
||||
private final TextView tvContent;
|
||||
private final TextView tvTitle;
|
||||
private final TextView tvJumpLink;
|
||||
private final ImageView ivType;
|
||||
private final ImageView ivNotifyPull;
|
||||
private final ImageView ivMsg;
|
||||
private ConstraintLayout root;
|
||||
private LinearLayout layoutMore;
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
root = itemView.findViewById(R.id.big_bg);
|
||||
// tvType = itemView.findViewById(R.id.iv_readtype);
|
||||
tvType = itemView.findViewById(R.id.tv_msg_type);
|
||||
ivType = itemView.findViewById(R.id.iv_icon);
|
||||
ivNotifyPull = itemView.findViewById(R.id.ic_notify_pull);
|
||||
ivMsg = itemView.findViewById(R.id.iv_notifyimage);
|
||||
tvContent = itemView.findViewById(R.id.iv_notifycontent);
|
||||
tvTitle = itemView.findViewById(R.id.tv_msg_title);
|
||||
tvTime = itemView.findViewById(R.id.tv_msg_time);
|
||||
tvJumpLink = itemView.findViewById(R.id.iv_notifyjumpclick);
|
||||
layoutMore = itemView.findViewById(R.id.layout_more);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public interface onItemClickPostionListener {
|
||||
void item(int position);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 提现记录
|
||||
*/
|
||||
public class MyWithDrwaListAdapter extends RecyclerView.Adapter<MyWithDrwaListAdapter.ViewHolder> {
|
||||
|
||||
|
||||
private List<WithDrawListInfo.WithDrawInfo> listdata;
|
||||
private Context context;
|
||||
|
||||
public MyWithDrwaListAdapter(Context context, List<WithDrawListInfo.WithDrawInfo> listdata) {
|
||||
this.context = context;
|
||||
this.listdata = listdata;
|
||||
}
|
||||
|
||||
public void setListdata(List<WithDrawListInfo.WithDrawInfo> listdata) {
|
||||
this.listdata = listdata;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_withdraw_records, parent, false);
|
||||
return new ViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
WithDrawListInfo.WithDrawInfo withDrawInfo = listdata.get(position);
|
||||
holder.tvWithDrawName.setText(withDrawInfo.getName() + "(" + withDrawInfo.getBankName() + ")");
|
||||
holder.tvWithDrawAmount.setText(String.format(context.getString(R.string.app_withdraw_amount), withDrawInfo.getAmount()));
|
||||
holder.tvWithDrawBalance.setText(String.format(context.getString(R.string.app_balance), withDrawInfo.getBalance()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return listdata != null ? listdata.size() : 0;
|
||||
}
|
||||
|
||||
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
private TextView tvWithDrawName;
|
||||
private TextView tvWithDrawAmount;
|
||||
private TextView tvWithDrawBalance;
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
tvWithDrawName = itemView.findViewById(R.id.tv_withdrawname);
|
||||
tvWithDrawAmount = itemView.findViewById(R.id.tv_withdrawamount);
|
||||
tvWithDrawBalance = itemView.findViewById(R.id.tv_withdrawbalance);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
386
Dmcslot/src/main/java/com/web/dmcslot/NotifyDetailsActivity.java
Normal file
@@ -0,0 +1,386 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.tencent.smtt.export.external.interfaces.PermissionRequest;
|
||||
import com.tencent.smtt.export.external.interfaces.WebResourceRequest;
|
||||
import com.tencent.smtt.sdk.DownloadListener;
|
||||
import com.tencent.smtt.sdk.ValueCallback;
|
||||
import com.tencent.smtt.sdk.WebChromeClient;
|
||||
import com.tencent.smtt.sdk.WebSettings;
|
||||
import com.tencent.smtt.sdk.WebView;
|
||||
import com.tencent.smtt.sdk.WebViewClient;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
//通知详情
|
||||
public class NotifyDetailsActivity extends AppCompatActivity {
|
||||
|
||||
|
||||
WebView webView;
|
||||
private LinearLayout showTopLy;
|
||||
private ImageView backIv;
|
||||
private ImageView contentIv;
|
||||
|
||||
public static String url = "https://vv88.io/";
|
||||
private static String[] PERMISSIONS_STORAGE = {
|
||||
"android.permission.READ_EXTERNAL_STORAGE",
|
||||
"android.permission.WRITE_EXTERNAL_STORAGE"};
|
||||
|
||||
private static String[] PERMISSIONS_CAMERA = {
|
||||
Manifest.permission.CAMERA};
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
getWindow().setNavigationBarColor(getColor(R.color.white));
|
||||
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
|
||||
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();
|
||||
}
|
||||
setContentView(R.layout.activity_notifydetails);
|
||||
initView();
|
||||
MessageInfo messageInfo = (MessageInfo) getIntent().getSerializableExtra("message");
|
||||
if (messageInfo != null) {
|
||||
recordNotify(messageInfo.getPushId());
|
||||
if (messageInfo.getType() == 3) {
|
||||
webView.setVisibility(View.VISIBLE);
|
||||
webView.loadUrl(messageInfo.getJumpUrl());
|
||||
}
|
||||
if (messageInfo.getType() == 2) {
|
||||
contentIv.setVisibility(View.VISIBLE);
|
||||
Glide.with(NotifyDetailsActivity.this).load(messageInfo.getImage()).into(contentIv);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void recordNotify(int pushId) {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("pushId", pushId);
|
||||
Api.getInstance().totalNotify(map)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver<Result>() {
|
||||
@Override
|
||||
public void onSuccess(Result o) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError2(Result o) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressLint({"NewApi", "WrongConstant"})
|
||||
protected void initView() {
|
||||
webView = findViewById(R.id.webview);
|
||||
showTopLy = findViewById(R.id.show_top_ly);
|
||||
backIv = (ImageView) findViewById(R.id.back_iv);
|
||||
contentIv = findViewById(R.id.image);
|
||||
WebSettings settings = webView.getSettings();
|
||||
settings.setDomStorageEnabled(true);
|
||||
settings.setAppCacheEnabled(true);
|
||||
settings.setCacheMode(WebSettings.LOAD_DEFAULT);
|
||||
settings.setJavaScriptEnabled(true);
|
||||
settings.setLoadWithOverviewMode(true);
|
||||
// 设置允许访问文件数据
|
||||
settings.setAllowFileAccess(true);
|
||||
settings.setAllowContentAccess(true);
|
||||
settings.setDatabaseEnabled(true);
|
||||
settings.setSavePassword(false);
|
||||
settings.setSaveFormData(false);
|
||||
settings.setUseWideViewPort(true);
|
||||
settings.setBuiltInZoomControls(true);
|
||||
settings.setPluginState(WebSettings.PluginState.ON);
|
||||
settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS);
|
||||
webView.setFocusable(true);
|
||||
webView.setFocusableInTouchMode(true);
|
||||
webView.getSettings().setSupportMultipleWindows(true);
|
||||
|
||||
settings.setSupportZoom(true);
|
||||
webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
|
||||
// webView.setHorizontalScrollbarOverlay(true);
|
||||
webView.setHorizontalScrollBarEnabled(true);
|
||||
webView.requestFocus();
|
||||
// webView.setBackgroundColor(getColor(R.color.black));
|
||||
settings.setJavaScriptCanOpenWindowsAutomatically(true);
|
||||
settings.setMediaPlaybackRequiresUserGesture(false);
|
||||
// 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件
|
||||
// Android 4.1前默认允许,4.1后默认禁止
|
||||
settings.setAllowFileAccessFromFileURLs(true);
|
||||
// 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源)
|
||||
// Android 4.1前默认允许,4.1后默认禁止
|
||||
settings.setAllowUniversalAccessFromFileURLs(true);
|
||||
|
||||
webView.setWebChromeClient(webChromeClient);
|
||||
webView.setWebViewClient(new WebViewClient() {
|
||||
|
||||
@Override
|
||||
public void onPageFinished(WebView webView, String s) {
|
||||
super.onPageFinished(webView, s);
|
||||
showTopLy.setVisibility(View.GONE);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) {
|
||||
Uri uri;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
uri = webResourceRequest.getUrl();
|
||||
} else {
|
||||
uri = Uri.parse(webResourceRequest.toString());
|
||||
}
|
||||
String url1 = uri.toString();
|
||||
|
||||
if (!(url1.startsWith("http") || url1.startsWith("https"))) {
|
||||
try {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(Intent.ACTION_VIEW);
|
||||
intent.setData(Uri.parse(url1));
|
||||
startActivity(intent);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
//其它的该怎么处理就怎么处理
|
||||
webView.loadUrl(url1);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView webView, String url1) {
|
||||
LogUtils.i("URL是啥:" + url1);
|
||||
|
||||
if (!(url1.startsWith("http") || url1.startsWith("https"))) {
|
||||
try {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(Intent.ACTION_VIEW);
|
||||
intent.setData(Uri.parse(url1));
|
||||
startActivity(intent);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
//其它的该怎么处理就怎么处理
|
||||
webView.loadUrl(url1);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
// new Handler().postDelayed(() -> showTopLy.setVisibility(View.GONE), 3000);
|
||||
// verifyStoragePermissions(this);
|
||||
|
||||
webView.setDownloadListener(new DownloadListener() {
|
||||
@Override
|
||||
public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) {
|
||||
LogUtils.i("URL是啥onDownloadStart:" + url);
|
||||
|
||||
try {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(Intent.ACTION_VIEW);
|
||||
intent.setData(Uri.parse(url));
|
||||
startActivity(intent);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
backIv.setOnClickListener(view -> finish());
|
||||
|
||||
}
|
||||
|
||||
private static final int REQUEST_CODE_FILE_CHOOSER = 1;
|
||||
private ValueCallback<Uri> mUploadCallbackForLowApi;
|
||||
private ValueCallback<Uri[]> mUploadCallbackForHighApi;
|
||||
WebChromeClient webChromeClient = new WebChromeClient() {
|
||||
@Override
|
||||
public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) {
|
||||
LogUtils.i("URL是啥onCreateWindow:" + webView.getUrl());
|
||||
// WebView newWebView = new WebView(MainActivity2.this);
|
||||
// topVvvv.setVisibility(View.VISIBLE);
|
||||
// webView.addView(newWebView);
|
||||
// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;
|
||||
// transport.setWebView(newWebView);
|
||||
// resultMsg.sendToTarget();
|
||||
//
|
||||
// newWebView.setWebViewClient(new WebViewClient() {
|
||||
// @Override
|
||||
// public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
// isAtGame = true;
|
||||
// webView.loadUrl(url);
|
||||
// return false;
|
||||
// }
|
||||
// });
|
||||
|
||||
WebView newWebView = new WebView(webViewdd.getContext());
|
||||
newWebView.setWebViewClient(new WebViewClient() {
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
if (!(url.startsWith("http") || url.startsWith("https"))) {
|
||||
try {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(Intent.ACTION_VIEW);
|
||||
intent.setData(Uri.parse(url));
|
||||
startActivity(intent);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
Intent browserIntent = new Intent(NotifyDetailsActivity.this, WebViewActivity.class);
|
||||
browserIntent.putExtra("url", url);
|
||||
startActivity(browserIntent);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;
|
||||
transport.setWebView(newWebView);
|
||||
resultMsg.sendToTarget();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCloseWindow(WebView window) {
|
||||
super.onCloseWindow(window);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProgressChanged(WebView view, int newProgress) {
|
||||
super.onProgressChanged(view, newProgress);
|
||||
// 更新进度条的进度
|
||||
|
||||
}
|
||||
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
@Override
|
||||
public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathCallback, FileChooserParams fileChooserParams) {
|
||||
LogUtils.i("数据接口:onShowFileChooser");
|
||||
mUploadCallbackForHighApi = filePathCallback;
|
||||
Intent intent = fileChooserParams.createIntent();
|
||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
try {
|
||||
startActivityForResult(intent, REQUEST_CODE_FILE_CHOOSER);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
// mUploadCallbackForHighApi = null;
|
||||
// WidgetUtils.showToast(JsBridgeActivity.this, "未知错误", WidgetUtils.ToastType.ERROR);
|
||||
// Toast.makeText(MainActivity2.this, "未知错误", Toast.LENGTH_SHORT).show();
|
||||
startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER);
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// For 3.0+
|
||||
protected void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType) {
|
||||
LogUtils.i("数据接口:openFileChooseracceptType");
|
||||
|
||||
openFilerChooser(uploadMsg);
|
||||
}
|
||||
|
||||
|
||||
private void openFilerChooser(ValueCallback<Uri> uploadMsg) {
|
||||
LogUtils.i("数据接口:openFileChooser");
|
||||
|
||||
mUploadCallbackForLowApi = uploadMsg;
|
||||
startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER);
|
||||
}
|
||||
|
||||
|
||||
private Intent getFilerChooserIntent() {
|
||||
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
|
||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
return intent;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onPermissionRequest(PermissionRequest request) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
NotifyDetailsActivity.this.runOnUiThread(new Runnable() {
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
@Override
|
||||
public void run() {
|
||||
for (String permisson : request.getResources()) {
|
||||
permissionRequest = request;
|
||||
if (permisson.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) {
|
||||
if (ContextCompat.checkSelfPermission(NotifyDetailsActivity.this, Manifest.permission.CAMERA) != 0) {
|
||||
ActivityCompat.requestPermissions(NotifyDetailsActivity.this, PERMISSIONS_CAMERA, 1111);
|
||||
} else {
|
||||
request.grant(request.getResources());
|
||||
request.getOrigin();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
private PermissionRequest permissionRequest;
|
||||
|
||||
}
|
||||
129
Dmcslot/src/main/java/com/web/dmcslot/NotifyListActivity.java
Normal file
@@ -0,0 +1,129 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
* 通知列表
|
||||
*/
|
||||
public class NotifyListActivity extends AppCompatActivity {
|
||||
|
||||
private RecyclerView recyclerView;
|
||||
private LinearLayoutManager manager;
|
||||
private MyNotifyListAdapter adapter;
|
||||
private List<MessageInfo> listdata = new ArrayList<>();
|
||||
private int userId = 2;
|
||||
private int page = 1;
|
||||
private boolean isNextPages = false;
|
||||
|
||||
private MessageInfo messageInfoItem;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
|
||||
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();
|
||||
}
|
||||
setContentView(R.layout.activity_notifylist);
|
||||
messageInfoItem = (MessageInfo) getIntent().getSerializableExtra("message");
|
||||
findViewById(R.id.back_iv).setOnClickListener(view -> finish());
|
||||
recyclerView = findViewById(R.id.recycler_nofity);
|
||||
manager = new LinearLayoutManager(this);
|
||||
recyclerView.setLayoutManager(manager);
|
||||
recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
||||
|
||||
@Override
|
||||
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
|
||||
int visibleCount = manager.getChildCount();
|
||||
int totalCount = manager.getItemCount();
|
||||
int firstvisibleCount = manager.findFirstVisibleItemPosition();
|
||||
if (visibleCount > 0 && visibleCount + firstvisibleCount == totalCount) { //滑动到底部
|
||||
if (!isNextPages) {
|
||||
Toast.makeText(NotifyListActivity.this, getString(R.string.app_toastloading), Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
page++;
|
||||
getNotifyList();
|
||||
}
|
||||
// super.onScrolled(recyclerView, dx, dy);
|
||||
}
|
||||
});
|
||||
adapter = new MyNotifyListAdapter(NotifyListActivity.this, listdata,messageInfoItem);
|
||||
recyclerView.setAdapter(adapter);
|
||||
adapter.setOnItemClick(new MyNotifyListAdapter.onItemClickPostionListener() {
|
||||
@Override
|
||||
public void item(int position) {
|
||||
try{
|
||||
MessageInfo messageInfo = listdata.get(position);
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(messageInfo.getJumpUrl()));
|
||||
startActivity(intent);
|
||||
}catch (Exception e){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
getNotifyList();
|
||||
}
|
||||
|
||||
public void getNotifyList() {
|
||||
//通知列表
|
||||
Api.getInstance().getNotifyList(userId, page, 10)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver<Result<ResultDataInfo<MessageInfo>>>() {
|
||||
@Override
|
||||
public void onSuccess(Result<ResultDataInfo<MessageInfo>> o) {
|
||||
if(o.data!=null){
|
||||
isNextPages = o.data.isHasNextPage();
|
||||
if (page == 1) {
|
||||
listdata.clear();
|
||||
}
|
||||
listdata.addAll(o.data.getList());
|
||||
adapter.setListdata(listdata);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
LogUtils.i("获取的结果error" + msg);
|
||||
if (page > 1) {
|
||||
page--;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError2(Result<ResultDataInfo<MessageInfo>> o) {
|
||||
LogUtils.i("获取的结果error");
|
||||
if (page > 1) {
|
||||
page--;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
31
Dmcslot/src/main/java/com/web/dmcslot/Result.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.web.dmcslot.GsonUtils;
|
||||
|
||||
/**
|
||||
* created by wmm on 2020/9/8
|
||||
*/
|
||||
public class Result<T> implements Serializable {
|
||||
|
||||
public String error;
|
||||
public int code;
|
||||
public T data;
|
||||
public String message;
|
||||
|
||||
|
||||
public boolean isSuccessful() {
|
||||
return code == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Result{" +
|
||||
"message='" + error + '\'' +
|
||||
", code=" + code +
|
||||
", data=" + GsonUtils.beanToJSONString(data) +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
45
Dmcslot/src/main/java/com/web/dmcslot/ResultDataInfo.java
Normal file
@@ -0,0 +1,45 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class ResultDataInfo<T> implements Serializable {
|
||||
|
||||
public List<T> list;
|
||||
public int pages;
|
||||
public int total;
|
||||
public boolean hasNextPage;
|
||||
|
||||
|
||||
public boolean isHasNextPage() {
|
||||
return hasNextPage;
|
||||
}
|
||||
|
||||
public void setHasNextPage(boolean hasNextPage) {
|
||||
this.hasNextPage = hasNextPage;
|
||||
}
|
||||
|
||||
public List<T> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<T> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
public int getPages() {
|
||||
return pages;
|
||||
}
|
||||
|
||||
public void setPages(int pages) {
|
||||
this.pages = pages;
|
||||
}
|
||||
|
||||
public int getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(int total) {
|
||||
this.total = total;
|
||||
}
|
||||
}
|
||||
233
Dmcslot/src/main/java/com/web/dmcslot/StartActivity.java
Normal file
@@ -0,0 +1,233 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
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 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 implements View.OnClickListener {
|
||||
|
||||
|
||||
private StringBuilder currentInput = new StringBuilder("");
|
||||
private BigDecimal currentAnswer = new BigDecimal(0);
|
||||
private boolean hasCount = false;
|
||||
private Button btn_0, btn_1, btn_2, btn_3, btn_4, btn_5, btn_6, btn_7, btn_8, btn_9, btn_equal;
|
||||
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();
|
||||
}
|
||||
setContentView(R.layout.activity_start);
|
||||
|
||||
setListener();
|
||||
getNetUrl();
|
||||
|
||||
}
|
||||
|
||||
public void setListener() {
|
||||
|
||||
|
||||
password1 = (TextView) findViewById(R.id.password_1);
|
||||
password2 = (TextView) findViewById(R.id.password_2);
|
||||
password3 = (TextView) findViewById(R.id.password_3);
|
||||
password4 = (TextView) findViewById(R.id.password_4);
|
||||
password5 = (TextView) findViewById(R.id.password_5);
|
||||
password6 = (TextView) findViewById(R.id.password_6);
|
||||
|
||||
|
||||
btn_0 = (Button) findViewById(R.id.btn_0);
|
||||
btn_0.setOnClickListener(this);
|
||||
btn_1 = (Button) findViewById(R.id.btn_1);
|
||||
btn_1.setOnClickListener(this);
|
||||
btn_2 = (Button) findViewById(R.id.btn_2);
|
||||
btn_2.setOnClickListener(this);
|
||||
btn_3 = (Button) findViewById(R.id.btn_3);
|
||||
btn_3.setOnClickListener(this);
|
||||
btn_4 = (Button) findViewById(R.id.btn_4);
|
||||
btn_4.setOnClickListener(this);
|
||||
btn_5 = (Button) findViewById(R.id.btn_5);
|
||||
btn_5.setOnClickListener(this);
|
||||
btn_6 = (Button) findViewById(R.id.btn_6);
|
||||
btn_6.setOnClickListener(this);
|
||||
btn_7 = (Button) findViewById(R.id.btn_7);
|
||||
btn_7.setOnClickListener(this);
|
||||
btn_8 = (Button) findViewById(R.id.btn_8);
|
||||
btn_8.setOnClickListener(this);
|
||||
btn_9 = (Button) findViewById(R.id.btn_9);
|
||||
btn_9.setOnClickListener(this);
|
||||
|
||||
btn_equal = (Button) findViewById(R.id.btn_equal);
|
||||
btn_equal.setOnClickListener(this);
|
||||
}
|
||||
|
||||
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("");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void getNetUrl(){
|
||||
// Api.getInstance().geUrl(System.currentTimeMillis())
|
||||
// .subscribeOn(Schedulers.io())
|
||||
// .observeOn(AndroidSchedulers.mainThread())
|
||||
// .subscribe(new BaseObserver<Result>() {
|
||||
// @Override
|
||||
// public void onSuccess(Result o) {
|
||||
// LogUtils.i("获取的文件地址:"+o.url);
|
||||
// if(!TextUtils.isEmpty(o.url)){
|
||||
// MainActivity.saveString(StartActivity.this,"base_url",o.url);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(int code, String msg) {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
Handler handler = new Handler();
|
||||
|
||||
private void toNext() {
|
||||
MainActivity.saveString(StartActivity.this, "loc_pass", password);
|
||||
Intent intent = new Intent(StartActivity.this, MainActivity2.class);
|
||||
// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.btn_0:
|
||||
addInput("0", 0);
|
||||
break;
|
||||
case R.id.btn_1:
|
||||
addInput("1", 0);
|
||||
break;
|
||||
case R.id.btn_2:
|
||||
addInput("2", 0);
|
||||
break;
|
||||
case R.id.btn_3:
|
||||
addInput("3", 0);
|
||||
break;
|
||||
case R.id.btn_4:
|
||||
addInput("4", 0);
|
||||
break;
|
||||
case R.id.btn_5:
|
||||
addInput("5", 0);
|
||||
break;
|
||||
case R.id.btn_6:
|
||||
addInput("6", 0);
|
||||
break;
|
||||
case R.id.btn_7:
|
||||
addInput("7", 0);
|
||||
break;
|
||||
case R.id.btn_8:
|
||||
addInput("8", 0);
|
||||
break;
|
||||
case R.id.btn_9:
|
||||
addInput("9", 0);
|
||||
break;
|
||||
|
||||
case R.id.btn_equal:
|
||||
deleteInput();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void deleteInput() {
|
||||
if (TextUtils.isEmpty(password)) {
|
||||
addInput("", 2);
|
||||
} else {
|
||||
addInput(password, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
}
|
||||
}
|
||||
44
Dmcslot/src/main/java/com/web/dmcslot/StatusLayout.java
Normal file
@@ -0,0 +1,44 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Created by kiun_2007 on 2018/3/29.
|
||||
*/
|
||||
|
||||
public class StatusLayout extends LinearLayout {
|
||||
public StatusLayout(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public StatusLayout(Context context, @Nullable AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public StatusLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
private int getStatusBarHeight(Context context) {
|
||||
int result = 0;
|
||||
int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
|
||||
if (resourceId > 0) {
|
||||
result = context.getResources().getDimensionPixelSize(resourceId);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onAttachedToWindow() {
|
||||
ViewGroup.LayoutParams lp = this.getLayoutParams();
|
||||
lp.width = -1;
|
||||
lp.height = getStatusBarHeight(getContext());
|
||||
this.setLayoutParams(lp);
|
||||
super.onAttachedToWindow();
|
||||
}
|
||||
}
|
||||
70
Dmcslot/src/main/java/com/web/dmcslot/Utils.java
Normal file
@@ -0,0 +1,70 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Build;
|
||||
import android.provider.Settings;
|
||||
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
public class Utils {
|
||||
|
||||
public static boolean isImageUrl(String url) {
|
||||
String end = url.substring(url.lastIndexOf(".") + 1).toLowerCase();
|
||||
String[] images = new String[]{"jpeg", "png", "jpg", "bmp", "webp", "gif"};
|
||||
for (String name : images) {
|
||||
if (end.equals(name)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public static String getUniqueId(Context context) {
|
||||
|
||||
@SuppressLint("HardwareIds")
|
||||
// ANDROID_ID是设备第一次启动时产生和存储的64bit的一个数,当设备被wipe后该数重置。
|
||||
String androidID = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
|
||||
// @SuppressLint("HardwareIds")
|
||||
// String id = androidID + Build.SERIAL; // +硬件序列号
|
||||
return androidID;
|
||||
|
||||
// try {
|
||||
// return toMD5(id);
|
||||
// } catch (NoSuchAlgorithmException e) {
|
||||
// e.printStackTrace();
|
||||
// return id;
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param @param key 要获取的key
|
||||
*/
|
||||
public static String get(Context context, String key, String defaultValue) {
|
||||
SharedPreferences nameSetting = getConfigShared(context);
|
||||
return nameSetting.getString(key, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param key 要设置的key
|
||||
*/
|
||||
public static void set(Context activity, String key, String is) {
|
||||
SharedPreferences nameSetting = getConfigShared(activity);
|
||||
SharedPreferences.Editor namePref = nameSetting.edit();
|
||||
namePref.putString(key, is);
|
||||
namePref.commit();
|
||||
}
|
||||
|
||||
public static SharedPreferences getConfigShared(Context context) {
|
||||
if (context == null) {
|
||||
context = WebApplication.application;
|
||||
}
|
||||
SharedPreferences sharedPreferences =
|
||||
context.getSharedPreferences("notify_data", Context.MODE_MULTI_PROCESS);
|
||||
return sharedPreferences;
|
||||
}
|
||||
|
||||
}
|
||||
37
Dmcslot/src/main/java/com/web/dmcslot/WebApplication.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
|
||||
import com.tencent.smtt.export.external.TbsCoreSettings;
|
||||
import com.tencent.smtt.sdk.QbSdk;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class WebApplication extends Application {
|
||||
|
||||
|
||||
public static Context application;
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
// 设置开启优化方案
|
||||
application = this;
|
||||
HashMap map = new HashMap();
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true);
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true);
|
||||
QbSdk.initTbsSettings(map);
|
||||
QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() {
|
||||
@Override
|
||||
public void onCoreInitFinished() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewInitFinished(boolean b) {
|
||||
|
||||
}
|
||||
});
|
||||
QbSdk.setDownloadWithoutWifi(true);
|
||||
}
|
||||
}
|
||||
340
Dmcslot/src/main/java/com/web/dmcslot/WebView2Activity.java
Normal file
@@ -0,0 +1,340 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.net.Uri;
|
||||
import android.net.http.SslError;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.tencent.smtt.export.external.interfaces.ConsoleMessage;
|
||||
import com.tencent.smtt.export.external.interfaces.WebResourceRequest;
|
||||
import com.tencent.smtt.sdk.ValueCallback;
|
||||
import com.tencent.smtt.sdk.WebChromeClient;
|
||||
import com.tencent.smtt.sdk.WebSettings;
|
||||
import com.tencent.smtt.sdk.WebView;
|
||||
import com.tencent.smtt.sdk.WebViewClient;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.Map;
|
||||
|
||||
import com.web.dmcslot.appdown.AppUpdater;
|
||||
import com.web.dmcslot.appdown.UpdateConfig;
|
||||
import com.web.dmcslot.appdown.constant.Constants;
|
||||
import com.web.dmcslot.appdown.util.AppUtils;
|
||||
import com.web.dmcslot.appdown.util.NotificationUtils;
|
||||
|
||||
public class WebView2Activity extends AppCompatActivity {
|
||||
|
||||
private String url;
|
||||
WebView webView;
|
||||
ImageView show_top_v;
|
||||
ImageView menu_iv;
|
||||
private ImageView helpIv;
|
||||
private LinearLayout showTopLy;
|
||||
private FrameLayout videoContainer;
|
||||
private ImageView backIv;
|
||||
private ProgressBar progressBar;
|
||||
private View topVvvv;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
getWindow().setNavigationBarColor(getColor(R.color.white));
|
||||
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
|
||||
|
||||
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();
|
||||
}
|
||||
setContentView(R.layout.activity_webview);
|
||||
findViewById(R.id.back_iv).setOnClickListener(view -> finish());
|
||||
url = getIntent().getStringExtra("url");
|
||||
initView();
|
||||
}
|
||||
|
||||
private ValueCallback<Uri[]> mUploadCallbackForHighApi;
|
||||
|
||||
public void initView() {
|
||||
topVvvv = (View) findViewById(R.id.top_vvvv);
|
||||
webView = findViewById(R.id.webview);
|
||||
show_top_v = findViewById(R.id.show_top_v);
|
||||
showTopLy = findViewById(R.id.show_top_ly);
|
||||
videoContainer = (FrameLayout) findViewById(R.id.videoContainer);
|
||||
backIv = (ImageView) findViewById(R.id.back_iv);
|
||||
progressBar = (ProgressBar) findViewById(R.id.progressbar);
|
||||
WebSettings settings = webView.getSettings();
|
||||
settings.setDomStorageEnabled(true);
|
||||
settings.setAppCacheEnabled(true);
|
||||
settings.setCacheMode(WebSettings.LOAD_DEFAULT);
|
||||
settings.setJavaScriptEnabled(true);
|
||||
settings.setLoadWithOverviewMode(true);
|
||||
// 设置允许访问文件数据
|
||||
settings.setAllowFileAccess(true);
|
||||
settings.setAllowContentAccess(true);
|
||||
settings.setDatabaseEnabled(true);
|
||||
settings.setSavePassword(false);
|
||||
settings.setSaveFormData(false);
|
||||
settings.setUseWideViewPort(true);
|
||||
settings.setBuiltInZoomControls(true);
|
||||
settings.setPluginState(WebSettings.PluginState.ON);
|
||||
settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS);
|
||||
webView.setFocusable(true);
|
||||
webView.setFocusableInTouchMode(true);
|
||||
webView.getSettings().setSupportMultipleWindows(true);
|
||||
|
||||
settings.setSupportZoom(false);
|
||||
webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
|
||||
// webView.setHorizontalScrollbarOverlay(true);
|
||||
webView.setHorizontalScrollBarEnabled(true);
|
||||
webView.requestFocus();
|
||||
// webView.setBackgroundColor(getColor(R.color.black));
|
||||
settings.setJavaScriptCanOpenWindowsAutomatically(false);
|
||||
settings.setMediaPlaybackRequiresUserGesture(false);
|
||||
|
||||
// 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件
|
||||
// Android 4.1前默认允许,4.1后默认禁止
|
||||
settings.setAllowFileAccessFromFileURLs(true);
|
||||
// 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源)
|
||||
// Android 4.1前默认允许,4.1后默认禁止
|
||||
settings.setAllowUniversalAccessFromFileURLs(true);
|
||||
|
||||
// settings.setBuiltInZoomControls(false); // 启用缩放功能
|
||||
// settings.setDisplayZoomControls(false); // 隐藏缩放控件
|
||||
|
||||
|
||||
webView.setWebChromeClient(new WebChromeClient() {
|
||||
@Override
|
||||
public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) {
|
||||
|
||||
WebView newWebView = new WebView(WebView2Activity.this);
|
||||
topVvvv.setVisibility(View.VISIBLE);
|
||||
webView.addView(newWebView);
|
||||
WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;
|
||||
transport.setWebView(newWebView);
|
||||
resultMsg.sendToTarget();
|
||||
|
||||
newWebView.setWebViewClient(new WebViewClient() {
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
// isAtGame = true;
|
||||
progressBar.setVisibility(View.GONE);
|
||||
webView.loadUrl(url);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
// WebView newWebView = new WebView(view.getContext());
|
||||
// newWebView.setWebViewClient(new WebViewClient() {
|
||||
// @Override
|
||||
// public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
// Intent browserIntent = new Intent(WebViewActivity.this, WebViewActivity.class);
|
||||
// browserIntent.putExtra("url", url);
|
||||
// startActivity(browserIntent);
|
||||
// return true;
|
||||
// }
|
||||
// });
|
||||
// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;
|
||||
// transport.setWebView(newWebView);
|
||||
// resultMsg.sendToTarget();
|
||||
// return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onCloseWindow(WebView window) {
|
||||
super.onCloseWindow(window);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
|
||||
LogUtils.d("consolemessage==" + consoleMessage.message());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onProgressChanged(WebView view, int newProgress) {
|
||||
super.onProgressChanged(view, newProgress);
|
||||
}
|
||||
});
|
||||
webView.setWebViewClient(new WebViewClient() {
|
||||
|
||||
|
||||
@Override
|
||||
public void onPageFinished(WebView view, String url) {
|
||||
super.onPageFinished(view, url);
|
||||
showTopLy.setVisibility(View.GONE);
|
||||
progressBar.setVisibility(View.GONE);
|
||||
topVvvv.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageStarted(WebView view, String url, Bitmap favicon) {
|
||||
super.onPageStarted(view, url, favicon);
|
||||
progressBar.setVisibility(View.VISIBLE);
|
||||
topVvvv.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
|
||||
|
||||
Uri uri;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
uri = request.getUrl();
|
||||
} else {
|
||||
uri = Uri.parse(request.toString());
|
||||
}
|
||||
String url1 = uri.toString();
|
||||
LogUtils.d("url1111111111==" + url1);
|
||||
if (url1.equals(url + "index") || url1.equals(url + "/index")) {
|
||||
topVvvv.setVisibility(View.GONE);
|
||||
} else {
|
||||
progressBar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
if (!(url1.startsWith("http") || url1.startsWith("https"))) {
|
||||
try {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(Intent.ACTION_VIEW);
|
||||
intent.setData(Uri.parse(url1));
|
||||
startActivity(intent);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
|
||||
if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) {
|
||||
return false;
|
||||
} else {
|
||||
if (url1.contains(".apk")) { //下载
|
||||
Toast.makeText(WebView2Activity.this, "下载开始,请稍后...", Toast.LENGTH_SHORT).show();
|
||||
Constants.isUpdate = false;
|
||||
new AppUpdater(WebView2Activity.this, url1).start();
|
||||
return false;
|
||||
}
|
||||
//其它的该怎么处理就怎么处理
|
||||
LogUtils.d("url1111111111==2" + url1);
|
||||
webView.loadUrl(url1);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url1) {
|
||||
if (url1.equals(url + "index") || url1.equals(url + "/index")) {
|
||||
topVvvv.setVisibility(View.GONE);
|
||||
} else {
|
||||
progressBar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
if (!(url1.startsWith("http") || url1.startsWith("https"))) {
|
||||
try {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(Intent.ACTION_VIEW);
|
||||
intent.setData(Uri.parse(url1));
|
||||
startActivity(intent);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
|
||||
if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) {
|
||||
return false;
|
||||
} else {
|
||||
if (url1.contains(".apk")) { //下载
|
||||
new AppUpdater(WebView2Activity.this, url1).start();
|
||||
return false;
|
||||
}
|
||||
//其它的该怎么处理就怎么处理
|
||||
webView.loadUrl(url1);
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
// webView.setOnTouchListener(new View.OnTouchListener() {
|
||||
// @Override
|
||||
// public boolean onTouch(View view, MotionEvent motionEvent) {
|
||||
// if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
// webView.loadUrl("javascript:_IntervalResize(+\" + view + \",false)");
|
||||
// return true;
|
||||
// } else {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
// webView.onWindowFocusChanged(true);
|
||||
// webView.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||
// @Override
|
||||
// public void onFocusChange(View view, boolean b) {
|
||||
// LogUtils.d("B==" + b);
|
||||
// view.invalidate();
|
||||
// }
|
||||
// });
|
||||
if (url != null) {
|
||||
webView.loadUrl(url);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if (webView.canGoBack()) {//当webview有多级能返回的时候
|
||||
webView.goBack();
|
||||
} else {//不能返回了
|
||||
WebView2Activity.this.finish();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
if (webView != null) {
|
||||
//加载null内容
|
||||
// webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null);
|
||||
//清除历史记录
|
||||
// webView.clearHistory();
|
||||
//移除WebView
|
||||
// ((ViewGroup) webView.getParent()).removeView(webView);
|
||||
//销毁VebView
|
||||
webView.destroy();
|
||||
}
|
||||
super.onDestroy();
|
||||
}
|
||||
}
|
||||
389
Dmcslot/src/main/java/com/web/dmcslot/WebViewActivity.java
Normal file
@@ -0,0 +1,389 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.net.Uri;
|
||||
import android.net.http.SslError;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.tencent.smtt.export.external.interfaces.ConsoleMessage;
|
||||
import com.tencent.smtt.export.external.interfaces.WebResourceError;
|
||||
import com.tencent.smtt.export.external.interfaces.WebResourceRequest;
|
||||
import com.tencent.smtt.sdk.ValueCallback;
|
||||
import com.tencent.smtt.sdk.WebChromeClient;
|
||||
import com.tencent.smtt.sdk.WebSettings;
|
||||
import com.tencent.smtt.sdk.WebView;
|
||||
import com.tencent.smtt.sdk.WebViewClient;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.Map;
|
||||
|
||||
import com.web.dmcslot.appdown.AppUpdater;
|
||||
import com.web.dmcslot.appdown.UpdateConfig;
|
||||
import com.web.dmcslot.appdown.constant.Constants;
|
||||
import com.web.dmcslot.appdown.util.AppUtils;
|
||||
import com.web.dmcslot.appdown.util.NotificationUtils;
|
||||
|
||||
public class WebViewActivity extends AppCompatActivity {
|
||||
|
||||
private String url;
|
||||
WebView webView;
|
||||
TextView tvErrorMsg;
|
||||
LinearLayout layoutError;
|
||||
ImageView show_top_v;
|
||||
ImageView menu_iv;
|
||||
private ImageView helpIv;
|
||||
private LinearLayout showTopLy;
|
||||
private FrameLayout videoContainer;
|
||||
private ImageView backIv;
|
||||
private ProgressBar progressBar;
|
||||
private View topVvvv;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
getWindow().setNavigationBarColor(getColor(R.color.white));
|
||||
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
|
||||
|
||||
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();
|
||||
}
|
||||
setContentView(R.layout.activity_main2);
|
||||
findViewById(R.id.back_iv).setOnClickListener(view -> finish());
|
||||
url = getIntent().getStringExtra("url");
|
||||
initView();
|
||||
}
|
||||
|
||||
private ValueCallback<Uri[]> mUploadCallbackForHighApi;
|
||||
|
||||
public void initView() {
|
||||
topVvvv = (View) findViewById(R.id.top_vvvv);
|
||||
webView = findViewById(R.id.webview);
|
||||
show_top_v = findViewById(R.id.show_top_v);
|
||||
showTopLy = findViewById(R.id.show_top_ly);
|
||||
tvErrorMsg = findViewById(R.id.errormsg);
|
||||
layoutError = findViewById(R.id.layoutError);
|
||||
videoContainer = (FrameLayout) findViewById(R.id.videoContainer);
|
||||
backIv = (ImageView) findViewById(R.id.back_iv);
|
||||
progressBar = (ProgressBar) findViewById(R.id.progressbar);
|
||||
WebSettings settings = webView.getSettings();
|
||||
settings.setDomStorageEnabled(true);
|
||||
settings.setAppCacheEnabled(true);
|
||||
settings.setCacheMode(WebSettings.LOAD_DEFAULT);
|
||||
settings.setJavaScriptEnabled(true);
|
||||
settings.setLoadWithOverviewMode(true);
|
||||
// 设置允许访问文件数据
|
||||
settings.setAllowFileAccess(true);
|
||||
settings.setAllowContentAccess(true);
|
||||
settings.setDatabaseEnabled(true);
|
||||
settings.setSavePassword(false);
|
||||
settings.setSaveFormData(false);
|
||||
settings.setUseWideViewPort(true);
|
||||
settings.setBuiltInZoomControls(true);
|
||||
settings.setPluginState(WebSettings.PluginState.ON);
|
||||
settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS);
|
||||
webView.setFocusable(true);
|
||||
webView.setFocusableInTouchMode(true);
|
||||
webView.getSettings().setSupportMultipleWindows(true);
|
||||
|
||||
settings.setSupportZoom(false);
|
||||
webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
|
||||
// webView.setHorizontalScrollbarOverlay(true);
|
||||
webView.setHorizontalScrollBarEnabled(true);
|
||||
webView.requestFocus();
|
||||
// webView.setBackgroundColor(getColor(R.color.black));
|
||||
settings.setJavaScriptCanOpenWindowsAutomatically(false);
|
||||
|
||||
// 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件
|
||||
// Android 4.1前默认允许,4.1后默认禁止
|
||||
settings.setAllowFileAccessFromFileURLs(true);
|
||||
// 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源)
|
||||
// Android 4.1前默认允许,4.1后默认禁止
|
||||
settings.setAllowUniversalAccessFromFileURLs(true);
|
||||
|
||||
// settings.setBuiltInZoomControls(false); // 启用缩放功能
|
||||
// settings.setDisplayZoomControls(false); // 隐藏缩放控件
|
||||
|
||||
|
||||
webView.setWebChromeClient(new WebChromeClient() {
|
||||
@Override
|
||||
public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) {
|
||||
|
||||
WebView newWebView = new WebView(WebViewActivity.this);
|
||||
topVvvv.setVisibility(View.VISIBLE);
|
||||
webView.addView(newWebView);
|
||||
WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;
|
||||
transport.setWebView(newWebView);
|
||||
resultMsg.sendToTarget();
|
||||
|
||||
newWebView.setWebViewClient(new WebViewClient() {
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
// isAtGame = true;
|
||||
progressBar.setVisibility(View.GONE);
|
||||
webView.loadUrl(url);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
// WebView newWebView = new WebView(view.getContext());
|
||||
// newWebView.setWebViewClient(new WebViewClient() {
|
||||
// @Override
|
||||
// public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
// Intent browserIntent = new Intent(WebViewActivity.this, WebViewActivity.class);
|
||||
// browserIntent.putExtra("url", url);
|
||||
// startActivity(browserIntent);
|
||||
// return true;
|
||||
// }
|
||||
// });
|
||||
// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;
|
||||
// transport.setWebView(newWebView);
|
||||
// resultMsg.sendToTarget();
|
||||
// return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
});
|
||||
webView.setWebViewClient(new WebViewClient() {
|
||||
|
||||
|
||||
@Override
|
||||
public void onPageFinished(WebView view, String url) {
|
||||
super.onPageFinished(view, url);
|
||||
showTopLy.setVisibility(View.GONE);
|
||||
progressBar.setVisibility(View.GONE);
|
||||
topVvvv.setVisibility(View.VISIBLE);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageStarted(WebView view, String url, Bitmap favicon) {
|
||||
super.onPageStarted(view, url, favicon);
|
||||
progressBar.setVisibility(View.VISIBLE);
|
||||
topVvvv.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
|
||||
super.onReceivedError(view, request, error);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
int errorCode = error.getErrorCode();
|
||||
String errorMessage = error.getDescription().toString();
|
||||
String currentUrl = request.getUrl().toString();
|
||||
LogUtils.d("onReceivedError2 url==" + url + " errorCode ==" + errorCode);
|
||||
if ((errorCode == -2 || errorCode == -6) && currentUrl.contains(url)) {
|
||||
onShowErrorView(errorMessage);
|
||||
} else {
|
||||
onShowNetView();
|
||||
}
|
||||
}
|
||||
progressBar.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
|
||||
super.onReceivedError(view, errorCode, description, failingUrl);
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
|
||||
LogUtils.d("onReceivedError2 url==" + failingUrl + " errorCode ==" + errorCode);
|
||||
if ((errorCode == -2 || errorCode == -6) && failingUrl.contains(url)) {
|
||||
onShowErrorView(description);
|
||||
} else {
|
||||
onShowNetView();
|
||||
}
|
||||
}
|
||||
progressBar.setVisibility(View.GONE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
|
||||
|
||||
Uri uri;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
uri = request.getUrl();
|
||||
} else {
|
||||
uri = Uri.parse(request.toString());
|
||||
}
|
||||
String url1 = uri.toString();
|
||||
LogUtils.d("url1111111111==" + url1);
|
||||
if (url1.equals(url + "index") || url1.equals(url + "/index")) {
|
||||
topVvvv.setVisibility(View.GONE);
|
||||
} else {
|
||||
progressBar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
if (!(url1.startsWith("http") || url1.startsWith("https"))) {
|
||||
try {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(Intent.ACTION_VIEW);
|
||||
intent.setData(Uri.parse(url1));
|
||||
startActivity(intent);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
|
||||
if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) {
|
||||
return false;
|
||||
} else {
|
||||
if (url1.contains(".apk")) { //下载
|
||||
Toast.makeText(WebViewActivity.this, "下载开始,请稍后...", Toast.LENGTH_SHORT).show();
|
||||
Constants.isUpdate = false;
|
||||
new AppUpdater(WebViewActivity.this, url1).start();
|
||||
return false;
|
||||
}
|
||||
//其它的该怎么处理就怎么处理
|
||||
LogUtils.d("url1111111111==2" + url1);
|
||||
webView.loadUrl(url1);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url1) {
|
||||
if (url1.equals(url + "index") || url1.equals(url + "/index")) {
|
||||
topVvvv.setVisibility(View.GONE);
|
||||
} else {
|
||||
progressBar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
if (!(url1.startsWith("http") || url1.startsWith("https"))) {
|
||||
try {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(Intent.ACTION_VIEW);
|
||||
intent.setData(Uri.parse(url1));
|
||||
startActivity(intent);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
|
||||
if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) {
|
||||
return false;
|
||||
} else {
|
||||
if (url1.contains(".apk")) { //下载
|
||||
new AppUpdater(WebViewActivity.this, url1).start();
|
||||
return false;
|
||||
}
|
||||
//其它的该怎么处理就怎么处理
|
||||
webView.loadUrl(url1);
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
webView.setOnGenericMotionListener(new View.OnGenericMotionListener() {
|
||||
@Override
|
||||
public boolean onGenericMotion(View view, MotionEvent motionEvent) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
// webView.setOnTouchListener(new View.OnTouchListener() {
|
||||
// @Override
|
||||
// public boolean onTouch(View view, MotionEvent motionEvent) {
|
||||
// if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
// webView.loadUrl("javascript:_IntervalResize(+\" + view + \",false)");
|
||||
// return true;
|
||||
// } else {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
// webView.onWindowFocusChanged(true);
|
||||
// webView.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||
// @Override
|
||||
// public void onFocusChange(View view, boolean b) {
|
||||
// LogUtils.d("B==" + b);
|
||||
// view.invalidate();
|
||||
// }
|
||||
// });
|
||||
if (url != null) {
|
||||
webView.loadUrl(url);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isNetError = false;
|
||||
|
||||
public void onShowErrorView(String errorMsg) { //网络不可用的情况
|
||||
topVvvv.setVisibility(View.VISIBLE);
|
||||
webView.setVisibility(View.GONE);
|
||||
layoutError.setVisibility(View.VISIBLE);
|
||||
tvErrorMsg.setText(errorMsg);
|
||||
showTopLy.setVisibility(View.GONE);
|
||||
isNetError = true;
|
||||
|
||||
}
|
||||
|
||||
public void onShowNetView() {
|
||||
topVvvv.setVisibility(View.VISIBLE);
|
||||
webView.setVisibility(View.VISIBLE);
|
||||
layoutError.setVisibility(View.GONE);
|
||||
showTopLy.setVisibility(View.GONE);
|
||||
isNetError = false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if (webView.canGoBack()) {//当webview有多级能返回的时候
|
||||
onShowNetView();
|
||||
webView.goBack();
|
||||
} else {//不能返回了
|
||||
WebViewActivity.this.finish();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
if (webView != null) {
|
||||
//加载null内容
|
||||
// webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null);
|
||||
//清除历史记录
|
||||
// webView.clearHistory();
|
||||
//移除WebView
|
||||
// ((ViewGroup) webView.getParent()).removeView(webView);
|
||||
//销毁VebView
|
||||
webView.destroy();
|
||||
}
|
||||
super.onDestroy();
|
||||
}
|
||||
}
|
||||
81
Dmcslot/src/main/java/com/web/dmcslot/WithDrawListInfo.java
Normal file
@@ -0,0 +1,81 @@
|
||||
package com.web.dmcslot;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 提现记录
|
||||
*/
|
||||
public class WithDrawListInfo implements Serializable {
|
||||
|
||||
//邀请记录
|
||||
private int total;
|
||||
private List<WithDrawInfo> list;
|
||||
|
||||
|
||||
public int getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(int total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public List<WithDrawInfo> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<WithDrawInfo> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
class WithDrawInfo{
|
||||
|
||||
private String amount;
|
||||
private String balance;
|
||||
private String bankName;
|
||||
private String createTime;
|
||||
private String name;
|
||||
|
||||
public String getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public void setAmount(String amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public String getBalance() {
|
||||
return balance;
|
||||
}
|
||||
|
||||
public void setBalance(String balance) {
|
||||
this.balance = balance;
|
||||
}
|
||||
|
||||
public String getBankName() {
|
||||
return bankName;
|
||||
}
|
||||
|
||||
public void setBankName(String bankName) {
|
||||
this.bankName = bankName;
|
||||
}
|
||||
|
||||
public String getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(String createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
384
Dmcslot/src/main/java/com/web/dmcslot/appdown/AppUpdater.java
Normal file
@@ -0,0 +1,384 @@
|
||||
package com.web.dmcslot.appdown;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.ServiceConnection;
|
||||
import android.os.IBinder;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.web.dmcslot.appdown.callback.UpdateCallback;
|
||||
import com.web.dmcslot.appdown.constant.Constants;
|
||||
import com.web.dmcslot.appdown.http.HttpManager;
|
||||
import com.web.dmcslot.appdown.http.IHttpManager;
|
||||
import com.web.dmcslot.appdown.http.OkHttpManager;
|
||||
import com.web.dmcslot.appdown.service.DownloadService;
|
||||
import com.web.dmcslot.appdown.util.PermissionUtils;
|
||||
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @author Jenly <a href="mailto:jenly1314@gmail.com">Jenly</a>
|
||||
*/
|
||||
public class AppUpdater {
|
||||
/**
|
||||
* {@link #mContext}不强制要求是{@link Activity},但能传{@link Activity}尽量传。AppUpdater本应该只专注于App更新,尽量不涉及动态权限相关的处理。如果mContext传的是{@link Activity},则默认会校验一次动态权限。
|
||||
*/
|
||||
private Context mContext;
|
||||
/**
|
||||
* 配置信息
|
||||
*/
|
||||
private UpdateConfig mConfig;
|
||||
/**
|
||||
* 更新回调
|
||||
*/
|
||||
private UpdateCallback mCallback;
|
||||
/**
|
||||
* http管理接口,可自定义实现。如:使用okHttp
|
||||
*/
|
||||
private IHttpManager mHttpManager;
|
||||
|
||||
private ServiceConnection mServiceConnection;
|
||||
|
||||
public AppUpdater(@NonNull Context context,@NonNull UpdateConfig config){
|
||||
this.mContext = context;
|
||||
this.mConfig = config;
|
||||
}
|
||||
|
||||
public AppUpdater(@NonNull Context context,@NonNull String url){
|
||||
this.mContext = context;
|
||||
mConfig = new UpdateConfig();
|
||||
mConfig.setUrl(url);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置下载更新进度回调
|
||||
* @param callback
|
||||
* @return
|
||||
*/
|
||||
public AppUpdater setUpdateCallback(UpdateCallback callback){
|
||||
this.mCallback = callback;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置一个IHttpManager
|
||||
* @param httpManager AppUpdater内置提供{@link HttpManager} 和 {@link OkHttpManager}两种实现。
|
||||
* 如果不设置,将默认使用{@link HttpManager},你也可以使用{@link OkHttpManager}或自己去实现一个
|
||||
* {@link IHttpManager}。
|
||||
* 当使用{@link OkHttpManager}时,必需依赖okhttp库
|
||||
* @return
|
||||
*/
|
||||
public AppUpdater setHttpManager(IHttpManager httpManager){
|
||||
this.mHttpManager = httpManager;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始下载
|
||||
*/
|
||||
public void start(){
|
||||
if(mConfig != null && !TextUtils.isEmpty(mConfig.getUrl())){
|
||||
//如果mContext是Activity,并且配置了下载路径,则默认会校验一次动态权限。
|
||||
if(mContext instanceof Activity && !TextUtils.isEmpty(mConfig.getPath())){
|
||||
PermissionUtils.verifyReadAndWritePermissions((Activity) mContext,Constants.RE_CODE_STORAGE_PERMISSION);
|
||||
}
|
||||
|
||||
if(mConfig.isShowNotification() && !PermissionUtils.isNotificationEnabled(mContext)){
|
||||
Log.w(Constants.TAG,"Notification permission not enabled.");
|
||||
}
|
||||
|
||||
startDownloadService();
|
||||
}else{
|
||||
throw new NullPointerException("Url must not be empty.");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 启动下载服务
|
||||
*/
|
||||
private void startDownloadService(){
|
||||
Intent intent = new Intent(mContext, DownloadService.class);
|
||||
if(mCallback!=null || mHttpManager!=null){//bindService
|
||||
mServiceConnection = new ServiceConnection() {
|
||||
@Override
|
||||
public void onServiceConnected(ComponentName name, IBinder service) {
|
||||
DownloadService.DownloadBinder binder = ((DownloadService.DownloadBinder)service);
|
||||
binder.start(mConfig,mHttpManager,mCallback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onServiceDisconnected(ComponentName name) {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
mContext.getApplicationContext().bindService(intent,mServiceConnection, Context.BIND_AUTO_CREATE);
|
||||
}else{//startService
|
||||
intent.putExtra(Constants.KEY_UPDATE_CONFIG,mConfig);
|
||||
mContext.startService(intent);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消下载
|
||||
*/
|
||||
public void stop(){
|
||||
stopDownloadService();
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止下载服务
|
||||
*/
|
||||
private void stopDownloadService(){
|
||||
Intent intent = new Intent(mContext, DownloadService.class);
|
||||
intent.putExtra(Constants.KEY_STOP_DOWNLOAD_SERVICE,true);
|
||||
mContext.startService(intent);
|
||||
}
|
||||
|
||||
/**
|
||||
* AppUpdater建造者
|
||||
*/
|
||||
public static class Builder{
|
||||
|
||||
|
||||
private UpdateConfig mConfig;
|
||||
|
||||
public Builder(){
|
||||
mConfig = new UpdateConfig();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置APK下载地址
|
||||
* @param url 下载地址
|
||||
* @return
|
||||
*/
|
||||
public Builder setUrl(@NonNull String url){
|
||||
mConfig.setUrl(url);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置保存的路径,(建议使用默认,不做设置)
|
||||
* @param path 下载保存的文件路径
|
||||
* @return
|
||||
* @deprecated 因为适配Android Q的分区存储,所以此方法已弃用,不建议再使用
|
||||
*/
|
||||
@Deprecated
|
||||
public Builder setPath(String path){
|
||||
mConfig.setPath(path);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置保存的文件名
|
||||
* @param filename 下载的保存的apk文件名 (默认优先取url文件名)
|
||||
* @return
|
||||
*/
|
||||
public Builder setFilename(String filename){
|
||||
mConfig.setFilename(filename);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否显示通知栏
|
||||
* @param isShowNotification 是否显示通知栏 (默认true)
|
||||
* @return
|
||||
*/
|
||||
public Builder setShowNotification(boolean isShowNotification) {
|
||||
mConfig.setShowNotification(isShowNotification);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置通知ID
|
||||
* @param notificationId 通知ID
|
||||
* @return
|
||||
*/
|
||||
public Builder setNotificationId(int notificationId) {
|
||||
mConfig.setNotificationId(notificationId);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置通知渠道ID
|
||||
* @param channelId 通知渠道ID (默认兼容O)
|
||||
* @return
|
||||
*/
|
||||
public Builder setChannelId(String channelId) {
|
||||
mConfig.setChannelId(channelId);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置通知渠道名称
|
||||
* @param channelName 通知渠道名称 (默认兼容O)
|
||||
* @return
|
||||
*/
|
||||
public Builder setChannelName(String channelName) {
|
||||
mConfig.setChannelName(channelName);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置通知图标
|
||||
* @param icon 通知栏图标 (默认取App的icon)
|
||||
* @return
|
||||
*/
|
||||
public Builder setNotificationIcon(@DrawableRes int icon) {
|
||||
mConfig.setNotificationIcon(icon);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置通知是否震动提示
|
||||
* @param vibrate 是否震动提示,为true时使用通知默认震动,Android O(8.0)以上设置,只有初次创建channel时有效,后续修改属性无效,想要重新有效需修改channelId或卸载App重装。
|
||||
* @return
|
||||
*/
|
||||
public Builder setVibrate(boolean vibrate) {
|
||||
mConfig.setVibrate(vibrate);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置通知是否铃声提示
|
||||
* @param sound 是否铃声提示,为true时使用通知默认铃声,Android O(8.0)以上设置,只有初次创建channel时有效,后续修改属性无效,想要重新有效需修改channelId或卸载App重装。
|
||||
* @return
|
||||
*/
|
||||
public Builder setSound(boolean sound) {
|
||||
mConfig.setSound(sound);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置下载完成后知否自动触发安装APK
|
||||
* @param isInstallApk 下载完成后是否自动调用安装APK(默认true)
|
||||
* @return
|
||||
*/
|
||||
public Builder setInstallApk(boolean isInstallApk){
|
||||
mConfig.setInstallApk(isInstallApk);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置FileProvider的authority
|
||||
* @param authority FileProvider的authority(默认兼容N,默认值{@link Context#getPackageName() + ".AppUpdaterFileProvider"})
|
||||
* @return
|
||||
*/
|
||||
public Builder setAuthority(String authority){
|
||||
mConfig.setAuthority(authority);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置下载时,通知栏是否显示下载百分比
|
||||
* @param showPercentage 下载时通知栏是否显示百分比
|
||||
* @return
|
||||
*/
|
||||
public Builder setShowPercentage(boolean showPercentage) {
|
||||
mConfig.setShowPercentage(showPercentage);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置下载失败时,是否支持点击通知栏重新下载。与之相关联的方法{@link #setReDownloads(int)}
|
||||
* @param reDownload 下载失败时是否支持点击通知栏重新下载,默认true
|
||||
* @return
|
||||
*/
|
||||
public Builder setReDownload(boolean reDownload) {
|
||||
mConfig.setReDownload(reDownload);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置下载失败时,最多重新下载次数。与之相关联的方法{@link #setReDownload(boolean)}
|
||||
* @param reDownloads 下载失败时是否支持点击通知栏重新下载,默认最多重新下载3次
|
||||
* @return
|
||||
*/
|
||||
public Builder setReDownloads(int reDownloads) {
|
||||
mConfig.setReDownloads(reDownloads);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置要下载APK的versionCode,用于优先取缓存时通过versionCode校验APK文件是否一致。
|
||||
* 缓存校验目前支持两种方式,一种是通过versionCode校验,即{@link #setVersionCode(Integer)};一种是文件MD5校验,即{@link #setApkMD5(String)}。推荐使用MD5校验方式
|
||||
* 如果两种方式都设置了,则只校验MD5
|
||||
* @param versionCode 为null表示不处理,默认不存在则下载,存在则重新下载。不为null时,表示会优先校验本地是否存在已下载版本号为versionCode的APK。
|
||||
* 如果存在则不会重新下载(AppUpdater会自动校验packageName一致性),直接取本地APK,反之重新下载。
|
||||
* @return
|
||||
*/
|
||||
public Builder setVersionCode(Integer versionCode) {
|
||||
mConfig.setVersionCode(versionCode);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置APK文件的MD5,用于优先取缓存时通过MD5校验文件APK是否一致。
|
||||
* 缓存校验目前支持两种方式,一种是通过versionCode校验,即{@link #setVersionCode(Integer)};一种是文件MD5校验,即{@link #setApkMD5(String)}。推荐使用MD5校验方式
|
||||
* 如果两种方式都设置了,则只校验MD5
|
||||
* @param md5 为null表示不处理,如果设置了MD5,则缓存APK的MD5相同时,只下载一次,优先取本地缓存
|
||||
* @return
|
||||
*/
|
||||
public Builder setApkMD5(String md5) {
|
||||
mConfig.setApkMD5(md5);
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* 请求头添加参数
|
||||
* @param key
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
public Builder addHeader(String key, String value){
|
||||
mConfig.addHeader(key,value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求头添加参数
|
||||
* @param headers
|
||||
* @return
|
||||
*/
|
||||
public Builder addHeader(Map<String,String> headers){
|
||||
mConfig.addHeader(headers);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否自动删除取消下载的文件
|
||||
* @param deleteCancelFile 是否删除取消下载的文件(默认为true)
|
||||
*/
|
||||
public Builder setDeleteCancelFile(boolean deleteCancelFile){
|
||||
mConfig.setDeleteCancelFile(deleteCancelFile);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否支持通过删除通知栏来取消下载(默认为:false)
|
||||
* @param cancelDownload
|
||||
* @return
|
||||
*/
|
||||
public Builder setCancelDownload(boolean cancelDownload){
|
||||
mConfig.setCancelDownload(cancelDownload);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public AppUpdater build(@NonNull Context context){
|
||||
return new AppUpdater(context,mConfig);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
460
Dmcslot/src/main/java/com/web/dmcslot/appdown/UpdateConfig.java
Normal file
@@ -0,0 +1,460 @@
|
||||
package com.web.dmcslot.appdown;
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import com.web.dmcslot.appdown.constant.Constants;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
|
||||
|
||||
/**
|
||||
* @author Jenly <a href="mailto:jenly1314@gmail.com">Jenly</a>
|
||||
*/
|
||||
public class UpdateConfig implements Parcelable {
|
||||
|
||||
/**
|
||||
* APK下载的Url
|
||||
*/
|
||||
private String mUrl;
|
||||
/**
|
||||
* 保存路径
|
||||
*/
|
||||
private String mPath;
|
||||
/**
|
||||
* 保存文件名
|
||||
*/
|
||||
private String mFilename;
|
||||
|
||||
/**
|
||||
* 是否显示通知栏
|
||||
*/
|
||||
private boolean isShowNotification = true;
|
||||
/**
|
||||
* 下载完成后是否自动弹出安装
|
||||
*/
|
||||
private boolean isInstallApk = true;
|
||||
/**
|
||||
* 通知栏图标:默认取app图标
|
||||
*/
|
||||
private int mNotificationIcon;
|
||||
|
||||
/**
|
||||
* 通知栏ID
|
||||
*/
|
||||
private int mNotificationId = Constants.DEFAULT_NOTIFICATION_ID;
|
||||
|
||||
/**
|
||||
* 通知栏渠道ID
|
||||
*/
|
||||
private String mChannelId;
|
||||
/**
|
||||
* 通知栏渠道名称
|
||||
*/
|
||||
private String mChannelName;
|
||||
/**
|
||||
* 默认{@link Context#getPackageName() + ".AppUpdaterFileProvider"}
|
||||
*/
|
||||
private String mAuthority;
|
||||
/**
|
||||
* 下载失败是否支持点击通知栏重新下载
|
||||
*/
|
||||
private boolean isReDownload = true;
|
||||
/**
|
||||
* 下载失败后,最大重新下载次数
|
||||
*/
|
||||
private int reDownloads = 3;
|
||||
/**
|
||||
* 是否显示百分比
|
||||
*/
|
||||
private boolean isShowPercentage = true;
|
||||
|
||||
/**
|
||||
* 是否震动提示,为true时使用通知默认震动
|
||||
*/
|
||||
private boolean isVibrate;
|
||||
|
||||
/**
|
||||
* 是否铃声提示,为true时使用通知默认铃声
|
||||
*/
|
||||
private boolean isSound;
|
||||
|
||||
/**
|
||||
* 要下载的APK的versionCode
|
||||
*/
|
||||
private Integer versionCode;
|
||||
|
||||
/**
|
||||
* 请求头参数
|
||||
*/
|
||||
private Map<String,String> mRequestProperty;
|
||||
|
||||
/**
|
||||
* 是否删除取消下载的文件
|
||||
*/
|
||||
private boolean isDeleteCancelFile = true;
|
||||
|
||||
/**
|
||||
* 是否支持通过删除通知栏来取消下载
|
||||
*/
|
||||
private boolean isCancelDownload = false;
|
||||
|
||||
/**
|
||||
* APK文件的MD5
|
||||
*/
|
||||
private String apkMD5;
|
||||
|
||||
|
||||
public UpdateConfig() {
|
||||
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return mUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置APK下载地址
|
||||
* @param url 下载地址
|
||||
*/
|
||||
public void setUrl(String url) {
|
||||
this.mUrl = url;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return mPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置保存的路径,(建议使用默认,不做设置)
|
||||
* @param path 下载保存的文件路径
|
||||
* @return
|
||||
* @deprecated 因为适配Android Q的分区存储,所以此方法已弃用,不建议再使用
|
||||
*/
|
||||
@Deprecated
|
||||
public void setPath(String path) {
|
||||
this.mPath = path;
|
||||
}
|
||||
|
||||
public String getFilename() {
|
||||
return mFilename;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置保存的文件名
|
||||
* @param filename 下载的保存的apk文件名 (默认优先取url文件名)
|
||||
*/
|
||||
public void setFilename(String filename) {
|
||||
this.mFilename = filename;
|
||||
}
|
||||
|
||||
public boolean isShowNotification() {
|
||||
return isShowNotification;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否显示通知栏
|
||||
* @param isShowNotification 是否显示通知栏 (默认true)
|
||||
*/
|
||||
public void setShowNotification(boolean isShowNotification) {
|
||||
this.isShowNotification = isShowNotification;
|
||||
}
|
||||
|
||||
public String getChannelId() {
|
||||
return mChannelId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置通知渠道ID
|
||||
* @param channelId 通知渠道ID (默认兼容O)
|
||||
*/
|
||||
public void setChannelId(String channelId) {
|
||||
this.mChannelId = channelId;
|
||||
}
|
||||
|
||||
public String getChannelName() {
|
||||
return mChannelName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置通知渠道名称
|
||||
* @param channelName 通知渠道名称 (默认兼容O)
|
||||
*/
|
||||
public void setChannelName(String channelName) {
|
||||
this.mChannelName = channelName;
|
||||
}
|
||||
/**
|
||||
* 设置通知ID
|
||||
* @param notificationId 通知ID
|
||||
*/
|
||||
public void setNotificationId(int notificationId){
|
||||
this.mNotificationId = notificationId;
|
||||
}
|
||||
|
||||
public int getNotificationId(){
|
||||
return this.mNotificationId;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置通知图标
|
||||
* @param icon 通知栏图标 (默认取App的icon)
|
||||
*/
|
||||
public void setNotificationIcon(@DrawableRes int icon){
|
||||
this.mNotificationIcon = icon;
|
||||
}
|
||||
|
||||
public int getNotificationIcon(){
|
||||
return this.mNotificationIcon;
|
||||
}
|
||||
|
||||
public boolean isInstallApk() {
|
||||
return isInstallApk;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置下载完成后知否自动触发安装APK
|
||||
* @param isInstallApk 下载完成后是否自动调用安装APK(默认true)
|
||||
*/
|
||||
public void setInstallApk(boolean isInstallApk) {
|
||||
this.isInstallApk = isInstallApk;
|
||||
}
|
||||
|
||||
public String getAuthority() {
|
||||
return mAuthority;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置FileProvider的authority
|
||||
* @param authority FileProvider的authority(默认兼容N,默认值{@link Context#getPackageName() + ".AppUpdaterFileProvider"})
|
||||
*/
|
||||
public void setAuthority(String authority) {
|
||||
this.mAuthority = authority;
|
||||
}
|
||||
|
||||
public boolean isShowPercentage() {
|
||||
return isShowPercentage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置下载时,通知栏是否显示下载百分比
|
||||
* @param showPercentage 下载时通知栏是否显示百分比
|
||||
*/
|
||||
public void setShowPercentage(boolean showPercentage) {
|
||||
isShowPercentage = showPercentage;
|
||||
}
|
||||
|
||||
public boolean isReDownload() {
|
||||
return isReDownload;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置下载失败时,是否支持点击通知栏重新下载。与之相关联的方法{@link #setReDownloads(int)}
|
||||
* @param reDownload 下载失败时是否支持点击通知栏重新下载,默认true
|
||||
*/
|
||||
public void setReDownload(boolean reDownload) {
|
||||
isReDownload = reDownload;
|
||||
}
|
||||
|
||||
public int getReDownloads() {
|
||||
return reDownloads;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置下载失败时,最多重新下载次数。与之相关联的方法{@link #setReDownload(boolean)}
|
||||
* @param reDownloads 下载失败时是否支持点击通知栏重新下载,默认最多重新下载3次
|
||||
*/
|
||||
public void setReDownloads(int reDownloads) {
|
||||
this.reDownloads = reDownloads;
|
||||
}
|
||||
|
||||
public boolean isVibrate() {
|
||||
return isVibrate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置通知是否震动提示
|
||||
* @param vibrate 是否震动提示,为true时使用通知默认震动,Android O(8.0)以上设置,只有初次创建channel时有效,后续修改属性无效,想要重新有效需修改channelId或卸载App重装。
|
||||
*/
|
||||
public void setVibrate(boolean vibrate) {
|
||||
isVibrate = vibrate;
|
||||
}
|
||||
|
||||
public boolean isSound() {
|
||||
return isSound;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置通知是否铃声提示
|
||||
* @param sound 是否铃声提示,为true时使用通知默认铃声,Android O(8.0)以上设置,只有初次创建channel时有效,后续修改属性无效,想要重新有效需修改channelId或卸载App重装。
|
||||
*/
|
||||
public void setSound(boolean sound) {
|
||||
isSound = sound;
|
||||
}
|
||||
|
||||
public Integer getVersionCode(){
|
||||
return versionCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置要下载APK的versionCode,用于优先取缓存时通过versionCode校验APK文件是否一致。
|
||||
* 缓存校验目前支持两种方式,一种是通过versionCode校验,即{@link #setVersionCode(Integer)};一种是文件MD5校验,即{@link #setApkMD5(String)}。推荐使用MD5校验方式
|
||||
* 如果两种方式都设置了,则只校验MD5
|
||||
* @param versionCode 为null表示不处理,默认不存在则下载,存在则重新下载。不为null时,表示会优先校验本地是否存在已下载版本号为versionCode的APK。
|
||||
* 如果存在则不会重新下载(AppUpdater会自动校验packageName一致性),直接取本地APK,反之重新下载。
|
||||
*/
|
||||
public void setVersionCode(Integer versionCode){
|
||||
this.versionCode = versionCode;
|
||||
}
|
||||
|
||||
public Map<String, String> getRequestProperty() {
|
||||
return mRequestProperty;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置APK文件的MD5,用于优先取缓存时通过MD5校验文件APK是否一致。
|
||||
* 缓存校验目前支持两种方式,一种是通过versionCode校验,即{@link #setVersionCode(Integer)};一种是文件MD5校验,即{@link #setApkMD5(String)}。推荐使用MD5校验方式
|
||||
* 如果两种方式都设置了,则只校验MD5
|
||||
* @param md5 为null表示不处理,如果设置了MD5,则缓存APK的MD5相同时,只下载一次,优先取本地缓存
|
||||
*/
|
||||
public void setApkMD5(String md5){
|
||||
this.apkMD5 = md5;
|
||||
}
|
||||
|
||||
public String getApkMD5(){
|
||||
return apkMD5;
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求头添加参数
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
public void addHeader(String key, String value){
|
||||
initRequestProperty();
|
||||
mRequestProperty.put(key,value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求头添加参数
|
||||
* @param headers
|
||||
*/
|
||||
public void addHeader(Map<String,String> headers){
|
||||
initRequestProperty();
|
||||
mRequestProperty.putAll(headers);
|
||||
}
|
||||
|
||||
private void initRequestProperty(){
|
||||
if(mRequestProperty == null){
|
||||
mRequestProperty = new HashMap<>();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isDeleteCancelFile() {
|
||||
return isDeleteCancelFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否自动删除取消下载的文件
|
||||
* @param deleteCancelFile 是否删除取消下载的文件(默认为:true)
|
||||
*/
|
||||
public void setDeleteCancelFile(boolean deleteCancelFile) {
|
||||
isDeleteCancelFile = deleteCancelFile;
|
||||
}
|
||||
|
||||
public boolean isCancelDownload(){
|
||||
return isCancelDownload;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否支持通过删除通知栏来取消下载(默认为:false)
|
||||
* @param cancelDownload
|
||||
*/
|
||||
public void setCancelDownload(boolean cancelDownload) {
|
||||
isCancelDownload = cancelDownload;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(this.mUrl);
|
||||
dest.writeString(this.mPath);
|
||||
dest.writeString(this.mFilename);
|
||||
dest.writeByte(this.isShowNotification ? (byte) 1 : (byte) 0);
|
||||
dest.writeByte(this.isInstallApk ? (byte) 1 : (byte) 0);
|
||||
dest.writeInt(this.mNotificationIcon);
|
||||
dest.writeInt(this.mNotificationId);
|
||||
dest.writeString(this.mChannelId);
|
||||
dest.writeString(this.mChannelName);
|
||||
dest.writeString(this.mAuthority);
|
||||
dest.writeByte(this.isReDownload ? (byte) 1 : (byte) 0);
|
||||
dest.writeInt(this.reDownloads);
|
||||
dest.writeByte(this.isShowPercentage ? (byte) 1 : (byte) 0);
|
||||
dest.writeByte(this.isVibrate ? (byte) 1 : (byte) 0);
|
||||
dest.writeByte(this.isSound ? (byte) 1 : (byte) 0);
|
||||
dest.writeValue(this.versionCode);
|
||||
if(mRequestProperty!=null){
|
||||
dest.writeInt(this.mRequestProperty.size());
|
||||
for (Map.Entry<String, String> entry : this.mRequestProperty.entrySet()) {
|
||||
dest.writeString(entry.getKey());
|
||||
dest.writeString(entry.getValue());
|
||||
}
|
||||
}else{
|
||||
dest.writeInt(0);
|
||||
}
|
||||
|
||||
dest.writeByte(this.isDeleteCancelFile ? (byte) 1 : (byte) 0);
|
||||
dest.writeByte(this.isCancelDownload ? (byte) 1 : (byte) 0);
|
||||
dest.writeString(this.apkMD5);
|
||||
}
|
||||
|
||||
protected UpdateConfig(Parcel in) {
|
||||
this.mUrl = in.readString();
|
||||
this.mPath = in.readString();
|
||||
this.mFilename = in.readString();
|
||||
this.isShowNotification = in.readByte() != 0;
|
||||
this.isInstallApk = in.readByte() != 0;
|
||||
this.mNotificationIcon = in.readInt();
|
||||
this.mNotificationId = in.readInt();
|
||||
this.mChannelId = in.readString();
|
||||
this.mChannelName = in.readString();
|
||||
this.mAuthority = in.readString();
|
||||
this.isReDownload = in.readByte() != 0;
|
||||
this.reDownloads = in.readInt();
|
||||
this.isShowPercentage = in.readByte() != 0;
|
||||
this.isVibrate = in.readByte() != 0;
|
||||
this.isSound = in.readByte() != 0;
|
||||
this.versionCode = (Integer) in.readValue(Integer.class.getClassLoader());
|
||||
int mRequestPropertySize = in.readInt();
|
||||
this.mRequestProperty = new HashMap<>(mRequestPropertySize);
|
||||
for (int i = 0; i < mRequestPropertySize; i++) {
|
||||
String key = in.readString();
|
||||
String value = in.readString();
|
||||
this.mRequestProperty.put(key, value);
|
||||
}
|
||||
this.isDeleteCancelFile = in.readByte() != 0;
|
||||
this.isCancelDownload = in.readByte() != 0;
|
||||
this.apkMD5 = in.readString();
|
||||
}
|
||||
|
||||
public static final Creator<UpdateConfig> CREATOR = new Creator<UpdateConfig>() {
|
||||
@Override
|
||||
public UpdateConfig createFromParcel(Parcel source) {
|
||||
return new UpdateConfig(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UpdateConfig[] newArray(int size) {
|
||||
return new UpdateConfig[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.web.dmcslot.appdown.callback;
|
||||
|
||||
/**
|
||||
* @author Jenly <a href="mailto:jenly1314@gmail.com">Jenly</a>
|
||||
*/
|
||||
public abstract class AppUpdateCallback implements UpdateCallback {
|
||||
@Override
|
||||
public void onDownloading(boolean isDownloading) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart(String url) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Exception e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.web.dmcslot.appdown.callback;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* @author Jenly <a href="mailto:jenly1314@gmail.com">Jenly</a>
|
||||
*/
|
||||
public interface UpdateCallback {
|
||||
|
||||
/**
|
||||
* 最开始调用(在onStart之前调用)
|
||||
* @param isDownloading true 表示已经在下载,false表示当前未开始下载,即将开始下载
|
||||
*/
|
||||
void onDownloading(boolean isDownloading);
|
||||
|
||||
/**
|
||||
* 开始
|
||||
*/
|
||||
void onStart(String url);
|
||||
|
||||
/**
|
||||
* 加载进度…
|
||||
* @param progress
|
||||
* @param total
|
||||
* @param isChange 进度百分比是否有改变,(主要可以用来过滤无用的刷新,从而降低刷新频率)
|
||||
*/
|
||||
void onProgress(long progress,long total,boolean isChange);
|
||||
|
||||
/**
|
||||
* 完成
|
||||
* @param file
|
||||
*/
|
||||
void onFinish(File file);
|
||||
|
||||
/**
|
||||
* 错误
|
||||
* @param e
|
||||
*/
|
||||
void onError(Exception e);
|
||||
|
||||
|
||||
/**
|
||||
* 取消
|
||||
*/
|
||||
void onCancel();
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.web.dmcslot.appdown.constant;
|
||||
|
||||
/**
|
||||
* @author Jenly <a href="mailto:jenly1314@gmail.com">Jenly</a>
|
||||
*/
|
||||
public final class Constants {
|
||||
|
||||
public static final String TAG = "AppUpdater";
|
||||
|
||||
public static final String KEY_UPDATE_CONFIG = "app_update_config";
|
||||
|
||||
public static final int DEFAULT_NOTIFICATION_ID = 0x66;
|
||||
|
||||
public static final String DEFAULT_NOTIFICATION_CHANNEL_ID = "0x66";
|
||||
|
||||
public static final String DEFAULT_NOTIFICATION_CHANNEL_NAME = "AppUpdater";
|
||||
|
||||
public static final String KEY_STOP_DOWNLOAD_SERVICE = "stop_download_service";
|
||||
|
||||
public static final String KEY_RE_DOWNLOAD = "app_update_re_download";
|
||||
|
||||
public static final int RE_CODE_STORAGE_PERMISSION = 0x66;
|
||||
|
||||
public static final int NONE = -1;
|
||||
|
||||
public static final String DEFAULT_FILE_PROVIDER = ".appdown.provider.AppUpdaterFileProvider";
|
||||
|
||||
public static final String DEFAULT_DIR = "apk";
|
||||
|
||||
public static boolean isUpdate = true;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,240 @@
|
||||
package com.web.dmcslot.appdown.http;
|
||||
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
|
||||
import com.web.dmcslot.appdown.util.LogUtils;
|
||||
import com.web.dmcslot.appdown.util.SSLSocketFactoryUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.net.ConnectException;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.net.ssl.HttpsURLConnection;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* HttpManager使用 {@link HttpURLConnection} 实现的 {@link IHttpManager}
|
||||
* @author Jenly <a href="mailto:jenly1314@gmail.com">Jenly</a>
|
||||
*/
|
||||
public class HttpManager implements IHttpManager {
|
||||
|
||||
private static final int HTTP_TEMP_REDIRECT = 307;
|
||||
private static final int HTTP_PERM_REDIRECT = 308;
|
||||
|
||||
private static final int DEFAULT_TIME_OUT = 20000;
|
||||
|
||||
private int mTimeout;
|
||||
|
||||
private DownloadTask mDownloadTask;
|
||||
|
||||
private static volatile HttpManager INSTANCE;
|
||||
|
||||
public static HttpManager getInstance(){
|
||||
if(INSTANCE == null){
|
||||
synchronized (HttpManager.class){
|
||||
if(INSTANCE == null){
|
||||
INSTANCE = new HttpManager();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
private HttpManager(){
|
||||
this(DEFAULT_TIME_OUT);
|
||||
}
|
||||
|
||||
/**
|
||||
* HttpManager对外暴露。如果没有特殊需求,推荐使用{@link HttpManager#getInstance()}
|
||||
*/
|
||||
public HttpManager(int timeout){
|
||||
this.mTimeout = timeout;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(String url, String path, String filename, @Nullable Map<String,String> requestProperty, DownloadCallback callback) {
|
||||
mDownloadTask = new DownloadTask(url, path, filename, mTimeout, requestProperty, callback);
|
||||
mDownloadTask.execute();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancel() {
|
||||
if(mDownloadTask != null){
|
||||
mDownloadTask.isCancel = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 异步下载任务
|
||||
*/
|
||||
private static class DownloadTask extends AsyncTask<Void,Long,File> {
|
||||
|
||||
private String url;
|
||||
|
||||
private String path;
|
||||
|
||||
private String filename;
|
||||
|
||||
private Map<String,String> requestProperty;
|
||||
|
||||
private DownloadCallback callback;
|
||||
|
||||
private Exception exception;
|
||||
|
||||
private int timeout;
|
||||
|
||||
private volatile boolean isCancel;
|
||||
|
||||
public DownloadTask(String url, String path, String filename, int timeout, @Nullable Map<String,String> requestProperty, DownloadCallback callback){
|
||||
this.url = url;
|
||||
this.path = path;
|
||||
this.filename = filename;
|
||||
this.timeout = timeout;
|
||||
this.callback = callback;
|
||||
this.requestProperty = requestProperty;
|
||||
}
|
||||
|
||||
private File download(String url) throws Exception{
|
||||
HttpURLConnection connect = (HttpURLConnection)new URL(url).openConnection();
|
||||
connect.setRequestMethod("GET");
|
||||
connect.setRequestProperty("Accept-Encoding", "identity");
|
||||
|
||||
connect.setReadTimeout(timeout);
|
||||
connect.setConnectTimeout(timeout);
|
||||
|
||||
if(requestProperty != null){
|
||||
for(Map.Entry<String,String> entry : requestProperty.entrySet()){
|
||||
connect.setRequestProperty(entry.getKey(),entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
connect.connect();
|
||||
|
||||
LogUtils.d("Content-Type:" + connect.getContentType());
|
||||
int responseCode = connect.getResponseCode();
|
||||
switch (responseCode){
|
||||
case HttpURLConnection.HTTP_OK: {
|
||||
InputStream is = connect.getInputStream();
|
||||
|
||||
long length = connect.getContentLength();
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
length = connect.getContentLengthLong();
|
||||
}
|
||||
|
||||
LogUtils.d( "contentLength:" + length);
|
||||
|
||||
long progress = 0;
|
||||
|
||||
byte[] buffer = new byte[8192];
|
||||
|
||||
int len;
|
||||
File file = new File(path, filename);
|
||||
FileOutputStream fos = new FileOutputStream(file);
|
||||
while ((len = is.read(buffer)) != -1) {
|
||||
if (isCancel) {
|
||||
cancel(true);
|
||||
break;
|
||||
}
|
||||
fos.write(buffer, 0, len);
|
||||
progress += len;
|
||||
// 更新进度
|
||||
if (length > 0) {
|
||||
publishProgress(progress, length);
|
||||
}
|
||||
}
|
||||
|
||||
fos.flush();
|
||||
fos.close();
|
||||
is.close();
|
||||
|
||||
connect.disconnect();
|
||||
|
||||
if(progress <= 0 && length <= 0){
|
||||
throw new IllegalStateException(String.format("contentLength = %d",length));
|
||||
}
|
||||
|
||||
return file;
|
||||
}
|
||||
case HttpURLConnection.HTTP_MULT_CHOICE:
|
||||
case HttpURLConnection.HTTP_MOVED_PERM:
|
||||
case HttpURLConnection.HTTP_MOVED_TEMP:
|
||||
case HttpURLConnection.HTTP_SEE_OTHER:
|
||||
case HTTP_TEMP_REDIRECT:
|
||||
case HTTP_PERM_REDIRECT: {// 重定向
|
||||
String redirectUrl = connect.getHeaderField("Location");
|
||||
LogUtils.d("redirectUrl = " + redirectUrl);
|
||||
connect.disconnect();
|
||||
return download(redirectUrl);
|
||||
}
|
||||
default://连接失败
|
||||
throw new ConnectException(String.format("responseCode = %d",responseCode));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected File doInBackground(Void... voids) {
|
||||
|
||||
try{
|
||||
HttpsURLConnection.setDefaultSSLSocketFactory(SSLSocketFactoryUtils.createSSLSocketFactory());
|
||||
HttpsURLConnection.setDefaultHostnameVerifier(SSLSocketFactoryUtils.createTrustAllHostnameVerifier());
|
||||
return download(url);
|
||||
} catch (Exception e) {
|
||||
this.exception = e;
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPreExecute() {
|
||||
super.onPreExecute();
|
||||
if(callback != null){
|
||||
callback.onStart(url);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(File file) {
|
||||
super.onPostExecute(file);
|
||||
if(callback != null){
|
||||
if(file != null){
|
||||
callback.onFinish(file);
|
||||
}else{
|
||||
callback.onError(exception);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onProgressUpdate(Long... values) {
|
||||
super.onProgressUpdate(values);
|
||||
if(callback != null){
|
||||
if(!isCancelled()){
|
||||
callback.onProgress(values[0],values[1]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCancelled() {
|
||||
super.onCancelled();
|
||||
if(callback != null){
|
||||
callback.onCancel();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.web.dmcslot.appdown.http;
|
||||
|
||||
|
||||
import java.io.File;
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* IHttpManager 默认提供 {@link HttpManager} 和 {@link OkHttpManager} 两种实现。
|
||||
* @author Jenly <a href="mailto:jenly1314@gmail.com">Jenly</a>
|
||||
*/
|
||||
public interface IHttpManager {
|
||||
|
||||
|
||||
/**
|
||||
* 下载
|
||||
* @param url
|
||||
* @param path
|
||||
* @param filename
|
||||
* @param requestProperty
|
||||
* @param callback
|
||||
*/
|
||||
void download(String url, String path, String filename, @Nullable Map<String,String> requestProperty, DownloadCallback callback);
|
||||
|
||||
/**
|
||||
* 取消下载
|
||||
*/
|
||||
void cancel();
|
||||
|
||||
interface DownloadCallback extends Serializable{
|
||||
/**
|
||||
* 开始
|
||||
* @param url
|
||||
*/
|
||||
void onStart(String url);
|
||||
|
||||
/**
|
||||
* 加载进度…
|
||||
* @param progress
|
||||
* @param total
|
||||
*/
|
||||
void onProgress(long progress,long total);
|
||||
|
||||
/**
|
||||
* 完成
|
||||
* @param file
|
||||
*/
|
||||
void onFinish(File file);
|
||||
|
||||
/**
|
||||
* 错误
|
||||
* @param e
|
||||
*/
|
||||
void onError(Exception e);
|
||||
|
||||
|
||||
/**
|
||||
* 取消
|
||||
*/
|
||||
void onCancel();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,235 @@
|
||||
package com.web.dmcslot.appdown.http;
|
||||
|
||||
import android.os.AsyncTask;
|
||||
|
||||
import com.web.dmcslot.appdown.util.LogUtils;
|
||||
import com.web.dmcslot.appdown.util.SSLSocketFactoryUtils;
|
||||
|
||||
import org.apache.http.conn.ssl.SSLSocketFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.net.ConnectException;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import okhttp3.Call;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
|
||||
/**
|
||||
* OkHttpManager使用 {@link OkHttpClient} 实现的 {@link IHttpManager}
|
||||
* <p>使用 OkHttpManager 时必须依赖 OkHttp 库
|
||||
* @author <a href="mailto:jenly1314@gmail.com">Jenly</a>
|
||||
*/
|
||||
public class OkHttpManager implements IHttpManager {
|
||||
|
||||
private static final int DEFAULT_TIME_OUT = 20000;
|
||||
|
||||
private OkHttpClient okHttpClient;
|
||||
|
||||
private DownloadTask mDownloadTask;
|
||||
|
||||
private static volatile OkHttpManager INSTANCE;
|
||||
|
||||
public static OkHttpManager getInstance(){
|
||||
if(INSTANCE == null){
|
||||
synchronized (HttpManager.class){
|
||||
if(INSTANCE == null){
|
||||
INSTANCE = new OkHttpManager();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
private OkHttpManager(){
|
||||
this(DEFAULT_TIME_OUT);
|
||||
}
|
||||
|
||||
/**
|
||||
* HttpManager对外暴露。如果没有特殊需求,推荐使用{@link HttpManager#getInstance()}
|
||||
* @param timeout 超时时间,单位:毫秒
|
||||
*/
|
||||
public OkHttpManager(int timeout){
|
||||
this(new OkHttpClient.Builder()
|
||||
.readTimeout(timeout, TimeUnit.MILLISECONDS)
|
||||
.connectTimeout(timeout, TimeUnit.MILLISECONDS)
|
||||
.sslSocketFactory(SSLSocketFactoryUtils.createSSLSocketFactory(),SSLSocketFactoryUtils.createTrustAllManager())
|
||||
.hostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER)
|
||||
.build());
|
||||
}
|
||||
|
||||
/**
|
||||
* HttpManager对外暴露,推荐使用{@link HttpManager#getInstance()}
|
||||
* @param okHttpClient {@link OkHttpClient}
|
||||
*/
|
||||
public OkHttpManager(@NonNull OkHttpClient okHttpClient){
|
||||
this.okHttpClient = okHttpClient;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void download(String url,final String path,final String filename, @Nullable Map<String, String> requestProperty,final DownloadCallback callback) {
|
||||
mDownloadTask = new DownloadTask(okHttpClient, url, path, filename, requestProperty, callback);
|
||||
mDownloadTask.execute();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancel() {
|
||||
if(mDownloadTask != null){
|
||||
mDownloadTask.isCancel = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 异步下载任务
|
||||
*/
|
||||
private static class DownloadTask extends AsyncTask<Void,Long,File> {
|
||||
|
||||
private String url;
|
||||
|
||||
private String path;
|
||||
|
||||
private String filename;
|
||||
|
||||
private Map<String,String> requestProperty;
|
||||
|
||||
private DownloadCallback callback;
|
||||
|
||||
private Exception exception;
|
||||
|
||||
private OkHttpClient okHttpClient;
|
||||
|
||||
private volatile boolean isCancel;
|
||||
|
||||
public DownloadTask(OkHttpClient okHttpClient,String url, String path, String filename ,@Nullable Map<String,String> requestProperty, DownloadCallback callback){
|
||||
this.okHttpClient = okHttpClient;
|
||||
this.url = url;
|
||||
this.path = path;
|
||||
this.filename = filename;
|
||||
this.callback = callback;
|
||||
this.requestProperty = requestProperty;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected File doInBackground(Void... voids) {
|
||||
|
||||
try{
|
||||
Request.Builder builder = new Request.Builder()
|
||||
.url(url)
|
||||
.addHeader("Accept-Encoding", "identity")
|
||||
.get();
|
||||
|
||||
if(requestProperty!=null){
|
||||
for(Map.Entry<String,String> entry : requestProperty.entrySet()){
|
||||
builder.addHeader(entry.getKey(),entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
Call call = okHttpClient.newCall(builder.build());
|
||||
Response response = call.execute();
|
||||
|
||||
if(response.isSuccessful()){
|
||||
InputStream is = response.body().byteStream();
|
||||
|
||||
long length = response.body().contentLength();
|
||||
|
||||
LogUtils.d("contentLength:" + length);
|
||||
|
||||
long progress = 0;
|
||||
|
||||
byte[] buffer = new byte[8192];
|
||||
|
||||
int len;
|
||||
File file = new File(path,filename);
|
||||
FileOutputStream fos = new FileOutputStream(file);
|
||||
while ((len = is.read(buffer)) != -1){
|
||||
if(isCancel){
|
||||
if(call != null){
|
||||
call.cancel();
|
||||
}
|
||||
cancel(true);
|
||||
break;
|
||||
}
|
||||
fos.write(buffer,0,len);
|
||||
progress += len;
|
||||
// 更新进度
|
||||
if(length > 0){
|
||||
publishProgress(progress,length);
|
||||
}
|
||||
}
|
||||
|
||||
fos.flush();
|
||||
fos.close();
|
||||
is.close();
|
||||
|
||||
response.close();
|
||||
|
||||
if(progress <= 0 && length <= 0){
|
||||
throw new IllegalStateException(String.format("contentLength = %d",length));
|
||||
}
|
||||
|
||||
return file;
|
||||
|
||||
}else {// 连接失败
|
||||
throw new ConnectException(String.format("responseCode = %d",response.code()));
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
this.exception = e;
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPreExecute() {
|
||||
super.onPreExecute();
|
||||
if(callback != null){
|
||||
callback.onStart(url);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(File file) {
|
||||
super.onPostExecute(file);
|
||||
if(callback != null){
|
||||
if(file != null){
|
||||
callback.onFinish(file);
|
||||
}else{
|
||||
callback.onError(exception);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onProgressUpdate(Long... values) {
|
||||
super.onProgressUpdate(values);
|
||||
if(callback != null){
|
||||
if(!isCancelled()){
|
||||
callback.onProgress(values[0],values[1]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCancelled() {
|
||||
super.onCancelled();
|
||||
if(callback != null){
|
||||
callback.onCancel();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.web.dmcslot.appdown.notify;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.web.dmcslot.appdown.UpdateConfig;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:jenly1314@gmail.com">Jenly</a>
|
||||
*/
|
||||
public interface INotification {
|
||||
|
||||
void onStart(Context context, int notifyId, String channelId, String channelName, @DrawableRes int icon, CharSequence title, CharSequence content, boolean isVibrate, boolean isSound, boolean isCancelDownload);
|
||||
|
||||
void onProgress(Context context, int notifyId, String channelId, @DrawableRes int icon, CharSequence title, CharSequence content, int progress, int size, boolean isCancelDownload);
|
||||
|
||||
void onFinish(Context context, int notifyId, String channelId, @DrawableRes int icon, CharSequence title, CharSequence content, File file, String authority);
|
||||
|
||||
void onError(Context context, int notifyId, String channelId, @DrawableRes int icon, CharSequence title, CharSequence content, boolean isReDownload, UpdateConfig config);
|
||||
|
||||
void onCancel(Context context, int notifyId);
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.web.dmcslot.appdown.notify;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.web.dmcslot.appdown.UpdateConfig;
|
||||
import com.web.dmcslot.appdown.util.NotificationUtils;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:jenly1314@gmail.com">Jenly</a>
|
||||
*/
|
||||
public class NotificationImpl implements INotification {
|
||||
@Override
|
||||
public void onStart(Context context, int notifyId, String channelId, String channelName, int icon, CharSequence title, CharSequence content, boolean isVibrate, boolean isSound, boolean isCancelDownload) {
|
||||
NotificationUtils.showStartNotification(context, notifyId, channelId, channelName, icon, title, content, isVibrate, isSound, isCancelDownload);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProgress(Context context, int notifyId, String channelId, int icon, CharSequence title, CharSequence content, int progress, int size, boolean isCancelDownload) {
|
||||
NotificationUtils.showProgressNotification(context, notifyId, channelId, icon, title, content, progress, size, isCancelDownload);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish(Context context, int notifyId, String channelId, int icon, CharSequence title, CharSequence content, File file, String authority) {
|
||||
NotificationUtils.showFinishNotification(context, notifyId, channelId, icon, title, content, file, authority);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Context context, int notifyId, String channelId, int icon, CharSequence title, CharSequence content, boolean isReDownload, UpdateConfig config) {
|
||||
NotificationUtils.showErrorNotification(context, notifyId, channelId, icon, title, content, isReDownload, config);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel(Context context, int notifyId) {
|
||||
NotificationUtils.cancelNotification(context, notifyId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.web.dmcslot.appdown.provider;
|
||||
|
||||
|
||||
import androidx.core.content.FileProvider;
|
||||
|
||||
/**
|
||||
* @author Jenly <a href="mailto:jenly1314@gmail.com">Jenly</a>
|
||||
*/
|
||||
public class AppUpdaterFileProvider extends FileProvider {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,456 @@
|
||||
package com.web.dmcslot.appdown.service;
|
||||
|
||||
import android.app.Service;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Binder;
|
||||
import android.os.Build;
|
||||
import android.os.IBinder;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.web.dmcslot.R;
|
||||
import com.web.dmcslot.appdown.UpdateConfig;
|
||||
import com.web.dmcslot.appdown.callback.UpdateCallback;
|
||||
import com.web.dmcslot.appdown.constant.Constants;
|
||||
import com.web.dmcslot.appdown.http.HttpManager;
|
||||
import com.web.dmcslot.appdown.http.IHttpManager;
|
||||
import com.web.dmcslot.appdown.notify.INotification;
|
||||
import com.web.dmcslot.appdown.notify.NotificationImpl;
|
||||
import com.web.dmcslot.appdown.util.AppUtils;
|
||||
import com.web.dmcslot.appdown.util.LogUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Locale;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
|
||||
/**
|
||||
* 下载服务
|
||||
* @author Jenly <a href="mailto:jenly1314@gmail.com">Jenly</a>
|
||||
*/
|
||||
public class DownloadService extends Service {
|
||||
|
||||
private DownloadBinder mDownloadBinder = new DownloadBinder();
|
||||
/**
|
||||
* 是否在下载,防止重复下载。
|
||||
*/
|
||||
private boolean isDownloading;
|
||||
/**
|
||||
* 失败后重新下载次数
|
||||
*/
|
||||
private int mCount = 0;
|
||||
/**
|
||||
* Http管理器
|
||||
*/
|
||||
private IHttpManager mHttpManager;
|
||||
|
||||
private File mApkFile;
|
||||
|
||||
private Context getContext(){
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
if(intent != null){
|
||||
boolean isStop = intent.getBooleanExtra(Constants.KEY_STOP_DOWNLOAD_SERVICE,false);
|
||||
if(isStop){
|
||||
stopDownload();
|
||||
} else if(!isDownloading){
|
||||
//是否实通过通知栏触发重复下载
|
||||
boolean isReDownload = intent.getBooleanExtra(Constants.KEY_RE_DOWNLOAD,false);
|
||||
if(isReDownload){
|
||||
mCount++;
|
||||
}
|
||||
//获取配置信息
|
||||
UpdateConfig config = intent.getParcelableExtra(Constants.KEY_UPDATE_CONFIG);
|
||||
startDownload(config,null,null, new NotificationImpl());
|
||||
}else{
|
||||
LogUtils.w("Please do not duplicate downloads.");
|
||||
}
|
||||
}
|
||||
|
||||
return super.onStartCommand(intent, flags, startId);
|
||||
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------
|
||||
|
||||
/**
|
||||
* 开始下载
|
||||
* @param config
|
||||
* @param httpManager
|
||||
* @param callback
|
||||
*/
|
||||
public void startDownload(@NonNull UpdateConfig config,@Nullable IHttpManager httpManager,@Nullable UpdateCallback callback, @Nullable INotification notification){
|
||||
if(callback != null){
|
||||
callback.onDownloading(isDownloading);
|
||||
}
|
||||
|
||||
if(isDownloading){
|
||||
LogUtils.w("Please do not duplicate downloads.");
|
||||
return;
|
||||
}
|
||||
|
||||
String url = config.getUrl();
|
||||
String path = config.getPath();
|
||||
String filename = config.getFilename();
|
||||
|
||||
//如果保存路径为空则使用缓存路径
|
||||
if(TextUtils.isEmpty(path)){
|
||||
path = getCacheFilesDir(getContext());
|
||||
}
|
||||
File dirFile = new File(path);
|
||||
if(!dirFile.exists()){
|
||||
dirFile.mkdirs();
|
||||
}
|
||||
|
||||
//如果文件名为空则使用路径
|
||||
if(TextUtils.isEmpty(filename)){
|
||||
filename = AppUtils.getAppFullName(getContext(),url,getResources().getString(R.string.app_name));
|
||||
}
|
||||
|
||||
mApkFile = new File(path, filename);
|
||||
if(mApkFile.exists()){//文件是否存在
|
||||
Integer versionCode = config.getVersionCode();
|
||||
String apkMD5 = config.getApkMD5();
|
||||
//是否存在相同的apk
|
||||
boolean isExistApk = false;
|
||||
if(!TextUtils.isEmpty(apkMD5)){//如果存在MD5,则优先校验MD5
|
||||
LogUtils.d(String.format(Locale.getDefault(),"UpdateConfig.apkMD5:%s",apkMD5));
|
||||
isExistApk = AppUtils.checkFileMD5(mApkFile,apkMD5);
|
||||
}else if(versionCode != null){//如果存在versionCode,则校验versionCode
|
||||
LogUtils.d(String.format(Locale.getDefault(),"UpdateConfig.versionCode:%d",versionCode));
|
||||
isExistApk = AppUtils.apkExists(getContext(),versionCode,mApkFile);
|
||||
}
|
||||
|
||||
if(isExistApk){
|
||||
//本地已经存在要下载的APK
|
||||
LogUtils.d("CacheFile:" + mApkFile);
|
||||
if(config.isInstallApk()){
|
||||
String authority = config.getAuthority();
|
||||
if(TextUtils.isEmpty(authority)){//如果为空则默认
|
||||
authority = AppUtils.getFileProviderAuthority(getContext());
|
||||
}
|
||||
AppUtils.installApk(getContext(), mApkFile, authority);
|
||||
}
|
||||
if(callback != null){
|
||||
callback.onFinish(mApkFile);
|
||||
}
|
||||
stopService();
|
||||
return;
|
||||
}
|
||||
|
||||
//删除旧文件
|
||||
mApkFile.delete();
|
||||
}
|
||||
LogUtils.d("File:" + mApkFile);
|
||||
|
||||
mHttpManager = httpManager != null ? httpManager : HttpManager.getInstance();
|
||||
IHttpManager.DownloadCallback downloadCallback = new AppDownloadCallback(getContext(),this, config, mApkFile, callback, notification);
|
||||
mHttpManager.download(url,path,filename,config.getRequestProperty(), downloadCallback);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止下载
|
||||
*/
|
||||
public void stopDownload(){
|
||||
if(mHttpManager != null){
|
||||
mHttpManager.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取缓存路径
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
private String getCacheFilesDir(Context context) {
|
||||
File[] files = ContextCompat.getExternalFilesDirs(context, Constants.DEFAULT_DIR);
|
||||
if(files != null && files.length > 0){
|
||||
return files[0].getAbsolutePath();
|
||||
}
|
||||
|
||||
File externalFilesDir = context.getExternalFilesDir(Constants.DEFAULT_DIR);
|
||||
if(externalFilesDir != null){
|
||||
return externalFilesDir.getAbsolutePath();
|
||||
}
|
||||
|
||||
return new File(context.getFilesDir(), Constants.DEFAULT_DIR).getAbsolutePath();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止服务
|
||||
*/
|
||||
private void stopService(){
|
||||
mCount = 0;
|
||||
stopSelf();
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------- DownloadCallback
|
||||
|
||||
/**
|
||||
* App下载回调接口
|
||||
*/
|
||||
public static class AppDownloadCallback implements IHttpManager.DownloadCallback {
|
||||
|
||||
private Context context;
|
||||
|
||||
private DownloadService downloadService;
|
||||
|
||||
public UpdateConfig config;
|
||||
|
||||
private boolean isShowNotification;
|
||||
|
||||
private int notifyId;
|
||||
|
||||
private String channelId;
|
||||
|
||||
private String channelName;
|
||||
|
||||
private int notificationIcon;
|
||||
|
||||
private boolean isInstallApk;
|
||||
|
||||
private String authority;
|
||||
|
||||
private boolean isShowPercentage;
|
||||
|
||||
private boolean isReDownload;
|
||||
|
||||
private boolean isDeleteCancelFile;
|
||||
|
||||
private boolean isCancelDownload;
|
||||
|
||||
private UpdateCallback callback;
|
||||
|
||||
private INotification notification;
|
||||
|
||||
/**
|
||||
* 最后更新进度,用来降频刷新
|
||||
*/
|
||||
private int lastProgress;
|
||||
/**
|
||||
* 最后进度更新时间,用来降频刷新
|
||||
*/
|
||||
private long lastTime;
|
||||
/**
|
||||
* APK文件
|
||||
*/
|
||||
private File apkFile;
|
||||
|
||||
|
||||
private AppDownloadCallback(Context context, DownloadService downloadService, UpdateConfig config, File apkFile, UpdateCallback callback, INotification notification){
|
||||
this.context = context;
|
||||
this.downloadService = downloadService;
|
||||
this.config = config;
|
||||
this.apkFile = apkFile;
|
||||
this.callback = callback;
|
||||
this.notification = notification;
|
||||
this.isShowNotification = config.isShowNotification();
|
||||
this.notifyId = config.getNotificationId();
|
||||
|
||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){
|
||||
this.channelId = TextUtils.isEmpty(config.getChannelId()) ? Constants.DEFAULT_NOTIFICATION_CHANNEL_ID : config.getChannelId();
|
||||
this.channelName = TextUtils.isEmpty(config.getChannelName()) ? Constants.DEFAULT_NOTIFICATION_CHANNEL_NAME : config.getChannelName();
|
||||
}
|
||||
if(config.getNotificationIcon() <= 0){
|
||||
this.notificationIcon = AppUtils.getAppIcon(context);
|
||||
}else{
|
||||
this.notificationIcon = config.getNotificationIcon();
|
||||
}
|
||||
|
||||
this.isInstallApk = config.isInstallApk();
|
||||
|
||||
this.authority = config.getAuthority();
|
||||
if(TextUtils.isEmpty(config.getAuthority())){//如果为空则默认
|
||||
authority = AppUtils.getFileProviderAuthority(context);
|
||||
}
|
||||
|
||||
this.isShowPercentage = config.isShowPercentage();
|
||||
this.isDeleteCancelFile = config.isDeleteCancelFile();
|
||||
this.isCancelDownload = config.isCancelDownload();
|
||||
|
||||
//支持下载失败时重新下载,当重新下载次数不超过限制时才被允许
|
||||
this.isReDownload = config.isReDownload() && downloadService.mCount < config.getReDownloads();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart(String url) {
|
||||
LogUtils.i("url:" + url);
|
||||
downloadService.isDownloading = true;
|
||||
lastProgress = 0;
|
||||
if(isShowNotification && notification != null){
|
||||
String title="";
|
||||
if(Constants.isUpdate){
|
||||
title = getString(R.string.app_updater_start_notification_title);
|
||||
}else{
|
||||
title = getString(R.string.app_updater_start_notification_title_2);
|
||||
}
|
||||
notification.onStart(context,notifyId,channelId,channelName,notificationIcon,title,getString(R.string.app_updater_start_notification_content),config.isVibrate(),config.isSound(),isCancelDownload);
|
||||
}
|
||||
|
||||
if(callback != null){
|
||||
callback.onStart(url);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProgress(long progress, long total) {
|
||||
boolean isChange = false;
|
||||
long curTime = System.currentTimeMillis();
|
||||
if(lastTime + 200 < curTime || progress == total) {//降低更新频率
|
||||
lastTime = curTime;
|
||||
|
||||
int currProgress = Math.round(progress * 1.0f / total * 100.0f);
|
||||
if(currProgress != lastProgress){//百分比改变了才更新
|
||||
isChange = true;
|
||||
lastProgress = currProgress;
|
||||
String percentage = currProgress + "%";
|
||||
LogUtils.i(String.format(Locale.getDefault(),"%s \t(%d/%d)", percentage, progress, total));
|
||||
if(isShowNotification && notification != null) {
|
||||
String content = context.getString(R.string.app_updater_progress_notification_content);
|
||||
if (isShowPercentage) {
|
||||
content += percentage;
|
||||
}
|
||||
String title="";
|
||||
if(Constants.isUpdate){
|
||||
title = getString(R.string.app_updater_progress_notification_title);
|
||||
}else{
|
||||
title = getString(R.string.app_updater_progress_notification_title_2);
|
||||
}
|
||||
notification.onProgress(context,notifyId, channelId, notificationIcon, title, content, currProgress, 100,isCancelDownload);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(callback != null){
|
||||
callback.onProgress(progress,total,isChange);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish(File file) {
|
||||
LogUtils.d("File:" + file);
|
||||
downloadService.isDownloading = false;
|
||||
if(isShowNotification && notification != null){
|
||||
notification.onFinish(context,notifyId,channelId,notificationIcon,getString(R.string.app_updater_finish_notification_title),getString(R.string.app_updater_finish_notification_content),file,authority);
|
||||
}
|
||||
if(isInstallApk){
|
||||
AppUtils.installApk(context,file,authority);
|
||||
}
|
||||
if(callback != null){
|
||||
callback.onFinish(file);
|
||||
}
|
||||
downloadService.stopService();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Exception e) {
|
||||
LogUtils.w(e.getMessage());
|
||||
downloadService.isDownloading = false;
|
||||
if(isShowNotification && notification != null){
|
||||
String content = isReDownload ? getString(R.string.app_updater_error_notification_content_re_download) : getString(R.string.app_updater_error_notification_content);
|
||||
notification.onError(context,notifyId,channelId,notificationIcon,getString(R.string.app_updater_error_notification_title),content,isReDownload,config);
|
||||
}
|
||||
|
||||
if(callback != null){
|
||||
callback.onError(e);
|
||||
}
|
||||
if(!isReDownload){
|
||||
downloadService.stopService();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
LogUtils.d("Cancel download.");
|
||||
downloadService.isDownloading = false;
|
||||
if(isShowNotification && notification != null){
|
||||
notification.onCancel(context,notifyId);
|
||||
}
|
||||
if(callback != null){
|
||||
callback.onCancel();
|
||||
}
|
||||
if(isDeleteCancelFile && apkFile != null){
|
||||
apkFile.delete();
|
||||
}
|
||||
downloadService.stopService();
|
||||
}
|
||||
|
||||
private String getString(@StringRes int resId){
|
||||
return context.getString(resId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
isDownloading = false;
|
||||
mHttpManager = null;
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
//---------------------------------------- Binder
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
return mDownloadBinder;
|
||||
}
|
||||
|
||||
/**
|
||||
* 提供绑定服务的方式进行下载
|
||||
*/
|
||||
public class DownloadBinder extends Binder {
|
||||
|
||||
/**
|
||||
* 开始下载
|
||||
* @param config {@link UpdateConfig}
|
||||
*/
|
||||
public void start(@NonNull UpdateConfig config){
|
||||
start(config,null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始下载
|
||||
* @param config {@link UpdateConfig}
|
||||
* @param callback {@link UpdateCallback}
|
||||
*/
|
||||
public void start(@NonNull UpdateConfig config, @Nullable UpdateCallback callback){
|
||||
start(config,null, callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始下载
|
||||
* @param config {@link UpdateConfig}
|
||||
* @param httpManager {@link IHttpManager}
|
||||
* @param callback {@link UpdateCallback}
|
||||
*/
|
||||
public void start(@NonNull UpdateConfig config, @Nullable IHttpManager httpManager, @Nullable UpdateCallback callback){
|
||||
start(config, httpManager, callback, new NotificationImpl());
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始下载
|
||||
* @param config {@link UpdateConfig}
|
||||
* @param httpManager {@link IHttpManager}
|
||||
* @param callback {@link UpdateCallback}
|
||||
* @param notification {@link INotification}
|
||||
*/
|
||||
public void start(@NonNull UpdateConfig config, @Nullable IHttpManager httpManager, @Nullable UpdateCallback callback,@NonNull INotification notification){
|
||||
startDownload(config, httpManager, callback, notification);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
264
Dmcslot/src/main/java/com/web/dmcslot/appdown/util/AppUtils.java
Normal file
@@ -0,0 +1,264 @@
|
||||
package com.web.dmcslot.appdown.util;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.AssetFileDescriptor;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.core.content.FileProvider;
|
||||
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.math.BigInteger;
|
||||
import java.security.MessageDigest;
|
||||
|
||||
import com.web.dmcslot.appdown.constant.Constants;
|
||||
|
||||
|
||||
/**
|
||||
* @author Jenly <a href="mailto:jenly1314@gmail.com">Jenly</a>
|
||||
*/
|
||||
public final class AppUtils {
|
||||
|
||||
private AppUtils(){
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过url获取App的全名称
|
||||
* @param context
|
||||
* @return AppName.apk
|
||||
*/
|
||||
public static String getAppFullName(Context context,String url,String defaultName){
|
||||
if(url.endsWith(".apk")){
|
||||
String apkName = url.substring(url.lastIndexOf("/") + 1);
|
||||
if(apkName.length() <= 64){
|
||||
return apkName;
|
||||
}
|
||||
}
|
||||
|
||||
String filename = getAppName(context);
|
||||
Log.d(Constants.TAG, "AppName:" + filename);
|
||||
if(TextUtils.isEmpty(filename)){
|
||||
filename = defaultName;
|
||||
}
|
||||
if(filename.endsWith(".apk")){
|
||||
return filename;
|
||||
}
|
||||
return String.format("%s.apk",filename);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取包信息
|
||||
* @param context
|
||||
* @return
|
||||
* @throws PackageManager.NameNotFoundException
|
||||
*/
|
||||
public static PackageInfo getPackageInfo(Context context) throws PackageManager.NameNotFoundException {
|
||||
PackageManager packageManager = context.getPackageManager();
|
||||
PackageInfo packageInfo = packageManager.getPackageInfo(context.getPackageName(), 0);
|
||||
return packageInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过APK路径获取包信息
|
||||
* @param context
|
||||
* @param archiveFilePath
|
||||
* @return
|
||||
*/
|
||||
public static PackageInfo getPackageInfo(Context context, String archiveFilePath) {
|
||||
PackageManager packageManager = context.getPackageManager();
|
||||
PackageInfo packageInfo = packageManager.getPackageArchiveInfo(archiveFilePath, PackageManager.GET_ACTIVITIES);
|
||||
return packageInfo;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取App的名称
|
||||
*/
|
||||
public static String getAppName(Context context) {
|
||||
try{
|
||||
int labelRes = getPackageInfo(context).applicationInfo.labelRes;
|
||||
return context.getResources().getString(labelRes);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取App的图标
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
public static int getAppIcon(Context context){
|
||||
try{
|
||||
return getPackageInfo(context).applicationInfo.icon;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 安装apk
|
||||
* @param context
|
||||
* @param file
|
||||
*/
|
||||
public static void installApk(Context context,File file,String authority){
|
||||
Intent intent = getInstallIntent(context,file,authority);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取安装Intent
|
||||
* @param context
|
||||
* @param file
|
||||
* @param authority
|
||||
* @return
|
||||
*/
|
||||
public static Intent getInstallIntent(Context context,File file,String authority){
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
intent.addCategory(Intent.CATEGORY_DEFAULT);
|
||||
Uri uriData;
|
||||
String type = "application/vnd.android.package-archive";
|
||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N){
|
||||
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||
uriData = FileProvider.getUriForFile(context, authority, file);
|
||||
}else{
|
||||
uriData = Uri.fromFile(file);
|
||||
}
|
||||
intent.setDataAndType(uriData, type);
|
||||
return intent;
|
||||
}
|
||||
|
||||
/**
|
||||
* APK是否存在
|
||||
* @param context
|
||||
* @param versionCode
|
||||
* @param file
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static boolean apkExists(Context context,int versionCode,File file){
|
||||
if(file != null && file.exists()){
|
||||
String packageName = context.getPackageName();
|
||||
PackageInfo packageInfo = AppUtils.getPackageInfo(context,file.getAbsolutePath());
|
||||
if(packageInfo != null){// 比对versionCode
|
||||
Log.d(Constants.TAG,String.format("ApkVersionCode:%d",packageInfo.versionCode));
|
||||
if(versionCode == packageInfo.versionCode){
|
||||
ApplicationInfo applicationInfo = packageInfo.applicationInfo;
|
||||
if(applicationInfo != null && packageName.equals(applicationInfo.packageName)){//比对packageName
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断文件是否存在
|
||||
* @param context
|
||||
* @param path
|
||||
* @return
|
||||
*/
|
||||
public static boolean isAndroidQFileExists(Context context,String path){
|
||||
return isAndroidQFileExists(context,new File(path));
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断文件是否存在
|
||||
* @param context
|
||||
* @param file
|
||||
* @return
|
||||
*/
|
||||
public static boolean isAndroidQFileExists(Context context,File file){
|
||||
AssetFileDescriptor descriptor = null;
|
||||
ContentResolver contentResolver = context.getContentResolver();
|
||||
try {
|
||||
Uri uri = Uri.fromFile(file);
|
||||
descriptor = contentResolver.openAssetFileDescriptor(uri, "r");
|
||||
if (descriptor == null) {
|
||||
return false;
|
||||
} else {
|
||||
close(descriptor);
|
||||
}
|
||||
return true;
|
||||
} catch (FileNotFoundException e) {
|
||||
|
||||
}finally {
|
||||
close(descriptor);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验文件MD5
|
||||
* @param file
|
||||
* @param md5
|
||||
* @return
|
||||
*/
|
||||
public static boolean checkFileMD5(File file,String md5){
|
||||
String fileMD5 = getFileMD5(file);
|
||||
Log.d(Constants.TAG,"FileMD5:"+ fileMD5);
|
||||
if(!TextUtils.isEmpty(md5)){
|
||||
return md5.equalsIgnoreCase(fileMD5);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件MD5
|
||||
* @param file
|
||||
* @return
|
||||
*/
|
||||
public static String getFileMD5(File file){
|
||||
try {
|
||||
FileInputStream fis = new FileInputStream(file);
|
||||
MessageDigest messageDigest = MessageDigest.getInstance("MD5");
|
||||
byte[] buffer = new byte[1024];
|
||||
int length;
|
||||
while ((length = fis.read(buffer)) != -1){
|
||||
messageDigest.update(buffer,0,length);
|
||||
}
|
||||
BigInteger bigInteger = new BigInteger(1,messageDigest.digest());
|
||||
return bigInteger.toString(16);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getFileProviderAuthority(Context context){
|
||||
return context.getPackageName() + Constants.DEFAULT_FILE_PROVIDER;
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭
|
||||
* @param descriptor
|
||||
*/
|
||||
private static void close(AssetFileDescriptor descriptor){
|
||||
if(descriptor != null){
|
||||
try {
|
||||
descriptor.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
316
Dmcslot/src/main/java/com/web/dmcslot/appdown/util/LogUtils.java
Normal file
@@ -0,0 +1,316 @@
|
||||
/*
|
||||
Copyright © 2015, 2016 Jenly Yu <a href="mailto:jenly1314@gmail.com">Jenly</a>
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
*/
|
||||
package com.web.dmcslot.appdown.util;
|
||||
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* @author Jenly <a href="mailto:jenly1314@gmail.com">Jenly</a>
|
||||
*/
|
||||
public class LogUtils {
|
||||
|
||||
public static final String TAG = "AppUpdater";
|
||||
|
||||
public static final String VERTICAL = "|";
|
||||
|
||||
/** 是否显示Log日志 */
|
||||
private static boolean isShowLog = true;
|
||||
|
||||
/** Log日志优先权 */
|
||||
private static int priority = 1;
|
||||
|
||||
/**
|
||||
* Priority constant for the println method;use System.out.println
|
||||
*/
|
||||
public static final int PRINTLN = 1;
|
||||
|
||||
/**
|
||||
* Priority constant for the println method; use Log.v.
|
||||
*/
|
||||
public static final int VERBOSE = 2;
|
||||
|
||||
/**
|
||||
* Priority constant for the println method; use Log.d.
|
||||
*/
|
||||
public static final int DEBUG = 3;
|
||||
|
||||
/**
|
||||
* Priority constant for the println method; use Log.i.
|
||||
*/
|
||||
public static final int INFO = 4;
|
||||
|
||||
/**
|
||||
* Priority constant for the println method; use Log.w.
|
||||
*/
|
||||
public static final int WARN = 5;
|
||||
|
||||
/**
|
||||
* Priority constant for the println method; use Log.e.
|
||||
*/
|
||||
public static final int ERROR = 6;
|
||||
|
||||
/**
|
||||
* Priority constant for the println method.use Log.wtf.
|
||||
*/
|
||||
public static final int ASSERT = 7;
|
||||
|
||||
public static final String TAG_FORMAT = "%s.%s(%s:%d)";
|
||||
|
||||
private LogUtils(){
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
||||
public static void setShowLog(boolean isShowLog) {
|
||||
|
||||
LogUtils.isShowLog = isShowLog;
|
||||
}
|
||||
|
||||
public static boolean isShowLog() {
|
||||
|
||||
return isShowLog;
|
||||
}
|
||||
|
||||
public static int getPriority() {
|
||||
|
||||
return priority;
|
||||
}
|
||||
|
||||
public static void setPriority(int priority) {
|
||||
|
||||
LogUtils.priority = priority;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据堆栈生成TAG
|
||||
* @return TAG|className.methodName(fileName:lineNumber)
|
||||
*/
|
||||
private static String generateTag(StackTraceElement caller) {
|
||||
String tag = TAG_FORMAT;
|
||||
String callerClazzName = caller.getClassName();
|
||||
callerClazzName = callerClazzName.substring(callerClazzName.lastIndexOf(".") + 1);
|
||||
tag = String.format(Locale.getDefault(),tag,callerClazzName, caller.getMethodName(),caller.getFileName(),caller.getLineNumber());
|
||||
return new StringBuilder().append(TAG).append(VERTICAL).append(tag).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取堆栈
|
||||
* @param n
|
||||
* n=0 VMStack
|
||||
* n=1 Thread
|
||||
* n=3 CurrentStack
|
||||
* n=4 CallerStack
|
||||
* ...
|
||||
* @return
|
||||
*/
|
||||
public static StackTraceElement getStackTraceElement(int n) {
|
||||
return Thread.currentThread().getStackTrace()[n];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取调用方的堆栈TAG
|
||||
* @return
|
||||
*/
|
||||
private static String getCallerStackLogTag(){
|
||||
return generateTag(getStackTraceElement(5));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param t
|
||||
* @return
|
||||
*/
|
||||
private static String getStackTraceString(Throwable t){
|
||||
return Log.getStackTraceString(t);
|
||||
}
|
||||
|
||||
// -----------------------------------Log.v
|
||||
|
||||
/**
|
||||
* Log.v
|
||||
* @param msg
|
||||
*/
|
||||
public static void v(String msg) {
|
||||
if (isShowLog && priority <= VERBOSE)
|
||||
Log.v(getCallerStackLogTag(), String.valueOf(msg));
|
||||
|
||||
}
|
||||
|
||||
public static void v(Throwable t) {
|
||||
if (isShowLog && priority <= VERBOSE)
|
||||
Log.v(getCallerStackLogTag(), getStackTraceString(t));
|
||||
}
|
||||
|
||||
public static void v(String msg,Throwable t) {
|
||||
if (isShowLog && priority <= VERBOSE)
|
||||
Log.v(getCallerStackLogTag(), String.valueOf(msg), t);
|
||||
}
|
||||
|
||||
// -----------------------------------Log.d
|
||||
|
||||
/**
|
||||
* Log.d
|
||||
* @param msg
|
||||
*/
|
||||
public static void d(String msg) {
|
||||
if (isShowLog && priority <= DEBUG)
|
||||
Log.d(getCallerStackLogTag(), String.valueOf(msg));
|
||||
}
|
||||
|
||||
public static void d(Throwable t) {
|
||||
if (isShowLog && priority <= DEBUG)
|
||||
Log.d(getCallerStackLogTag(), getStackTraceString(t));
|
||||
}
|
||||
|
||||
public static void d(String msg,Throwable t) {
|
||||
if (isShowLog && priority <= DEBUG)
|
||||
Log.d(getCallerStackLogTag(), String.valueOf(msg), t);
|
||||
}
|
||||
|
||||
// -----------------------------------Log.i
|
||||
|
||||
/**
|
||||
* Log.i
|
||||
* @param msg
|
||||
*/
|
||||
public static void i(String msg) {
|
||||
if (isShowLog && priority <= INFO)
|
||||
Log.i(getCallerStackLogTag(), String.valueOf(msg));
|
||||
}
|
||||
|
||||
public static void i(Throwable t) {
|
||||
if (isShowLog && priority <= INFO)
|
||||
Log.i(getCallerStackLogTag(), getStackTraceString(t));
|
||||
}
|
||||
|
||||
public static void i(String msg,Throwable t) {
|
||||
if (isShowLog && priority <= INFO)
|
||||
Log.i(getCallerStackLogTag(), String.valueOf(msg), t);
|
||||
}
|
||||
|
||||
// -----------------------------------Log.w
|
||||
|
||||
/**
|
||||
* Log.w
|
||||
* @param msg
|
||||
*/
|
||||
public static void w(String msg) {
|
||||
if (isShowLog && priority <= WARN)
|
||||
Log.w(getCallerStackLogTag(), String.valueOf(msg));
|
||||
}
|
||||
|
||||
public static void w(Throwable t) {
|
||||
if (isShowLog && priority <= WARN)
|
||||
Log.w(getCallerStackLogTag(), getStackTraceString(t));
|
||||
}
|
||||
|
||||
public static void w(String msg,Throwable t) {
|
||||
if (isShowLog && priority <= WARN)
|
||||
Log.w(getCallerStackLogTag(), String.valueOf(msg), t);
|
||||
}
|
||||
|
||||
// -----------------------------------Log.e
|
||||
|
||||
/**
|
||||
* Log.e
|
||||
* @param msg
|
||||
*/
|
||||
public static void e(String msg) {
|
||||
if (isShowLog && priority <= ERROR)
|
||||
Log.e(getCallerStackLogTag(), String.valueOf(msg));
|
||||
}
|
||||
|
||||
public static void e(Throwable t) {
|
||||
if (isShowLog && priority <= ERROR)
|
||||
Log.e(getCallerStackLogTag(), getStackTraceString(t));
|
||||
}
|
||||
|
||||
public static void e(String msg,Throwable t) {
|
||||
if (isShowLog && priority <= ERROR)
|
||||
Log.e(getCallerStackLogTag(), String.valueOf(msg), t);
|
||||
}
|
||||
|
||||
// -----------------------------------Log.wtf
|
||||
|
||||
/**
|
||||
* Log.wtf
|
||||
* @param msg
|
||||
*/
|
||||
public static void wtf(String msg) {
|
||||
if (isShowLog && priority <= ASSERT)
|
||||
Log.wtf(getCallerStackLogTag(), String.valueOf(msg));
|
||||
}
|
||||
|
||||
public static void wtf(Throwable t) {
|
||||
if (isShowLog && priority <= ASSERT)
|
||||
Log.wtf(getCallerStackLogTag(), getStackTraceString(t));
|
||||
}
|
||||
|
||||
public static void wtf(String msg,Throwable t) {
|
||||
if (isShowLog && priority <= ASSERT)
|
||||
Log.wtf(getCallerStackLogTag(), String.valueOf(msg), t);
|
||||
}
|
||||
|
||||
// -----------------------------------System.out.print
|
||||
|
||||
/**
|
||||
* System.out.print
|
||||
*
|
||||
* @param msg
|
||||
*/
|
||||
public static void print(String msg) {
|
||||
if (isShowLog && priority <= PRINTLN)
|
||||
System.out.print(msg);
|
||||
}
|
||||
|
||||
public static void print(Object obj) {
|
||||
if (isShowLog && priority <= PRINTLN)
|
||||
System.out.print(obj);
|
||||
}
|
||||
|
||||
// -----------------------------------System.out.printf
|
||||
|
||||
/**
|
||||
* System.out.printf
|
||||
*
|
||||
* @param msg
|
||||
*/
|
||||
public static void printf(String msg) {
|
||||
if (isShowLog && priority <= PRINTLN)
|
||||
System.out.printf(msg);
|
||||
}
|
||||
|
||||
// -----------------------------------System.out.println
|
||||
|
||||
/**
|
||||
* System.out.println
|
||||
*
|
||||
* @param msg
|
||||
*/
|
||||
public static void println(String msg) {
|
||||
if (isShowLog && priority <= PRINTLN)
|
||||
System.out.println(msg);
|
||||
}
|
||||
|
||||
public static void println(Object obj) {
|
||||
if (isShowLog && priority <= PRINTLN)
|
||||
System.out.println(obj);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,261 @@
|
||||
package com.web.dmcslot.appdown.util;
|
||||
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import com.web.dmcslot.appdown.UpdateConfig;
|
||||
import com.web.dmcslot.appdown.constant.Constants;
|
||||
import com.web.dmcslot.appdown.service.DownloadService;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:jenly1314@gmail.com">Jenly</a>
|
||||
*/
|
||||
public class NotificationUtils {
|
||||
|
||||
private NotificationUtils(){
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示开始下载时的通知
|
||||
* @param notifyId
|
||||
* @param channelId
|
||||
* @param channelName
|
||||
* @param icon
|
||||
* @param title
|
||||
* @param content
|
||||
*/
|
||||
public static void showStartNotification(Context context, int notifyId,String channelId, String channelName,@DrawableRes int icon,CharSequence title,CharSequence content,boolean isVibrate,boolean isSound, boolean isCancelDownload){
|
||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){
|
||||
createNotificationChannel(context,channelId,channelName,isVibrate,isSound);
|
||||
}
|
||||
NotificationCompat.Builder builder = buildNotification(context,channelId,icon,title,content);
|
||||
builder.setPriority(NotificationCompat.PRIORITY_DEFAULT);
|
||||
if(isVibrate && isSound){
|
||||
builder.setDefaults(Notification.DEFAULT_VIBRATE | Notification.DEFAULT_SOUND);
|
||||
}else if(isVibrate){
|
||||
builder.setDefaults(Notification.DEFAULT_VIBRATE);
|
||||
}else if(isSound){
|
||||
builder.setDefaults(Notification.DEFAULT_SOUND);
|
||||
}
|
||||
|
||||
if(isCancelDownload){
|
||||
Intent intent = new Intent(context, DownloadService.class);
|
||||
intent.putExtra(Constants.KEY_STOP_DOWNLOAD_SERVICE,true);
|
||||
PendingIntent deleteIntent = PendingIntent.getService(context, notifyId,intent, getPendingIntentFlags(PendingIntent.FLAG_CANCEL_CURRENT));
|
||||
builder.setDeleteIntent(deleteIntent);
|
||||
}
|
||||
|
||||
Notification notification = builder.build();
|
||||
if(isCancelDownload){
|
||||
notification.flags = Notification.FLAG_ONLY_ALERT_ONCE;
|
||||
}else{
|
||||
notification.flags = Notification.FLAG_NO_CLEAR | Notification.FLAG_ONLY_ALERT_ONCE;
|
||||
}
|
||||
|
||||
notifyNotification(context,notifyId,notification);
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示下载中的通知(更新进度)
|
||||
* @param notifyId
|
||||
* @param channelId
|
||||
* @param icon
|
||||
* @param title
|
||||
* @param content
|
||||
* @param progress
|
||||
* @param size
|
||||
*/
|
||||
public static void showProgressNotification(Context context, int notifyId,String channelId,@DrawableRes int icon,CharSequence title,CharSequence content,int progress,int size, boolean isCancelDownload){
|
||||
NotificationCompat.Builder builder = buildNotification(context,channelId,icon,title,content,progress,size);
|
||||
|
||||
if(isCancelDownload){
|
||||
Intent intent = new Intent(context, DownloadService.class);
|
||||
intent.putExtra(Constants.KEY_STOP_DOWNLOAD_SERVICE,true);
|
||||
PendingIntent deleteIntent = PendingIntent.getService(context, notifyId, intent, getPendingIntentFlags(PendingIntent.FLAG_CANCEL_CURRENT));
|
||||
builder.setDeleteIntent(deleteIntent);
|
||||
}
|
||||
|
||||
Notification notification = builder.build();
|
||||
|
||||
if(isCancelDownload){
|
||||
notification.flags = Notification.FLAG_ONLY_ALERT_ONCE;
|
||||
}else{
|
||||
notification.flags = Notification.FLAG_NO_CLEAR | Notification.FLAG_ONLY_ALERT_ONCE;
|
||||
}
|
||||
|
||||
notifyNotification(context,notifyId,notification);
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示下载完成时的通知(点击安装)
|
||||
* @param notifyId
|
||||
* @param channelId
|
||||
* @param icon
|
||||
* @param title
|
||||
* @param content
|
||||
* @param file
|
||||
*/
|
||||
public static void showFinishNotification(Context context, int notifyId, String channelId, @DrawableRes int icon, CharSequence title, CharSequence content, File file, String authority){
|
||||
cancelNotification(context,notifyId);
|
||||
NotificationCompat.Builder builder = buildNotification(context,channelId,icon,title,content);
|
||||
builder.setAutoCancel(true);
|
||||
Intent intent = AppUtils.getInstallIntent(context,file,authority);
|
||||
PendingIntent clickIntent = PendingIntent.getActivity(context, notifyId, intent, getPendingIntentFlags(PendingIntent.FLAG_UPDATE_CURRENT));
|
||||
builder.setContentIntent(clickIntent);
|
||||
Notification notification = builder.build();
|
||||
notification.flags = Notification.FLAG_AUTO_CANCEL;
|
||||
notifyNotification(context,notifyId,notification);
|
||||
}
|
||||
|
||||
/**
|
||||
* 现在下载失败通知
|
||||
* @param context
|
||||
* @param notifyId
|
||||
* @param channelId
|
||||
* @param icon
|
||||
* @param title
|
||||
* @param content
|
||||
* @param isReDownload
|
||||
* @param config
|
||||
*/
|
||||
public static void showErrorNotification(Context context, int notifyId, String channelId, @DrawableRes int icon, CharSequence title, CharSequence content, boolean isReDownload, UpdateConfig config){
|
||||
NotificationCompat.Builder builder = buildNotification(context,channelId,icon,title,content);
|
||||
builder.setAutoCancel(true);
|
||||
int flag = getPendingIntentFlags(PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
if(isReDownload){// 重新下载
|
||||
Intent intent = new Intent(context, DownloadService.class);
|
||||
intent.putExtra(Constants.KEY_RE_DOWNLOAD,true);
|
||||
intent.putExtra(Constants.KEY_UPDATE_CONFIG,config);
|
||||
PendingIntent clickIntent = PendingIntent.getService(context, notifyId,intent, flag);
|
||||
builder.setContentIntent(clickIntent);
|
||||
}else{
|
||||
PendingIntent clickIntent = PendingIntent.getService(context, notifyId, new Intent(), flag);
|
||||
builder.setContentIntent(clickIntent);
|
||||
}
|
||||
|
||||
Notification notification = builder.build();
|
||||
notification.flags = Notification.FLAG_AUTO_CANCEL;
|
||||
notifyNotification(context,notifyId,notification);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 显示通知信息(非第一次)
|
||||
* @param notifyId
|
||||
* @param channelId
|
||||
* @param icon
|
||||
* @param title
|
||||
* @param content
|
||||
*/
|
||||
public static void showNotification(Context context, int notifyId,String channelId,@DrawableRes int icon,CharSequence title,CharSequence content,boolean isAutoCancel){
|
||||
NotificationCompat.Builder builder = buildNotification(context,channelId,icon,title,content);
|
||||
builder.setAutoCancel(isAutoCancel);
|
||||
Notification notification = builder.build();
|
||||
notification.flags = Notification.FLAG_AUTO_CANCEL;
|
||||
notifyNotification(context,notifyId,notification);
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消通知
|
||||
* @param notifyId
|
||||
*/
|
||||
public static void cancelNotification(Context context, int notifyId){
|
||||
getNotificationManager(context).cancel(notifyId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取通知管理器
|
||||
* @return
|
||||
*/
|
||||
public static NotificationManager getNotificationManager(Context context){
|
||||
return (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建一个通知渠道(兼容0以上版本)
|
||||
* @param channelId
|
||||
* @param channelName
|
||||
*/
|
||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
||||
public static void createNotificationChannel(Context context, String channelId, String channelName,boolean isVibrate,boolean isSound){
|
||||
NotificationChannel channel = new NotificationChannel(channelId,channelName, NotificationManager.IMPORTANCE_HIGH);
|
||||
channel.enableVibration(isVibrate);
|
||||
if(!isSound){
|
||||
channel.setSound(null,null);
|
||||
}
|
||||
getNotificationManager(context).createNotificationChannel(channel);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建一个通知构建器
|
||||
* @param channelId
|
||||
* @param icon
|
||||
* @param title
|
||||
* @param content
|
||||
* @return
|
||||
*/
|
||||
private static NotificationCompat.Builder buildNotification(Context context, String channelId, @DrawableRes int icon,CharSequence title,CharSequence content){
|
||||
return buildNotification(context,channelId,icon,title,content,Constants.NONE,Constants.NONE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建一个通知构建器
|
||||
* @param channelId
|
||||
* @param icon
|
||||
* @param title
|
||||
* @param content
|
||||
* @param progress
|
||||
* @param size
|
||||
* @return
|
||||
*/
|
||||
private static NotificationCompat.Builder buildNotification(Context context, String channelId, @DrawableRes int icon, CharSequence title, CharSequence content, int progress, int size){
|
||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(context,channelId);
|
||||
builder.setSmallIcon(icon);
|
||||
|
||||
builder.setContentTitle(title);
|
||||
builder.setContentText(content);
|
||||
builder.setOngoing(true);
|
||||
|
||||
if(progress != Constants.NONE && size != Constants.NONE){
|
||||
builder.setProgress(size,progress,false);
|
||||
}
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新通知栏
|
||||
* @param id
|
||||
* @param notification
|
||||
*/
|
||||
private static void notifyNotification(Context context, int id, Notification notification){
|
||||
getNotificationManager(context).notify(id,notification);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 PendingIntent 的 flags
|
||||
* @param flag
|
||||
* @return
|
||||
*/
|
||||
private static int getPendingIntentFlags(int flag){
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
return flag | PendingIntent.FLAG_IMMUTABLE;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.web.dmcslot.appdown.util;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.app.AppOpsManager;
|
||||
import android.app.NotificationManager;
|
||||
import android.content.Context;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Build;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/**
|
||||
* @author Jenly <a href="mailto:jenly1314@gmail.com">Jenly</a>
|
||||
*/
|
||||
public final class PermissionUtils {
|
||||
|
||||
private PermissionUtils() {
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验权限
|
||||
*
|
||||
* @param activity
|
||||
* @param requestCode
|
||||
* @return
|
||||
*/
|
||||
public static boolean verifyReadAndWritePermissions(@NonNull Activity activity, int requestCode) {
|
||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M){
|
||||
int readResult = checkPermission(activity, Manifest.permission.READ_EXTERNAL_STORAGE);
|
||||
int writeResult = checkPermission(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE);
|
||||
if (readResult != PackageManager.PERMISSION_GRANTED || writeResult != PackageManager.PERMISSION_GRANTED) {
|
||||
ActivityCompat.requestPermissions(activity, new String[]{
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE}, requestCode);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static int checkPermission(@NonNull Activity activity, @NonNull String permission) {
|
||||
return ActivityCompat.checkSelfPermission(activity, permission);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取通知权限
|
||||
*
|
||||
* @param context
|
||||
*/
|
||||
public static boolean isNotificationEnabled(Context context) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
if (notificationManager.getImportance() == NotificationManager.IMPORTANCE_NONE) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
String CHECK_OP_NO_THROW = "checkOpNoThrow";
|
||||
String OP_POST_NOTIFICATION = "OP_POST_NOTIFICATION";
|
||||
|
||||
AppOpsManager mAppOps = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);
|
||||
ApplicationInfo appInfo = context.getApplicationInfo();
|
||||
String pkg = context.getApplicationContext().getPackageName();
|
||||
int uid = appInfo.uid;
|
||||
|
||||
try {
|
||||
Class appOpsClass = Class.forName(AppOpsManager.class.getName());
|
||||
Method checkOpNoThrowMethod = appOpsClass.getMethod(CHECK_OP_NO_THROW, Integer.TYPE, Integer.TYPE, String.class);
|
||||
Field opPostNotificationValue = appOpsClass.getDeclaredField(OP_POST_NOTIFICATION);
|
||||
|
||||
int value = (Integer) opPostNotificationValue.get(Integer.class);
|
||||
return ((Integer) checkOpNoThrowMethod.invoke(mAppOps, value, uid, pkg) == AppOpsManager.MODE_ALLOWED);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
package com.web.dmcslot.appdown.util;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.RawRes;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.security.KeyStore;
|
||||
import java.security.SecureRandom;
|
||||
import java.security.cert.Certificate;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.security.cert.CertificateFactory;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.util.Arrays;
|
||||
|
||||
import javax.net.ssl.HostnameVerifier;
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.SSLSession;
|
||||
import javax.net.ssl.SSLSocketFactory;
|
||||
import javax.net.ssl.TrustManager;
|
||||
import javax.net.ssl.TrustManagerFactory;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
|
||||
|
||||
/**
|
||||
* @author Jenly <a href="mailto:jenly1314@gmail.com">Jenly</a>
|
||||
*/
|
||||
public final class SSLSocketFactoryUtils {
|
||||
|
||||
private static final String[] VERIFY_HOST_NAME = new String[]{};
|
||||
|
||||
private SSLSocketFactoryUtils() {
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
||||
public static SSLSocketFactory createSSLSocketFactory() {
|
||||
SSLSocketFactory sslSocketFactory = null;
|
||||
try {
|
||||
SSLContext sslContext = SSLContext.getInstance("TLS");
|
||||
sslContext.init(null, getTrustAllManager(), new SecureRandom());
|
||||
sslSocketFactory = sslContext.getSocketFactory();
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
return sslSocketFactory;
|
||||
}
|
||||
|
||||
public static X509TrustManager createTrustAllManager() {
|
||||
X509TrustManager tm = null;
|
||||
try {
|
||||
tm = new X509TrustManager() {
|
||||
public void checkClientTrusted(X509Certificate[] chain, String authType)
|
||||
throws CertificateException {
|
||||
//do nothing
|
||||
}
|
||||
|
||||
public void checkServerTrusted(X509Certificate[] chain, String authType)
|
||||
throws CertificateException {
|
||||
//do nothing
|
||||
}
|
||||
|
||||
public X509Certificate[] getAcceptedIssuers() {
|
||||
return new X509Certificate[0];
|
||||
}
|
||||
};
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return tm;
|
||||
}
|
||||
|
||||
public static TrustAllHostnameVerifier createTrustAllHostnameVerifier() {
|
||||
return new TrustAllHostnameVerifier();
|
||||
}
|
||||
|
||||
public static class TrustAllHostnameVerifier implements HostnameVerifier {
|
||||
@Override
|
||||
public boolean verify(String hostname, SSLSession session) {
|
||||
if (TextUtils.isEmpty(hostname)) {
|
||||
return false;
|
||||
}
|
||||
return !Arrays.asList(VERIFY_HOST_NAME).contains(hostname);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param keyServerStoreID
|
||||
* @return
|
||||
*/
|
||||
public static SSLSocketFactory createSSLSocketFactory(Context context, @RawRes int keyServerStoreID) {
|
||||
InputStream trustStream = context.getResources().openRawResource(keyServerStoreID);
|
||||
return createSSLSocketFactory(trustStream);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param certificates
|
||||
* @return
|
||||
*/
|
||||
public static SSLSocketFactory createSSLSocketFactory(InputStream... certificates) {
|
||||
SSLSocketFactory sSLSocketFactory = null;
|
||||
if (sSLSocketFactory == null) {
|
||||
synchronized (SSLSocketFactoryUtils.class) {
|
||||
if (sSLSocketFactory == null) {
|
||||
try {
|
||||
SSLContext sslContext = SSLContext.getInstance("TLS");
|
||||
sslContext.init(null, getTrustManager(certificates), new SecureRandom());
|
||||
sSLSocketFactory = sslContext.getSocketFactory();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return sSLSocketFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得指定流中的服务器端证书库
|
||||
*
|
||||
* @param certificates
|
||||
* @return
|
||||
*/
|
||||
public static TrustManager[] getTrustManager(InputStream... certificates) {
|
||||
try {
|
||||
CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509");
|
||||
KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
|
||||
keyStore.load(null, null);
|
||||
int index = 0;
|
||||
for (InputStream certificate : certificates) {
|
||||
if (certificate == null) {
|
||||
continue;
|
||||
}
|
||||
Certificate certificate1;
|
||||
try {
|
||||
certificate1 = certificateFactory.generateCertificate(certificate);
|
||||
} finally {
|
||||
certificate.close();
|
||||
}
|
||||
|
||||
String certificateAlias = Integer.toString(index++);
|
||||
keyStore.setCertificateEntry(certificateAlias, certificate1);
|
||||
}
|
||||
|
||||
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory
|
||||
.getDefaultAlgorithm());
|
||||
|
||||
trustManagerFactory.init(keyStore);
|
||||
return trustManagerFactory.getTrustManagers();
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
|
||||
return getTrustAllManager();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得信任所有服务器端证书库
|
||||
*/
|
||||
public static TrustManager[] getTrustAllManager() {
|
||||
return new TrustManager[]{createTrustAllManager()};
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
11
Dmcslot/src/main/res/drawable-anydpi/ic_action_back.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="#333333"
|
||||
android:alpha="0.8">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
|
||||
</vector>
|
||||
BIN
Dmcslot/src/main/res/drawable-hdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 182 B |
BIN
Dmcslot/src/main/res/drawable-mdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 150 B |
30
Dmcslot/src/main/res/drawable-v24/ic_launcher_foreground.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
||||
BIN
Dmcslot/src/main/res/drawable-xhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 212 B |
BIN
Dmcslot/src/main/res/drawable-xxhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 324 B |
170
Dmcslot/src/main/res/drawable/ic_launcher_background.xml
Normal file
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
||||
20
Dmcslot/src/main/res/drawable/input_bg.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/white">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape>
|
||||
<solid android:color="@android:color/transparent" />
|
||||
<corners android:radius="23dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 默认显⽰效果-->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/dialog_input_bg"/>
|
||||
<corners
|
||||
android:radius="3dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
|
||||
28
Dmcslot/src/main/res/drawable/pass_word_bg.xml
Normal 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>
|
||||
|
||||
23
Dmcslot/src/main/res/drawable/pass_word_bg1.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#FF0000"
|
||||
android:centerColor="#FF5555"
|
||||
android:endColor="#FBD3D0"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
23
Dmcslot/src/main/res/drawable/pass_word_bg2.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#000000"
|
||||
android:centerColor="#888888"
|
||||
android:endColor="#FFFFFF"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
5
Dmcslot/src/main/res/drawable/shape_btn_bg.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="22dp" />
|
||||
<solid android:color="@color/jisuanqi" />
|
||||
</shape>
|
||||
6
Dmcslot/src/main/res/drawable/shape_dialog_bg2.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:topRightRadius="12dp"
|
||||
android:topLeftRadius="12dp"/>
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
Dmcslot/src/main/res/drawable/shape_dialog_bg3.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="12dp" />
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
Dmcslot/src/main/res/drawable/shape_dialog_bg_new.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="20dp" />
|
||||
<solid android:color="@color/white" />
|
||||
</shape>
|
||||
5
Dmcslot/src/main/res/drawable/shape_notify_typebg.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="2dp" />
|
||||
<solid android:color="@android:color/black" />
|
||||
</shape>
|
||||
351
Dmcslot/src/main/res/layout/activity_main.xml
Normal 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>
|
||||
387
Dmcslot/src/main/res/layout/activity_main2.xml
Normal file
@@ -0,0 +1,387 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<RelativeLayout 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:fitsSystemWindows="false"
|
||||
android:keepScreenOn="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.web.dmcslot.StatusLayout
|
||||
android:id="@+id/top_vvvv1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:visibility="gone" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/top_vvvv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_below="@id/top_vvvv1"
|
||||
android:background="@color/white"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back_iv"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/ic_action_back" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@mipmap/app_logo" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<!-- webview 全屏状态 start -->
|
||||
<!-- <androidx.constraintlayout.widget.ConstraintLayout-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_below="@id/top_vvvv">-->
|
||||
|
||||
<!-- <androidx.constraintlayout.widget.ConstraintLayout-->
|
||||
<!-- android:id="@+id/layouttop_config"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:gravity="center_vertical"-->
|
||||
<!-- android:visibility="gone"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent">-->
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:id="@+id/iv_topconfig"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:background="@color/color_red"-->
|
||||
<!-- android:minHeight="80dp"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent" />-->
|
||||
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:orientation="horizontal"-->
|
||||
<!-- android:layout_marginBottom="10dp"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="@+id/iv_topconfig">-->
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/home"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:paddingStart="5dp"-->
|
||||
<!-- android:paddingEnd="5dp"-->
|
||||
<!-- android:text="Home"-->
|
||||
<!-- android:textColor="@android:color/white"-->
|
||||
<!-- android:textSize="20sp"-->
|
||||
<!-- android:textStyle="bold" />-->
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/tv_other"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginStart="10dp"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:paddingStart="5dp"-->
|
||||
<!-- android:paddingEnd="5dp"-->
|
||||
<!-- android:text="Miss AV"-->
|
||||
<!-- android:textColor="@android:color/white"-->
|
||||
<!-- android:textSize="20sp"-->
|
||||
<!-- android:textStyle="bold" />-->
|
||||
<!-- </LinearLayout>-->
|
||||
<!-- </androidx.constraintlayout.widget.ConstraintLayout>-->
|
||||
|
||||
<!-- <com.tencent.smtt.sdk.WebView-->
|
||||
<!-- android:id="@+id/webview"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="0dp"-->
|
||||
<!-- app:layout_constraintBottom_toTopOf="@+id/bottom_v"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@+id/layouttop_config"-->
|
||||
<!-- app:layout_goneMarginTop="40dp" />-->
|
||||
|
||||
<!-- <View-->
|
||||
<!-- android:id="@+id/bottom_v"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="0dp"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent" />-->
|
||||
|
||||
<!-- </androidx.constraintlayout.widget.ConstraintLayout>-->
|
||||
<!-- webview 全屏状态 end -->
|
||||
<com.tencent.smtt.sdk.WebView
|
||||
android:id="@+id/webview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/top_vvvv" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layoutError"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progress_error"
|
||||
style="@android:style/Widget.ProgressBar.Large"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@string/agentweb_loading" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/errormsg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:textColor="#999999"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/bt_menu"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginRight="50dp"
|
||||
android:layout_marginBottom="80dp"
|
||||
android:visibility="gone"
|
||||
app:backgroundTint="@color/dialog_bg"
|
||||
app:srcCompat="@mipmap/ic_menu" />
|
||||
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/bt_otherapp"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="120dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:visibility="gone"
|
||||
app:cardBackgroundColor="@color/dialog_bg"
|
||||
app:cardCornerRadius="50dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_otherApp"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@mipmap/ic_shousuo" />
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<!-- 分享的app -->
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_otherapp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/bt_otherapp"
|
||||
android:layout_alignStart="@+id/bt_otherapp"
|
||||
android:layout_alignEnd="@+id/bt_otherapp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:visibility="visible">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/iv_home"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:background="@android:color/white"
|
||||
android:visibility="gone"
|
||||
app:cardCornerRadius="50dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:src="@mipmap/ic_hometo" />
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/iv_link"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:visibility="gone"
|
||||
app:cardCornerRadius="50dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_linkbg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_link"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/transparent"
|
||||
android:gravity="center"
|
||||
android:text="MISV"
|
||||
android:textColor="@color/dialog_textcolor"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/iv_facebook"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@android:color/white"
|
||||
android:visibility="gone"
|
||||
app:cardCornerRadius="50dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:src="@mipmap/ic_facebook" />
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/iv_whatsapp"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@android:color/white"
|
||||
android:visibility="gone"
|
||||
app:cardCornerRadius="50dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:src="@mipmap/ic_whatsapp" />
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/iv_tel"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@android:color/white"
|
||||
android:visibility="gone"
|
||||
app:cardCornerRadius="50dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:src="@mipmap/ic_tel" />
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/bt_notifyitem"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@android:color/black"
|
||||
android:visibility="gone"
|
||||
app:cardCornerRadius="50dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:src="@mipmap/ic_email" />
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/bt_notify"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="160dp"
|
||||
android:visibility="gone"
|
||||
app:cardBackgroundColor="@color/black"
|
||||
app:cardCornerRadius="50dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_notify"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@mipmap/ic_email" />
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/show_top_ly"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/top_vvvv"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
android:visibility="visible">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="4"
|
||||
android:gravity="center">
|
||||
|
||||
<com.web.dmcslot.CircleImageView
|
||||
android:id="@+id/show_top_v"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:src="@mipmap/app_logo"
|
||||
android:visibility="visible"
|
||||
app:ease_border_color="#EEEEEE"
|
||||
app:ease_border_width="1dp"
|
||||
app:es_shape_type="round" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="6"
|
||||
android:gravity="center">
|
||||
|
||||
<ProgressBar
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:indeterminateDrawable="@drawable/pass_word_bg1" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/videoContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressbar"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginRight="15dp"
|
||||
android:indeterminateDrawable="@drawable/pass_word_bg2"
|
||||
android:visibility="gone" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
108
Dmcslot/src/main/res/layout/activity_main3.xml
Normal file
@@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<RelativeLayout 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">
|
||||
|
||||
<com.web.dmcslot.StatusLayout
|
||||
android:id="@+id/top_vvvv1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:visibility="gone" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/top_vvvv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_below="@id/top_vvvv1"
|
||||
android:background="@color/white"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back_iv"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/ic_action_back" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@mipmap/app_logo" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/webview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_below="@id/top_vvvv" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/show_top_ly"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/top_vvvv"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="4"
|
||||
android:gravity="center">
|
||||
|
||||
<com.web.dmcslot.CircleImageView
|
||||
android:id="@+id/show_top_v"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:src="@mipmap/app_logo"
|
||||
android:visibility="visible"
|
||||
app:ease_border_color="#EEEEEE"
|
||||
app:ease_border_width="1dp"
|
||||
app:es_shape_type="round" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="6"
|
||||
android:gravity="center">
|
||||
|
||||
<ProgressBar
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminateDrawable="@drawable/pass_word_bg1"
|
||||
android:layout_centerHorizontal="true" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/videoContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
<ProgressBar
|
||||
android:id="@+id/progressbar"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:visibility="gone"
|
||||
android:layout_marginRight="15dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:indeterminateDrawable="@drawable/pass_word_bg2"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
95
Dmcslot/src/main/res/layout/activity_notifydetails.xml
Normal file
@@ -0,0 +1,95 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<RelativeLayout 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:keepScreenOn="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/top_vvvv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:background="@color/white"
|
||||
android:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back_iv"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/ic_action_back" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@mipmap/app_logo" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/top_vvvv"
|
||||
android:scaleType="centerCrop"
|
||||
android:visibility="gone" />
|
||||
|
||||
<com.tencent.smtt.sdk.WebView
|
||||
android:id="@+id/webview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/top_vvvv"
|
||||
android:visibility="gone" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/show_top_ly"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/top_vvvv"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="4"
|
||||
android:gravity="center">
|
||||
|
||||
<com.web.dmcslot.CircleImageView
|
||||
android:id="@+id/show_top_v"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:src="@mipmap/app_logo"
|
||||
android:visibility="visible"
|
||||
app:ease_border_color="#EEEEEE"
|
||||
app:ease_border_width="1dp"
|
||||
app:es_shape_type="round" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="6"
|
||||
android:gravity="center">
|
||||
|
||||
<ProgressBar
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:indeterminateDrawable="@drawable/pass_word_bg1" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
43
Dmcslot/src/main/res/layout/activity_notifylist.xml
Normal file
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<RelativeLayout 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:keepScreenOn="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/top_vvvv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:background="@color/white"
|
||||
android:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back_iv"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/ic_action_back" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerInParent="true"
|
||||
android:gravity="center"
|
||||
android:text="@string/app_notify_title"
|
||||
android:textColor="@color/dialog_bg"
|
||||
android:textSize="16sp" />
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_nofity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@+id/top_vvvv" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
294
Dmcslot/src/main/res/layout/activity_start.xml
Normal 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>
|
||||
108
Dmcslot/src/main/res/layout/activity_webview.xml
Normal file
@@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<RelativeLayout 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:keepScreenOn="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.web.dmcslot.StatusLayout
|
||||
android:id="@+id/top_vvvv1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:visibility="gone" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/top_vvvv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_below="@id/top_vvvv1"
|
||||
android:background="@color/white"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back_iv"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/ic_action_back" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@mipmap/app_logo" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
|
||||
<com.tencent.smtt.sdk.WebView
|
||||
android:id="@+id/webview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/top_vvvv" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/show_top_ly"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/top_vvvv"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
android:visibility="visible">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="4"
|
||||
android:gravity="center">
|
||||
|
||||
<com.web.dmcslot.CircleImageView
|
||||
android:id="@+id/show_top_v"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:src="@mipmap/app_logo"
|
||||
android:visibility="visible"
|
||||
app:ease_border_color="#EEEEEE"
|
||||
app:ease_border_width="1dp"
|
||||
app:es_shape_type="round" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="6"
|
||||
android:gravity="center">
|
||||
|
||||
<ProgressBar
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminateDrawable="@drawable/pass_word_bg1"
|
||||
android:layout_centerHorizontal="true" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/videoContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
<ProgressBar
|
||||
android:id="@+id/progressbar"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:visibility="gone"
|
||||
android:layout_marginRight="15dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:indeterminateDrawable="@drawable/pass_word_bg2"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
228
Dmcslot/src/main/res/layout/dialog_action_bankinfo.xml
Normal file
@@ -0,0 +1,228 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shape_dialog_bg3"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="144dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/layout_top"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ic_dialog_close"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:tint="@color/white"
|
||||
android:src="@mipmap/ic_close" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/content_tv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="25dp"
|
||||
android:gravity="center"
|
||||
android:lineSpacingExtra="4dp"
|
||||
android:text="@string/app_bankinfo_title"
|
||||
android:textColor="@color/dialog_textcolor"
|
||||
android:textSize="18sp" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/layout_bankinfo_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_below="@+id/layout_top"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bankinfo_name"
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:text="@string/app_bankinfo_name"
|
||||
android:textColor="@color/dialog_textcolor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/inputname_tv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_toRightOf="@+id/tv_bankinfo_name"
|
||||
android:background="@drawable/input_bg"
|
||||
android:gravity="center"
|
||||
android:hint="@string/app_bankinfo_name_hint"
|
||||
android:lineSpacingExtra="4dp"
|
||||
android:textColor="@color/dialog_textcolor"
|
||||
android:textColorHint="#BCBCBC"
|
||||
android:textSize="16sp" />
|
||||
</RelativeLayout>
|
||||
<RelativeLayout
|
||||
android:id="@+id/layout_bankinfo_country"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_below="@+id/layout_bankinfo_name"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bankinfo_country"
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:text="@string/app_bankinfo_bankcountry"
|
||||
android:textColor="@color/dialog_textcolor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/inputcountry_tv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_toRightOf="@+id/tv_bankinfo_country"
|
||||
android:drawableEnd="@mipmap/ic_pull_down"
|
||||
android:background="@drawable/input_bg"
|
||||
android:gravity="center"
|
||||
android:paddingEnd="10dp"
|
||||
android:hint="@string/app_bankinfo_bankcountry_hint"
|
||||
android:lineSpacingExtra="4dp"
|
||||
android:textColor="@color/dialog_textcolor"
|
||||
android:textColorHint="#BCBCBC"
|
||||
android:textSize="16sp" />
|
||||
</RelativeLayout>
|
||||
<RelativeLayout
|
||||
android:id="@+id/layout_bankcountry"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_below="@+id/layout_bankinfo_country"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bank_name"
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:drawablePadding="10dp"
|
||||
android:text="@string/app_bankinfo_bankname"
|
||||
android:textColor="@color/dialog_textcolor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/inputbankname_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_toEndOf="@+id/tv_bank_name"
|
||||
android:background="@drawable/input_bg"
|
||||
android:drawableRight="@mipmap/ic_pull_down"
|
||||
android:gravity="center"
|
||||
android:hint="@string/app_bankinfo_bankname_hint"
|
||||
android:inputType="number"
|
||||
android:lineSpacingExtra="4dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:textColor="@color/dialog_textcolor"
|
||||
android:textColorHint="#BCBCBC"
|
||||
android:textSize="16sp" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/layout_bankinfo_code"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_below="@+id/layout_bankcountry"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bank_code"
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:text="@string/app_bankinfo_code"
|
||||
android:textColor="@color/dialog_textcolor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/inputcode_tv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_toRightOf="@+id/tv_bank_code"
|
||||
android:background="@drawable/input_bg"
|
||||
android:gravity="center"
|
||||
android:hint="@string/app_bankinfo_code_hint"
|
||||
android:lineSpacingExtra="4dp"
|
||||
android:textColor="@color/dialog_textcolor"
|
||||
android:textColorHint="#BCBCBC"
|
||||
android:textSize="16sp" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sumbit_tv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="45dp"
|
||||
android:layout_below="@+id/layout_bankinfo_code"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="70dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginBottom="50dp"
|
||||
android:background="@drawable/shape_btn_bg"
|
||||
android:gravity="center"
|
||||
android:text="@string/sure_txt"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_bankname"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="220dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_below="@+id/layout_bankcountry"
|
||||
android:background="@color/dialog_bg"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_bankcountry"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="260dp"
|
||||
android:layout_below="@+id/layout_bankinfo_country"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:background="@color/dialog_bg"
|
||||
android:visibility="gone" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
71
Dmcslot/src/main/res/layout/dialog_action_confirm.xml
Normal file
@@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shape_dialog_bg3"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="285dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="144dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/content_tv"
|
||||
android:layout_width="245dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginBottom="30dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:lineSpacingExtra="4dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:background="@color/white" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="62dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/cancel_tv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="@string/cancel_txt"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<View
|
||||
android:id="@+id/line_v"
|
||||
android:layout_width="0.5dp"
|
||||
android:layout_height="42dp"
|
||||
android:background="@color/white" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sumbit_tv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="@string/sure_txt"
|
||||
android:textColor="@color/dialog_textcolor"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
89
Dmcslot/src/main/res/layout/dialog_action_invite.xml
Normal file
@@ -0,0 +1,89 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shape_dialog_bg3"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="285dp"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:minHeight="144dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/content_tv"
|
||||
android:layout_width="245dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:lineSpacingExtra="4dp"
|
||||
android:text="@string/app_tishi"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/input_tv"
|
||||
android:layout_width="245dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="30dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/input_bg"
|
||||
android:gravity="center"
|
||||
android:hint="@string/app_hint"
|
||||
android:lineSpacingExtra="4dp"
|
||||
android:textColor="@color/dialog_textcolor"
|
||||
android:textColorHint="#BCBCBC"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:background="@color/white" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="62dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/cancel_tv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="@string/cancel_txt"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<View
|
||||
android:id="@+id/line_v"
|
||||
android:layout_width="0.5dp"
|
||||
android:layout_height="42dp"
|
||||
android:background="@color/white" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sumbit_tv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="@string/sure_txt"
|
||||
android:textColor="@color/dialog_textcolor"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
105
Dmcslot/src/main/res/layout/dialog_action_invite_records.xml
Normal file
@@ -0,0 +1,105 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shape_dialog_bg3"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="144dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ic_dialog_close"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:tint="@color/white"
|
||||
android:src="@mipmap/ic_close" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/content_tv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="30dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/dialog_textcolor"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/layout_balance"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/content_tv"
|
||||
android:layout_marginTop="15dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/balance_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_marginStart="10dp"
|
||||
android:textColor="@color/dialog_textcolor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/totalearnings_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:textColor="@color/dialog_textcolor"
|
||||
android:textSize="16sp" />
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_empty"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="360dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:tint="@color/dialog_textcolor"
|
||||
android:src="@mipmap/ic_empty" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_nodata"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/layout_balance"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:text="@string/app_nodata"
|
||||
android:textColor="@color/dialog_textcolor"
|
||||
android:textSize="20sp" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="360dp"
|
||||
android:layout_below="@+id/layout_balance"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:background="@color/dialog_bg"
|
||||
android:visibility="visible" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
121
Dmcslot/src/main/res/layout/dialog_action_withdrawapply.xml
Normal file
@@ -0,0 +1,121 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shape_dialog_bg3"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="285dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="144dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/content_tv"
|
||||
android:layout_width="245dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:lineSpacingExtra="4dp"
|
||||
android:text="@string/app_withdrawapply_title"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/balance_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="left|center_vertical"
|
||||
android:lineSpacingExtra="4dp"
|
||||
android:textColor="@color/dialog_textcolor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_records"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="right|center_vertical"
|
||||
android:text="@string/app_withdrawtitle"
|
||||
android:textColor="@color/dialog_textcolor"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/input_tv"
|
||||
android:layout_width="245dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="30dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/input_bg"
|
||||
android:gravity="center"
|
||||
android:hint="@string/app_withdraw_apply_hint"
|
||||
android:inputType="numberDecimal"
|
||||
android:lineSpacingExtra="4dp"
|
||||
android:textColor="@color/dialog_textcolor"
|
||||
android:textColorHint="#BCBCBC"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:background="#D8D8D8" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="62dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/cancel_tv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="@string/cancel_txt"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<View
|
||||
android:id="@+id/line_v"
|
||||
android:layout_width="0.5dp"
|
||||
android:layout_height="42dp"
|
||||
android:background="#d8d8d8" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sumbit_tv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="@string/sure_txt"
|
||||
android:textColor="@color/dialog_textcolor"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
76
Dmcslot/src/main/res/layout/dialog_select_action.xml
Normal file
@@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@drawable/shape_dialog_bg2"
|
||||
android:gravity="bottom"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/share"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/app_share"
|
||||
android:textColor="@color/dialog_textcolor"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:background="@color/dialog_input_bg" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/check"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/app_invitetitle"
|
||||
android:textColor="@color/dialog_textcolor"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:background="@color/dialog_input_bg" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/withdraw"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/app_withdrawtitle"
|
||||
android:textColor="@color/dialog_textcolor"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:background="@color/dialog_input_bg" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/withdraw_apply"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/app_withdrawapply_title"
|
||||
android:textColor="@color/dialog_textcolor"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:background="@color/dialog_input_bg" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bankinfo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/app_bankinfo_title"
|
||||
android:textColor="@color/dialog_textcolor"
|
||||
android:textSize="20sp" />
|
||||
</LinearLayout>
|
||||
22
Dmcslot/src/main/res/layout/item_invite_records.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?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:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_invitecode"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/dialog_textcolor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:background="@color/dialog_input_bg" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
146
Dmcslot/src/main/res/layout/item_notify_list.xml
Normal file
@@ -0,0 +1,146 @@
|
||||
<?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="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="MissingDefaultResource">
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/big_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/notify_imagecolor"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="10dp">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_icon"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:background="@mipmap/ic_notifylogo"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_msg_type"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_msg_type" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_msg_type"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:background="@drawable/shape_notify_typebg"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingTop="2dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:paddingBottom="2dp"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_icon"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_msg_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="2025-1-8"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_msg_type"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_msg_type" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/iv_readtype"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="10dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/shape_btn_bg"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="@+id/iv_icon"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_msg_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:paddingStart="5dp"
|
||||
android:textColor="#383838"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_icon"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_icon" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ic_notify_pull"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:background="@mipmap/ic_notify_xiala"
|
||||
android:paddingStart="5dp"
|
||||
android:textColor="#6d80ff"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_msg_title" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_more"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:background="@android:color/black" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_notifyimage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/iv_notifycontent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:textColor="#383838"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/iv_notifyjumpclick"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:textColor="#4169E1"
|
||||
android:visibility="gone"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
59
Dmcslot/src/main/res/layout/item_withdraw_records.xml
Normal file
@@ -0,0 +1,59 @@
|
||||
<?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:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_withdrawname"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:textColor="@color/dialog_textcolor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="right|center_vertical"
|
||||
android:orientation="vertical"
|
||||
android:paddingEnd="10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_withdrawamount"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:textColor="#4BCD6D"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_withdrawbalance"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:textColor="#EF4723"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:background="@color/dialog_input_bg" />
|
||||
|
||||
</LinearLayout>
|
||||
5
Dmcslot/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
BIN
Dmcslot/src/main/res/mipmap-hdpi/ic_empty.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
Dmcslot/src/main/res/mipmap-hdpi/ic_pull_down.png
Normal file
|
After Width: | Height: | Size: 271 B |
BIN
Dmcslot/src/main/res/mipmap-xhdpi/ic_close.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
Dmcslot/src/main/res/mipmap-xhdpi/ic_email.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
Dmcslot/src/main/res/mipmap-xhdpi/ic_facebook.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
Dmcslot/src/main/res/mipmap-xhdpi/ic_hometo.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
Dmcslot/src/main/res/mipmap-xhdpi/ic_link.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
Dmcslot/src/main/res/mipmap-xhdpi/ic_menu.png
Normal file
|
After Width: | Height: | Size: 779 B |
BIN
Dmcslot/src/main/res/mipmap-xhdpi/ic_notify_email.png
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
BIN
Dmcslot/src/main/res/mipmap-xhdpi/ic_notify_normal.png
Normal file
|
After Width: | Height: | Size: 9.0 KiB |
BIN
Dmcslot/src/main/res/mipmap-xhdpi/ic_notify_shangla.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
Dmcslot/src/main/res/mipmap-xhdpi/ic_notify_xiala.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
Dmcslot/src/main/res/mipmap-xhdpi/ic_notifylogo.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
Dmcslot/src/main/res/mipmap-xhdpi/ic_shousuo.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
Dmcslot/src/main/res/mipmap-xhdpi/ic_tel.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
Dmcslot/src/main/res/mipmap-xhdpi/ic_whatsapp.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
Dmcslot/src/main/res/mipmap-xhdpi/ic_zhangkai.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
Dmcslot/src/main/res/mipmap-xxhdpi/app_logo.png
Normal file
|
After Width: | Height: | Size: 126 KiB |
54
Dmcslot/src/main/res/values-en/strings.xml
Normal file
@@ -0,0 +1,54 @@
|
||||
<resources>
|
||||
<string name="app_name">DMCSLOT</string>
|
||||
<string name="qsrlwmm_txt">Please Set Your Password</string>
|
||||
<string name="cancel_txt">Cancel</string>
|
||||
<string name="sure_txt">Sure</string>
|
||||
<string name="banbengengxin_txt">New Version Update</string>
|
||||
<string name="xiacigengxin_txt">Next Update</string>
|
||||
<string name="lijigengxin_txt">Update Immediately</string>
|
||||
<string name="app_updater_error_notification_content">Click to close notification</string>
|
||||
<string name="app_updater_error_notification_content_re_download">Click to re-download</string>
|
||||
<string name="app_updater_error_notification_title">Download failed</string>
|
||||
<string name="app_updater_finish_notification_content">Click to install</string>
|
||||
<string name="app_updater_finish_notification_title">Download completed</string>
|
||||
<string name="app_updater_progress_notification_content">Downloading...</string>
|
||||
<string name="app_updater_progress_notification_title">Version update</string>
|
||||
<string name="app_updater_progress_notification_title_2">Downloading game</string>
|
||||
<string name="app_updater_start_notification_content">Getting download data...</string>
|
||||
<string name="app_updater_start_notification_title">Version update</string>
|
||||
<string name="app_updater_start_notification_title_2">Downloading game</string>
|
||||
<string name="notification_title_txt">Need to turn on mobile phone notification permission</string>
|
||||
<string name="notification_cancel_txt">Exit</string>
|
||||
<string name="notification_setting_txt">Setting</string>
|
||||
<string name="app_tishi">Tip</string>
|
||||
<string name="app_hint">Please enter the invitation code</string>
|
||||
<string name="app_sharetitle">My invitation code:</string>
|
||||
<string name="app_sharetitle2">Superior invitation code:</string>
|
||||
<string name="app_totalinvite">Total number of invites:</string>
|
||||
<string name="app_sharecontent">App download link:</string>
|
||||
<string name="app_share">Share</string>
|
||||
<string name="app_checklist">Check Invitation Records</string>
|
||||
<string name="app_invitetitle">Invitation Records</string>
|
||||
<string name="app_checklist_number">Total number of invitees: %d</string>
|
||||
<string name="app_nodata">No Data</string>
|
||||
<string name="app_withdrawtitle">Withdrawal Record</string>
|
||||
<string name="app_withdrawapply_title">Withdrawal Application</string>
|
||||
<string name="app_bankinfo_title">Edit Bank Card Information</string>
|
||||
<string name="app_bankinfo_countrycode">60</string>
|
||||
<string name="app_bankinfo_name">Name:</string>
|
||||
<string name="app_bankinfo_name_hint">Please enter the bank card name</string>
|
||||
<string name="app_bankinfo_code">Bank card account:</string>
|
||||
<string name="app_bankinfo_code_hint">Please enter the bank card account</string>
|
||||
<string name="app_bankinfo_bankcountry">Country:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">Please select a country</string>
|
||||
<string name="app_bankinfo_bankname">Bank Name:</string>
|
||||
<string name="app_bankinfo_bankname_hint">Please select a bank name</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">Note: Please enter the country code before selecting the bank name!</string>
|
||||
<string name="app_balance">Balance: %s</string>
|
||||
<string name="app_totalearning">Total Earnings: %s</string>
|
||||
<string name="app_withdraw_amount">Amount: %s</string>
|
||||
<string name="app_withdraw_apply_hint">Please enter the withdrawal amount</string>
|
||||
<string name="app_toastapply">Withdrawal application has been submitted</string>
|
||||
<string name="app_toastloading">No additional data available for now</string>
|
||||
<string name="app_notify_title">NOTIFICATIONS</string>
|
||||
</resources>
|
||||
69
Dmcslot/src/main/res/values-night/themes.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.Calculcator" parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_200</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/black</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_200</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</item>
|
||||
</style>
|
||||
</resources>
|
||||
22
Dmcslot/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="purple_200">#FFFFFF</color>
|
||||
<color name="purple_500">#FFFFFF</color>
|
||||
<color name="purple_700">#FFFFFF</color>
|
||||
<color name="teal_200">#FF03DAC5</color>
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="jisuanqi">#EF4723</color>
|
||||
<color name="notify_color">#FFFFFFFF</color>
|
||||
|
||||
<color name="dialog_bg">#2C2C2E</color>
|
||||
<color name="dialog_textcolor">#FFA722</color>
|
||||
<color name="dialog_input_bg">#434343</color>
|
||||
<color name="dialog_dark">#BCBCBC</color>
|
||||
|
||||
<color name="notify_textcolor">#ACDFEE</color>
|
||||
<color name="notify_imagecolor">#BDDDB7</color>
|
||||
<color name="notify_jumplinkcolor">#C3B5D0</color>
|
||||
|
||||
</resources>
|
||||
76
Dmcslot/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,76 @@
|
||||
<resources>
|
||||
<string name="app_name">DMCSLOT</string>
|
||||
<string name="qsrlwmm_txt">请输入6位密码</string>
|
||||
<string name="cancel_txt">取消</string>
|
||||
<string name="sure_txt">确定</string>
|
||||
<string name="banbengengxin_txt">版本更新</string>
|
||||
<string name="xiacigengxin_txt">下次更新</string>
|
||||
<string name="lijigengxin_txt">立即更新</string>
|
||||
<string name="app_updater_error_notification_content">点击关闭通知</string>
|
||||
<string name="app_updater_error_notification_content_re_download">点击重新下载</string>
|
||||
<string name="app_updater_error_notification_title">下载失败</string>
|
||||
<string name="app_updater_finish_notification_content">点击安装</string>
|
||||
<string name="app_updater_finish_notification_title">下载完成</string>
|
||||
<string name="app_updater_progress_notification_content">正在下载…</string>
|
||||
<string name="app_updater_progress_notification_title">版本更新</string>
|
||||
<string name="app_updater_progress_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_title">版本更新</string>
|
||||
<string name="app_updater_start_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_content">正在获取下载数据…</string>
|
||||
<string name="notification_title_txt">需要打开手机通知权限</string>
|
||||
<string name="notification_cancel_txt">退出</string>
|
||||
<string name="notification_setting_txt">设置</string>
|
||||
<string name="app_tishi">提示</string>
|
||||
<string name="app_hint">请输入邀请码</string>
|
||||
<string name="app_sharetitle">我的邀请码:</string>
|
||||
<string name="app_sharetitle2">上级邀请码:</string>
|
||||
<string name="app_totalinvite">总邀请人数:</string>
|
||||
<string name="app_sharecontent">邀请您下载:</string>
|
||||
<string name="app_share">分享</string>
|
||||
<string name="app_checklist">查看邀请记录</string>
|
||||
<string name="app_invitetitle">邀请记录</string>
|
||||
<string name="app_checklist_number">总邀请人数: %d</string>
|
||||
<string name="app_nodata">暂无数据</string>
|
||||
<string name="app_withdrawtitle">提现记录</string>
|
||||
<string name="app_withdrawapply_title">提现申请</string>
|
||||
<string name="app_bankinfo_title">编辑银行卡信息</string>
|
||||
<string name="app_bankinfo_countrycode">86</string>
|
||||
<string name="app_bankinfo_name">持卡人姓名:</string>
|
||||
<string name="app_bankinfo_name_hint">请输入持卡人姓名</string>
|
||||
<string name="app_bankinfo_bankcountry">国家地区:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">请选择国家地区</string>
|
||||
<string name="app_bankinfo_bankname">开户行名称:</string>
|
||||
<string name="app_bankinfo_bankname_hint">请选择开户行名称</string>
|
||||
<string name="app_bankinfo_code">银行户口:</string>
|
||||
<string name="app_bankinfo_code_hint">请输入银行卡户口</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">(注:请先输入国家区号再选择开户行名称!)</string>
|
||||
<string name="app_balance">余额: %s</string>
|
||||
<string name="app_totalearning">总收益: %s</string>
|
||||
<string name="app_withdraw_amount">金额: %s</string>
|
||||
<string name="app_withdraw_apply_hint">请输入提现金额</string>
|
||||
<string name="app_toastapply">提现申请已提交</string>
|
||||
<string name="app_toastloading">暂无更多数据</string>
|
||||
<string name="app_notify_title">通知</string>
|
||||
<!-- <string name="app_name">SPEEDAU</string>-->
|
||||
<!-- <string name="qsrlwmm_txt">Please Set Your Password</string>-->
|
||||
<!-- <string name="cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="sure_txt">Sure</string>-->
|
||||
<!-- <string name="banbengengxin_txt">New Version Update</string>-->
|
||||
<!-- <string name="xiacigengxin_txt">Next Update</string>-->
|
||||
<!-- <string name="lijigengxin_txt">Update Immediately</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content">Click to close notification</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content_re_download">Click to re-download</string>-->
|
||||
<!-- <string name="app_updater_error_notification_title">Download failed</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_content">Click to install</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_title">Download completed</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_content">Downloading...</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="app_updater_start_notification_content">Getting download data...</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="notification_title_txt">Need to turn on mobile phone notification permission</string>-->
|
||||
<!-- <string name="notification_cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="notification_setting_txt">Setting</string>-->
|
||||
|
||||
</resources>
|
||||
88
Dmcslot/src/main/res/values/themes.xml
Normal file
@@ -0,0 +1,88 @@
|
||||
<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. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</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>
|
||||
10
Dmcslot/src/main/res/xml/app_updater_paths.xml
Normal 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>
|
||||
4
Dmcslot/src/main/res/xml/network_security_config.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<network-security-config>
|
||||
<base-config cleartextTrafficPermitted="true" />
|
||||
</network-security-config>
|
||||
13
Dmcslot/src/main/res/xml/provider_paths.xml
Normal 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"异常的问题 -->
|
||||
@@ -0,0 +1,35 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void TestPattern(){
|
||||
//
|
||||
Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$");
|
||||
String a="+45.5";
|
||||
boolean matches = compile.matcher(a).matches();
|
||||
System.out.println(matches);
|
||||
String result = compile.matcher(a).replaceAll("");
|
||||
System.out.println(result);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
1
Gdslot888/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
92
Gdslot888/build.gradle
Normal file
@@ -0,0 +1,92 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'com.google.gms.google-services'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 31
|
||||
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.web.gdslot888"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 31
|
||||
versionCode 106
|
||||
versionName "v1.0.6"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
signingConfigs {
|
||||
debug {
|
||||
storeFile file('gdslot888.jks')
|
||||
storePassword "android2014"
|
||||
keyAlias 'key0'
|
||||
keyPassword "android2014"
|
||||
}
|
||||
release {
|
||||
storeFile file('gdslot888.jks')
|
||||
storePassword "android2014"
|
||||
keyAlias 'key0'
|
||||
keyPassword "android2014"
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'com.google.android.material:material:1.1.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
testImplementation 'junit:junit:4.+'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar')
|
||||
|
||||
// okhttp相关库
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
|
||||
|
||||
// JSON解析库
|
||||
implementation 'com.google.code.gson:gson:2.9.0'
|
||||
implementation 'com.alibaba:fastjson:1.1.71.android'
|
||||
api 'com.squareup.retrofit2:retrofit:2.5.0'
|
||||
api 'com.squareup.retrofit2:converter-scalars:2.3.0'
|
||||
api 'com.squareup.retrofit2:converter-gson:2.4.0'
|
||||
api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
|
||||
api 'io.reactivex.rxjava2:rxjava:2.1.16'
|
||||
api 'io.reactivex.rxjava2:rxandroid:2.0.2'
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选)
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选)
|
||||
implementation 'com.github.Justson:Downloader:v5.0.4-androidx'
|
||||
//implementation 'com.tencent.tbs:tbssdk:44286'
|
||||
// sdk 33
|
||||
// implementation platform('com.google.firebase:firebase-bom:32.7.0')
|
||||
// Firebase Cloud Messaging
|
||||
// implementation("com.google.firebase:firebase-messaging")
|
||||
// implementation("com.google.firebase:firebase-analytics")
|
||||
|
||||
implementation platform('com.google.firebase:firebase-bom:32.1.0')
|
||||
|
||||
// Add the dependencies for the Firebase Cloud Messaging and Analytics libraries
|
||||
// When using the BoM, you don't specify versions in Firebase library dependencies
|
||||
implementation 'com.google.firebase:firebase-messaging'
|
||||
implementation 'com.google.firebase:firebase-analytics'
|
||||
// implementation("com.google.firebase:firebase-messaging:23.2.1")
|
||||
// implementation("com.google.firebase:firebase-analytics:21.2.1")
|
||||
// implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式
|
||||
implementation("com.github.bumptech.glide:glide:4.13.1")
|
||||
implementation project(path: ':base')
|
||||
|
||||
}
|
||||
BIN
Gdslot888/gdslot888.jks
Normal file
29
Gdslot888/google-services.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "1031065586711",
|
||||
"project_id": "gdslot888-2f04f",
|
||||
"storage_bucket": "gdslot888-2f04f.firebasestorage.app"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:1031065586711:android:4136ad7324e62f0f966052",
|
||||
"android_client_info": {
|
||||
"package_name": "com.web.gdslot888"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyCbmZ6jonTvi8D_yzgVVGB-QzckF5crzeo"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
BIN
Gdslot888/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar
Normal file
32
Gdslot888/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
||||
-dontwarn dalvik.**
|
||||
-dontwarn com.tencent.smtt.**
|
||||
|
||||
-keep class com.tencent.smtt.** {
|
||||
*;
|
||||
}
|
||||
|
||||
-keep class com.tencent.tbs.** {
|
||||
*;
|
||||
}
|
||||
BIN
Gdslot888/release/Gdslot888.apk
Normal file
18
Gdslot888/release/output-metadata.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"version": 2,
|
||||
"artifactType": {
|
||||
"type": "APK",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "com.web.gdslot888",
|
||||
"variantName": "processReleaseResources",
|
||||
"elements": [
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"versionCode": 106,
|
||||
"versionName": "v1.0.6",
|
||||
"outputFile": "Gdslot888-release.apk"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("Tptogiar.calculcator", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
112
Gdslot888/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,112 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.web.gdslot888">
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera"
|
||||
android:required="false" />
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera2"
|
||||
android:required="false" />
|
||||
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS" /> <!-- 获取通讯录-->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<!-- 多媒体相关 -->
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
|
||||
<!-- 8.0+系统需要-->
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
|
||||
<!--推送权限-->
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_SECURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.RECORD_AUDIO" />-->
|
||||
|
||||
|
||||
<!-- <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_AUDIO_OUTPUT" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.autofocus" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.front" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.level.full" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.capability.raw" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.any" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.microphone" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera2" android:required="true" />-->
|
||||
|
||||
<queries>
|
||||
<intent>
|
||||
<action android:name="android.media.action.IMAGE_CAPTURE" />
|
||||
</intent>
|
||||
</queries>
|
||||
<application
|
||||
android:name=".WebApplication"
|
||||
android:allowBackup="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:icon="@mipmap/app_logo"
|
||||
android:label="@string/app_name"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:roundIcon="@mipmap/app_logo"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.AppTheme"
|
||||
android:usesCleartextTraffic="true">
|
||||
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity2"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:exported="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:theme="@style/AppThemeStart">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<service
|
||||
android:name="com.tencent.smtt.export.external.DexClassLoaderProviderService"
|
||||
android:label="dexopt"
|
||||
android:process=":dexopt" />
|
||||
|
||||
|
||||
<!-- android:directBootAware="true" 为应用启用消息处理直接启动模式-->
|
||||
<service
|
||||
android:name=".MyFirebaseMessageingService"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<!-- Set custom default icon. This is used when no icon is set for incoming notification messages.
|
||||
See README(https://goo.gl/l4GJaQ) for more. 设置推送默认图标 和颜色-->
|
||||
<meta-data
|
||||
android:name="com.google.firebase.messaging.default_notification_icon"
|
||||
android:resource="@mipmap/app_logo" />
|
||||
<!-- Set color used with incoming notification messages. This is used when no color is set for the incoming
|
||||
notification message. See README(https://goo.gl/6BKBk7) for more. -->
|
||||
<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" />
|
||||
<!-- 还可设置推送渠道 -->
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.google.firebase.messaging.default_notification_channel_id"-->
|
||||
<!-- android:value="@string/default_notification_channel_id" />-->
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
54
Gdslot888/src/main/java/com/web/gdslot888/MainActivity2.java
Normal file
@@ -0,0 +1,54 @@
|
||||
package com.web.gdslot888;
|
||||
|
||||
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.android.gms.tasks.OnCompleteListener;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.firebase.messaging.FirebaseMessaging;
|
||||
import com.web.base.MainActivity;
|
||||
|
||||
public class MainActivity2 extends com.web.base.MainActivity2 {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
userId = 89;
|
||||
saveInt(MainActivity2.this,"user_code",userId);
|
||||
saveInt(MainActivity2.this,"version_code",getVersion());
|
||||
MainActivity.saveString(this, "base_url", "https://www.gdslot888.net/");
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
//订阅主题
|
||||
FirebaseMessaging.getInstance().subscribeToTopic("demo")
|
||||
.addOnCompleteListener(new OnCompleteListener<Void>() {
|
||||
@Override
|
||||
public void onComplete(@NonNull Task<Void> task) {
|
||||
String msg = "Subscribed";
|
||||
if (!task.isSuccessful()) {
|
||||
msg = "Subscribe failed";
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public int getVersion(){
|
||||
try {
|
||||
PackageManager packageManager = getPackageManager();
|
||||
PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0);
|
||||
String StringversionName = packageInfo.versionName; // 版本号
|
||||
int versionCode = packageInfo.versionCode; // 版本码
|
||||
// 在这里可以使用versionName和versionCode进行相关的操作
|
||||
// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode);
|
||||
return versionCode;
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
package com.web.gdslot888;
|
||||
|
||||
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.web.base.GsonUtils;
|
||||
import com.web.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);
|
||||
// if (remoteMessage.getNotification() != null) {
|
||||
// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
// }
|
||||
} else {
|
||||
//收到通知 创建notify
|
||||
if (remoteMessage.getNotification() != null) {
|
||||
showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void showNotification(MessageInfo messageInfo) {
|
||||
Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.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);
|
||||
|
||||
// Intent notifyIntent = new Intent(this, MainActivity2.class);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
// // notifyIntent.putExtra("message", messageInfo);
|
||||
// notifyIntent.setAction(Intent.ACTION_VIEW);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须
|
||||
// PendingIntent pendingIntent;
|
||||
// pendingIntent = PendingIntent.getActivity
|
||||
// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | 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(com.web.base.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(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(messageInfo.getTitle())
|
||||
.setContentText(messageInfo.getContent())
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.R.mipmap.ic_launcher)
|
||||
.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, MainActivity2.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(com.web.base.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(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
}
|
||||
notificationManager.notify(0, notificationBuilder.build());
|
||||
//存储数据
|
||||
// saveNotifyMessage(body);
|
||||
}
|
||||
|
||||
|
||||
// public void saveNotifyMessage(String body) {
|
||||
// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class);
|
||||
// String savenotify = Utils.get(getApplication(),ApiService.savenotify,"");
|
||||
// if(messageInfo!=null){
|
||||
// if(TextUtils.isEmpty(savenotify)){
|
||||
// GsonUtils.getListFromJSON(savenotify,)
|
||||
// }
|
||||
// }
|
||||
// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @param key 要设置的key
|
||||
// */
|
||||
// public static void set(Context activity, String key, String is) {
|
||||
// SharedPreferences nameSetting = getConfigShared(activity);
|
||||
// SharedPreferences.Editor namePref = nameSetting.edit();
|
||||
// namePref.putString(key, is);
|
||||
// namePref.commit();
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.web.gdslot888;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
|
||||
import com.tencent.smtt.export.external.TbsCoreSettings;
|
||||
import com.tencent.smtt.sdk.QbSdk;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class WebApplication extends Application {
|
||||
|
||||
|
||||
public static Context application;
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
// 设置开启优化方案
|
||||
application = this;
|
||||
HashMap map = new HashMap();
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true);
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true);
|
||||
QbSdk.initTbsSettings(map);
|
||||
QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() {
|
||||
@Override
|
||||
public void onCoreInitFinished() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewInitFinished(boolean b) {
|
||||
|
||||
}
|
||||
});
|
||||
QbSdk.setDownloadWithoutWifi(true);
|
||||
}
|
||||
}
|
||||
11
Gdslot888/src/main/res/drawable-anydpi/ic_action_back.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="#333333"
|
||||
android:alpha="0.8">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
|
||||
</vector>
|
||||
BIN
Gdslot888/src/main/res/drawable-hdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 182 B |
BIN
Gdslot888/src/main/res/drawable-mdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 150 B |
@@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
||||
BIN
Gdslot888/src/main/res/drawable-xhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 212 B |
BIN
Gdslot888/src/main/res/drawable-xxhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 324 B |
170
Gdslot888/src/main/res/drawable/ic_launcher_background.xml
Normal file
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
||||
20
Gdslot888/src/main/res/drawable/input_bg.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/white">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape>
|
||||
<solid android:color="@android:color/transparent" />
|
||||
<corners android:radius="23dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 默认显⽰效果-->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/dialog_input_bg"/>
|
||||
<corners
|
||||
android:radius="3dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
|
||||
28
Gdslot888/src/main/res/drawable/pass_word_bg.xml
Normal 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>
|
||||
|
||||
23
Gdslot888/src/main/res/drawable/pass_word_bg1.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#FF0000"
|
||||
android:centerColor="#FF5555"
|
||||
android:endColor="#FBD3D0"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
23
Gdslot888/src/main/res/drawable/pass_word_bg2.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#000000"
|
||||
android:centerColor="#888888"
|
||||
android:endColor="#FFFFFF"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
5
Gdslot888/src/main/res/drawable/shape_btn_bg.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="22dp" />
|
||||
<solid android:color="@color/jisuanqi" />
|
||||
</shape>
|
||||
6
Gdslot888/src/main/res/drawable/shape_dialog_bg2.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:topRightRadius="12dp"
|
||||
android:topLeftRadius="12dp"/>
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
Gdslot888/src/main/res/drawable/shape_dialog_bg3.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="12dp" />
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
Gdslot888/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
BIN
Gdslot888/src/main/res/mipmap-hdpi/ic_empty.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
Gdslot888/src/main/res/mipmap-hdpi/ic_pull_down.png
Normal file
|
After Width: | Height: | Size: 271 B |
BIN
Gdslot888/src/main/res/mipmap-xhdpi/ic_close.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
Gdslot888/src/main/res/mipmap-xhdpi/ic_facebook.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
Gdslot888/src/main/res/mipmap-xhdpi/ic_hometo.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
Gdslot888/src/main/res/mipmap-xhdpi/ic_link.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
Gdslot888/src/main/res/mipmap-xhdpi/ic_menu.png
Normal file
|
After Width: | Height: | Size: 779 B |
BIN
Gdslot888/src/main/res/mipmap-xhdpi/ic_shousuo.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
Gdslot888/src/main/res/mipmap-xhdpi/ic_tel.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
Gdslot888/src/main/res/mipmap-xhdpi/ic_whatsapp.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
Gdslot888/src/main/res/mipmap-xhdpi/ic_zhangkai.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
Gdslot888/src/main/res/mipmap-xxhdpi/app_logo.jpg
Normal file
|
After Width: | Height: | Size: 175 KiB |
54
Gdslot888/src/main/res/values-en/strings.xml
Normal file
@@ -0,0 +1,54 @@
|
||||
<resources>
|
||||
<string name="app_name">GDSlot888</string>
|
||||
<string name="qsrlwmm_txt">Please Set Your Password</string>
|
||||
<string name="cancel_txt">Cancel</string>
|
||||
<string name="sure_txt">Sure</string>
|
||||
<string name="banbengengxin_txt">New Version Update</string>
|
||||
<string name="xiacigengxin_txt">Next Update</string>
|
||||
<string name="lijigengxin_txt">Update Immediately</string>
|
||||
<string name="app_updater_error_notification_content">Click to close notification</string>
|
||||
<string name="app_updater_error_notification_content_re_download">Click to re-download</string>
|
||||
<string name="app_updater_error_notification_title">Download failed</string>
|
||||
<string name="app_updater_finish_notification_content">Click to install</string>
|
||||
<string name="app_updater_finish_notification_title">Download completed</string>
|
||||
<string name="app_updater_progress_notification_content">Downloading...</string>
|
||||
<string name="app_updater_progress_notification_title">Version update</string>
|
||||
<string name="app_updater_progress_notification_title_2">Downloading game</string>
|
||||
<string name="app_updater_start_notification_content">Getting download data...</string>
|
||||
<string name="app_updater_start_notification_title">Version update</string>
|
||||
<string name="app_updater_start_notification_title_2">Downloading game</string>
|
||||
<string name="notification_title_txt">Need to turn on mobile phone notification permission</string>
|
||||
<string name="notification_cancel_txt">Exit</string>
|
||||
<string name="notification_setting_txt">Setting</string>
|
||||
<string name="app_tishi">Tip</string>
|
||||
<string name="app_hint">Please enter the invitation code</string>
|
||||
<string name="app_sharetitle">My invitation code:</string>
|
||||
<string name="app_sharetitle2">Superior invitation code:</string>
|
||||
<string name="app_totalinvite">Total number of invites:</string>
|
||||
<string name="app_sharecontent">App download link:</string>
|
||||
<string name="app_share">Share</string>
|
||||
<string name="app_checklist">Check Invitation Records</string>
|
||||
<string name="app_invitetitle">Invitation Records</string>
|
||||
<string name="app_checklist_number">Total number of invitees: %d</string>
|
||||
<string name="app_nodata">No Data</string>
|
||||
<string name="app_withdrawtitle">Withdrawal Record</string>
|
||||
<string name="app_withdrawapply_title">Withdrawal Application</string>
|
||||
<string name="app_bankinfo_title">Edit Bank Card Information</string>
|
||||
<string name="app_bankinfo_countrycode">60</string>
|
||||
<string name="app_bankinfo_name">Name:</string>
|
||||
<string name="app_bankinfo_name_hint">Please enter the bank card name</string>
|
||||
<string name="app_bankinfo_code">Bank card account:</string>
|
||||
<string name="app_bankinfo_code_hint">Please enter the bank card account</string>
|
||||
<string name="app_bankinfo_bankcountry">Country:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">Please select a country</string>
|
||||
<string name="app_bankinfo_bankname">Bank Name:</string>
|
||||
<string name="app_bankinfo_bankname_hint">Please select a bank name</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">Note: Please enter the country code before selecting the bank name!</string>
|
||||
<string name="app_balance">Balance: %s</string>
|
||||
<string name="app_totalearning">Total Earnings: %s</string>
|
||||
<string name="app_withdraw_amount">Amount: %s</string>
|
||||
<string name="app_withdraw_apply_hint">Please enter the withdrawal amount</string>
|
||||
<string name="app_toastapply">Withdrawal application has been submitted</string>
|
||||
<string name="app_notinstall">App not installed</string>
|
||||
|
||||
</resources>
|
||||
69
Gdslot888/src/main/res/values-night/themes.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.Calculcator" parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_200</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/black</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_200</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</item>
|
||||
</style>
|
||||
</resources>
|
||||
19
Gdslot888/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="purple_200">#FFFFFF</color>
|
||||
<color name="purple_500">#FFFFFF</color>
|
||||
<color name="purple_700">#FFFFFF</color>
|
||||
<color name="teal_200">#FF03DAC5</color>
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="jisuanqi">#EF4723</color>
|
||||
<color name="notify_color">#FFFFFFFF</color>
|
||||
|
||||
<color name="dialog_bg">#2C2C2E</color>
|
||||
<color name="dialog_textcolor">#FFA722</color>
|
||||
<color name="dialog_input_bg">#434343</color>
|
||||
<color name="dialog_dark">#BCBCBC</color>
|
||||
<color name="color_red">#DC1927</color>
|
||||
|
||||
</resources>
|
||||
77
Gdslot888/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,77 @@
|
||||
<resources>
|
||||
<string name="app_name">GDSlot888</string>
|
||||
<string name="qsrlwmm_txt">请输入6位密码</string>
|
||||
<string name="cancel_txt">取消</string>
|
||||
<string name="sure_txt">确定</string>
|
||||
<string name="banbengengxin_txt">版本更新</string>
|
||||
<string name="xiacigengxin_txt">下次更新</string>
|
||||
<string name="lijigengxin_txt">立即更新</string>
|
||||
<string name="app_updater_error_notification_content">点击关闭通知</string>
|
||||
<string name="app_updater_error_notification_content_re_download">点击重新下载</string>
|
||||
<string name="app_updater_error_notification_title">下载失败</string>
|
||||
<string name="app_updater_finish_notification_content">点击安装</string>
|
||||
<string name="app_updater_finish_notification_title">下载完成</string>
|
||||
<string name="app_updater_progress_notification_content">正在下载…</string>
|
||||
<string name="app_updater_progress_notification_title">版本更新</string>
|
||||
<string name="app_updater_progress_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_title">版本更新</string>
|
||||
<string name="app_updater_start_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_content">正在获取下载数据…</string>
|
||||
<string name="notification_title_txt">需要打开手机通知权限</string>
|
||||
<string name="notification_cancel_txt">退出</string>
|
||||
<string name="notification_setting_txt">设置</string>
|
||||
<string name="app_tishi">提示</string>
|
||||
<string name="app_hint">请输入邀请码</string>
|
||||
<string name="app_sharetitle">我的邀请码:</string>
|
||||
<string name="app_sharetitle2">上级邀请码:</string>
|
||||
<string name="app_totalinvite">总邀请人数:</string>
|
||||
<string name="app_sharecontent">邀请您下载:</string>
|
||||
<string name="app_share">分享</string>
|
||||
<string name="app_checklist">查看邀请记录</string>
|
||||
<string name="app_invitetitle">邀请记录</string>
|
||||
<string name="app_checklist_number">总邀请人数: %d</string>
|
||||
<string name="app_nodata">暂无数据</string>
|
||||
<string name="app_withdrawtitle">提现记录</string>
|
||||
<string name="app_withdrawapply_title">提现申请</string>
|
||||
<string name="app_bankinfo_title">编辑银行卡信息</string>
|
||||
<string name="app_bankinfo_countrycode">86</string>
|
||||
<string name="app_bankinfo_name">持卡人姓名:</string>
|
||||
<string name="app_bankinfo_name_hint">请输入持卡人姓名</string>
|
||||
<string name="app_bankinfo_bankcountry">国家地区:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">请选择国家地区</string>
|
||||
<string name="app_bankinfo_bankname">开户行名称:</string>
|
||||
<string name="app_bankinfo_bankname_hint">请选择开户行名称</string>
|
||||
<string name="app_bankinfo_code">银行户口:</string>
|
||||
<string name="app_bankinfo_code_hint">请输入银行卡户口</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">(注:请先输入国家区号再选择开户行名称!)</string>
|
||||
<string name="app_balance">余额: %s</string>
|
||||
<string name="app_totalearning">总收益: %s</string>
|
||||
<string name="app_withdraw_amount">金额: %s</string>
|
||||
<string name="app_withdraw_apply_hint">请输入提现金额</string>
|
||||
<string name="app_toastapply">提现申请已提交</string>
|
||||
<string name="app_notinstall">应用未安装</string>
|
||||
|
||||
|
||||
<!-- <string name="app_name">SPEEDAU</string>-->
|
||||
<!-- <string name="qsrlwmm_txt">Please Set Your Password</string>-->
|
||||
<!-- <string name="cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="sure_txt">Sure</string>-->
|
||||
<!-- <string name="banbengengxin_txt">New Version Update</string>-->
|
||||
<!-- <string name="xiacigengxin_txt">Next Update</string>-->
|
||||
<!-- <string name="lijigengxin_txt">Update Immediately</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content">Click to close notification</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content_re_download">Click to re-download</string>-->
|
||||
<!-- <string name="app_updater_error_notification_title">Download failed</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_content">Click to install</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_title">Download completed</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_content">Downloading...</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="app_updater_start_notification_content">Getting download data...</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="notification_title_txt">Need to turn on mobile phone notification permission</string>-->
|
||||
<!-- <string name="notification_cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="notification_setting_txt">Setting</string>-->
|
||||
|
||||
</resources>
|
||||
20
Gdslot888/src/main/res/values/style.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="AppThemeStart1" parent="@style/Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="android:windowTranslucentStatus">true</item>
|
||||
<item name="android:windowTranslucentNavigation">false</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="colorPrimary">@android:color/transparent</item>
|
||||
<item name="colorPrimaryDark">@android:color/transparent</item>
|
||||
<item name="colorAccent">@android:color/transparent</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<!-- 隐藏Activity窗口的Title标题栏 -->
|
||||
<item name="windowNoTitle">true</item>
|
||||
<!-- <item name="android:windowFullscreen">true</item>-->
|
||||
<item name="android:windowBackground">@color/white</item>
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</item>
|
||||
</style>
|
||||
</resources>
|
||||
89
Gdslot888/src/main/res/values/themes.xml
Normal file
@@ -0,0 +1,89 @@
|
||||
<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. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
<item name="android:enforceNavigationBarContrast" tools:ignore="NewApi">false</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</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>
|
||||
10
Gdslot888/src/main/res/xml/app_updater_paths.xml
Normal 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>
|
||||
4
Gdslot888/src/main/res/xml/network_security_config.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<network-security-config>
|
||||
<base-config cleartextTrafficPermitted="true" />
|
||||
</network-security-config>
|
||||
13
Gdslot888/src/main/res/xml/provider_paths.xml
Normal 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"异常的问题 -->
|
||||
@@ -0,0 +1,35 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void TestPattern(){
|
||||
//
|
||||
Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$");
|
||||
String a="+45.5";
|
||||
boolean matches = compile.matcher(a).matches();
|
||||
System.out.println(matches);
|
||||
String result = compile.matcher(a).replaceAll("");
|
||||
System.out.println(result);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
1
Jeslot88/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
91
Jeslot88/build.gradle
Normal file
@@ -0,0 +1,91 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'com.google.gms.google-services'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 31
|
||||
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.web.jeslot88"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 31
|
||||
versionCode 106
|
||||
versionName "v1.0.6"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
signingConfigs {
|
||||
debug {
|
||||
storeFile file('jeslot88.jks')
|
||||
storePassword "android2014"
|
||||
keyAlias 'key0'
|
||||
keyPassword "android2014"
|
||||
}
|
||||
release {
|
||||
storeFile file('jeslot88.jks')
|
||||
storePassword "android2014"
|
||||
keyAlias 'key0'
|
||||
keyPassword "android2014"
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'com.google.android.material:material:1.1.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
testImplementation 'junit:junit:4.+'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar')
|
||||
|
||||
// okhttp相关库
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
|
||||
|
||||
// JSON解析库
|
||||
implementation 'com.google.code.gson:gson:2.9.0'
|
||||
implementation 'com.alibaba:fastjson:1.1.71.android'
|
||||
api 'com.squareup.retrofit2:retrofit:2.5.0'
|
||||
api 'com.squareup.retrofit2:converter-scalars:2.3.0'
|
||||
api 'com.squareup.retrofit2:converter-gson:2.4.0'
|
||||
api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
|
||||
api 'io.reactivex.rxjava2:rxjava:2.1.16'
|
||||
api 'io.reactivex.rxjava2:rxandroid:2.0.2'
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选)
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选)
|
||||
implementation 'com.github.Justson:Downloader:v5.0.4-androidx'
|
||||
//implementation 'com.tencent.tbs:tbssdk:44286'
|
||||
// sdk 33
|
||||
// implementation platform('com.google.firebase:firebase-bom:32.7.0')
|
||||
// Firebase Cloud Messaging
|
||||
// implementation("com.google.firebase:firebase-messaging")
|
||||
// implementation("com.google.firebase:firebase-analytics")
|
||||
|
||||
implementation platform('com.google.firebase:firebase-bom:32.1.0')
|
||||
|
||||
// Add the dependencies for the Firebase Cloud Messaging and Analytics libraries
|
||||
// When using the BoM, you don't specify versions in Firebase library dependencies
|
||||
implementation 'com.google.firebase:firebase-messaging'
|
||||
implementation 'com.google.firebase:firebase-analytics'
|
||||
// implementation("com.google.firebase:firebase-messaging:23.2.1")
|
||||
// implementation("com.google.firebase:firebase-analytics:21.2.1")
|
||||
// implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式
|
||||
implementation("com.github.bumptech.glide:glide:4.13.1")
|
||||
implementation project(path: ':base')
|
||||
|
||||
}
|
||||
29
Jeslot88/google-services.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "54193138344",
|
||||
"project_id": "jeslot88-11954",
|
||||
"storage_bucket": "jeslot88-11954.firebasestorage.app"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:54193138344:android:1d108d4e81451ce5bbf09d",
|
||||
"android_client_info": {
|
||||
"package_name": "com.web.jeslot88"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyD3SVVnmLcXEBg7Uh_ngYJx1_Hvy7WsOAo"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
BIN
Jeslot88/jeslot88.jks
Normal file
BIN
Jeslot88/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar
Normal file
32
Jeslot88/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
||||
-dontwarn dalvik.**
|
||||
-dontwarn com.tencent.smtt.**
|
||||
|
||||
-keep class com.tencent.smtt.** {
|
||||
*;
|
||||
}
|
||||
|
||||
-keep class com.tencent.tbs.** {
|
||||
*;
|
||||
}
|
||||
BIN
Jeslot88/release/Jeslot88.apk
Normal file
18
Jeslot88/release/output-metadata.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"version": 2,
|
||||
"artifactType": {
|
||||
"type": "APK",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "com.web.jeslot88",
|
||||
"variantName": "processReleaseResources",
|
||||
"elements": [
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"versionCode": 106,
|
||||
"versionName": "v1.0.6",
|
||||
"outputFile": "Jeslot88-release.apk"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("Tptogiar.calculcator", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
115
Jeslot88/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,115 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.web.jeslot88">
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera"
|
||||
android:required="false" />
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera2"
|
||||
android:required="false" />
|
||||
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS" /> <!-- 获取通讯录-->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<!-- 多媒体相关 -->
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
|
||||
<!-- 8.0+系统需要-->
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
|
||||
<!--推送权限-->
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_SECURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.RECORD_AUDIO" />-->
|
||||
|
||||
|
||||
<!-- <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_AUDIO_OUTPUT" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.autofocus" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.front" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.level.full" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.capability.raw" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.any" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.microphone" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera2" android:required="true" />-->
|
||||
|
||||
<queries>
|
||||
<intent>
|
||||
<action android:name="android.media.action.IMAGE_CAPTURE" />
|
||||
</intent>
|
||||
</queries>
|
||||
<application
|
||||
android:name=".WebApplication"
|
||||
android:allowBackup="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:icon="@mipmap/app_logo"
|
||||
android:label="@string/app_name"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:roundIcon="@mipmap/app_logo"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.AppTheme"
|
||||
android:usesCleartextTraffic="true">
|
||||
|
||||
|
||||
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity2"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:exported="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:theme="@style/AppThemeStart">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
|
||||
<service
|
||||
android:name="com.tencent.smtt.export.external.DexClassLoaderProviderService"
|
||||
android:label="dexopt"
|
||||
android:process=":dexopt" />
|
||||
|
||||
|
||||
<!-- android:directBootAware="true" 为应用启用消息处理直接启动模式-->
|
||||
<service
|
||||
android:name=".MyFirebaseMessageingService"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<!-- Set custom default icon. This is used when no icon is set for incoming notification messages.
|
||||
See README(https://goo.gl/l4GJaQ) for more. 设置推送默认图标 和颜色-->
|
||||
<meta-data
|
||||
android:name="com.google.firebase.messaging.default_notification_icon"
|
||||
android:resource="@mipmap/app_logo" />
|
||||
<!-- Set color used with incoming notification messages. This is used when no color is set for the incoming
|
||||
notification message. See README(https://goo.gl/6BKBk7) for more. -->
|
||||
<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" />
|
||||
<!-- 还可设置推送渠道 -->
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.google.firebase.messaging.default_notification_channel_id"-->
|
||||
<!-- android:value="@string/default_notification_channel_id" />-->
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
54
Jeslot88/src/main/java/com/web/jeslot88/MainActivity2.java
Normal file
@@ -0,0 +1,54 @@
|
||||
package com.web.jeslot88;
|
||||
|
||||
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.android.gms.tasks.OnCompleteListener;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.firebase.messaging.FirebaseMessaging;
|
||||
import com.web.base.MainActivity;
|
||||
|
||||
public class MainActivity2 extends com.web.base.MainActivity2 {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
userId = 91;
|
||||
saveInt(MainActivity2.this,"user_code",userId);
|
||||
saveInt(MainActivity2.this,"version_code",getVersion());
|
||||
MainActivity.saveString(this, "base_url", "https://jeslot88.online/");
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
//订阅主题
|
||||
FirebaseMessaging.getInstance().subscribeToTopic("demo")
|
||||
.addOnCompleteListener(new OnCompleteListener<Void>() {
|
||||
@Override
|
||||
public void onComplete(@NonNull Task<Void> task) {
|
||||
String msg = "Subscribed";
|
||||
if (!task.isSuccessful()) {
|
||||
msg = "Subscribe failed";
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public int getVersion(){
|
||||
try {
|
||||
PackageManager packageManager = getPackageManager();
|
||||
PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0);
|
||||
String StringversionName = packageInfo.versionName; // 版本号
|
||||
int versionCode = packageInfo.versionCode; // 版本码
|
||||
// 在这里可以使用versionName和versionCode进行相关的操作
|
||||
// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode);
|
||||
return versionCode;
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
package com.web.jeslot88;
|
||||
|
||||
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.web.base.GsonUtils;
|
||||
import com.web.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);
|
||||
// if (remoteMessage.getNotification() != null) {
|
||||
// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
// }
|
||||
} else {
|
||||
//收到通知 创建notify
|
||||
if (remoteMessage.getNotification() != null) {
|
||||
showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void showNotification(MessageInfo messageInfo) {
|
||||
Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.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);
|
||||
|
||||
// Intent notifyIntent = new Intent(this, MainActivity2.class);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
// // notifyIntent.putExtra("message", messageInfo);
|
||||
// notifyIntent.setAction(Intent.ACTION_VIEW);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须
|
||||
// PendingIntent pendingIntent;
|
||||
// pendingIntent = PendingIntent.getActivity
|
||||
// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | 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(com.web.base.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(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(messageInfo.getTitle())
|
||||
.setContentText(messageInfo.getContent())
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.R.mipmap.ic_launcher)
|
||||
.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, MainActivity2.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(com.web.base.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(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
}
|
||||
notificationManager.notify(0, notificationBuilder.build());
|
||||
//存储数据
|
||||
// saveNotifyMessage(body);
|
||||
}
|
||||
|
||||
|
||||
// public void saveNotifyMessage(String body) {
|
||||
// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class);
|
||||
// String savenotify = Utils.get(getApplication(),ApiService.savenotify,"");
|
||||
// if(messageInfo!=null){
|
||||
// if(TextUtils.isEmpty(savenotify)){
|
||||
// GsonUtils.getListFromJSON(savenotify,)
|
||||
// }
|
||||
// }
|
||||
// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @param key 要设置的key
|
||||
// */
|
||||
// public static void set(Context activity, String key, String is) {
|
||||
// SharedPreferences nameSetting = getConfigShared(activity);
|
||||
// SharedPreferences.Editor namePref = nameSetting.edit();
|
||||
// namePref.putString(key, is);
|
||||
// namePref.commit();
|
||||
// }
|
||||
}
|
||||
37
Jeslot88/src/main/java/com/web/jeslot88/WebApplication.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.web.jeslot88;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
|
||||
import com.tencent.smtt.export.external.TbsCoreSettings;
|
||||
import com.tencent.smtt.sdk.QbSdk;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class WebApplication extends Application {
|
||||
|
||||
|
||||
public static Context application;
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
// 设置开启优化方案
|
||||
application = this;
|
||||
HashMap map = new HashMap();
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true);
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true);
|
||||
QbSdk.initTbsSettings(map);
|
||||
QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() {
|
||||
@Override
|
||||
public void onCoreInitFinished() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewInitFinished(boolean b) {
|
||||
|
||||
}
|
||||
});
|
||||
QbSdk.setDownloadWithoutWifi(true);
|
||||
}
|
||||
}
|
||||
11
Jeslot88/src/main/res/drawable-anydpi/ic_action_back.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="#333333"
|
||||
android:alpha="0.8">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
|
||||
</vector>
|
||||
BIN
Jeslot88/src/main/res/drawable-hdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 182 B |
BIN
Jeslot88/src/main/res/drawable-mdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 150 B |
@@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
||||
BIN
Jeslot88/src/main/res/drawable-xhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 212 B |
BIN
Jeslot88/src/main/res/drawable-xxhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 324 B |
170
Jeslot88/src/main/res/drawable/ic_launcher_background.xml
Normal file
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
||||
20
Jeslot88/src/main/res/drawable/input_bg.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/white">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape>
|
||||
<solid android:color="@android:color/transparent" />
|
||||
<corners android:radius="23dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 默认显⽰效果-->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/dialog_input_bg"/>
|
||||
<corners
|
||||
android:radius="3dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
|
||||
28
Jeslot88/src/main/res/drawable/pass_word_bg.xml
Normal 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>
|
||||
|
||||
23
Jeslot88/src/main/res/drawable/pass_word_bg1.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#FF0000"
|
||||
android:centerColor="#FF5555"
|
||||
android:endColor="#FBD3D0"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
23
Jeslot88/src/main/res/drawable/pass_word_bg2.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#000000"
|
||||
android:centerColor="#888888"
|
||||
android:endColor="#FFFFFF"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
5
Jeslot88/src/main/res/drawable/shape_btn_bg.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="22dp" />
|
||||
<solid android:color="@color/jisuanqi" />
|
||||
</shape>
|
||||
6
Jeslot88/src/main/res/drawable/shape_dialog_bg2.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:topRightRadius="12dp"
|
||||
android:topLeftRadius="12dp"/>
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
Jeslot88/src/main/res/drawable/shape_dialog_bg3.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="12dp" />
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
Jeslot88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
BIN
Jeslot88/src/main/res/mipmap-hdpi/ic_empty.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
Jeslot88/src/main/res/mipmap-hdpi/ic_pull_down.png
Normal file
|
After Width: | Height: | Size: 271 B |
BIN
Jeslot88/src/main/res/mipmap-xhdpi/ic_close.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
Jeslot88/src/main/res/mipmap-xhdpi/ic_facebook.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
Jeslot88/src/main/res/mipmap-xhdpi/ic_hometo.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
Jeslot88/src/main/res/mipmap-xhdpi/ic_link.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
Jeslot88/src/main/res/mipmap-xhdpi/ic_menu.png
Normal file
|
After Width: | Height: | Size: 779 B |
BIN
Jeslot88/src/main/res/mipmap-xhdpi/ic_shousuo.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
Jeslot88/src/main/res/mipmap-xhdpi/ic_tel.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
Jeslot88/src/main/res/mipmap-xhdpi/ic_whatsapp.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
Jeslot88/src/main/res/mipmap-xhdpi/ic_zhangkai.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
Jeslot88/src/main/res/mipmap-xxhdpi/app_logo.png
Normal file
|
After Width: | Height: | Size: 7.8 KiB |
54
Jeslot88/src/main/res/values-en/strings.xml
Normal file
@@ -0,0 +1,54 @@
|
||||
<resources>
|
||||
<string name="app_name">JESLOT88</string>
|
||||
<string name="qsrlwmm_txt">Please Set Your Password</string>
|
||||
<string name="cancel_txt">Cancel</string>
|
||||
<string name="sure_txt">Sure</string>
|
||||
<string name="banbengengxin_txt">New Version Update</string>
|
||||
<string name="xiacigengxin_txt">Next Update</string>
|
||||
<string name="lijigengxin_txt">Update Immediately</string>
|
||||
<string name="app_updater_error_notification_content">Click to close notification</string>
|
||||
<string name="app_updater_error_notification_content_re_download">Click to re-download</string>
|
||||
<string name="app_updater_error_notification_title">Download failed</string>
|
||||
<string name="app_updater_finish_notification_content">Click to install</string>
|
||||
<string name="app_updater_finish_notification_title">Download completed</string>
|
||||
<string name="app_updater_progress_notification_content">Downloading...</string>
|
||||
<string name="app_updater_progress_notification_title">Version update</string>
|
||||
<string name="app_updater_progress_notification_title_2">Downloading game</string>
|
||||
<string name="app_updater_start_notification_content">Getting download data...</string>
|
||||
<string name="app_updater_start_notification_title">Version update</string>
|
||||
<string name="app_updater_start_notification_title_2">Downloading game</string>
|
||||
<string name="notification_title_txt">Need to turn on mobile phone notification permission</string>
|
||||
<string name="notification_cancel_txt">Exit</string>
|
||||
<string name="notification_setting_txt">Setting</string>
|
||||
<string name="app_tishi">Tip</string>
|
||||
<string name="app_hint">Please enter the invitation code</string>
|
||||
<string name="app_sharetitle">My invitation code:</string>
|
||||
<string name="app_sharetitle2">Superior invitation code:</string>
|
||||
<string name="app_totalinvite">Total number of invites:</string>
|
||||
<string name="app_sharecontent">App download link:</string>
|
||||
<string name="app_share">Share</string>
|
||||
<string name="app_checklist">Check Invitation Records</string>
|
||||
<string name="app_invitetitle">Invitation Records</string>
|
||||
<string name="app_checklist_number">Total number of invitees: %d</string>
|
||||
<string name="app_nodata">No Data</string>
|
||||
<string name="app_withdrawtitle">Withdrawal Record</string>
|
||||
<string name="app_withdrawapply_title">Withdrawal Application</string>
|
||||
<string name="app_bankinfo_title">Edit Bank Card Information</string>
|
||||
<string name="app_bankinfo_countrycode">60</string>
|
||||
<string name="app_bankinfo_name">Name:</string>
|
||||
<string name="app_bankinfo_name_hint">Please enter the bank card name</string>
|
||||
<string name="app_bankinfo_code">Bank card account:</string>
|
||||
<string name="app_bankinfo_code_hint">Please enter the bank card account</string>
|
||||
<string name="app_bankinfo_bankcountry">Country:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">Please select a country</string>
|
||||
<string name="app_bankinfo_bankname">Bank Name:</string>
|
||||
<string name="app_bankinfo_bankname_hint">Please select a bank name</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">Note: Please enter the country code before selecting the bank name!</string>
|
||||
<string name="app_balance">Balance: %s</string>
|
||||
<string name="app_totalearning">Total Earnings: %s</string>
|
||||
<string name="app_withdraw_amount">Amount: %s</string>
|
||||
<string name="app_withdraw_apply_hint">Please enter the withdrawal amount</string>
|
||||
<string name="app_toastapply">Withdrawal application has been submitted</string>
|
||||
<string name="app_notinstall">App not installed</string>
|
||||
|
||||
</resources>
|
||||
69
Jeslot88/src/main/res/values-night/themes.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.Calculcator" parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_200</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/black</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_200</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</item>
|
||||
</style>
|
||||
</resources>
|
||||
19
Jeslot88/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="purple_200">#FFFFFF</color>
|
||||
<color name="purple_500">#FFFFFF</color>
|
||||
<color name="purple_700">#FFFFFF</color>
|
||||
<color name="teal_200">#FF03DAC5</color>
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="jisuanqi">#EF4723</color>
|
||||
<color name="notify_color">#FFFFFFFF</color>
|
||||
|
||||
<color name="dialog_bg">#2C2C2E</color>
|
||||
<color name="dialog_textcolor">#FFA722</color>
|
||||
<color name="dialog_input_bg">#434343</color>
|
||||
<color name="dialog_dark">#BCBCBC</color>
|
||||
<color name="color_red">#DC1927</color>
|
||||
|
||||
</resources>
|
||||
77
Jeslot88/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,77 @@
|
||||
<resources>
|
||||
<string name="app_name">JESLOT88</string>
|
||||
<string name="qsrlwmm_txt">请输入6位密码</string>
|
||||
<string name="cancel_txt">取消</string>
|
||||
<string name="sure_txt">确定</string>
|
||||
<string name="banbengengxin_txt">版本更新</string>
|
||||
<string name="xiacigengxin_txt">下次更新</string>
|
||||
<string name="lijigengxin_txt">立即更新</string>
|
||||
<string name="app_updater_error_notification_content">点击关闭通知</string>
|
||||
<string name="app_updater_error_notification_content_re_download">点击重新下载</string>
|
||||
<string name="app_updater_error_notification_title">下载失败</string>
|
||||
<string name="app_updater_finish_notification_content">点击安装</string>
|
||||
<string name="app_updater_finish_notification_title">下载完成</string>
|
||||
<string name="app_updater_progress_notification_content">正在下载…</string>
|
||||
<string name="app_updater_progress_notification_title">版本更新</string>
|
||||
<string name="app_updater_progress_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_title">版本更新</string>
|
||||
<string name="app_updater_start_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_content">正在获取下载数据…</string>
|
||||
<string name="notification_title_txt">需要打开手机通知权限</string>
|
||||
<string name="notification_cancel_txt">退出</string>
|
||||
<string name="notification_setting_txt">设置</string>
|
||||
<string name="app_tishi">提示</string>
|
||||
<string name="app_hint">请输入邀请码</string>
|
||||
<string name="app_sharetitle">我的邀请码:</string>
|
||||
<string name="app_sharetitle2">上级邀请码:</string>
|
||||
<string name="app_totalinvite">总邀请人数:</string>
|
||||
<string name="app_sharecontent">邀请您下载:</string>
|
||||
<string name="app_share">分享</string>
|
||||
<string name="app_checklist">查看邀请记录</string>
|
||||
<string name="app_invitetitle">邀请记录</string>
|
||||
<string name="app_checklist_number">总邀请人数: %d</string>
|
||||
<string name="app_nodata">暂无数据</string>
|
||||
<string name="app_withdrawtitle">提现记录</string>
|
||||
<string name="app_withdrawapply_title">提现申请</string>
|
||||
<string name="app_bankinfo_title">编辑银行卡信息</string>
|
||||
<string name="app_bankinfo_countrycode">86</string>
|
||||
<string name="app_bankinfo_name">持卡人姓名:</string>
|
||||
<string name="app_bankinfo_name_hint">请输入持卡人姓名</string>
|
||||
<string name="app_bankinfo_bankcountry">国家地区:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">请选择国家地区</string>
|
||||
<string name="app_bankinfo_bankname">开户行名称:</string>
|
||||
<string name="app_bankinfo_bankname_hint">请选择开户行名称</string>
|
||||
<string name="app_bankinfo_code">银行户口:</string>
|
||||
<string name="app_bankinfo_code_hint">请输入银行卡户口</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">(注:请先输入国家区号再选择开户行名称!)</string>
|
||||
<string name="app_balance">余额: %s</string>
|
||||
<string name="app_totalearning">总收益: %s</string>
|
||||
<string name="app_withdraw_amount">金额: %s</string>
|
||||
<string name="app_withdraw_apply_hint">请输入提现金额</string>
|
||||
<string name="app_toastapply">提现申请已提交</string>
|
||||
<string name="app_notinstall">应用未安装</string>
|
||||
|
||||
|
||||
<!-- <string name="app_name">SPEEDAU</string>-->
|
||||
<!-- <string name="qsrlwmm_txt">Please Set Your Password</string>-->
|
||||
<!-- <string name="cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="sure_txt">Sure</string>-->
|
||||
<!-- <string name="banbengengxin_txt">New Version Update</string>-->
|
||||
<!-- <string name="xiacigengxin_txt">Next Update</string>-->
|
||||
<!-- <string name="lijigengxin_txt">Update Immediately</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content">Click to close notification</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content_re_download">Click to re-download</string>-->
|
||||
<!-- <string name="app_updater_error_notification_title">Download failed</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_content">Click to install</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_title">Download completed</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_content">Downloading...</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="app_updater_start_notification_content">Getting download data...</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="notification_title_txt">Need to turn on mobile phone notification permission</string>-->
|
||||
<!-- <string name="notification_cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="notification_setting_txt">Setting</string>-->
|
||||
|
||||
</resources>
|
||||
20
Jeslot88/src/main/res/values/style.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="AppThemeStart1" parent="@style/Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="android:windowTranslucentStatus">true</item>
|
||||
<item name="android:windowTranslucentNavigation">false</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="colorPrimary">@android:color/transparent</item>
|
||||
<item name="colorPrimaryDark">@android:color/transparent</item>
|
||||
<item name="colorAccent">@android:color/transparent</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<!-- 隐藏Activity窗口的Title标题栏 -->
|
||||
<item name="windowNoTitle">true</item>
|
||||
<!-- <item name="android:windowFullscreen">true</item>-->
|
||||
<item name="android:windowBackground">@color/white</item>
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</item>
|
||||
</style>
|
||||
</resources>
|
||||
89
Jeslot88/src/main/res/values/themes.xml
Normal file
@@ -0,0 +1,89 @@
|
||||
<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. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
<item name="android:enforceNavigationBarContrast" tools:ignore="NewApi">false</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</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>
|
||||
10
Jeslot88/src/main/res/xml/app_updater_paths.xml
Normal 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>
|
||||
4
Jeslot88/src/main/res/xml/network_security_config.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<network-security-config>
|
||||
<base-config cleartextTrafficPermitted="true" />
|
||||
</network-security-config>
|
||||
13
Jeslot88/src/main/res/xml/provider_paths.xml
Normal 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"异常的问题 -->
|
||||
@@ -0,0 +1,35 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void TestPattern(){
|
||||
//
|
||||
Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$");
|
||||
String a="+45.5";
|
||||
boolean matches = compile.matcher(a).matches();
|
||||
System.out.println(matches);
|
||||
String result = compile.matcher(a).replaceAll("");
|
||||
System.out.println(result);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
1
Judy88/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
92
Judy88/build.gradle
Normal file
@@ -0,0 +1,92 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'com.google.gms.google-services'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 31
|
||||
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.web.judy88"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 31
|
||||
versionCode 106
|
||||
versionName "v1.0.6"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
signingConfigs {
|
||||
debug {
|
||||
storeFile file('judy88.jks')
|
||||
storePassword "android2014"
|
||||
keyAlias 'key0'
|
||||
keyPassword "android2014"
|
||||
}
|
||||
release {
|
||||
storeFile file('judy88.jks')
|
||||
storePassword "android2014"
|
||||
keyAlias 'key0'
|
||||
keyPassword "android2014"
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'com.google.android.material:material:1.1.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
testImplementation 'junit:junit:4.+'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar')
|
||||
|
||||
// okhttp相关库
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
|
||||
|
||||
// JSON解析库
|
||||
implementation 'com.google.code.gson:gson:2.9.0'
|
||||
implementation 'com.alibaba:fastjson:1.1.71.android'
|
||||
api 'com.squareup.retrofit2:retrofit:2.5.0'
|
||||
api 'com.squareup.retrofit2:converter-scalars:2.3.0'
|
||||
api 'com.squareup.retrofit2:converter-gson:2.4.0'
|
||||
api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
|
||||
api 'io.reactivex.rxjava2:rxjava:2.1.16'
|
||||
api 'io.reactivex.rxjava2:rxandroid:2.0.2'
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选)
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选)
|
||||
implementation 'com.github.Justson:Downloader:v5.0.4-androidx'
|
||||
//implementation 'com.tencent.tbs:tbssdk:44286'
|
||||
// sdk 33
|
||||
// implementation platform('com.google.firebase:firebase-bom:32.7.0')
|
||||
// Firebase Cloud Messaging
|
||||
// implementation("com.google.firebase:firebase-messaging")
|
||||
// implementation("com.google.firebase:firebase-analytics")
|
||||
|
||||
implementation platform('com.google.firebase:firebase-bom:32.1.0')
|
||||
|
||||
// Add the dependencies for the Firebase Cloud Messaging and Analytics libraries
|
||||
// When using the BoM, you don't specify versions in Firebase library dependencies
|
||||
implementation 'com.google.firebase:firebase-messaging'
|
||||
implementation 'com.google.firebase:firebase-analytics'
|
||||
// implementation("com.google.firebase:firebase-messaging:23.2.1")
|
||||
// implementation("com.google.firebase:firebase-analytics:21.2.1")
|
||||
// implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式
|
||||
implementation("com.github.bumptech.glide:glide:4.13.1")
|
||||
implementation project(path: ':base')
|
||||
|
||||
}
|
||||
29
Judy88/google-services.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "988212673486",
|
||||
"project_id": "judy88-904b7",
|
||||
"storage_bucket": "judy88-904b7.firebasestorage.app"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:988212673486:android:d44bd63db932c6bdf2899f",
|
||||
"android_client_info": {
|
||||
"package_name": "com.web.judy88"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyA2H4KZEBB2fkOJs9ldog9lAAuVSx41Oz0"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
BIN
Judy88/judy88.jks
Normal file
BIN
Judy88/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar
Normal file
32
Judy88/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
||||
-dontwarn dalvik.**
|
||||
-dontwarn com.tencent.smtt.**
|
||||
|
||||
-keep class com.tencent.smtt.** {
|
||||
*;
|
||||
}
|
||||
|
||||
-keep class com.tencent.tbs.** {
|
||||
*;
|
||||
}
|
||||
BIN
Judy88/release/Judy88.apk
Normal file
18
Judy88/release/output-metadata.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"version": 2,
|
||||
"artifactType": {
|
||||
"type": "APK",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "com.web.judy88",
|
||||
"variantName": "processReleaseResources",
|
||||
"elements": [
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"versionCode": 106,
|
||||
"versionName": "v1.0.6",
|
||||
"outputFile": "Judy88-release.apk"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("Tptogiar.calculcator", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
113
Judy88/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,113 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.web.judy88">
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera"
|
||||
android:required="false" />
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera2"
|
||||
android:required="false" />
|
||||
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS" /> <!-- 获取通讯录-->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<!-- 多媒体相关 -->
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
|
||||
<!-- 8.0+系统需要-->
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
|
||||
<!--推送权限-->
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_SECURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.RECORD_AUDIO" />-->
|
||||
|
||||
|
||||
<!-- <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_AUDIO_OUTPUT" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.autofocus" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.front" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.level.full" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.capability.raw" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.any" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.microphone" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera2" android:required="true" />-->
|
||||
|
||||
<queries>
|
||||
<intent>
|
||||
<action android:name="android.media.action.IMAGE_CAPTURE" />
|
||||
</intent>
|
||||
</queries>
|
||||
<application
|
||||
android:name=".WebApplication"
|
||||
android:allowBackup="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:icon="@mipmap/app_logo"
|
||||
android:label="@string/app_name"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:roundIcon="@mipmap/app_logo"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.AppTheme"
|
||||
android:usesCleartextTraffic="true">
|
||||
|
||||
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity2"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:exported="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:theme="@style/AppThemeStart">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<service
|
||||
android:name="com.tencent.smtt.export.external.DexClassLoaderProviderService"
|
||||
android:label="dexopt"
|
||||
android:process=":dexopt" />
|
||||
|
||||
|
||||
<!-- android:directBootAware="true" 为应用启用消息处理直接启动模式-->
|
||||
<service
|
||||
android:name=".MyFirebaseMessageingService"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<!-- Set custom default icon. This is used when no icon is set for incoming notification messages.
|
||||
See README(https://goo.gl/l4GJaQ) for more. 设置推送默认图标 和颜色-->
|
||||
<meta-data
|
||||
android:name="com.google.firebase.messaging.default_notification_icon"
|
||||
android:resource="@mipmap/app_logo" />
|
||||
<!-- Set color used with incoming notification messages. This is used when no color is set for the incoming
|
||||
notification message. See README(https://goo.gl/6BKBk7) for more. -->
|
||||
<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" />
|
||||
<!-- 还可设置推送渠道 -->
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.google.firebase.messaging.default_notification_channel_id"-->
|
||||
<!-- android:value="@string/default_notification_channel_id" />-->
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
54
Judy88/src/main/java/com/web/judy88/MainActivity2.java
Normal file
@@ -0,0 +1,54 @@
|
||||
package com.web.judy88;
|
||||
|
||||
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.android.gms.tasks.OnCompleteListener;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.firebase.messaging.FirebaseMessaging;
|
||||
import com.web.base.MainActivity;
|
||||
|
||||
public class MainActivity2 extends com.web.base.MainActivity2 {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
userId = 92;
|
||||
saveInt(MainActivity2.this,"user_code",userId);
|
||||
saveInt(MainActivity2.this,"version_code",getVersion());
|
||||
MainActivity.saveString(this, "base_url","https://judy88.online/");
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
//订阅主题
|
||||
FirebaseMessaging.getInstance().subscribeToTopic("demo")
|
||||
.addOnCompleteListener(new OnCompleteListener<Void>() {
|
||||
@Override
|
||||
public void onComplete(@NonNull Task<Void> task) {
|
||||
String msg = "Subscribed";
|
||||
if (!task.isSuccessful()) {
|
||||
msg = "Subscribe failed";
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public int getVersion(){
|
||||
try {
|
||||
PackageManager packageManager = getPackageManager();
|
||||
PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0);
|
||||
String StringversionName = packageInfo.versionName; // 版本号
|
||||
int versionCode = packageInfo.versionCode; // 版本码
|
||||
// 在这里可以使用versionName和versionCode进行相关的操作
|
||||
// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode);
|
||||
return versionCode;
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
package com.web.judy88;
|
||||
|
||||
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.web.base.GsonUtils;
|
||||
import com.web.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);
|
||||
// if (remoteMessage.getNotification() != null) {
|
||||
// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
// }
|
||||
} else {
|
||||
//收到通知 创建notify
|
||||
if (remoteMessage.getNotification() != null) {
|
||||
showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void showNotification(MessageInfo messageInfo) {
|
||||
Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.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);
|
||||
|
||||
// Intent notifyIntent = new Intent(this, MainActivity2.class);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
// // notifyIntent.putExtra("message", messageInfo);
|
||||
// notifyIntent.setAction(Intent.ACTION_VIEW);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须
|
||||
// PendingIntent pendingIntent;
|
||||
// pendingIntent = PendingIntent.getActivity
|
||||
// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | 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(com.web.base.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(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(messageInfo.getTitle())
|
||||
.setContentText(messageInfo.getContent())
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.R.mipmap.ic_launcher)
|
||||
.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, MainActivity2.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(com.web.base.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(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
}
|
||||
notificationManager.notify(0, notificationBuilder.build());
|
||||
//存储数据
|
||||
// saveNotifyMessage(body);
|
||||
}
|
||||
|
||||
|
||||
// public void saveNotifyMessage(String body) {
|
||||
// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class);
|
||||
// String savenotify = Utils.get(getApplication(),ApiService.savenotify,"");
|
||||
// if(messageInfo!=null){
|
||||
// if(TextUtils.isEmpty(savenotify)){
|
||||
// GsonUtils.getListFromJSON(savenotify,)
|
||||
// }
|
||||
// }
|
||||
// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @param key 要设置的key
|
||||
// */
|
||||
// public static void set(Context activity, String key, String is) {
|
||||
// SharedPreferences nameSetting = getConfigShared(activity);
|
||||
// SharedPreferences.Editor namePref = nameSetting.edit();
|
||||
// namePref.putString(key, is);
|
||||
// namePref.commit();
|
||||
// }
|
||||
}
|
||||
37
Judy88/src/main/java/com/web/judy88/WebApplication.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.web.judy88;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
|
||||
import com.tencent.smtt.export.external.TbsCoreSettings;
|
||||
import com.tencent.smtt.sdk.QbSdk;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class WebApplication extends Application {
|
||||
|
||||
|
||||
public static Context application;
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
// 设置开启优化方案
|
||||
application = this;
|
||||
HashMap map = new HashMap();
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true);
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true);
|
||||
QbSdk.initTbsSettings(map);
|
||||
QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() {
|
||||
@Override
|
||||
public void onCoreInitFinished() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewInitFinished(boolean b) {
|
||||
|
||||
}
|
||||
});
|
||||
QbSdk.setDownloadWithoutWifi(true);
|
||||
}
|
||||
}
|
||||
11
Judy88/src/main/res/drawable-anydpi/ic_action_back.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="#333333"
|
||||
android:alpha="0.8">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
|
||||
</vector>
|
||||
BIN
Judy88/src/main/res/drawable-hdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 182 B |
BIN
Judy88/src/main/res/drawable-mdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 150 B |
30
Judy88/src/main/res/drawable-v24/ic_launcher_foreground.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
||||
BIN
Judy88/src/main/res/drawable-xhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 212 B |
BIN
Judy88/src/main/res/drawable-xxhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 324 B |
170
Judy88/src/main/res/drawable/ic_launcher_background.xml
Normal file
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
||||
20
Judy88/src/main/res/drawable/input_bg.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/white">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape>
|
||||
<solid android:color="@android:color/transparent" />
|
||||
<corners android:radius="23dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 默认显⽰效果-->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/dialog_input_bg"/>
|
||||
<corners
|
||||
android:radius="3dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
|
||||
28
Judy88/src/main/res/drawable/pass_word_bg.xml
Normal 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>
|
||||
|
||||
23
Judy88/src/main/res/drawable/pass_word_bg1.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#FF0000"
|
||||
android:centerColor="#FF5555"
|
||||
android:endColor="#FBD3D0"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
23
Judy88/src/main/res/drawable/pass_word_bg2.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#000000"
|
||||
android:centerColor="#888888"
|
||||
android:endColor="#FFFFFF"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
5
Judy88/src/main/res/drawable/shape_btn_bg.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="22dp" />
|
||||
<solid android:color="@color/jisuanqi" />
|
||||
</shape>
|
||||
6
Judy88/src/main/res/drawable/shape_dialog_bg2.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:topRightRadius="12dp"
|
||||
android:topLeftRadius="12dp"/>
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
Judy88/src/main/res/drawable/shape_dialog_bg3.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="12dp" />
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
Judy88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
BIN
Judy88/src/main/res/mipmap-hdpi/ic_empty.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
Judy88/src/main/res/mipmap-hdpi/ic_pull_down.png
Normal file
|
After Width: | Height: | Size: 271 B |
BIN
Judy88/src/main/res/mipmap-xhdpi/ic_close.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
Judy88/src/main/res/mipmap-xhdpi/ic_facebook.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
Judy88/src/main/res/mipmap-xhdpi/ic_hometo.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
Judy88/src/main/res/mipmap-xhdpi/ic_link.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
Judy88/src/main/res/mipmap-xhdpi/ic_menu.png
Normal file
|
After Width: | Height: | Size: 779 B |
BIN
Judy88/src/main/res/mipmap-xhdpi/ic_shousuo.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
Judy88/src/main/res/mipmap-xhdpi/ic_tel.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
Judy88/src/main/res/mipmap-xhdpi/ic_whatsapp.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
Judy88/src/main/res/mipmap-xhdpi/ic_zhangkai.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
Judy88/src/main/res/mipmap-xxhdpi/app_logo.png
Normal file
|
After Width: | Height: | Size: 1.4 MiB |
54
Judy88/src/main/res/values-en/strings.xml
Normal file
@@ -0,0 +1,54 @@
|
||||
<resources>
|
||||
<string name="app_name">JUDY88</string>
|
||||
<string name="qsrlwmm_txt">Please Set Your Password</string>
|
||||
<string name="cancel_txt">Cancel</string>
|
||||
<string name="sure_txt">Sure</string>
|
||||
<string name="banbengengxin_txt">New Version Update</string>
|
||||
<string name="xiacigengxin_txt">Next Update</string>
|
||||
<string name="lijigengxin_txt">Update Immediately</string>
|
||||
<string name="app_updater_error_notification_content">Click to close notification</string>
|
||||
<string name="app_updater_error_notification_content_re_download">Click to re-download</string>
|
||||
<string name="app_updater_error_notification_title">Download failed</string>
|
||||
<string name="app_updater_finish_notification_content">Click to install</string>
|
||||
<string name="app_updater_finish_notification_title">Download completed</string>
|
||||
<string name="app_updater_progress_notification_content">Downloading...</string>
|
||||
<string name="app_updater_progress_notification_title">Version update</string>
|
||||
<string name="app_updater_progress_notification_title_2">Downloading game</string>
|
||||
<string name="app_updater_start_notification_content">Getting download data...</string>
|
||||
<string name="app_updater_start_notification_title">Version update</string>
|
||||
<string name="app_updater_start_notification_title_2">Downloading game</string>
|
||||
<string name="notification_title_txt">Need to turn on mobile phone notification permission</string>
|
||||
<string name="notification_cancel_txt">Exit</string>
|
||||
<string name="notification_setting_txt">Setting</string>
|
||||
<string name="app_tishi">Tip</string>
|
||||
<string name="app_hint">Please enter the invitation code</string>
|
||||
<string name="app_sharetitle">My invitation code:</string>
|
||||
<string name="app_sharetitle2">Superior invitation code:</string>
|
||||
<string name="app_totalinvite">Total number of invites:</string>
|
||||
<string name="app_sharecontent">App download link:</string>
|
||||
<string name="app_share">Share</string>
|
||||
<string name="app_checklist">Check Invitation Records</string>
|
||||
<string name="app_invitetitle">Invitation Records</string>
|
||||
<string name="app_checklist_number">Total number of invitees: %d</string>
|
||||
<string name="app_nodata">No Data</string>
|
||||
<string name="app_withdrawtitle">Withdrawal Record</string>
|
||||
<string name="app_withdrawapply_title">Withdrawal Application</string>
|
||||
<string name="app_bankinfo_title">Edit Bank Card Information</string>
|
||||
<string name="app_bankinfo_countrycode">60</string>
|
||||
<string name="app_bankinfo_name">Name:</string>
|
||||
<string name="app_bankinfo_name_hint">Please enter the bank card name</string>
|
||||
<string name="app_bankinfo_code">Bank card account:</string>
|
||||
<string name="app_bankinfo_code_hint">Please enter the bank card account</string>
|
||||
<string name="app_bankinfo_bankcountry">Country:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">Please select a country</string>
|
||||
<string name="app_bankinfo_bankname">Bank Name:</string>
|
||||
<string name="app_bankinfo_bankname_hint">Please select a bank name</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">Note: Please enter the country code before selecting the bank name!</string>
|
||||
<string name="app_balance">Balance: %s</string>
|
||||
<string name="app_totalearning">Total Earnings: %s</string>
|
||||
<string name="app_withdraw_amount">Amount: %s</string>
|
||||
<string name="app_withdraw_apply_hint">Please enter the withdrawal amount</string>
|
||||
<string name="app_toastapply">Withdrawal application has been submitted</string>
|
||||
<string name="app_notinstall">App not installed</string>
|
||||
|
||||
</resources>
|
||||
69
Judy88/src/main/res/values-night/themes.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.Calculcator" parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_200</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/black</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_200</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</item>
|
||||
</style>
|
||||
</resources>
|
||||
19
Judy88/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="purple_200">#FFFFFF</color>
|
||||
<color name="purple_500">#FFFFFF</color>
|
||||
<color name="purple_700">#FFFFFF</color>
|
||||
<color name="teal_200">#FF03DAC5</color>
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="jisuanqi">#EF4723</color>
|
||||
<color name="notify_color">#FFFFFFFF</color>
|
||||
|
||||
<color name="dialog_bg">#2C2C2E</color>
|
||||
<color name="dialog_textcolor">#FFA722</color>
|
||||
<color name="dialog_input_bg">#434343</color>
|
||||
<color name="dialog_dark">#BCBCBC</color>
|
||||
<color name="color_red">#DC1927</color>
|
||||
|
||||
</resources>
|
||||
77
Judy88/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,77 @@
|
||||
<resources>
|
||||
<string name="app_name">JUDY88</string>
|
||||
<string name="qsrlwmm_txt">请输入6位密码</string>
|
||||
<string name="cancel_txt">取消</string>
|
||||
<string name="sure_txt">确定</string>
|
||||
<string name="banbengengxin_txt">版本更新</string>
|
||||
<string name="xiacigengxin_txt">下次更新</string>
|
||||
<string name="lijigengxin_txt">立即更新</string>
|
||||
<string name="app_updater_error_notification_content">点击关闭通知</string>
|
||||
<string name="app_updater_error_notification_content_re_download">点击重新下载</string>
|
||||
<string name="app_updater_error_notification_title">下载失败</string>
|
||||
<string name="app_updater_finish_notification_content">点击安装</string>
|
||||
<string name="app_updater_finish_notification_title">下载完成</string>
|
||||
<string name="app_updater_progress_notification_content">正在下载…</string>
|
||||
<string name="app_updater_progress_notification_title">版本更新</string>
|
||||
<string name="app_updater_progress_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_title">版本更新</string>
|
||||
<string name="app_updater_start_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_content">正在获取下载数据…</string>
|
||||
<string name="notification_title_txt">需要打开手机通知权限</string>
|
||||
<string name="notification_cancel_txt">退出</string>
|
||||
<string name="notification_setting_txt">设置</string>
|
||||
<string name="app_tishi">提示</string>
|
||||
<string name="app_hint">请输入邀请码</string>
|
||||
<string name="app_sharetitle">我的邀请码:</string>
|
||||
<string name="app_sharetitle2">上级邀请码:</string>
|
||||
<string name="app_totalinvite">总邀请人数:</string>
|
||||
<string name="app_sharecontent">邀请您下载:</string>
|
||||
<string name="app_share">分享</string>
|
||||
<string name="app_checklist">查看邀请记录</string>
|
||||
<string name="app_invitetitle">邀请记录</string>
|
||||
<string name="app_checklist_number">总邀请人数: %d</string>
|
||||
<string name="app_nodata">暂无数据</string>
|
||||
<string name="app_withdrawtitle">提现记录</string>
|
||||
<string name="app_withdrawapply_title">提现申请</string>
|
||||
<string name="app_bankinfo_title">编辑银行卡信息</string>
|
||||
<string name="app_bankinfo_countrycode">86</string>
|
||||
<string name="app_bankinfo_name">持卡人姓名:</string>
|
||||
<string name="app_bankinfo_name_hint">请输入持卡人姓名</string>
|
||||
<string name="app_bankinfo_bankcountry">国家地区:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">请选择国家地区</string>
|
||||
<string name="app_bankinfo_bankname">开户行名称:</string>
|
||||
<string name="app_bankinfo_bankname_hint">请选择开户行名称</string>
|
||||
<string name="app_bankinfo_code">银行户口:</string>
|
||||
<string name="app_bankinfo_code_hint">请输入银行卡户口</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">(注:请先输入国家区号再选择开户行名称!)</string>
|
||||
<string name="app_balance">余额: %s</string>
|
||||
<string name="app_totalearning">总收益: %s</string>
|
||||
<string name="app_withdraw_amount">金额: %s</string>
|
||||
<string name="app_withdraw_apply_hint">请输入提现金额</string>
|
||||
<string name="app_toastapply">提现申请已提交</string>
|
||||
<string name="app_notinstall">应用未安装</string>
|
||||
|
||||
|
||||
<!-- <string name="app_name">SPEEDAU</string>-->
|
||||
<!-- <string name="qsrlwmm_txt">Please Set Your Password</string>-->
|
||||
<!-- <string name="cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="sure_txt">Sure</string>-->
|
||||
<!-- <string name="banbengengxin_txt">New Version Update</string>-->
|
||||
<!-- <string name="xiacigengxin_txt">Next Update</string>-->
|
||||
<!-- <string name="lijigengxin_txt">Update Immediately</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content">Click to close notification</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content_re_download">Click to re-download</string>-->
|
||||
<!-- <string name="app_updater_error_notification_title">Download failed</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_content">Click to install</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_title">Download completed</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_content">Downloading...</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="app_updater_start_notification_content">Getting download data...</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="notification_title_txt">Need to turn on mobile phone notification permission</string>-->
|
||||
<!-- <string name="notification_cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="notification_setting_txt">Setting</string>-->
|
||||
|
||||
</resources>
|
||||
20
Judy88/src/main/res/values/style.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="AppThemeStart1" parent="@style/Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="android:windowTranslucentStatus">true</item>
|
||||
<item name="android:windowTranslucentNavigation">false</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="colorPrimary">@android:color/transparent</item>
|
||||
<item name="colorPrimaryDark">@android:color/transparent</item>
|
||||
<item name="colorAccent">@android:color/transparent</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<!-- 隐藏Activity窗口的Title标题栏 -->
|
||||
<item name="windowNoTitle">true</item>
|
||||
<!-- <item name="android:windowFullscreen">true</item>-->
|
||||
<item name="android:windowBackground">@color/white</item>
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</item>
|
||||
</style>
|
||||
</resources>
|
||||
89
Judy88/src/main/res/values/themes.xml
Normal file
@@ -0,0 +1,89 @@
|
||||
<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. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
<item name="android:enforceNavigationBarContrast" tools:ignore="NewApi">false</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</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>
|
||||
10
Judy88/src/main/res/xml/app_updater_paths.xml
Normal 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>
|
||||
4
Judy88/src/main/res/xml/network_security_config.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<network-security-config>
|
||||
<base-config cleartextTrafficPermitted="true" />
|
||||
</network-security-config>
|
||||
13
Judy88/src/main/res/xml/provider_paths.xml
Normal 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"异常的问题 -->
|
||||
@@ -0,0 +1,35 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void TestPattern(){
|
||||
//
|
||||
Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$");
|
||||
String a="+45.5";
|
||||
boolean matches = compile.matcher(a).matches();
|
||||
System.out.println(matches);
|
||||
String result = compile.matcher(a).replaceAll("");
|
||||
System.out.println(result);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
1
Kejapjudi/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
92
Kejapjudi/build.gradle
Normal file
@@ -0,0 +1,92 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'com.google.gms.google-services'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 31
|
||||
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.web.kejapjudi"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 31
|
||||
versionCode 106
|
||||
versionName "v1.0.6"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
signingConfigs {
|
||||
debug {
|
||||
storeFile file('kj.jks')
|
||||
storePassword "android2014"
|
||||
keyAlias 'key0'
|
||||
keyPassword "android2014"
|
||||
}
|
||||
release {
|
||||
storeFile file('kj.jks')
|
||||
storePassword "android2014"
|
||||
keyAlias 'key0'
|
||||
keyPassword "android2014"
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'com.google.android.material:material:1.1.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
testImplementation 'junit:junit:4.+'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar')
|
||||
|
||||
// okhttp相关库
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
|
||||
|
||||
// JSON解析库
|
||||
implementation 'com.google.code.gson:gson:2.9.0'
|
||||
implementation 'com.alibaba:fastjson:1.1.71.android'
|
||||
api 'com.squareup.retrofit2:retrofit:2.5.0'
|
||||
api 'com.squareup.retrofit2:converter-scalars:2.3.0'
|
||||
api 'com.squareup.retrofit2:converter-gson:2.4.0'
|
||||
api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
|
||||
api 'io.reactivex.rxjava2:rxjava:2.1.16'
|
||||
api 'io.reactivex.rxjava2:rxandroid:2.0.2'
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选)
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选)
|
||||
implementation 'com.github.Justson:Downloader:v5.0.4-androidx'
|
||||
//implementation 'com.tencent.tbs:tbssdk:44286'
|
||||
// sdk 33
|
||||
// implementation platform('com.google.firebase:firebase-bom:32.7.0')
|
||||
// Firebase Cloud Messaging
|
||||
// implementation("com.google.firebase:firebase-messaging")
|
||||
// implementation("com.google.firebase:firebase-analytics")
|
||||
|
||||
implementation platform('com.google.firebase:firebase-bom:32.1.0')
|
||||
|
||||
// Add the dependencies for the Firebase Cloud Messaging and Analytics libraries
|
||||
// When using the BoM, you don't specify versions in Firebase library dependencies
|
||||
implementation 'com.google.firebase:firebase-messaging'
|
||||
implementation 'com.google.firebase:firebase-analytics'
|
||||
// implementation("com.google.firebase:firebase-messaging:23.2.1")
|
||||
// implementation("com.google.firebase:firebase-analytics:21.2.1")
|
||||
// implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式
|
||||
implementation("com.github.bumptech.glide:glide:4.13.1")
|
||||
implementation project(path: ':base')
|
||||
|
||||
}
|
||||
29
Kejapjudi/google-services.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "39605079051",
|
||||
"project_id": "kejapjudi-704e8",
|
||||
"storage_bucket": "kejapjudi-704e8.firebasestorage.app"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:39605079051:android:906fa6147de70d25e84b0e",
|
||||
"android_client_info": {
|
||||
"package_name": "com.web.kejapjudi"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyBZnMbbkQlBjxrF7U3KEl5NR-ObexmAvNg"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
BIN
Kejapjudi/kj.jks
Normal file
BIN
Kejapjudi/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar
Normal file
32
Kejapjudi/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
||||
-dontwarn dalvik.**
|
||||
-dontwarn com.tencent.smtt.**
|
||||
|
||||
-keep class com.tencent.smtt.** {
|
||||
*;
|
||||
}
|
||||
|
||||
-keep class com.tencent.tbs.** {
|
||||
*;
|
||||
}
|
||||
BIN
Kejapjudi/release/Kejapjudi.apk
Normal file
18
Kejapjudi/release/output-metadata.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"version": 2,
|
||||
"artifactType": {
|
||||
"type": "APK",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "com.web.kejapjudi",
|
||||
"variantName": "processReleaseResources",
|
||||
"elements": [
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"versionCode": 106,
|
||||
"versionName": "v1.0.6",
|
||||
"outputFile": "Kejapjudi-release.apk"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("Tptogiar.calculcator", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
113
Kejapjudi/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,113 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.web.kejapjudi">
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera"
|
||||
android:required="false" />
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera2"
|
||||
android:required="false" />
|
||||
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS" /> <!-- 获取通讯录-->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<!-- 多媒体相关 -->
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
|
||||
<!-- 8.0+系统需要-->
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
|
||||
<!--推送权限-->
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_SECURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.RECORD_AUDIO" />-->
|
||||
|
||||
|
||||
<!-- <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_AUDIO_OUTPUT" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.autofocus" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.front" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.level.full" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.capability.raw" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.any" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.microphone" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera2" android:required="true" />-->
|
||||
|
||||
<queries>
|
||||
<intent>
|
||||
<action android:name="android.media.action.IMAGE_CAPTURE" />
|
||||
</intent>
|
||||
</queries>
|
||||
<application
|
||||
android:name=".WebApplication"
|
||||
android:allowBackup="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:icon="@mipmap/app_logo"
|
||||
android:label="@string/app_name"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:roundIcon="@mipmap/app_logo"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.AppTheme"
|
||||
android:usesCleartextTraffic="true">
|
||||
|
||||
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity2"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:exported="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:theme="@style/AppThemeStart">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<service
|
||||
android:name="com.tencent.smtt.export.external.DexClassLoaderProviderService"
|
||||
android:label="dexopt"
|
||||
android:process=":dexopt" />
|
||||
|
||||
|
||||
<!-- android:directBootAware="true" 为应用启用消息处理直接启动模式-->
|
||||
<service
|
||||
android:name=".MyFirebaseMessageingService"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<!-- Set custom default icon. This is used when no icon is set for incoming notification messages.
|
||||
See README(https://goo.gl/l4GJaQ) for more. 设置推送默认图标 和颜色-->
|
||||
<meta-data
|
||||
android:name="com.google.firebase.messaging.default_notification_icon"
|
||||
android:resource="@mipmap/app_logo" />
|
||||
<!-- Set color used with incoming notification messages. This is used when no color is set for the incoming
|
||||
notification message. See README(https://goo.gl/6BKBk7) for more. -->
|
||||
<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" />
|
||||
<!-- 还可设置推送渠道 -->
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.google.firebase.messaging.default_notification_channel_id"-->
|
||||
<!-- android:value="@string/default_notification_channel_id" />-->
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
54
Kejapjudi/src/main/java/com/web/kejapjudi/MainActivity2.java
Normal file
@@ -0,0 +1,54 @@
|
||||
package com.web.kejapjudi;
|
||||
|
||||
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.android.gms.tasks.OnCompleteListener;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.firebase.messaging.FirebaseMessaging;
|
||||
import com.web.base.MainActivity;
|
||||
|
||||
public class MainActivity2 extends com.web.base.MainActivity2 {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
userId = 93;
|
||||
saveInt(MainActivity2.this,"user_code",userId);
|
||||
saveInt(MainActivity2.this,"version_code",getVersion());
|
||||
MainActivity.saveString(this, "base_url", "https://kejapjudi.online/");
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
//订阅主题
|
||||
FirebaseMessaging.getInstance().subscribeToTopic("demo")
|
||||
.addOnCompleteListener(new OnCompleteListener<Void>() {
|
||||
@Override
|
||||
public void onComplete(@NonNull Task<Void> task) {
|
||||
String msg = "Subscribed";
|
||||
if (!task.isSuccessful()) {
|
||||
msg = "Subscribe failed";
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public int getVersion(){
|
||||
try {
|
||||
PackageManager packageManager = getPackageManager();
|
||||
PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0);
|
||||
String StringversionName = packageInfo.versionName; // 版本号
|
||||
int versionCode = packageInfo.versionCode; // 版本码
|
||||
// 在这里可以使用versionName和versionCode进行相关的操作
|
||||
// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode);
|
||||
return versionCode;
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
package com.web.kejapjudi;
|
||||
|
||||
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.web.base.GsonUtils;
|
||||
import com.web.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);
|
||||
// if (remoteMessage.getNotification() != null) {
|
||||
// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
// }
|
||||
} else {
|
||||
//收到通知 创建notify
|
||||
if (remoteMessage.getNotification() != null) {
|
||||
showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void showNotification(MessageInfo messageInfo) {
|
||||
Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.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);
|
||||
|
||||
// Intent notifyIntent = new Intent(this, MainActivity2.class);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
// // notifyIntent.putExtra("message", messageInfo);
|
||||
// notifyIntent.setAction(Intent.ACTION_VIEW);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须
|
||||
// PendingIntent pendingIntent;
|
||||
// pendingIntent = PendingIntent.getActivity
|
||||
// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | 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(com.web.base.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(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(messageInfo.getTitle())
|
||||
.setContentText(messageInfo.getContent())
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.R.mipmap.ic_launcher)
|
||||
.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, MainActivity2.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(com.web.base.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(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
}
|
||||
notificationManager.notify(0, notificationBuilder.build());
|
||||
//存储数据
|
||||
// saveNotifyMessage(body);
|
||||
}
|
||||
|
||||
|
||||
// public void saveNotifyMessage(String body) {
|
||||
// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class);
|
||||
// String savenotify = Utils.get(getApplication(),ApiService.savenotify,"");
|
||||
// if(messageInfo!=null){
|
||||
// if(TextUtils.isEmpty(savenotify)){
|
||||
// GsonUtils.getListFromJSON(savenotify,)
|
||||
// }
|
||||
// }
|
||||
// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @param key 要设置的key
|
||||
// */
|
||||
// public static void set(Context activity, String key, String is) {
|
||||
// SharedPreferences nameSetting = getConfigShared(activity);
|
||||
// SharedPreferences.Editor namePref = nameSetting.edit();
|
||||
// namePref.putString(key, is);
|
||||
// namePref.commit();
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.web.kejapjudi;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
|
||||
import com.tencent.smtt.export.external.TbsCoreSettings;
|
||||
import com.tencent.smtt.sdk.QbSdk;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class WebApplication extends Application {
|
||||
|
||||
|
||||
public static Context application;
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
// 设置开启优化方案
|
||||
application = this;
|
||||
HashMap map = new HashMap();
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true);
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true);
|
||||
QbSdk.initTbsSettings(map);
|
||||
QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() {
|
||||
@Override
|
||||
public void onCoreInitFinished() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewInitFinished(boolean b) {
|
||||
|
||||
}
|
||||
});
|
||||
QbSdk.setDownloadWithoutWifi(true);
|
||||
}
|
||||
}
|
||||
11
Kejapjudi/src/main/res/drawable-anydpi/ic_action_back.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="#333333"
|
||||
android:alpha="0.8">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
|
||||
</vector>
|
||||
BIN
Kejapjudi/src/main/res/drawable-hdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 182 B |
BIN
Kejapjudi/src/main/res/drawable-mdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 150 B |
@@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
||||
BIN
Kejapjudi/src/main/res/drawable-xhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 212 B |
BIN
Kejapjudi/src/main/res/drawable-xxhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 324 B |
170
Kejapjudi/src/main/res/drawable/ic_launcher_background.xml
Normal file
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
||||
20
Kejapjudi/src/main/res/drawable/input_bg.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/white">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape>
|
||||
<solid android:color="@android:color/transparent" />
|
||||
<corners android:radius="23dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 默认显⽰效果-->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/dialog_input_bg"/>
|
||||
<corners
|
||||
android:radius="3dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
|
||||
28
Kejapjudi/src/main/res/drawable/pass_word_bg.xml
Normal 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>
|
||||
|
||||
23
Kejapjudi/src/main/res/drawable/pass_word_bg1.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#FF0000"
|
||||
android:centerColor="#FF5555"
|
||||
android:endColor="#FBD3D0"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
23
Kejapjudi/src/main/res/drawable/pass_word_bg2.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#000000"
|
||||
android:centerColor="#888888"
|
||||
android:endColor="#FFFFFF"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
5
Kejapjudi/src/main/res/drawable/shape_btn_bg.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="22dp" />
|
||||
<solid android:color="@color/jisuanqi" />
|
||||
</shape>
|
||||
6
Kejapjudi/src/main/res/drawable/shape_dialog_bg2.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:topRightRadius="12dp"
|
||||
android:topLeftRadius="12dp"/>
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
Kejapjudi/src/main/res/drawable/shape_dialog_bg3.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="12dp" />
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
Kejapjudi/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
BIN
Kejapjudi/src/main/res/mipmap-hdpi/ic_empty.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
Kejapjudi/src/main/res/mipmap-hdpi/ic_pull_down.png
Normal file
|
After Width: | Height: | Size: 271 B |
BIN
Kejapjudi/src/main/res/mipmap-xhdpi/ic_close.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
Kejapjudi/src/main/res/mipmap-xhdpi/ic_facebook.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
Kejapjudi/src/main/res/mipmap-xhdpi/ic_hometo.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
Kejapjudi/src/main/res/mipmap-xhdpi/ic_link.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
Kejapjudi/src/main/res/mipmap-xhdpi/ic_menu.png
Normal file
|
After Width: | Height: | Size: 779 B |
BIN
Kejapjudi/src/main/res/mipmap-xhdpi/ic_shousuo.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
Kejapjudi/src/main/res/mipmap-xhdpi/ic_tel.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
Kejapjudi/src/main/res/mipmap-xhdpi/ic_whatsapp.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
Kejapjudi/src/main/res/mipmap-xhdpi/ic_zhangkai.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
Kejapjudi/src/main/res/mipmap-xxhdpi/app_logo.jpg
Normal file
|
After Width: | Height: | Size: 14 KiB |
54
Kejapjudi/src/main/res/values-en/strings.xml
Normal file
@@ -0,0 +1,54 @@
|
||||
<resources>
|
||||
<string name="app_name">KJ</string>
|
||||
<string name="qsrlwmm_txt">Please Set Your Password</string>
|
||||
<string name="cancel_txt">Cancel</string>
|
||||
<string name="sure_txt">Sure</string>
|
||||
<string name="banbengengxin_txt">New Version Update</string>
|
||||
<string name="xiacigengxin_txt">Next Update</string>
|
||||
<string name="lijigengxin_txt">Update Immediately</string>
|
||||
<string name="app_updater_error_notification_content">Click to close notification</string>
|
||||
<string name="app_updater_error_notification_content_re_download">Click to re-download</string>
|
||||
<string name="app_updater_error_notification_title">Download failed</string>
|
||||
<string name="app_updater_finish_notification_content">Click to install</string>
|
||||
<string name="app_updater_finish_notification_title">Download completed</string>
|
||||
<string name="app_updater_progress_notification_content">Downloading...</string>
|
||||
<string name="app_updater_progress_notification_title">Version update</string>
|
||||
<string name="app_updater_progress_notification_title_2">Downloading game</string>
|
||||
<string name="app_updater_start_notification_content">Getting download data...</string>
|
||||
<string name="app_updater_start_notification_title">Version update</string>
|
||||
<string name="app_updater_start_notification_title_2">Downloading game</string>
|
||||
<string name="notification_title_txt">Need to turn on mobile phone notification permission</string>
|
||||
<string name="notification_cancel_txt">Exit</string>
|
||||
<string name="notification_setting_txt">Setting</string>
|
||||
<string name="app_tishi">Tip</string>
|
||||
<string name="app_hint">Please enter the invitation code</string>
|
||||
<string name="app_sharetitle">My invitation code:</string>
|
||||
<string name="app_sharetitle2">Superior invitation code:</string>
|
||||
<string name="app_totalinvite">Total number of invites:</string>
|
||||
<string name="app_sharecontent">App download link:</string>
|
||||
<string name="app_share">Share</string>
|
||||
<string name="app_checklist">Check Invitation Records</string>
|
||||
<string name="app_invitetitle">Invitation Records</string>
|
||||
<string name="app_checklist_number">Total number of invitees: %d</string>
|
||||
<string name="app_nodata">No Data</string>
|
||||
<string name="app_withdrawtitle">Withdrawal Record</string>
|
||||
<string name="app_withdrawapply_title">Withdrawal Application</string>
|
||||
<string name="app_bankinfo_title">Edit Bank Card Information</string>
|
||||
<string name="app_bankinfo_countrycode">60</string>
|
||||
<string name="app_bankinfo_name">Name:</string>
|
||||
<string name="app_bankinfo_name_hint">Please enter the bank card name</string>
|
||||
<string name="app_bankinfo_code">Bank card account:</string>
|
||||
<string name="app_bankinfo_code_hint">Please enter the bank card account</string>
|
||||
<string name="app_bankinfo_bankcountry">Country:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">Please select a country</string>
|
||||
<string name="app_bankinfo_bankname">Bank Name:</string>
|
||||
<string name="app_bankinfo_bankname_hint">Please select a bank name</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">Note: Please enter the country code before selecting the bank name!</string>
|
||||
<string name="app_balance">Balance: %s</string>
|
||||
<string name="app_totalearning">Total Earnings: %s</string>
|
||||
<string name="app_withdraw_amount">Amount: %s</string>
|
||||
<string name="app_withdraw_apply_hint">Please enter the withdrawal amount</string>
|
||||
<string name="app_toastapply">Withdrawal application has been submitted</string>
|
||||
<string name="app_notinstall">App not installed</string>
|
||||
|
||||
</resources>
|
||||
69
Kejapjudi/src/main/res/values-night/themes.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.Calculcator" parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_200</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/black</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_200</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</item>
|
||||
</style>
|
||||
</resources>
|
||||
19
Kejapjudi/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="purple_200">#FFFFFF</color>
|
||||
<color name="purple_500">#FFFFFF</color>
|
||||
<color name="purple_700">#FFFFFF</color>
|
||||
<color name="teal_200">#FF03DAC5</color>
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="jisuanqi">#EF4723</color>
|
||||
<color name="notify_color">#FFFFFFFF</color>
|
||||
|
||||
<color name="dialog_bg">#2C2C2E</color>
|
||||
<color name="dialog_textcolor">#FFA722</color>
|
||||
<color name="dialog_input_bg">#434343</color>
|
||||
<color name="dialog_dark">#BCBCBC</color>
|
||||
<color name="color_red">#DC1927</color>
|
||||
|
||||
</resources>
|
||||
77
Kejapjudi/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,77 @@
|
||||
<resources>
|
||||
<string name="app_name">KJ</string>
|
||||
<string name="qsrlwmm_txt">请输入6位密码</string>
|
||||
<string name="cancel_txt">取消</string>
|
||||
<string name="sure_txt">确定</string>
|
||||
<string name="banbengengxin_txt">版本更新</string>
|
||||
<string name="xiacigengxin_txt">下次更新</string>
|
||||
<string name="lijigengxin_txt">立即更新</string>
|
||||
<string name="app_updater_error_notification_content">点击关闭通知</string>
|
||||
<string name="app_updater_error_notification_content_re_download">点击重新下载</string>
|
||||
<string name="app_updater_error_notification_title">下载失败</string>
|
||||
<string name="app_updater_finish_notification_content">点击安装</string>
|
||||
<string name="app_updater_finish_notification_title">下载完成</string>
|
||||
<string name="app_updater_progress_notification_content">正在下载…</string>
|
||||
<string name="app_updater_progress_notification_title">版本更新</string>
|
||||
<string name="app_updater_progress_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_title">版本更新</string>
|
||||
<string name="app_updater_start_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_content">正在获取下载数据…</string>
|
||||
<string name="notification_title_txt">需要打开手机通知权限</string>
|
||||
<string name="notification_cancel_txt">退出</string>
|
||||
<string name="notification_setting_txt">设置</string>
|
||||
<string name="app_tishi">提示</string>
|
||||
<string name="app_hint">请输入邀请码</string>
|
||||
<string name="app_sharetitle">我的邀请码:</string>
|
||||
<string name="app_sharetitle2">上级邀请码:</string>
|
||||
<string name="app_totalinvite">总邀请人数:</string>
|
||||
<string name="app_sharecontent">邀请您下载:</string>
|
||||
<string name="app_share">分享</string>
|
||||
<string name="app_checklist">查看邀请记录</string>
|
||||
<string name="app_invitetitle">邀请记录</string>
|
||||
<string name="app_checklist_number">总邀请人数: %d</string>
|
||||
<string name="app_nodata">暂无数据</string>
|
||||
<string name="app_withdrawtitle">提现记录</string>
|
||||
<string name="app_withdrawapply_title">提现申请</string>
|
||||
<string name="app_bankinfo_title">编辑银行卡信息</string>
|
||||
<string name="app_bankinfo_countrycode">86</string>
|
||||
<string name="app_bankinfo_name">持卡人姓名:</string>
|
||||
<string name="app_bankinfo_name_hint">请输入持卡人姓名</string>
|
||||
<string name="app_bankinfo_bankcountry">国家地区:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">请选择国家地区</string>
|
||||
<string name="app_bankinfo_bankname">开户行名称:</string>
|
||||
<string name="app_bankinfo_bankname_hint">请选择开户行名称</string>
|
||||
<string name="app_bankinfo_code">银行户口:</string>
|
||||
<string name="app_bankinfo_code_hint">请输入银行卡户口</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">(注:请先输入国家区号再选择开户行名称!)</string>
|
||||
<string name="app_balance">余额: %s</string>
|
||||
<string name="app_totalearning">总收益: %s</string>
|
||||
<string name="app_withdraw_amount">金额: %s</string>
|
||||
<string name="app_withdraw_apply_hint">请输入提现金额</string>
|
||||
<string name="app_toastapply">提现申请已提交</string>
|
||||
<string name="app_notinstall">应用未安装</string>
|
||||
|
||||
|
||||
<!-- <string name="app_name">SPEEDAU</string>-->
|
||||
<!-- <string name="qsrlwmm_txt">Please Set Your Password</string>-->
|
||||
<!-- <string name="cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="sure_txt">Sure</string>-->
|
||||
<!-- <string name="banbengengxin_txt">New Version Update</string>-->
|
||||
<!-- <string name="xiacigengxin_txt">Next Update</string>-->
|
||||
<!-- <string name="lijigengxin_txt">Update Immediately</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content">Click to close notification</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content_re_download">Click to re-download</string>-->
|
||||
<!-- <string name="app_updater_error_notification_title">Download failed</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_content">Click to install</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_title">Download completed</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_content">Downloading...</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="app_updater_start_notification_content">Getting download data...</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="notification_title_txt">Need to turn on mobile phone notification permission</string>-->
|
||||
<!-- <string name="notification_cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="notification_setting_txt">Setting</string>-->
|
||||
|
||||
</resources>
|
||||
20
Kejapjudi/src/main/res/values/style.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="AppThemeStart1" parent="@style/Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="android:windowTranslucentStatus">true</item>
|
||||
<item name="android:windowTranslucentNavigation">false</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="colorPrimary">@android:color/transparent</item>
|
||||
<item name="colorPrimaryDark">@android:color/transparent</item>
|
||||
<item name="colorAccent">@android:color/transparent</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<!-- 隐藏Activity窗口的Title标题栏 -->
|
||||
<item name="windowNoTitle">true</item>
|
||||
<!-- <item name="android:windowFullscreen">true</item>-->
|
||||
<item name="android:windowBackground">@color/white</item>
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</item>
|
||||
</style>
|
||||
</resources>
|
||||
89
Kejapjudi/src/main/res/values/themes.xml
Normal file
@@ -0,0 +1,89 @@
|
||||
<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. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
<item name="android:enforceNavigationBarContrast" tools:ignore="NewApi">false</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</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>
|
||||
10
Kejapjudi/src/main/res/xml/app_updater_paths.xml
Normal 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>
|
||||
4
Kejapjudi/src/main/res/xml/network_security_config.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<network-security-config>
|
||||
<base-config cleartextTrafficPermitted="true" />
|
||||
</network-security-config>
|
||||
13
Kejapjudi/src/main/res/xml/provider_paths.xml
Normal 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"异常的问题 -->
|
||||
@@ -0,0 +1,35 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void TestPattern(){
|
||||
//
|
||||
Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$");
|
||||
String a="+45.5";
|
||||
boolean matches = compile.matcher(a).matches();
|
||||
System.out.println(matches);
|
||||
String result = compile.matcher(a).replaceAll("");
|
||||
System.out.println(result);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
1
Magnum888/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
92
Magnum888/build.gradle
Normal file
@@ -0,0 +1,92 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'com.google.gms.google-services'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 31
|
||||
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.web.magnum888"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 31
|
||||
versionCode 106
|
||||
versionName "v1.0.6"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
signingConfigs {
|
||||
debug {
|
||||
storeFile file('magnum888.jks')
|
||||
storePassword "android2014"
|
||||
keyAlias 'key0'
|
||||
keyPassword "android2014"
|
||||
}
|
||||
release {
|
||||
storeFile file('magnum888.jks')
|
||||
storePassword "android2014"
|
||||
keyAlias 'key0'
|
||||
keyPassword "android2014"
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'com.google.android.material:material:1.1.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
testImplementation 'junit:junit:4.+'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar')
|
||||
|
||||
// okhttp相关库
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
|
||||
|
||||
// JSON解析库
|
||||
implementation 'com.google.code.gson:gson:2.9.0'
|
||||
implementation 'com.alibaba:fastjson:1.1.71.android'
|
||||
api 'com.squareup.retrofit2:retrofit:2.5.0'
|
||||
api 'com.squareup.retrofit2:converter-scalars:2.3.0'
|
||||
api 'com.squareup.retrofit2:converter-gson:2.4.0'
|
||||
api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
|
||||
api 'io.reactivex.rxjava2:rxjava:2.1.16'
|
||||
api 'io.reactivex.rxjava2:rxandroid:2.0.2'
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选)
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选)
|
||||
implementation 'com.github.Justson:Downloader:v5.0.4-androidx'
|
||||
//implementation 'com.tencent.tbs:tbssdk:44286'
|
||||
// sdk 33
|
||||
// implementation platform('com.google.firebase:firebase-bom:32.7.0')
|
||||
// Firebase Cloud Messaging
|
||||
// implementation("com.google.firebase:firebase-messaging")
|
||||
// implementation("com.google.firebase:firebase-analytics")
|
||||
|
||||
implementation platform('com.google.firebase:firebase-bom:32.1.0')
|
||||
|
||||
// Add the dependencies for the Firebase Cloud Messaging and Analytics libraries
|
||||
// When using the BoM, you don't specify versions in Firebase library dependencies
|
||||
implementation 'com.google.firebase:firebase-messaging'
|
||||
implementation 'com.google.firebase:firebase-analytics'
|
||||
// implementation("com.google.firebase:firebase-messaging:23.2.1")
|
||||
// implementation("com.google.firebase:firebase-analytics:21.2.1")
|
||||
// implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式
|
||||
implementation("com.github.bumptech.glide:glide:4.13.1")
|
||||
implementation project(path: ':base')
|
||||
|
||||
}
|
||||
29
Magnum888/google-services.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "454931833879",
|
||||
"project_id": "magnum888-136ec",
|
||||
"storage_bucket": "magnum888-136ec.firebasestorage.app"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:454931833879:android:448a55f8cb5b8ce10e6852",
|
||||
"android_client_info": {
|
||||
"package_name": "com.web.magnum888"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyDykjEg62UYo3mDaEHAwO_QbWzgbAtRlRQ"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
BIN
Magnum888/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar
Normal file
BIN
Magnum888/magnum888.jks
Normal file
32
Magnum888/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
||||
-dontwarn dalvik.**
|
||||
-dontwarn com.tencent.smtt.**
|
||||
|
||||
-keep class com.tencent.smtt.** {
|
||||
*;
|
||||
}
|
||||
|
||||
-keep class com.tencent.tbs.** {
|
||||
*;
|
||||
}
|
||||
BIN
Magnum888/release/Magnum888.apk
Normal file
18
Magnum888/release/output-metadata.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"version": 2,
|
||||
"artifactType": {
|
||||
"type": "APK",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "com.web.magnum888",
|
||||
"variantName": "processReleaseResources",
|
||||
"elements": [
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"versionCode": 106,
|
||||
"versionName": "v1.0.6",
|
||||
"outputFile": "Magnum888-release.apk"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("Tptogiar.calculcator", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
113
Magnum888/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,113 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.web.magnum888">
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera"
|
||||
android:required="false" />
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera2"
|
||||
android:required="false" />
|
||||
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS" /> <!-- 获取通讯录-->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<!-- 多媒体相关 -->
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
|
||||
<!-- 8.0+系统需要-->
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
|
||||
<!--推送权限-->
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_SECURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.RECORD_AUDIO" />-->
|
||||
|
||||
|
||||
<!-- <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_AUDIO_OUTPUT" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.autofocus" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.front" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.level.full" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.capability.raw" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.any" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.microphone" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera2" android:required="true" />-->
|
||||
|
||||
<queries>
|
||||
<intent>
|
||||
<action android:name="android.media.action.IMAGE_CAPTURE" />
|
||||
</intent>
|
||||
</queries>
|
||||
<application
|
||||
android:name=".WebApplication"
|
||||
android:allowBackup="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:icon="@mipmap/app_logo"
|
||||
android:label="@string/app_name"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:roundIcon="@mipmap/app_logo"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.AppTheme"
|
||||
android:usesCleartextTraffic="true">
|
||||
|
||||
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity2"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:exported="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:theme="@style/AppThemeStart">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<service
|
||||
android:name="com.tencent.smtt.export.external.DexClassLoaderProviderService"
|
||||
android:label="dexopt"
|
||||
android:process=":dexopt" />
|
||||
|
||||
|
||||
<!-- android:directBootAware="true" 为应用启用消息处理直接启动模式-->
|
||||
<service
|
||||
android:name=".MyFirebaseMessageingService"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<!-- Set custom default icon. This is used when no icon is set for incoming notification messages.
|
||||
See README(https://goo.gl/l4GJaQ) for more. 设置推送默认图标 和颜色-->
|
||||
<meta-data
|
||||
android:name="com.google.firebase.messaging.default_notification_icon"
|
||||
android:resource="@mipmap/app_logo" />
|
||||
<!-- Set color used with incoming notification messages. This is used when no color is set for the incoming
|
||||
notification message. See README(https://goo.gl/6BKBk7) for more. -->
|
||||
<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" />
|
||||
<!-- 还可设置推送渠道 -->
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.google.firebase.messaging.default_notification_channel_id"-->
|
||||
<!-- android:value="@string/default_notification_channel_id" />-->
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
54
Magnum888/src/main/java/com/web/magnum888/MainActivity2.java
Normal file
@@ -0,0 +1,54 @@
|
||||
package com.web.magnum888;
|
||||
|
||||
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.android.gms.tasks.OnCompleteListener;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.firebase.messaging.FirebaseMessaging;
|
||||
import com.web.base.MainActivity;
|
||||
|
||||
public class MainActivity2 extends com.web.base.MainActivity2 {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
userId = 94;
|
||||
saveInt(MainActivity2.this,"user_code",userId);
|
||||
saveInt(MainActivity2.this,"version_code",getVersion());
|
||||
MainActivity.saveString(this, "base_url","https://www.magnum888.cash/");
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
//订阅主题
|
||||
FirebaseMessaging.getInstance().subscribeToTopic("demo")
|
||||
.addOnCompleteListener(new OnCompleteListener<Void>() {
|
||||
@Override
|
||||
public void onComplete(@NonNull Task<Void> task) {
|
||||
String msg = "Subscribed";
|
||||
if (!task.isSuccessful()) {
|
||||
msg = "Subscribe failed";
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public int getVersion(){
|
||||
try {
|
||||
PackageManager packageManager = getPackageManager();
|
||||
PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0);
|
||||
String StringversionName = packageInfo.versionName; // 版本号
|
||||
int versionCode = packageInfo.versionCode; // 版本码
|
||||
// 在这里可以使用versionName和versionCode进行相关的操作
|
||||
// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode);
|
||||
return versionCode;
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
package com.web.magnum888;
|
||||
|
||||
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.web.base.GsonUtils;
|
||||
import com.web.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);
|
||||
// if (remoteMessage.getNotification() != null) {
|
||||
// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
// }
|
||||
} else {
|
||||
//收到通知 创建notify
|
||||
if (remoteMessage.getNotification() != null) {
|
||||
showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void showNotification(MessageInfo messageInfo) {
|
||||
Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.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);
|
||||
|
||||
// Intent notifyIntent = new Intent(this, MainActivity2.class);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
// // notifyIntent.putExtra("message", messageInfo);
|
||||
// notifyIntent.setAction(Intent.ACTION_VIEW);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须
|
||||
// PendingIntent pendingIntent;
|
||||
// pendingIntent = PendingIntent.getActivity
|
||||
// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | 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(com.web.base.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(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(messageInfo.getTitle())
|
||||
.setContentText(messageInfo.getContent())
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.R.mipmap.ic_launcher)
|
||||
.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, MainActivity2.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(com.web.base.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(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
}
|
||||
notificationManager.notify(0, notificationBuilder.build());
|
||||
//存储数据
|
||||
// saveNotifyMessage(body);
|
||||
}
|
||||
|
||||
|
||||
// public void saveNotifyMessage(String body) {
|
||||
// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class);
|
||||
// String savenotify = Utils.get(getApplication(),ApiService.savenotify,"");
|
||||
// if(messageInfo!=null){
|
||||
// if(TextUtils.isEmpty(savenotify)){
|
||||
// GsonUtils.getListFromJSON(savenotify,)
|
||||
// }
|
||||
// }
|
||||
// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @param key 要设置的key
|
||||
// */
|
||||
// public static void set(Context activity, String key, String is) {
|
||||
// SharedPreferences nameSetting = getConfigShared(activity);
|
||||
// SharedPreferences.Editor namePref = nameSetting.edit();
|
||||
// namePref.putString(key, is);
|
||||
// namePref.commit();
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.web.magnum888;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
|
||||
import com.tencent.smtt.export.external.TbsCoreSettings;
|
||||
import com.tencent.smtt.sdk.QbSdk;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class WebApplication extends Application {
|
||||
|
||||
|
||||
public static Context application;
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
// 设置开启优化方案
|
||||
application = this;
|
||||
HashMap map = new HashMap();
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true);
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true);
|
||||
QbSdk.initTbsSettings(map);
|
||||
QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() {
|
||||
@Override
|
||||
public void onCoreInitFinished() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewInitFinished(boolean b) {
|
||||
|
||||
}
|
||||
});
|
||||
QbSdk.setDownloadWithoutWifi(true);
|
||||
}
|
||||
}
|
||||
11
Magnum888/src/main/res/drawable-anydpi/ic_action_back.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="#333333"
|
||||
android:alpha="0.8">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
|
||||
</vector>
|
||||
BIN
Magnum888/src/main/res/drawable-hdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 182 B |
BIN
Magnum888/src/main/res/drawable-mdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 150 B |
@@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
||||
BIN
Magnum888/src/main/res/drawable-xhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 212 B |
BIN
Magnum888/src/main/res/drawable-xxhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 324 B |
170
Magnum888/src/main/res/drawable/ic_launcher_background.xml
Normal file
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
||||
20
Magnum888/src/main/res/drawable/input_bg.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/white">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape>
|
||||
<solid android:color="@android:color/transparent" />
|
||||
<corners android:radius="23dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 默认显⽰效果-->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/dialog_input_bg"/>
|
||||
<corners
|
||||
android:radius="3dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
|
||||
28
Magnum888/src/main/res/drawable/pass_word_bg.xml
Normal 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>
|
||||
|
||||
23
Magnum888/src/main/res/drawable/pass_word_bg1.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#FF0000"
|
||||
android:centerColor="#FF5555"
|
||||
android:endColor="#FBD3D0"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
23
Magnum888/src/main/res/drawable/pass_word_bg2.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#000000"
|
||||
android:centerColor="#888888"
|
||||
android:endColor="#FFFFFF"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
5
Magnum888/src/main/res/drawable/shape_btn_bg.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="22dp" />
|
||||
<solid android:color="@color/jisuanqi" />
|
||||
</shape>
|
||||
6
Magnum888/src/main/res/drawable/shape_dialog_bg2.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:topRightRadius="12dp"
|
||||
android:topLeftRadius="12dp"/>
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
Magnum888/src/main/res/drawable/shape_dialog_bg3.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="12dp" />
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
Magnum888/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
BIN
Magnum888/src/main/res/mipmap-hdpi/ic_empty.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
Magnum888/src/main/res/mipmap-hdpi/ic_pull_down.png
Normal file
|
After Width: | Height: | Size: 271 B |
BIN
Magnum888/src/main/res/mipmap-xhdpi/ic_close.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
Magnum888/src/main/res/mipmap-xhdpi/ic_facebook.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
Magnum888/src/main/res/mipmap-xhdpi/ic_hometo.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
Magnum888/src/main/res/mipmap-xhdpi/ic_link.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
Magnum888/src/main/res/mipmap-xhdpi/ic_menu.png
Normal file
|
After Width: | Height: | Size: 779 B |
BIN
Magnum888/src/main/res/mipmap-xhdpi/ic_shousuo.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
Magnum888/src/main/res/mipmap-xhdpi/ic_tel.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
Magnum888/src/main/res/mipmap-xhdpi/ic_whatsapp.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
Magnum888/src/main/res/mipmap-xhdpi/ic_zhangkai.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
Magnum888/src/main/res/mipmap-xxhdpi/app_logo.png
Normal file
|
After Width: | Height: | Size: 792 KiB |
54
Magnum888/src/main/res/values-en/strings.xml
Normal file
@@ -0,0 +1,54 @@
|
||||
<resources>
|
||||
<string name="app_name">Magnum888</string>
|
||||
<string name="qsrlwmm_txt">Please Set Your Password</string>
|
||||
<string name="cancel_txt">Cancel</string>
|
||||
<string name="sure_txt">Sure</string>
|
||||
<string name="banbengengxin_txt">New Version Update</string>
|
||||
<string name="xiacigengxin_txt">Next Update</string>
|
||||
<string name="lijigengxin_txt">Update Immediately</string>
|
||||
<string name="app_updater_error_notification_content">Click to close notification</string>
|
||||
<string name="app_updater_error_notification_content_re_download">Click to re-download</string>
|
||||
<string name="app_updater_error_notification_title">Download failed</string>
|
||||
<string name="app_updater_finish_notification_content">Click to install</string>
|
||||
<string name="app_updater_finish_notification_title">Download completed</string>
|
||||
<string name="app_updater_progress_notification_content">Downloading...</string>
|
||||
<string name="app_updater_progress_notification_title">Version update</string>
|
||||
<string name="app_updater_progress_notification_title_2">Downloading game</string>
|
||||
<string name="app_updater_start_notification_content">Getting download data...</string>
|
||||
<string name="app_updater_start_notification_title">Version update</string>
|
||||
<string name="app_updater_start_notification_title_2">Downloading game</string>
|
||||
<string name="notification_title_txt">Need to turn on mobile phone notification permission</string>
|
||||
<string name="notification_cancel_txt">Exit</string>
|
||||
<string name="notification_setting_txt">Setting</string>
|
||||
<string name="app_tishi">Tip</string>
|
||||
<string name="app_hint">Please enter the invitation code</string>
|
||||
<string name="app_sharetitle">My invitation code:</string>
|
||||
<string name="app_sharetitle2">Superior invitation code:</string>
|
||||
<string name="app_totalinvite">Total number of invites:</string>
|
||||
<string name="app_sharecontent">App download link:</string>
|
||||
<string name="app_share">Share</string>
|
||||
<string name="app_checklist">Check Invitation Records</string>
|
||||
<string name="app_invitetitle">Invitation Records</string>
|
||||
<string name="app_checklist_number">Total number of invitees: %d</string>
|
||||
<string name="app_nodata">No Data</string>
|
||||
<string name="app_withdrawtitle">Withdrawal Record</string>
|
||||
<string name="app_withdrawapply_title">Withdrawal Application</string>
|
||||
<string name="app_bankinfo_title">Edit Bank Card Information</string>
|
||||
<string name="app_bankinfo_countrycode">60</string>
|
||||
<string name="app_bankinfo_name">Name:</string>
|
||||
<string name="app_bankinfo_name_hint">Please enter the bank card name</string>
|
||||
<string name="app_bankinfo_code">Bank card account:</string>
|
||||
<string name="app_bankinfo_code_hint">Please enter the bank card account</string>
|
||||
<string name="app_bankinfo_bankcountry">Country:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">Please select a country</string>
|
||||
<string name="app_bankinfo_bankname">Bank Name:</string>
|
||||
<string name="app_bankinfo_bankname_hint">Please select a bank name</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">Note: Please enter the country code before selecting the bank name!</string>
|
||||
<string name="app_balance">Balance: %s</string>
|
||||
<string name="app_totalearning">Total Earnings: %s</string>
|
||||
<string name="app_withdraw_amount">Amount: %s</string>
|
||||
<string name="app_withdraw_apply_hint">Please enter the withdrawal amount</string>
|
||||
<string name="app_toastapply">Withdrawal application has been submitted</string>
|
||||
<string name="app_notinstall">App not installed</string>
|
||||
|
||||
</resources>
|
||||
69
Magnum888/src/main/res/values-night/themes.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.Calculcator" parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_200</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/black</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_200</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</item>
|
||||
</style>
|
||||
</resources>
|
||||
19
Magnum888/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="purple_200">#FFFFFF</color>
|
||||
<color name="purple_500">#FFFFFF</color>
|
||||
<color name="purple_700">#FFFFFF</color>
|
||||
<color name="teal_200">#FF03DAC5</color>
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="jisuanqi">#EF4723</color>
|
||||
<color name="notify_color">#FFFFFFFF</color>
|
||||
|
||||
<color name="dialog_bg">#2C2C2E</color>
|
||||
<color name="dialog_textcolor">#FFA722</color>
|
||||
<color name="dialog_input_bg">#434343</color>
|
||||
<color name="dialog_dark">#BCBCBC</color>
|
||||
<color name="color_red">#DC1927</color>
|
||||
|
||||
</resources>
|
||||
77
Magnum888/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,77 @@
|
||||
<resources>
|
||||
<string name="app_name">Magnum888</string>
|
||||
<string name="qsrlwmm_txt">请输入6位密码</string>
|
||||
<string name="cancel_txt">取消</string>
|
||||
<string name="sure_txt">确定</string>
|
||||
<string name="banbengengxin_txt">版本更新</string>
|
||||
<string name="xiacigengxin_txt">下次更新</string>
|
||||
<string name="lijigengxin_txt">立即更新</string>
|
||||
<string name="app_updater_error_notification_content">点击关闭通知</string>
|
||||
<string name="app_updater_error_notification_content_re_download">点击重新下载</string>
|
||||
<string name="app_updater_error_notification_title">下载失败</string>
|
||||
<string name="app_updater_finish_notification_content">点击安装</string>
|
||||
<string name="app_updater_finish_notification_title">下载完成</string>
|
||||
<string name="app_updater_progress_notification_content">正在下载…</string>
|
||||
<string name="app_updater_progress_notification_title">版本更新</string>
|
||||
<string name="app_updater_progress_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_title">版本更新</string>
|
||||
<string name="app_updater_start_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_content">正在获取下载数据…</string>
|
||||
<string name="notification_title_txt">需要打开手机通知权限</string>
|
||||
<string name="notification_cancel_txt">退出</string>
|
||||
<string name="notification_setting_txt">设置</string>
|
||||
<string name="app_tishi">提示</string>
|
||||
<string name="app_hint">请输入邀请码</string>
|
||||
<string name="app_sharetitle">我的邀请码:</string>
|
||||
<string name="app_sharetitle2">上级邀请码:</string>
|
||||
<string name="app_totalinvite">总邀请人数:</string>
|
||||
<string name="app_sharecontent">邀请您下载:</string>
|
||||
<string name="app_share">分享</string>
|
||||
<string name="app_checklist">查看邀请记录</string>
|
||||
<string name="app_invitetitle">邀请记录</string>
|
||||
<string name="app_checklist_number">总邀请人数: %d</string>
|
||||
<string name="app_nodata">暂无数据</string>
|
||||
<string name="app_withdrawtitle">提现记录</string>
|
||||
<string name="app_withdrawapply_title">提现申请</string>
|
||||
<string name="app_bankinfo_title">编辑银行卡信息</string>
|
||||
<string name="app_bankinfo_countrycode">86</string>
|
||||
<string name="app_bankinfo_name">持卡人姓名:</string>
|
||||
<string name="app_bankinfo_name_hint">请输入持卡人姓名</string>
|
||||
<string name="app_bankinfo_bankcountry">国家地区:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">请选择国家地区</string>
|
||||
<string name="app_bankinfo_bankname">开户行名称:</string>
|
||||
<string name="app_bankinfo_bankname_hint">请选择开户行名称</string>
|
||||
<string name="app_bankinfo_code">银行户口:</string>
|
||||
<string name="app_bankinfo_code_hint">请输入银行卡户口</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">(注:请先输入国家区号再选择开户行名称!)</string>
|
||||
<string name="app_balance">余额: %s</string>
|
||||
<string name="app_totalearning">总收益: %s</string>
|
||||
<string name="app_withdraw_amount">金额: %s</string>
|
||||
<string name="app_withdraw_apply_hint">请输入提现金额</string>
|
||||
<string name="app_toastapply">提现申请已提交</string>
|
||||
<string name="app_notinstall">应用未安装</string>
|
||||
|
||||
|
||||
<!-- <string name="app_name">SPEEDAU</string>-->
|
||||
<!-- <string name="qsrlwmm_txt">Please Set Your Password</string>-->
|
||||
<!-- <string name="cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="sure_txt">Sure</string>-->
|
||||
<!-- <string name="banbengengxin_txt">New Version Update</string>-->
|
||||
<!-- <string name="xiacigengxin_txt">Next Update</string>-->
|
||||
<!-- <string name="lijigengxin_txt">Update Immediately</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content">Click to close notification</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content_re_download">Click to re-download</string>-->
|
||||
<!-- <string name="app_updater_error_notification_title">Download failed</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_content">Click to install</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_title">Download completed</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_content">Downloading...</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="app_updater_start_notification_content">Getting download data...</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="notification_title_txt">Need to turn on mobile phone notification permission</string>-->
|
||||
<!-- <string name="notification_cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="notification_setting_txt">Setting</string>-->
|
||||
|
||||
</resources>
|
||||
20
Magnum888/src/main/res/values/style.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="AppThemeStart1" parent="@style/Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="android:windowTranslucentStatus">true</item>
|
||||
<item name="android:windowTranslucentNavigation">false</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="colorPrimary">@android:color/transparent</item>
|
||||
<item name="colorPrimaryDark">@android:color/transparent</item>
|
||||
<item name="colorAccent">@android:color/transparent</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<!-- 隐藏Activity窗口的Title标题栏 -->
|
||||
<item name="windowNoTitle">true</item>
|
||||
<!-- <item name="android:windowFullscreen">true</item>-->
|
||||
<item name="android:windowBackground">@color/white</item>
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</item>
|
||||
</style>
|
||||
</resources>
|
||||
89
Magnum888/src/main/res/values/themes.xml
Normal file
@@ -0,0 +1,89 @@
|
||||
<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. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
<item name="android:enforceNavigationBarContrast" tools:ignore="NewApi">false</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</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>
|
||||
10
Magnum888/src/main/res/xml/app_updater_paths.xml
Normal 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>
|
||||
4
Magnum888/src/main/res/xml/network_security_config.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<network-security-config>
|
||||
<base-config cleartextTrafficPermitted="true" />
|
||||
</network-security-config>
|
||||
13
Magnum888/src/main/res/xml/provider_paths.xml
Normal 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"异常的问题 -->
|
||||
@@ -0,0 +1,35 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void TestPattern(){
|
||||
//
|
||||
Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$");
|
||||
String a="+45.5";
|
||||
boolean matches = compile.matcher(a).matches();
|
||||
System.out.println(matches);
|
||||
String result = compile.matcher(a).replaceAll("");
|
||||
System.out.println(result);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
1
Mahkota8/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
92
Mahkota8/build.gradle
Normal file
@@ -0,0 +1,92 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'com.google.gms.google-services'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 31
|
||||
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.web.MAHKOTA8"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 31
|
||||
versionCode 106
|
||||
versionName "v1.0.6"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
signingConfigs {
|
||||
debug {
|
||||
storeFile file('mahkota8.jks')
|
||||
storePassword "android2014"
|
||||
keyAlias 'key0'
|
||||
keyPassword "android2014"
|
||||
}
|
||||
release {
|
||||
storeFile file('mahkota8.jks')
|
||||
storePassword "android2014"
|
||||
keyAlias 'key0'
|
||||
keyPassword "android2014"
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'com.google.android.material:material:1.1.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
testImplementation 'junit:junit:4.+'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar')
|
||||
|
||||
// okhttp相关库
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
|
||||
|
||||
// JSON解析库
|
||||
implementation 'com.google.code.gson:gson:2.9.0'
|
||||
implementation 'com.alibaba:fastjson:1.1.71.android'
|
||||
api 'com.squareup.retrofit2:retrofit:2.5.0'
|
||||
api 'com.squareup.retrofit2:converter-scalars:2.3.0'
|
||||
api 'com.squareup.retrofit2:converter-gson:2.4.0'
|
||||
api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
|
||||
api 'io.reactivex.rxjava2:rxjava:2.1.16'
|
||||
api 'io.reactivex.rxjava2:rxandroid:2.0.2'
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选)
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选)
|
||||
implementation 'com.github.Justson:Downloader:v5.0.4-androidx'
|
||||
//implementation 'com.tencent.tbs:tbssdk:44286'
|
||||
// sdk 33
|
||||
// implementation platform('com.google.firebase:firebase-bom:32.7.0')
|
||||
// Firebase Cloud Messaging
|
||||
// implementation("com.google.firebase:firebase-messaging")
|
||||
// implementation("com.google.firebase:firebase-analytics")
|
||||
|
||||
implementation platform('com.google.firebase:firebase-bom:32.1.0')
|
||||
|
||||
// Add the dependencies for the Firebase Cloud Messaging and Analytics libraries
|
||||
// When using the BoM, you don't specify versions in Firebase library dependencies
|
||||
implementation 'com.google.firebase:firebase-messaging'
|
||||
implementation 'com.google.firebase:firebase-analytics'
|
||||
// implementation("com.google.firebase:firebase-messaging:23.2.1")
|
||||
// implementation("com.google.firebase:firebase-analytics:21.2.1")
|
||||
// implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式
|
||||
implementation("com.github.bumptech.glide:glide:4.13.1")
|
||||
implementation project(path: ':base')
|
||||
|
||||
}
|
||||
29
Mahkota8/google-services.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "643424299568",
|
||||
"project_id": "mahkota8-186da",
|
||||
"storage_bucket": "mahkota8-186da.firebasestorage.app"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:643424299568:android:7ef0cd13dc9175bafb9bf5",
|
||||
"android_client_info": {
|
||||
"package_name": "com.web.MAHKOTA8"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyBuleiR8aPa6Dt3kevaK4wtSoYck31s8AU"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
BIN
Mahkota8/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar
Normal file
BIN
Mahkota8/mahkota8.jks
Normal file
32
Mahkota8/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
||||
-dontwarn dalvik.**
|
||||
-dontwarn com.tencent.smtt.**
|
||||
|
||||
-keep class com.tencent.smtt.** {
|
||||
*;
|
||||
}
|
||||
|
||||
-keep class com.tencent.tbs.** {
|
||||
*;
|
||||
}
|
||||
BIN
Mahkota8/release/Mahkota8.apk
Normal file
18
Mahkota8/release/output-metadata.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"version": 2,
|
||||
"artifactType": {
|
||||
"type": "APK",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "com.web.MAHKOTA8",
|
||||
"variantName": "processReleaseResources",
|
||||
"elements": [
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"versionCode": 106,
|
||||
"versionName": "v1.0.6",
|
||||
"outputFile": "Mahkota8-release.apk"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("Tptogiar.calculcator", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
114
Mahkota8/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.web.MAHKOTA8">
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera"
|
||||
android:required="false" />
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera2"
|
||||
android:required="false" />
|
||||
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS" /> <!-- 获取通讯录-->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<!-- 多媒体相关 -->
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
|
||||
<!-- 8.0+系统需要-->
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
|
||||
<!--推送权限-->
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_SECURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.RECORD_AUDIO" />-->
|
||||
|
||||
|
||||
<!-- <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_AUDIO_OUTPUT" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.autofocus" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.front" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.level.full" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.capability.raw" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.any" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.microphone" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera2" android:required="true" />-->
|
||||
|
||||
<queries>
|
||||
<intent>
|
||||
<action android:name="android.media.action.IMAGE_CAPTURE" />
|
||||
</intent>
|
||||
</queries>
|
||||
<application
|
||||
android:name=".WebApplication"
|
||||
android:allowBackup="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:icon="@mipmap/app_logo"
|
||||
android:label="@string/app_name"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:roundIcon="@mipmap/app_logo"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.AppTheme"
|
||||
android:usesCleartextTraffic="true">
|
||||
|
||||
|
||||
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity2"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:exported="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:theme="@style/AppThemeStart">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<service
|
||||
android:name="com.tencent.smtt.export.external.DexClassLoaderProviderService"
|
||||
android:label="dexopt"
|
||||
android:process=":dexopt" />
|
||||
|
||||
|
||||
<!-- android:directBootAware="true" 为应用启用消息处理直接启动模式-->
|
||||
<service
|
||||
android:name=".MyFirebaseMessageingService"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<!-- Set custom default icon. This is used when no icon is set for incoming notification messages.
|
||||
See README(https://goo.gl/l4GJaQ) for more. 设置推送默认图标 和颜色-->
|
||||
<meta-data
|
||||
android:name="com.google.firebase.messaging.default_notification_icon"
|
||||
android:resource="@mipmap/app_logo" />
|
||||
<!-- Set color used with incoming notification messages. This is used when no color is set for the incoming
|
||||
notification message. See README(https://goo.gl/6BKBk7) for more. -->
|
||||
<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" />
|
||||
<!-- 还可设置推送渠道 -->
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.google.firebase.messaging.default_notification_channel_id"-->
|
||||
<!-- android:value="@string/default_notification_channel_id" />-->
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
54
Mahkota8/src/main/java/com/web/MAHKOTA8/MainActivity2.java
Normal file
@@ -0,0 +1,54 @@
|
||||
package com.web.MAHKOTA8;
|
||||
|
||||
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.android.gms.tasks.OnCompleteListener;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.firebase.messaging.FirebaseMessaging;
|
||||
import com.web.base.MainActivity;
|
||||
|
||||
public class MainActivity2 extends com.web.base.MainActivity2 {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
userId = 95;
|
||||
saveInt(MainActivity2.this,"user_code",userId);
|
||||
saveInt(MainActivity2.this,"version_code",getVersion());
|
||||
MainActivity.saveString(this, "base_url", "https://www.mahkota8b.com/");
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
//订阅主题
|
||||
FirebaseMessaging.getInstance().subscribeToTopic("demo")
|
||||
.addOnCompleteListener(new OnCompleteListener<Void>() {
|
||||
@Override
|
||||
public void onComplete(@NonNull Task<Void> task) {
|
||||
String msg = "Subscribed";
|
||||
if (!task.isSuccessful()) {
|
||||
msg = "Subscribe failed";
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public int getVersion(){
|
||||
try {
|
||||
PackageManager packageManager = getPackageManager();
|
||||
PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0);
|
||||
String StringversionName = packageInfo.versionName; // 版本号
|
||||
int versionCode = packageInfo.versionCode; // 版本码
|
||||
// 在这里可以使用versionName和versionCode进行相关的操作
|
||||
// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode);
|
||||
return versionCode;
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
package com.web.MAHKOTA8;
|
||||
|
||||
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.web.base.GsonUtils;
|
||||
import com.web.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);
|
||||
// if (remoteMessage.getNotification() != null) {
|
||||
// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
// }
|
||||
} else {
|
||||
//收到通知 创建notify
|
||||
if (remoteMessage.getNotification() != null) {
|
||||
showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void showNotification(MessageInfo messageInfo) {
|
||||
Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.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);
|
||||
|
||||
// Intent notifyIntent = new Intent(this, MainActivity2.class);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
// // notifyIntent.putExtra("message", messageInfo);
|
||||
// notifyIntent.setAction(Intent.ACTION_VIEW);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须
|
||||
// PendingIntent pendingIntent;
|
||||
// pendingIntent = PendingIntent.getActivity
|
||||
// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | 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(com.web.base.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(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(messageInfo.getTitle())
|
||||
.setContentText(messageInfo.getContent())
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.R.mipmap.ic_launcher)
|
||||
.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, MainActivity2.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(com.web.base.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(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
}
|
||||
notificationManager.notify(0, notificationBuilder.build());
|
||||
//存储数据
|
||||
// saveNotifyMessage(body);
|
||||
}
|
||||
|
||||
|
||||
// public void saveNotifyMessage(String body) {
|
||||
// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class);
|
||||
// String savenotify = Utils.get(getApplication(),ApiService.savenotify,"");
|
||||
// if(messageInfo!=null){
|
||||
// if(TextUtils.isEmpty(savenotify)){
|
||||
// GsonUtils.getListFromJSON(savenotify,)
|
||||
// }
|
||||
// }
|
||||
// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @param key 要设置的key
|
||||
// */
|
||||
// public static void set(Context activity, String key, String is) {
|
||||
// SharedPreferences nameSetting = getConfigShared(activity);
|
||||
// SharedPreferences.Editor namePref = nameSetting.edit();
|
||||
// namePref.putString(key, is);
|
||||
// namePref.commit();
|
||||
// }
|
||||
}
|
||||
37
Mahkota8/src/main/java/com/web/MAHKOTA8/WebApplication.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.web.MAHKOTA8;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
|
||||
import com.tencent.smtt.export.external.TbsCoreSettings;
|
||||
import com.tencent.smtt.sdk.QbSdk;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class WebApplication extends Application {
|
||||
|
||||
|
||||
public static Context application;
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
// 设置开启优化方案
|
||||
application = this;
|
||||
HashMap map = new HashMap();
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true);
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true);
|
||||
QbSdk.initTbsSettings(map);
|
||||
QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() {
|
||||
@Override
|
||||
public void onCoreInitFinished() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewInitFinished(boolean b) {
|
||||
|
||||
}
|
||||
});
|
||||
QbSdk.setDownloadWithoutWifi(true);
|
||||
}
|
||||
}
|
||||
11
Mahkota8/src/main/res/drawable-anydpi/ic_action_back.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="#333333"
|
||||
android:alpha="0.8">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
|
||||
</vector>
|
||||
BIN
Mahkota8/src/main/res/drawable-hdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 182 B |
BIN
Mahkota8/src/main/res/drawable-mdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 150 B |
@@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
||||
BIN
Mahkota8/src/main/res/drawable-xhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 212 B |
BIN
Mahkota8/src/main/res/drawable-xxhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 324 B |
170
Mahkota8/src/main/res/drawable/ic_launcher_background.xml
Normal file
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
||||
20
Mahkota8/src/main/res/drawable/input_bg.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/white">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape>
|
||||
<solid android:color="@android:color/transparent" />
|
||||
<corners android:radius="23dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 默认显⽰效果-->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/dialog_input_bg"/>
|
||||
<corners
|
||||
android:radius="3dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
|
||||
28
Mahkota8/src/main/res/drawable/pass_word_bg.xml
Normal 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>
|
||||
|
||||
23
Mahkota8/src/main/res/drawable/pass_word_bg1.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#FF0000"
|
||||
android:centerColor="#FF5555"
|
||||
android:endColor="#FBD3D0"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
23
Mahkota8/src/main/res/drawable/pass_word_bg2.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#000000"
|
||||
android:centerColor="#888888"
|
||||
android:endColor="#FFFFFF"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
5
Mahkota8/src/main/res/drawable/shape_btn_bg.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="22dp" />
|
||||
<solid android:color="@color/jisuanqi" />
|
||||
</shape>
|
||||
6
Mahkota8/src/main/res/drawable/shape_dialog_bg2.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:topRightRadius="12dp"
|
||||
android:topLeftRadius="12dp"/>
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
Mahkota8/src/main/res/drawable/shape_dialog_bg3.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="12dp" />
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
Mahkota8/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
BIN
Mahkota8/src/main/res/mipmap-hdpi/ic_empty.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
Mahkota8/src/main/res/mipmap-hdpi/ic_pull_down.png
Normal file
|
After Width: | Height: | Size: 271 B |
BIN
Mahkota8/src/main/res/mipmap-xhdpi/ic_close.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
Mahkota8/src/main/res/mipmap-xhdpi/ic_facebook.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
Mahkota8/src/main/res/mipmap-xhdpi/ic_hometo.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
Mahkota8/src/main/res/mipmap-xhdpi/ic_link.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
Mahkota8/src/main/res/mipmap-xhdpi/ic_menu.png
Normal file
|
After Width: | Height: | Size: 779 B |
BIN
Mahkota8/src/main/res/mipmap-xhdpi/ic_shousuo.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
Mahkota8/src/main/res/mipmap-xhdpi/ic_tel.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
Mahkota8/src/main/res/mipmap-xhdpi/ic_whatsapp.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
Mahkota8/src/main/res/mipmap-xhdpi/ic_zhangkai.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
Mahkota8/src/main/res/mipmap-xxhdpi/app_logo.png
Normal file
|
After Width: | Height: | Size: 521 KiB |
54
Mahkota8/src/main/res/values-en/strings.xml
Normal file
@@ -0,0 +1,54 @@
|
||||
<resources>
|
||||
<string name="app_name">MAHKOTA8</string>
|
||||
<string name="qsrlwmm_txt">Please Set Your Password</string>
|
||||
<string name="cancel_txt">Cancel</string>
|
||||
<string name="sure_txt">Sure</string>
|
||||
<string name="banbengengxin_txt">New Version Update</string>
|
||||
<string name="xiacigengxin_txt">Next Update</string>
|
||||
<string name="lijigengxin_txt">Update Immediately</string>
|
||||
<string name="app_updater_error_notification_content">Click to close notification</string>
|
||||
<string name="app_updater_error_notification_content_re_download">Click to re-download</string>
|
||||
<string name="app_updater_error_notification_title">Download failed</string>
|
||||
<string name="app_updater_finish_notification_content">Click to install</string>
|
||||
<string name="app_updater_finish_notification_title">Download completed</string>
|
||||
<string name="app_updater_progress_notification_content">Downloading...</string>
|
||||
<string name="app_updater_progress_notification_title">Version update</string>
|
||||
<string name="app_updater_progress_notification_title_2">Downloading game</string>
|
||||
<string name="app_updater_start_notification_content">Getting download data...</string>
|
||||
<string name="app_updater_start_notification_title">Version update</string>
|
||||
<string name="app_updater_start_notification_title_2">Downloading game</string>
|
||||
<string name="notification_title_txt">Need to turn on mobile phone notification permission</string>
|
||||
<string name="notification_cancel_txt">Exit</string>
|
||||
<string name="notification_setting_txt">Setting</string>
|
||||
<string name="app_tishi">Tip</string>
|
||||
<string name="app_hint">Please enter the invitation code</string>
|
||||
<string name="app_sharetitle">My invitation code:</string>
|
||||
<string name="app_sharetitle2">Superior invitation code:</string>
|
||||
<string name="app_totalinvite">Total number of invites:</string>
|
||||
<string name="app_sharecontent">App download link:</string>
|
||||
<string name="app_share">Share</string>
|
||||
<string name="app_checklist">Check Invitation Records</string>
|
||||
<string name="app_invitetitle">Invitation Records</string>
|
||||
<string name="app_checklist_number">Total number of invitees: %d</string>
|
||||
<string name="app_nodata">No Data</string>
|
||||
<string name="app_withdrawtitle">Withdrawal Record</string>
|
||||
<string name="app_withdrawapply_title">Withdrawal Application</string>
|
||||
<string name="app_bankinfo_title">Edit Bank Card Information</string>
|
||||
<string name="app_bankinfo_countrycode">60</string>
|
||||
<string name="app_bankinfo_name">Name:</string>
|
||||
<string name="app_bankinfo_name_hint">Please enter the bank card name</string>
|
||||
<string name="app_bankinfo_code">Bank card account:</string>
|
||||
<string name="app_bankinfo_code_hint">Please enter the bank card account</string>
|
||||
<string name="app_bankinfo_bankcountry">Country:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">Please select a country</string>
|
||||
<string name="app_bankinfo_bankname">Bank Name:</string>
|
||||
<string name="app_bankinfo_bankname_hint">Please select a bank name</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">Note: Please enter the country code before selecting the bank name!</string>
|
||||
<string name="app_balance">Balance: %s</string>
|
||||
<string name="app_totalearning">Total Earnings: %s</string>
|
||||
<string name="app_withdraw_amount">Amount: %s</string>
|
||||
<string name="app_withdraw_apply_hint">Please enter the withdrawal amount</string>
|
||||
<string name="app_toastapply">Withdrawal application has been submitted</string>
|
||||
<string name="app_notinstall">App not installed</string>
|
||||
|
||||
</resources>
|
||||
69
Mahkota8/src/main/res/values-night/themes.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.Calculcator" parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_200</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/black</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_200</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</item>
|
||||
</style>
|
||||
</resources>
|
||||
19
Mahkota8/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="purple_200">#FFFFFF</color>
|
||||
<color name="purple_500">#FFFFFF</color>
|
||||
<color name="purple_700">#FFFFFF</color>
|
||||
<color name="teal_200">#FF03DAC5</color>
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="jisuanqi">#EF4723</color>
|
||||
<color name="notify_color">#FFFFFFFF</color>
|
||||
|
||||
<color name="dialog_bg">#2C2C2E</color>
|
||||
<color name="dialog_textcolor">#FFA722</color>
|
||||
<color name="dialog_input_bg">#434343</color>
|
||||
<color name="dialog_dark">#BCBCBC</color>
|
||||
<color name="color_red">#DC1927</color>
|
||||
|
||||
</resources>
|
||||
77
Mahkota8/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,77 @@
|
||||
<resources>
|
||||
<string name="app_name">MAHKOTA8</string>
|
||||
<string name="qsrlwmm_txt">请输入6位密码</string>
|
||||
<string name="cancel_txt">取消</string>
|
||||
<string name="sure_txt">确定</string>
|
||||
<string name="banbengengxin_txt">版本更新</string>
|
||||
<string name="xiacigengxin_txt">下次更新</string>
|
||||
<string name="lijigengxin_txt">立即更新</string>
|
||||
<string name="app_updater_error_notification_content">点击关闭通知</string>
|
||||
<string name="app_updater_error_notification_content_re_download">点击重新下载</string>
|
||||
<string name="app_updater_error_notification_title">下载失败</string>
|
||||
<string name="app_updater_finish_notification_content">点击安装</string>
|
||||
<string name="app_updater_finish_notification_title">下载完成</string>
|
||||
<string name="app_updater_progress_notification_content">正在下载…</string>
|
||||
<string name="app_updater_progress_notification_title">版本更新</string>
|
||||
<string name="app_updater_progress_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_title">版本更新</string>
|
||||
<string name="app_updater_start_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_content">正在获取下载数据…</string>
|
||||
<string name="notification_title_txt">需要打开手机通知权限</string>
|
||||
<string name="notification_cancel_txt">退出</string>
|
||||
<string name="notification_setting_txt">设置</string>
|
||||
<string name="app_tishi">提示</string>
|
||||
<string name="app_hint">请输入邀请码</string>
|
||||
<string name="app_sharetitle">我的邀请码:</string>
|
||||
<string name="app_sharetitle2">上级邀请码:</string>
|
||||
<string name="app_totalinvite">总邀请人数:</string>
|
||||
<string name="app_sharecontent">邀请您下载:</string>
|
||||
<string name="app_share">分享</string>
|
||||
<string name="app_checklist">查看邀请记录</string>
|
||||
<string name="app_invitetitle">邀请记录</string>
|
||||
<string name="app_checklist_number">总邀请人数: %d</string>
|
||||
<string name="app_nodata">暂无数据</string>
|
||||
<string name="app_withdrawtitle">提现记录</string>
|
||||
<string name="app_withdrawapply_title">提现申请</string>
|
||||
<string name="app_bankinfo_title">编辑银行卡信息</string>
|
||||
<string name="app_bankinfo_countrycode">86</string>
|
||||
<string name="app_bankinfo_name">持卡人姓名:</string>
|
||||
<string name="app_bankinfo_name_hint">请输入持卡人姓名</string>
|
||||
<string name="app_bankinfo_bankcountry">国家地区:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">请选择国家地区</string>
|
||||
<string name="app_bankinfo_bankname">开户行名称:</string>
|
||||
<string name="app_bankinfo_bankname_hint">请选择开户行名称</string>
|
||||
<string name="app_bankinfo_code">银行户口:</string>
|
||||
<string name="app_bankinfo_code_hint">请输入银行卡户口</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">(注:请先输入国家区号再选择开户行名称!)</string>
|
||||
<string name="app_balance">余额: %s</string>
|
||||
<string name="app_totalearning">总收益: %s</string>
|
||||
<string name="app_withdraw_amount">金额: %s</string>
|
||||
<string name="app_withdraw_apply_hint">请输入提现金额</string>
|
||||
<string name="app_toastapply">提现申请已提交</string>
|
||||
<string name="app_notinstall">应用未安装</string>
|
||||
|
||||
|
||||
<!-- <string name="app_name">SPEEDAU</string>-->
|
||||
<!-- <string name="qsrlwmm_txt">Please Set Your Password</string>-->
|
||||
<!-- <string name="cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="sure_txt">Sure</string>-->
|
||||
<!-- <string name="banbengengxin_txt">New Version Update</string>-->
|
||||
<!-- <string name="xiacigengxin_txt">Next Update</string>-->
|
||||
<!-- <string name="lijigengxin_txt">Update Immediately</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content">Click to close notification</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content_re_download">Click to re-download</string>-->
|
||||
<!-- <string name="app_updater_error_notification_title">Download failed</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_content">Click to install</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_title">Download completed</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_content">Downloading...</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="app_updater_start_notification_content">Getting download data...</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="notification_title_txt">Need to turn on mobile phone notification permission</string>-->
|
||||
<!-- <string name="notification_cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="notification_setting_txt">Setting</string>-->
|
||||
|
||||
</resources>
|
||||
20
Mahkota8/src/main/res/values/style.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="AppThemeStart1" parent="@style/Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="android:windowTranslucentStatus">true</item>
|
||||
<item name="android:windowTranslucentNavigation">false</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="colorPrimary">@android:color/transparent</item>
|
||||
<item name="colorPrimaryDark">@android:color/transparent</item>
|
||||
<item name="colorAccent">@android:color/transparent</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<!-- 隐藏Activity窗口的Title标题栏 -->
|
||||
<item name="windowNoTitle">true</item>
|
||||
<!-- <item name="android:windowFullscreen">true</item>-->
|
||||
<item name="android:windowBackground">@color/white</item>
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</item>
|
||||
</style>
|
||||
</resources>
|
||||
89
Mahkota8/src/main/res/values/themes.xml
Normal file
@@ -0,0 +1,89 @@
|
||||
<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. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
<item name="android:enforceNavigationBarContrast" tools:ignore="NewApi">false</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</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>
|
||||
10
Mahkota8/src/main/res/xml/app_updater_paths.xml
Normal 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>
|
||||
4
Mahkota8/src/main/res/xml/network_security_config.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<network-security-config>
|
||||
<base-config cleartextTrafficPermitted="true" />
|
||||
</network-security-config>
|
||||
13
Mahkota8/src/main/res/xml/provider_paths.xml
Normal 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"异常的问题 -->
|
||||
@@ -0,0 +1,35 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void TestPattern(){
|
||||
//
|
||||
Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$");
|
||||
String a="+45.5";
|
||||
boolean matches = compile.matcher(a).matches();
|
||||
System.out.println(matches);
|
||||
String result = compile.matcher(a).replaceAll("");
|
||||
System.out.println(result);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
1
Mk88aud/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
86
Mk88aud/build.gradle
Normal file
@@ -0,0 +1,86 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'com.google.gms.google-services'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 31
|
||||
buildToolsVersion "30.0.3"
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.web.mk88"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 31
|
||||
versionCode 106
|
||||
versionName "v1.0.6"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
signingConfigs {
|
||||
debug {
|
||||
storeFile file('mk88aud.jks')
|
||||
storePassword "android2014"
|
||||
keyAlias 'key0'
|
||||
keyPassword "android2014"
|
||||
}
|
||||
release {
|
||||
storeFile file('mk88aud.jks')
|
||||
storePassword "android2014"
|
||||
keyAlias 'key0'
|
||||
keyPassword "android2014"
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'com.google.android.material:material:1.1.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
testImplementation 'junit:junit:4.+'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar')
|
||||
|
||||
// okhttp相关库
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
|
||||
|
||||
// JSON解析库
|
||||
implementation 'com.google.code.gson:gson:2.9.0'
|
||||
implementation 'com.alibaba:fastjson:1.1.71.android'
|
||||
api 'com.squareup.retrofit2:retrofit:2.5.0'
|
||||
api 'com.squareup.retrofit2:converter-scalars:2.3.0'
|
||||
api 'com.squareup.retrofit2:converter-gson:2.4.0'
|
||||
api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
|
||||
api 'io.reactivex.rxjava2:rxjava:2.1.16'
|
||||
api 'io.reactivex.rxjava2:rxandroid:2.0.2'
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选)
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选)
|
||||
implementation 'com.github.Justson:Downloader:v5.0.4-androidx'
|
||||
//implementation 'com.tencent.tbs:tbssdk:44286'
|
||||
// sdk 33
|
||||
implementation platform('com.google.firebase:firebase-bom:32.7.0')
|
||||
// Firebase Cloud Messaging
|
||||
implementation("com.google.firebase:firebase-messaging")
|
||||
// implementation("com.google.firebase:firebase-analytics")
|
||||
|
||||
// implementation("com.google.firebase:firebase-messaging:23.2.1")
|
||||
// implementation("com.google.firebase:firebase-analytics:21.2.1")
|
||||
// implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式
|
||||
implementation("com.github.bumptech.glide:glide:4.13.1")
|
||||
implementation project(path: ':base')
|
||||
|
||||
}
|
||||
29
Mk88aud/google-services.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "637535395676",
|
||||
"project_id": "mk88au",
|
||||
"storage_bucket": "mk88au.firebasestorage.app"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:637535395676:android:4a3c0ba171a6445b11ab99",
|
||||
"android_client_info": {
|
||||
"package_name": "com.web.mk88"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyBVa3ICPExBtE4YSVn0Fuimd0FoELPCvWA"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
BIN
Mk88aud/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar
Normal file
BIN
Mk88aud/mk88aud.jks
Normal file
32
Mk88aud/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
||||
-dontwarn dalvik.**
|
||||
-dontwarn com.tencent.smtt.**
|
||||
|
||||
-keep class com.tencent.smtt.** {
|
||||
*;
|
||||
}
|
||||
|
||||
-keep class com.tencent.tbs.** {
|
||||
*;
|
||||
}
|
||||
BIN
Mk88aud/release/mk88aud.apk
Normal file
18
Mk88aud/release/output-metadata.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"version": 2,
|
||||
"artifactType": {
|
||||
"type": "APK",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "com.web.mk88",
|
||||
"variantName": "processReleaseResources",
|
||||
"elements": [
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"versionCode": 106,
|
||||
"versionName": "v1.0.6",
|
||||
"outputFile": "Mk88aud-release.apk"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("Tptogiar.calculcator", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
126
Mk88aud/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.web.mk88">
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera"
|
||||
android:required="false" />
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera2"
|
||||
android:required="false" />
|
||||
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS" /> <!-- 获取通讯录-->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<!-- 多媒体相关 -->
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
|
||||
<!-- 8.0+系统需要-->
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
|
||||
<!--推送权限-->
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_SECURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.RECORD_AUDIO" />-->
|
||||
|
||||
|
||||
<!-- <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_AUDIO_OUTPUT" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.autofocus" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.front" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.level.full" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.capability.raw" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.any" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.microphone" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera2" android:required="true" />-->
|
||||
|
||||
<queries>
|
||||
<intent>
|
||||
<action android:name="android.media.action.IMAGE_CAPTURE" />
|
||||
</intent>
|
||||
</queries>
|
||||
<application
|
||||
android:name=".WebApplication"
|
||||
android:allowBackup="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:icon="@mipmap/app_logo"
|
||||
android:label="@string/app_name"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:roundIcon="@mipmap/app_logo"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.AppTheme"
|
||||
android:usesCleartextTraffic="true">
|
||||
|
||||
|
||||
<!-- <activity-alias-->
|
||||
<!-- android:name=".MainActivityNew"-->
|
||||
<!-- android:icon="@mipmap/winway"-->
|
||||
<!-- android:roundIcon="@mipmap/winway"-->
|
||||
<!-- android:label="@string/app_name1"-->
|
||||
<!-- android:targetActivity=".MainActivity"-->
|
||||
<!-- android:enabled="false"-->
|
||||
<!-- android:exported="true"-->
|
||||
<!-- android:configChanges="orientation|navigation|keyboardHidden"-->
|
||||
<!-- android:launchMode="singleTop"-->
|
||||
<!-- android:excludeFromRecents="true"-->
|
||||
<!-- android:screenOrientation="portrait">-->
|
||||
<!-- <intent-filter>-->
|
||||
<!-- <action android:name="android.intent.action.MAIN" />-->
|
||||
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
|
||||
<!-- </intent-filter>-->
|
||||
<!-- </activity-alias>-->
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity2"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:exported="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:launchMode="singleTop"
|
||||
android:theme="@style/AppThemeStart">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
|
||||
<!-- android:directBootAware="true" 为应用启用消息处理直接启动模式-->
|
||||
<service
|
||||
android:name=".MyFirebaseMessageingService"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<!-- Set custom default icon. This is used when no icon is set for incoming notification messages.
|
||||
See README(https://goo.gl/l4GJaQ) for more. 设置推送默认图标 和颜色-->
|
||||
<meta-data
|
||||
android:name="com.google.firebase.messaging.default_notification_icon"
|
||||
android:resource="@mipmap/app_logo" />
|
||||
<!-- Set color used with incoming notification messages. This is used when no color is set for the incoming
|
||||
notification message. See README(https://goo.gl/6BKBk7) for more. -->
|
||||
<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" />
|
||||
<!-- 还可设置推送渠道 -->
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.google.firebase.messaging.default_notification_channel_id"-->
|
||||
<!-- android:value="@string/default_notification_channel_id" />-->
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
54
Mk88aud/src/main/java/com/web/mk88/MainActivity2.java
Normal file
@@ -0,0 +1,54 @@
|
||||
package com.web.mk88;
|
||||
|
||||
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.android.gms.tasks.OnCompleteListener;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.firebase.messaging.FirebaseMessaging;
|
||||
import com.web.base.MainActivity;
|
||||
|
||||
public class MainActivity2 extends com.web.base.MainActivity2 {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
userId = 57;
|
||||
saveInt(MainActivity2.this,"user_code",userId);
|
||||
saveInt(MainActivity2.this,"version_code",getVersion());
|
||||
MainActivity.saveString(this, "base_url", "https://mk88au.net/");
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
//订阅主题
|
||||
FirebaseMessaging.getInstance().subscribeToTopic("demo")
|
||||
.addOnCompleteListener(new OnCompleteListener<Void>() {
|
||||
@Override
|
||||
public void onComplete(@NonNull Task<Void> task) {
|
||||
String msg = "Subscribed";
|
||||
if (!task.isSuccessful()) {
|
||||
msg = "Subscribe failed";
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public int getVersion(){
|
||||
try {
|
||||
PackageManager packageManager = getPackageManager();
|
||||
PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0);
|
||||
String StringversionName = packageInfo.versionName; // 版本号
|
||||
int versionCode = packageInfo.versionCode; // 版本码
|
||||
// 在这里可以使用versionName和versionCode进行相关的操作
|
||||
// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode);
|
||||
return versionCode;
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
package com.web.mk88;
|
||||
|
||||
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.web.base.GsonUtils;
|
||||
import com.web.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);
|
||||
// if (remoteMessage.getNotification() != null) {
|
||||
// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
// }
|
||||
} else {
|
||||
//收到通知 创建notify
|
||||
if (remoteMessage.getNotification() != null) {
|
||||
showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void showNotification(MessageInfo messageInfo) {
|
||||
Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.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);
|
||||
|
||||
// Intent notifyIntent = new Intent(this, MainActivity2.class);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
// // notifyIntent.putExtra("message", messageInfo);
|
||||
// notifyIntent.setAction(Intent.ACTION_VIEW);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须
|
||||
// PendingIntent pendingIntent;
|
||||
// pendingIntent = PendingIntent.getActivity
|
||||
// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | 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(com.web.base.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(com.web.base.R.mipmap.app_logo)
|
||||
.setContentTitle(messageInfo.getTitle())
|
||||
.setContentText(messageInfo.getContent())
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.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, MainActivity2.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(com.web.base.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(com.web.base.R.mipmap.app_logo)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.R.mipmap.app_logo)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
}
|
||||
notificationManager.notify(0, notificationBuilder.build());
|
||||
//存储数据
|
||||
// saveNotifyMessage(body);
|
||||
}
|
||||
|
||||
|
||||
// public void saveNotifyMessage(String body) {
|
||||
// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class);
|
||||
// String savenotify = Utils.get(getApplication(),ApiService.savenotify,"");
|
||||
// if(messageInfo!=null){
|
||||
// if(TextUtils.isEmpty(savenotify)){
|
||||
// GsonUtils.getListFromJSON(savenotify,)
|
||||
// }
|
||||
// }
|
||||
// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @param key 要设置的key
|
||||
// */
|
||||
// public static void set(Context activity, String key, String is) {
|
||||
// SharedPreferences nameSetting = getConfigShared(activity);
|
||||
// SharedPreferences.Editor namePref = nameSetting.edit();
|
||||
// namePref.putString(key, is);
|
||||
// namePref.commit();
|
||||
// }
|
||||
}
|
||||
37
Mk88aud/src/main/java/com/web/mk88/WebApplication.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.web.mk88;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
|
||||
import com.tencent.smtt.export.external.TbsCoreSettings;
|
||||
import com.tencent.smtt.sdk.QbSdk;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class WebApplication extends Application {
|
||||
|
||||
|
||||
public static Context application;
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
// 设置开启优化方案
|
||||
application = this;
|
||||
HashMap map = new HashMap();
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true);
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true);
|
||||
QbSdk.initTbsSettings(map);
|
||||
QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() {
|
||||
@Override
|
||||
public void onCoreInitFinished() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewInitFinished(boolean b) {
|
||||
|
||||
}
|
||||
});
|
||||
QbSdk.setDownloadWithoutWifi(true);
|
||||
}
|
||||
}
|
||||
11
Mk88aud/src/main/res/drawable-anydpi/ic_action_back.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="#333333"
|
||||
android:alpha="0.8">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
|
||||
</vector>
|
||||
BIN
Mk88aud/src/main/res/drawable-hdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 182 B |
BIN
Mk88aud/src/main/res/drawable-mdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 150 B |
30
Mk88aud/src/main/res/drawable-v24/ic_launcher_foreground.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
||||
BIN
Mk88aud/src/main/res/drawable-xhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 212 B |
BIN
Mk88aud/src/main/res/drawable-xxhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 324 B |
170
Mk88aud/src/main/res/drawable/ic_launcher_background.xml
Normal file
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
||||
20
Mk88aud/src/main/res/drawable/input_bg.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/white">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape>
|
||||
<solid android:color="@android:color/transparent" />
|
||||
<corners android:radius="23dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 默认显⽰效果-->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/dialog_input_bg"/>
|
||||
<corners
|
||||
android:radius="3dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
|
||||
28
Mk88aud/src/main/res/drawable/pass_word_bg.xml
Normal 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>
|
||||
|
||||
23
Mk88aud/src/main/res/drawable/pass_word_bg1.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#FF0000"
|
||||
android:centerColor="#FF5555"
|
||||
android:endColor="#FBD3D0"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
23
Mk88aud/src/main/res/drawable/pass_word_bg2.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#000000"
|
||||
android:centerColor="#888888"
|
||||
android:endColor="#FFFFFF"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
5
Mk88aud/src/main/res/drawable/shape_btn_bg.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="22dp" />
|
||||
<solid android:color="@color/jisuanqi" />
|
||||
</shape>
|
||||
6
Mk88aud/src/main/res/drawable/shape_dialog_bg2.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:topRightRadius="12dp"
|
||||
android:topLeftRadius="12dp"/>
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
Mk88aud/src/main/res/drawable/shape_dialog_bg3.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="12dp" />
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
Mk88aud/src/main/res/drawable/shape_dialog_bg_new.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="20dp" />
|
||||
<solid android:color="@color/white" />
|
||||
</shape>
|
||||
5
Mk88aud/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
BIN
Mk88aud/src/main/res/mipmap-hdpi/ic_empty.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
Mk88aud/src/main/res/mipmap-hdpi/ic_pull_down.png
Normal file
|
After Width: | Height: | Size: 271 B |
BIN
Mk88aud/src/main/res/mipmap-xhdpi/ic_close.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
Mk88aud/src/main/res/mipmap-xhdpi/ic_menu.png
Normal file
|
After Width: | Height: | Size: 779 B |
BIN
Mk88aud/src/main/res/mipmap-xxhdpi/app_logo.png
Normal file
|
After Width: | Height: | Size: 376 KiB |
52
Mk88aud/src/main/res/values-en/strings.xml
Normal file
@@ -0,0 +1,52 @@
|
||||
<resources>
|
||||
<string name="app_name">MK88AUD</string>
|
||||
<string name="qsrlwmm_txt">Please Set Your Password</string>
|
||||
<string name="cancel_txt">Cancel</string>
|
||||
<string name="sure_txt">Sure</string>
|
||||
<string name="banbengengxin_txt">New Version Update</string>
|
||||
<string name="xiacigengxin_txt">Next Update</string>
|
||||
<string name="lijigengxin_txt">Update Immediately</string>
|
||||
<string name="app_updater_error_notification_content">Click to close notification</string>
|
||||
<string name="app_updater_error_notification_content_re_download">Click to re-download</string>
|
||||
<string name="app_updater_error_notification_title">Download failed</string>
|
||||
<string name="app_updater_finish_notification_content">Click to install</string>
|
||||
<string name="app_updater_finish_notification_title">Download completed</string>
|
||||
<string name="app_updater_progress_notification_content">Downloading...</string>
|
||||
<string name="app_updater_progress_notification_title">Version update</string>
|
||||
<string name="app_updater_progress_notification_title_2">Downloading game</string>
|
||||
<string name="app_updater_start_notification_content">Getting download data...</string>
|
||||
<string name="app_updater_start_notification_title">Version update</string>
|
||||
<string name="app_updater_start_notification_title_2">Downloading game</string>
|
||||
<string name="notification_title_txt">Need to turn on mobile phone notification permission</string>
|
||||
<string name="notification_cancel_txt">Exit</string>
|
||||
<string name="notification_setting_txt">Setting</string>
|
||||
<string name="app_tishi">Tip</string>
|
||||
<string name="app_hint">Please enter the invitation code</string>
|
||||
<string name="app_sharetitle">My invitation code:</string>
|
||||
<string name="app_sharetitle2">Superior invitation code:</string>
|
||||
<string name="app_totalinvite">Total number of invites:</string>
|
||||
<string name="app_sharecontent">App download link:</string>
|
||||
<string name="app_share">Share</string>
|
||||
<string name="app_checklist">Check Invitation Records</string>
|
||||
<string name="app_invitetitle">Invitation Records</string>
|
||||
<string name="app_checklist_number">Total number of invitees: %d</string>
|
||||
<string name="app_nodata">No Data</string>
|
||||
<string name="app_withdrawtitle">Withdrawal Record</string>
|
||||
<string name="app_withdrawapply_title">Withdrawal Application</string>
|
||||
<string name="app_bankinfo_title">Edit Bank Card Information</string>
|
||||
<string name="app_bankinfo_countrycode">60</string>
|
||||
<string name="app_bankinfo_name">Name:</string>
|
||||
<string name="app_bankinfo_name_hint">Please enter the bank card name</string>
|
||||
<string name="app_bankinfo_code">Bank card account:</string>
|
||||
<string name="app_bankinfo_code_hint">Please enter the bank card account</string>
|
||||
<string name="app_bankinfo_bankcountry">Country:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">Please select a country</string>
|
||||
<string name="app_bankinfo_bankname">Bank Name:</string>
|
||||
<string name="app_bankinfo_bankname_hint">Please select a bank name</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">Note: Please enter the country code before selecting the bank name!</string>
|
||||
<string name="app_balance">Balance: %s</string>
|
||||
<string name="app_totalearning">Total Earnings: %s</string>
|
||||
<string name="app_withdraw_amount">Amount: %s</string>
|
||||
<string name="app_withdraw_apply_hint">Please enter the withdrawal amount</string>
|
||||
<string name="app_toastapply">Withdrawal application has been submitted</string>
|
||||
</resources>
|
||||
69
Mk88aud/src/main/res/values-night/themes.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.Calculcator" parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_200</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/black</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_200</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</item>
|
||||
</style>
|
||||
</resources>
|
||||
18
Mk88aud/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="purple_200">#FFFFFF</color>
|
||||
<color name="purple_500">#FFFFFF</color>
|
||||
<color name="purple_700">#FFFFFF</color>
|
||||
<color name="teal_200">#FF03DAC5</color>
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="jisuanqi">#EF4723</color>
|
||||
<color name="notify_color">#FFFFFFFF</color>
|
||||
|
||||
<color name="dialog_bg">#2C2C2E</color>
|
||||
<color name="dialog_textcolor">#FFA722</color>
|
||||
<color name="dialog_input_bg">#434343</color>
|
||||
<color name="dialog_dark">#BCBCBC</color>
|
||||
|
||||
</resources>
|
||||
74
Mk88aud/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,74 @@
|
||||
<resources>
|
||||
<string name="app_name">MK88AUD</string>
|
||||
<string name="qsrlwmm_txt">请输入6位密码</string>
|
||||
<string name="cancel_txt">取消</string>
|
||||
<string name="sure_txt">确定</string>
|
||||
<string name="banbengengxin_txt">版本更新</string>
|
||||
<string name="xiacigengxin_txt">下次更新</string>
|
||||
<string name="lijigengxin_txt">立即更新</string>
|
||||
<string name="app_updater_error_notification_content">点击关闭通知</string>
|
||||
<string name="app_updater_error_notification_content_re_download">点击重新下载</string>
|
||||
<string name="app_updater_error_notification_title">下载失败</string>
|
||||
<string name="app_updater_finish_notification_content">点击安装</string>
|
||||
<string name="app_updater_finish_notification_title">下载完成</string>
|
||||
<string name="app_updater_progress_notification_content">正在下载…</string>
|
||||
<string name="app_updater_progress_notification_title">版本更新</string>
|
||||
<string name="app_updater_progress_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_title">版本更新</string>
|
||||
<string name="app_updater_start_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_content">正在获取下载数据…</string>
|
||||
<string name="notification_title_txt">需要打开手机通知权限</string>
|
||||
<string name="notification_cancel_txt">退出</string>
|
||||
<string name="notification_setting_txt">设置</string>
|
||||
<string name="app_tishi">提示</string>
|
||||
<string name="app_hint">请输入邀请码</string>
|
||||
<string name="app_sharetitle">我的邀请码:</string>
|
||||
<string name="app_sharetitle2">上级邀请码:</string>
|
||||
<string name="app_totalinvite">总邀请人数:</string>
|
||||
<string name="app_sharecontent">邀请您下载:</string>
|
||||
<string name="app_share">分享</string>
|
||||
<string name="app_checklist">查看邀请记录</string>
|
||||
<string name="app_invitetitle">邀请记录</string>
|
||||
<string name="app_checklist_number">总邀请人数: %d</string>
|
||||
<string name="app_nodata">暂无数据</string>
|
||||
<string name="app_withdrawtitle">提现记录</string>
|
||||
<string name="app_withdrawapply_title">提现申请</string>
|
||||
<string name="app_bankinfo_title">编辑银行卡信息</string>
|
||||
<string name="app_bankinfo_countrycode">86</string>
|
||||
<string name="app_bankinfo_name">持卡人姓名:</string>
|
||||
<string name="app_bankinfo_name_hint">请输入持卡人姓名</string>
|
||||
<string name="app_bankinfo_bankcountry">国家地区:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">请选择国家地区</string>
|
||||
<string name="app_bankinfo_bankname">开户行名称:</string>
|
||||
<string name="app_bankinfo_bankname_hint">请选择开户行名称</string>
|
||||
<string name="app_bankinfo_code">银行户口:</string>
|
||||
<string name="app_bankinfo_code_hint">请输入银行卡户口</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">(注:请先输入国家区号再选择开户行名称!)</string>
|
||||
<string name="app_balance">余额: %s</string>
|
||||
<string name="app_totalearning">总收益: %s</string>
|
||||
<string name="app_withdraw_amount">金额: %s</string>
|
||||
<string name="app_withdraw_apply_hint">请输入提现金额</string>
|
||||
<string name="app_toastapply">提现申请已提交</string>
|
||||
<!-- <string name="app_name">SPEEDAU</string>-->
|
||||
<!-- <string name="qsrlwmm_txt">Please Set Your Password</string>-->
|
||||
<!-- <string name="cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="sure_txt">Sure</string>-->
|
||||
<!-- <string name="banbengengxin_txt">New Version Update</string>-->
|
||||
<!-- <string name="xiacigengxin_txt">Next Update</string>-->
|
||||
<!-- <string name="lijigengxin_txt">Update Immediately</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content">Click to close notification</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content_re_download">Click to re-download</string>-->
|
||||
<!-- <string name="app_updater_error_notification_title">Download failed</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_content">Click to install</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_title">Download completed</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_content">Downloading...</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="app_updater_start_notification_content">Getting download data...</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="notification_title_txt">Need to turn on mobile phone notification permission</string>-->
|
||||
<!-- <string name="notification_cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="notification_setting_txt">Setting</string>-->
|
||||
|
||||
</resources>
|
||||
88
Mk88aud/src/main/res/values/themes.xml
Normal file
@@ -0,0 +1,88 @@
|
||||
<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. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</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>
|
||||
10
Mk88aud/src/main/res/xml/app_updater_paths.xml
Normal 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>
|
||||
4
Mk88aud/src/main/res/xml/network_security_config.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<network-security-config>
|
||||
<base-config cleartextTrafficPermitted="true" />
|
||||
</network-security-config>
|
||||
13
Mk88aud/src/main/res/xml/provider_paths.xml
Normal 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"异常的问题 -->
|
||||
@@ -0,0 +1,35 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void TestPattern(){
|
||||
//
|
||||
Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$");
|
||||
String a="+45.5";
|
||||
boolean matches = compile.matcher(a).matches();
|
||||
System.out.println(matches);
|
||||
String result = compile.matcher(a).replaceAll("");
|
||||
System.out.println(result);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
1
Mko888/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
91
Mko888/build.gradle
Normal file
@@ -0,0 +1,91 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'com.google.gms.google-services'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 31
|
||||
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.web.MKO888"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 31
|
||||
versionCode 106
|
||||
versionName "v1.0.6"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
signingConfigs {
|
||||
debug {
|
||||
storeFile file('mko888.jks')
|
||||
storePassword "android2014"
|
||||
keyAlias 'key0'
|
||||
keyPassword "android2014"
|
||||
}
|
||||
release {
|
||||
storeFile file('mko888.jks')
|
||||
storePassword "android2014"
|
||||
keyAlias 'key0'
|
||||
keyPassword "android2014"
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'com.google.android.material:material:1.1.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
testImplementation 'junit:junit:4.+'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar')
|
||||
|
||||
// okhttp相关库
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
|
||||
|
||||
// JSON解析库
|
||||
implementation 'com.google.code.gson:gson:2.9.0'
|
||||
implementation 'com.alibaba:fastjson:1.1.71.android'
|
||||
api 'com.squareup.retrofit2:retrofit:2.5.0'
|
||||
api 'com.squareup.retrofit2:converter-scalars:2.3.0'
|
||||
api 'com.squareup.retrofit2:converter-gson:2.4.0'
|
||||
api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
|
||||
api 'io.reactivex.rxjava2:rxjava:2.1.16'
|
||||
api 'io.reactivex.rxjava2:rxandroid:2.0.2'
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选)
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选)
|
||||
implementation 'com.github.Justson:Downloader:v5.0.4-androidx'
|
||||
//implementation 'com.tencent.tbs:tbssdk:44286'
|
||||
// sdk 33
|
||||
// implementation platform('com.google.firebase:firebase-bom:32.7.0')
|
||||
// Firebase Cloud Messaging
|
||||
// implementation("com.google.firebase:firebase-messaging")
|
||||
// implementation("com.google.firebase:firebase-analytics")
|
||||
|
||||
implementation platform('com.google.firebase:firebase-bom:32.1.0')
|
||||
|
||||
// Add the dependencies for the Firebase Cloud Messaging and Analytics libraries
|
||||
// When using the BoM, you don't specify versions in Firebase library dependencies
|
||||
implementation 'com.google.firebase:firebase-messaging'
|
||||
implementation 'com.google.firebase:firebase-analytics'
|
||||
// implementation("com.google.firebase:firebase-messaging:23.2.1")
|
||||
// implementation("com.google.firebase:firebase-analytics:21.2.1")
|
||||
// implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式
|
||||
implementation("com.github.bumptech.glide:glide:4.13.1")
|
||||
implementation project(path: ':base')
|
||||
}
|
||||
29
Mko888/google-services.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "542008271037",
|
||||
"project_id": "mko888",
|
||||
"storage_bucket": "mko888.firebasestorage.app"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:542008271037:android:afa77592f5cb7f5fd957d4",
|
||||
"android_client_info": {
|
||||
"package_name": "com.web.MKO888"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyBxl0WvwdSZbH0_Eec_zeRvP7KwOnIqmuY"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
BIN
Mko888/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar
Normal file
BIN
Mko888/mko888.jks
Normal file
32
Mko888/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
||||
-dontwarn dalvik.**
|
||||
-dontwarn com.tencent.smtt.**
|
||||
|
||||
-keep class com.tencent.smtt.** {
|
||||
*;
|
||||
}
|
||||
|
||||
-keep class com.tencent.tbs.** {
|
||||
*;
|
||||
}
|
||||
BIN
Mko888/release/Mko888.apk
Normal file
18
Mko888/release/output-metadata.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"version": 2,
|
||||
"artifactType": {
|
||||
"type": "APK",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "com.web.MKO888",
|
||||
"variantName": "processReleaseResources",
|
||||
"elements": [
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"versionCode": 106,
|
||||
"versionName": "v1.0.6",
|
||||
"outputFile": "Mko888-release.apk"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("Tptogiar.calculcator", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
112
Mko888/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,112 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.web.MKO888">
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera"
|
||||
android:required="false" />
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera2"
|
||||
android:required="false" />
|
||||
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS" /> <!-- 获取通讯录-->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<!-- 多媒体相关 -->
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
|
||||
<!-- 8.0+系统需要-->
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
|
||||
<!--推送权限-->
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_SECURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.RECORD_AUDIO" />-->
|
||||
|
||||
|
||||
<!-- <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_AUDIO_OUTPUT" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.autofocus" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.front" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.level.full" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.capability.raw" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.any" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.microphone" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera2" android:required="true" />-->
|
||||
|
||||
<queries>
|
||||
<intent>
|
||||
<action android:name="android.media.action.IMAGE_CAPTURE" />
|
||||
</intent>
|
||||
</queries>
|
||||
<application
|
||||
android:name=".WebApplication"
|
||||
android:allowBackup="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:icon="@mipmap/app_logo"
|
||||
android:label="@string/app_name"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:roundIcon="@mipmap/app_logo"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.AppTheme"
|
||||
android:usesCleartextTraffic="true">
|
||||
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity2"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:exported="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:theme="@style/AppThemeStart">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<service
|
||||
android:name="com.tencent.smtt.export.external.DexClassLoaderProviderService"
|
||||
android:label="dexopt"
|
||||
android:process=":dexopt" />
|
||||
|
||||
|
||||
<!-- android:directBootAware="true" 为应用启用消息处理直接启动模式-->
|
||||
<service
|
||||
android:name=".MyFirebaseMessageingService"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<!-- Set custom default icon. This is used when no icon is set for incoming notification messages.
|
||||
See README(https://goo.gl/l4GJaQ) for more. 设置推送默认图标 和颜色-->
|
||||
<meta-data
|
||||
android:name="com.google.firebase.messaging.default_notification_icon"
|
||||
android:resource="@mipmap/app_logo" />
|
||||
<!-- Set color used with incoming notification messages. This is used when no color is set for the incoming
|
||||
notification message. See README(https://goo.gl/6BKBk7) for more. -->
|
||||
<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" />
|
||||
<!-- 还可设置推送渠道 -->
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.google.firebase.messaging.default_notification_channel_id"-->
|
||||
<!-- android:value="@string/default_notification_channel_id" />-->
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
54
Mko888/src/main/java/com/web/MKO888/MainActivity2.java
Normal file
@@ -0,0 +1,54 @@
|
||||
package com.web.MKO888;
|
||||
|
||||
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.android.gms.tasks.OnCompleteListener;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.firebase.messaging.FirebaseMessaging;
|
||||
import com.web.base.MainActivity;
|
||||
|
||||
public class MainActivity2 extends com.web.base.MainActivity2 {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
userId = 96;
|
||||
saveInt(MainActivity2.this,"user_code",userId);
|
||||
saveInt(MainActivity2.this,"version_code",getVersion());
|
||||
MainActivity.saveString(this, "base_url", "https://www.mko888.net/");
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
//订阅主题
|
||||
FirebaseMessaging.getInstance().subscribeToTopic("demo")
|
||||
.addOnCompleteListener(new OnCompleteListener<Void>() {
|
||||
@Override
|
||||
public void onComplete(@NonNull Task<Void> task) {
|
||||
String msg = "Subscribed";
|
||||
if (!task.isSuccessful()) {
|
||||
msg = "Subscribe failed";
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public int getVersion(){
|
||||
try {
|
||||
PackageManager packageManager = getPackageManager();
|
||||
PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0);
|
||||
String StringversionName = packageInfo.versionName; // 版本号
|
||||
int versionCode = packageInfo.versionCode; // 版本码
|
||||
// 在这里可以使用versionName和versionCode进行相关的操作
|
||||
// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode);
|
||||
return versionCode;
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
package com.web.MKO888;
|
||||
|
||||
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.web.base.GsonUtils;
|
||||
import com.web.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);
|
||||
// if (remoteMessage.getNotification() != null) {
|
||||
// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
// }
|
||||
} else {
|
||||
//收到通知 创建notify
|
||||
if (remoteMessage.getNotification() != null) {
|
||||
showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void showNotification(MessageInfo messageInfo) {
|
||||
Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.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);
|
||||
|
||||
// Intent notifyIntent = new Intent(this, MainActivity2.class);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
// // notifyIntent.putExtra("message", messageInfo);
|
||||
// notifyIntent.setAction(Intent.ACTION_VIEW);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须
|
||||
// PendingIntent pendingIntent;
|
||||
// pendingIntent = PendingIntent.getActivity
|
||||
// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | 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(com.web.base.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(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(messageInfo.getTitle())
|
||||
.setContentText(messageInfo.getContent())
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.R.mipmap.ic_launcher)
|
||||
.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, MainActivity2.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(com.web.base.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(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
}
|
||||
notificationManager.notify(0, notificationBuilder.build());
|
||||
//存储数据
|
||||
// saveNotifyMessage(body);
|
||||
}
|
||||
|
||||
|
||||
// public void saveNotifyMessage(String body) {
|
||||
// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class);
|
||||
// String savenotify = Utils.get(getApplication(),ApiService.savenotify,"");
|
||||
// if(messageInfo!=null){
|
||||
// if(TextUtils.isEmpty(savenotify)){
|
||||
// GsonUtils.getListFromJSON(savenotify,)
|
||||
// }
|
||||
// }
|
||||
// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @param key 要设置的key
|
||||
// */
|
||||
// public static void set(Context activity, String key, String is) {
|
||||
// SharedPreferences nameSetting = getConfigShared(activity);
|
||||
// SharedPreferences.Editor namePref = nameSetting.edit();
|
||||
// namePref.putString(key, is);
|
||||
// namePref.commit();
|
||||
// }
|
||||
}
|
||||
37
Mko888/src/main/java/com/web/MKO888/WebApplication.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.web.MKO888;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
|
||||
import com.tencent.smtt.export.external.TbsCoreSettings;
|
||||
import com.tencent.smtt.sdk.QbSdk;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class WebApplication extends Application {
|
||||
|
||||
|
||||
public static Context application;
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
// 设置开启优化方案
|
||||
application = this;
|
||||
HashMap map = new HashMap();
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true);
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true);
|
||||
QbSdk.initTbsSettings(map);
|
||||
QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() {
|
||||
@Override
|
||||
public void onCoreInitFinished() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewInitFinished(boolean b) {
|
||||
|
||||
}
|
||||
});
|
||||
QbSdk.setDownloadWithoutWifi(true);
|
||||
}
|
||||
}
|
||||
11
Mko888/src/main/res/drawable-anydpi/ic_action_back.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="#333333"
|
||||
android:alpha="0.8">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
|
||||
</vector>
|
||||
BIN
Mko888/src/main/res/drawable-hdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 182 B |
BIN
Mko888/src/main/res/drawable-mdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 150 B |
30
Mko888/src/main/res/drawable-v24/ic_launcher_foreground.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
||||
BIN
Mko888/src/main/res/drawable-xhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 212 B |
BIN
Mko888/src/main/res/drawable-xxhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 324 B |
170
Mko888/src/main/res/drawable/ic_launcher_background.xml
Normal file
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
||||
20
Mko888/src/main/res/drawable/input_bg.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/white">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape>
|
||||
<solid android:color="@android:color/transparent" />
|
||||
<corners android:radius="23dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 默认显⽰效果-->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/dialog_input_bg"/>
|
||||
<corners
|
||||
android:radius="3dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
|
||||
28
Mko888/src/main/res/drawable/pass_word_bg.xml
Normal 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>
|
||||
|
||||
23
Mko888/src/main/res/drawable/pass_word_bg1.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#FF0000"
|
||||
android:centerColor="#FF5555"
|
||||
android:endColor="#FBD3D0"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
23
Mko888/src/main/res/drawable/pass_word_bg2.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#000000"
|
||||
android:centerColor="#888888"
|
||||
android:endColor="#FFFFFF"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
5
Mko888/src/main/res/drawable/shape_btn_bg.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="22dp" />
|
||||
<solid android:color="@color/jisuanqi" />
|
||||
</shape>
|
||||
6
Mko888/src/main/res/drawable/shape_dialog_bg2.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:topRightRadius="12dp"
|
||||
android:topLeftRadius="12dp"/>
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
Mko888/src/main/res/drawable/shape_dialog_bg3.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="12dp" />
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
Mko888/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
BIN
Mko888/src/main/res/mipmap-hdpi/ic_empty.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
Mko888/src/main/res/mipmap-hdpi/ic_pull_down.png
Normal file
|
After Width: | Height: | Size: 271 B |
BIN
Mko888/src/main/res/mipmap-xhdpi/ic_close.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
Mko888/src/main/res/mipmap-xhdpi/ic_facebook.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
Mko888/src/main/res/mipmap-xhdpi/ic_hometo.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
Mko888/src/main/res/mipmap-xhdpi/ic_link.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
Mko888/src/main/res/mipmap-xhdpi/ic_menu.png
Normal file
|
After Width: | Height: | Size: 779 B |
BIN
Mko888/src/main/res/mipmap-xhdpi/ic_shousuo.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
Mko888/src/main/res/mipmap-xhdpi/ic_tel.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
Mko888/src/main/res/mipmap-xhdpi/ic_whatsapp.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
Mko888/src/main/res/mipmap-xhdpi/ic_zhangkai.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
Mko888/src/main/res/mipmap-xxhdpi/app_logo.png
Normal file
|
After Width: | Height: | Size: 149 KiB |
54
Mko888/src/main/res/values-en/strings.xml
Normal file
@@ -0,0 +1,54 @@
|
||||
<resources>
|
||||
<string name="app_name">MKO888</string>
|
||||
<string name="qsrlwmm_txt">Please Set Your Password</string>
|
||||
<string name="cancel_txt">Cancel</string>
|
||||
<string name="sure_txt">Sure</string>
|
||||
<string name="banbengengxin_txt">New Version Update</string>
|
||||
<string name="xiacigengxin_txt">Next Update</string>
|
||||
<string name="lijigengxin_txt">Update Immediately</string>
|
||||
<string name="app_updater_error_notification_content">Click to close notification</string>
|
||||
<string name="app_updater_error_notification_content_re_download">Click to re-download</string>
|
||||
<string name="app_updater_error_notification_title">Download failed</string>
|
||||
<string name="app_updater_finish_notification_content">Click to install</string>
|
||||
<string name="app_updater_finish_notification_title">Download completed</string>
|
||||
<string name="app_updater_progress_notification_content">Downloading...</string>
|
||||
<string name="app_updater_progress_notification_title">Version update</string>
|
||||
<string name="app_updater_progress_notification_title_2">Downloading game</string>
|
||||
<string name="app_updater_start_notification_content">Getting download data...</string>
|
||||
<string name="app_updater_start_notification_title">Version update</string>
|
||||
<string name="app_updater_start_notification_title_2">Downloading game</string>
|
||||
<string name="notification_title_txt">Need to turn on mobile phone notification permission</string>
|
||||
<string name="notification_cancel_txt">Exit</string>
|
||||
<string name="notification_setting_txt">Setting</string>
|
||||
<string name="app_tishi">Tip</string>
|
||||
<string name="app_hint">Please enter the invitation code</string>
|
||||
<string name="app_sharetitle">My invitation code:</string>
|
||||
<string name="app_sharetitle2">Superior invitation code:</string>
|
||||
<string name="app_totalinvite">Total number of invites:</string>
|
||||
<string name="app_sharecontent">App download link:</string>
|
||||
<string name="app_share">Share</string>
|
||||
<string name="app_checklist">Check Invitation Records</string>
|
||||
<string name="app_invitetitle">Invitation Records</string>
|
||||
<string name="app_checklist_number">Total number of invitees: %d</string>
|
||||
<string name="app_nodata">No Data</string>
|
||||
<string name="app_withdrawtitle">Withdrawal Record</string>
|
||||
<string name="app_withdrawapply_title">Withdrawal Application</string>
|
||||
<string name="app_bankinfo_title">Edit Bank Card Information</string>
|
||||
<string name="app_bankinfo_countrycode">60</string>
|
||||
<string name="app_bankinfo_name">Name:</string>
|
||||
<string name="app_bankinfo_name_hint">Please enter the bank card name</string>
|
||||
<string name="app_bankinfo_code">Bank card account:</string>
|
||||
<string name="app_bankinfo_code_hint">Please enter the bank card account</string>
|
||||
<string name="app_bankinfo_bankcountry">Country:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">Please select a country</string>
|
||||
<string name="app_bankinfo_bankname">Bank Name:</string>
|
||||
<string name="app_bankinfo_bankname_hint">Please select a bank name</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">Note: Please enter the country code before selecting the bank name!</string>
|
||||
<string name="app_balance">Balance: %s</string>
|
||||
<string name="app_totalearning">Total Earnings: %s</string>
|
||||
<string name="app_withdraw_amount">Amount: %s</string>
|
||||
<string name="app_withdraw_apply_hint">Please enter the withdrawal amount</string>
|
||||
<string name="app_toastapply">Withdrawal application has been submitted</string>
|
||||
<string name="app_notinstall">App not installed</string>
|
||||
|
||||
</resources>
|
||||
69
Mko888/src/main/res/values-night/themes.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.Calculcator" parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_200</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/black</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_200</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</item>
|
||||
</style>
|
||||
</resources>
|
||||
19
Mko888/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="purple_200">#FFFFFF</color>
|
||||
<color name="purple_500">#FFFFFF</color>
|
||||
<color name="purple_700">#FFFFFF</color>
|
||||
<color name="teal_200">#FF03DAC5</color>
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="jisuanqi">#EF4723</color>
|
||||
<color name="notify_color">#FFFFFFFF</color>
|
||||
|
||||
<color name="dialog_bg">#2C2C2E</color>
|
||||
<color name="dialog_textcolor">#FFA722</color>
|
||||
<color name="dialog_input_bg">#434343</color>
|
||||
<color name="dialog_dark">#BCBCBC</color>
|
||||
<color name="color_red">#DC1927</color>
|
||||
|
||||
</resources>
|
||||
77
Mko888/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,77 @@
|
||||
<resources>
|
||||
<string name="app_name">MKO888</string>
|
||||
<string name="qsrlwmm_txt">请输入6位密码</string>
|
||||
<string name="cancel_txt">取消</string>
|
||||
<string name="sure_txt">确定</string>
|
||||
<string name="banbengengxin_txt">版本更新</string>
|
||||
<string name="xiacigengxin_txt">下次更新</string>
|
||||
<string name="lijigengxin_txt">立即更新</string>
|
||||
<string name="app_updater_error_notification_content">点击关闭通知</string>
|
||||
<string name="app_updater_error_notification_content_re_download">点击重新下载</string>
|
||||
<string name="app_updater_error_notification_title">下载失败</string>
|
||||
<string name="app_updater_finish_notification_content">点击安装</string>
|
||||
<string name="app_updater_finish_notification_title">下载完成</string>
|
||||
<string name="app_updater_progress_notification_content">正在下载…</string>
|
||||
<string name="app_updater_progress_notification_title">版本更新</string>
|
||||
<string name="app_updater_progress_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_title">版本更新</string>
|
||||
<string name="app_updater_start_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_content">正在获取下载数据…</string>
|
||||
<string name="notification_title_txt">需要打开手机通知权限</string>
|
||||
<string name="notification_cancel_txt">退出</string>
|
||||
<string name="notification_setting_txt">设置</string>
|
||||
<string name="app_tishi">提示</string>
|
||||
<string name="app_hint">请输入邀请码</string>
|
||||
<string name="app_sharetitle">我的邀请码:</string>
|
||||
<string name="app_sharetitle2">上级邀请码:</string>
|
||||
<string name="app_totalinvite">总邀请人数:</string>
|
||||
<string name="app_sharecontent">邀请您下载:</string>
|
||||
<string name="app_share">分享</string>
|
||||
<string name="app_checklist">查看邀请记录</string>
|
||||
<string name="app_invitetitle">邀请记录</string>
|
||||
<string name="app_checklist_number">总邀请人数: %d</string>
|
||||
<string name="app_nodata">暂无数据</string>
|
||||
<string name="app_withdrawtitle">提现记录</string>
|
||||
<string name="app_withdrawapply_title">提现申请</string>
|
||||
<string name="app_bankinfo_title">编辑银行卡信息</string>
|
||||
<string name="app_bankinfo_countrycode">86</string>
|
||||
<string name="app_bankinfo_name">持卡人姓名:</string>
|
||||
<string name="app_bankinfo_name_hint">请输入持卡人姓名</string>
|
||||
<string name="app_bankinfo_bankcountry">国家地区:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">请选择国家地区</string>
|
||||
<string name="app_bankinfo_bankname">开户行名称:</string>
|
||||
<string name="app_bankinfo_bankname_hint">请选择开户行名称</string>
|
||||
<string name="app_bankinfo_code">银行户口:</string>
|
||||
<string name="app_bankinfo_code_hint">请输入银行卡户口</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">(注:请先输入国家区号再选择开户行名称!)</string>
|
||||
<string name="app_balance">余额: %s</string>
|
||||
<string name="app_totalearning">总收益: %s</string>
|
||||
<string name="app_withdraw_amount">金额: %s</string>
|
||||
<string name="app_withdraw_apply_hint">请输入提现金额</string>
|
||||
<string name="app_toastapply">提现申请已提交</string>
|
||||
<string name="app_notinstall">应用未安装</string>
|
||||
|
||||
|
||||
<!-- <string name="app_name">SPEEDAU</string>-->
|
||||
<!-- <string name="qsrlwmm_txt">Please Set Your Password</string>-->
|
||||
<!-- <string name="cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="sure_txt">Sure</string>-->
|
||||
<!-- <string name="banbengengxin_txt">New Version Update</string>-->
|
||||
<!-- <string name="xiacigengxin_txt">Next Update</string>-->
|
||||
<!-- <string name="lijigengxin_txt">Update Immediately</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content">Click to close notification</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content_re_download">Click to re-download</string>-->
|
||||
<!-- <string name="app_updater_error_notification_title">Download failed</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_content">Click to install</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_title">Download completed</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_content">Downloading...</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="app_updater_start_notification_content">Getting download data...</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="notification_title_txt">Need to turn on mobile phone notification permission</string>-->
|
||||
<!-- <string name="notification_cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="notification_setting_txt">Setting</string>-->
|
||||
|
||||
</resources>
|
||||
20
Mko888/src/main/res/values/style.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="AppThemeStart1" parent="@style/Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="android:windowTranslucentStatus">true</item>
|
||||
<item name="android:windowTranslucentNavigation">false</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="colorPrimary">@android:color/transparent</item>
|
||||
<item name="colorPrimaryDark">@android:color/transparent</item>
|
||||
<item name="colorAccent">@android:color/transparent</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<!-- 隐藏Activity窗口的Title标题栏 -->
|
||||
<item name="windowNoTitle">true</item>
|
||||
<!-- <item name="android:windowFullscreen">true</item>-->
|
||||
<item name="android:windowBackground">@color/white</item>
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</item>
|
||||
</style>
|
||||
</resources>
|
||||
89
Mko888/src/main/res/values/themes.xml
Normal file
@@ -0,0 +1,89 @@
|
||||
<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. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
<item name="android:enforceNavigationBarContrast" tools:ignore="NewApi">false</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</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>
|
||||
10
Mko888/src/main/res/xml/app_updater_paths.xml
Normal 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>
|
||||
4
Mko888/src/main/res/xml/network_security_config.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<network-security-config>
|
||||
<base-config cleartextTrafficPermitted="true" />
|
||||
</network-security-config>
|
||||
13
Mko888/src/main/res/xml/provider_paths.xml
Normal 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"异常的问题 -->
|
||||
@@ -0,0 +1,35 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void TestPattern(){
|
||||
//
|
||||
Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$");
|
||||
String a="+45.5";
|
||||
boolean matches = compile.matcher(a).matches();
|
||||
System.out.println(matches);
|
||||
String result = compile.matcher(a).replaceAll("");
|
||||
System.out.println(result);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
1
Petron777/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
92
Petron777/build.gradle
Normal file
@@ -0,0 +1,92 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'com.google.gms.google-services'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 31
|
||||
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.web.petron777"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 31
|
||||
versionCode 106
|
||||
versionName "v1.0.6"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
signingConfigs {
|
||||
debug {
|
||||
storeFile file('petron777.jks')
|
||||
storePassword "android2014"
|
||||
keyAlias 'key0'
|
||||
keyPassword "android2014"
|
||||
}
|
||||
release {
|
||||
storeFile file('petron777.jks')
|
||||
storePassword "android2014"
|
||||
keyAlias 'key0'
|
||||
keyPassword "android2014"
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'com.google.android.material:material:1.1.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
testImplementation 'junit:junit:4.+'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar')
|
||||
|
||||
// okhttp相关库
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
|
||||
|
||||
// JSON解析库
|
||||
implementation 'com.google.code.gson:gson:2.9.0'
|
||||
implementation 'com.alibaba:fastjson:1.1.71.android'
|
||||
api 'com.squareup.retrofit2:retrofit:2.5.0'
|
||||
api 'com.squareup.retrofit2:converter-scalars:2.3.0'
|
||||
api 'com.squareup.retrofit2:converter-gson:2.4.0'
|
||||
api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
|
||||
api 'io.reactivex.rxjava2:rxjava:2.1.16'
|
||||
api 'io.reactivex.rxjava2:rxandroid:2.0.2'
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选)
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选)
|
||||
implementation 'com.github.Justson:Downloader:v5.0.4-androidx'
|
||||
//implementation 'com.tencent.tbs:tbssdk:44286'
|
||||
// sdk 33
|
||||
// implementation platform('com.google.firebase:firebase-bom:32.7.0')
|
||||
// Firebase Cloud Messaging
|
||||
// implementation("com.google.firebase:firebase-messaging")
|
||||
// implementation("com.google.firebase:firebase-analytics")
|
||||
|
||||
implementation platform('com.google.firebase:firebase-bom:32.1.0')
|
||||
|
||||
// Add the dependencies for the Firebase Cloud Messaging and Analytics libraries
|
||||
// When using the BoM, you don't specify versions in Firebase library dependencies
|
||||
implementation 'com.google.firebase:firebase-messaging'
|
||||
implementation 'com.google.firebase:firebase-analytics'
|
||||
// implementation("com.google.firebase:firebase-messaging:23.2.1")
|
||||
// implementation("com.google.firebase:firebase-analytics:21.2.1")
|
||||
// implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式
|
||||
implementation("com.github.bumptech.glide:glide:4.13.1")
|
||||
implementation project(path: ':base')
|
||||
|
||||
}
|
||||
29
Petron777/google-services.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "58444174936",
|
||||
"project_id": "petron777-7720f",
|
||||
"storage_bucket": "petron777-7720f.firebasestorage.app"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:58444174936:android:cbed18389c63a6b1c8dc2d",
|
||||
"android_client_info": {
|
||||
"package_name": "com.web.petron777"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyBwhI_8NkjpJWrvnuETE-HhKnuh1Rv2qKc"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
BIN
Petron777/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar
Normal file
BIN
Petron777/petron777.jks
Normal file
32
Petron777/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
||||
-dontwarn dalvik.**
|
||||
-dontwarn com.tencent.smtt.**
|
||||
|
||||
-keep class com.tencent.smtt.** {
|
||||
*;
|
||||
}
|
||||
|
||||
-keep class com.tencent.tbs.** {
|
||||
*;
|
||||
}
|
||||
BIN
Petron777/release/Petron777.apk
Normal file
18
Petron777/release/output-metadata.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"version": 2,
|
||||
"artifactType": {
|
||||
"type": "APK",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "com.web.petron777",
|
||||
"variantName": "processReleaseResources",
|
||||
"elements": [
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"versionCode": 106,
|
||||
"versionName": "v1.0.6",
|
||||
"outputFile": "Petron777-release.apk"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("Tptogiar.calculcator", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
114
Petron777/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.web.petron777">
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera"
|
||||
android:required="false" />
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera2"
|
||||
android:required="false" />
|
||||
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS" /> <!-- 获取通讯录-->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<!-- 多媒体相关 -->
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
|
||||
<!-- 8.0+系统需要-->
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
|
||||
<!--推送权限-->
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_SECURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.RECORD_AUDIO" />-->
|
||||
|
||||
|
||||
<!-- <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_AUDIO_OUTPUT" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.autofocus" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.front" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.level.full" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.capability.raw" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.any" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.microphone" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera2" android:required="true" />-->
|
||||
|
||||
<queries>
|
||||
<intent>
|
||||
<action android:name="android.media.action.IMAGE_CAPTURE" />
|
||||
</intent>
|
||||
</queries>
|
||||
<application
|
||||
android:name=".WebApplication"
|
||||
android:allowBackup="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:icon="@mipmap/app_logo"
|
||||
android:label="@string/app_name"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:roundIcon="@mipmap/app_logo"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.AppTheme"
|
||||
android:usesCleartextTraffic="true">
|
||||
|
||||
|
||||
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity2"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:exported="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:theme="@style/AppThemeStart">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<service
|
||||
android:name="com.tencent.smtt.export.external.DexClassLoaderProviderService"
|
||||
android:label="dexopt"
|
||||
android:process=":dexopt" />
|
||||
|
||||
|
||||
<!-- android:directBootAware="true" 为应用启用消息处理直接启动模式-->
|
||||
<service
|
||||
android:name=".MyFirebaseMessageingService"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<!-- Set custom default icon. This is used when no icon is set for incoming notification messages.
|
||||
See README(https://goo.gl/l4GJaQ) for more. 设置推送默认图标 和颜色-->
|
||||
<meta-data
|
||||
android:name="com.google.firebase.messaging.default_notification_icon"
|
||||
android:resource="@mipmap/app_logo" />
|
||||
<!-- Set color used with incoming notification messages. This is used when no color is set for the incoming
|
||||
notification message. See README(https://goo.gl/6BKBk7) for more. -->
|
||||
<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" />
|
||||
<!-- 还可设置推送渠道 -->
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.google.firebase.messaging.default_notification_channel_id"-->
|
||||
<!-- android:value="@string/default_notification_channel_id" />-->
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
54
Petron777/src/main/java/com/web/petron777/MainActivity2.java
Normal file
@@ -0,0 +1,54 @@
|
||||
package com.web.petron777;
|
||||
|
||||
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.android.gms.tasks.OnCompleteListener;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.firebase.messaging.FirebaseMessaging;
|
||||
import com.web.base.MainActivity;
|
||||
|
||||
public class MainActivity2 extends com.web.base.MainActivity2 {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
userId = 97;
|
||||
saveInt(MainActivity2.this,"user_code",userId);
|
||||
saveInt(MainActivity2.this,"version_code",getVersion());
|
||||
MainActivity.saveString(this, "base_url", "https://p777.asia/");
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
//订阅主题
|
||||
FirebaseMessaging.getInstance().subscribeToTopic("demo")
|
||||
.addOnCompleteListener(new OnCompleteListener<Void>() {
|
||||
@Override
|
||||
public void onComplete(@NonNull Task<Void> task) {
|
||||
String msg = "Subscribed";
|
||||
if (!task.isSuccessful()) {
|
||||
msg = "Subscribe failed";
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public int getVersion(){
|
||||
try {
|
||||
PackageManager packageManager = getPackageManager();
|
||||
PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0);
|
||||
String StringversionName = packageInfo.versionName; // 版本号
|
||||
int versionCode = packageInfo.versionCode; // 版本码
|
||||
// 在这里可以使用versionName和versionCode进行相关的操作
|
||||
// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode);
|
||||
return versionCode;
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
package com.web.petron777;
|
||||
|
||||
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.web.base.GsonUtils;
|
||||
import com.web.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);
|
||||
// if (remoteMessage.getNotification() != null) {
|
||||
// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
// }
|
||||
} else {
|
||||
//收到通知 创建notify
|
||||
if (remoteMessage.getNotification() != null) {
|
||||
showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void showNotification(MessageInfo messageInfo) {
|
||||
Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.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);
|
||||
|
||||
// Intent notifyIntent = new Intent(this, MainActivity2.class);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
// // notifyIntent.putExtra("message", messageInfo);
|
||||
// notifyIntent.setAction(Intent.ACTION_VIEW);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须
|
||||
// PendingIntent pendingIntent;
|
||||
// pendingIntent = PendingIntent.getActivity
|
||||
// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | 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(com.web.base.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(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(messageInfo.getTitle())
|
||||
.setContentText(messageInfo.getContent())
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.R.mipmap.ic_launcher)
|
||||
.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, MainActivity2.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(com.web.base.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(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.R.mipmap.ic_launcher)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
}
|
||||
notificationManager.notify(0, notificationBuilder.build());
|
||||
//存储数据
|
||||
// saveNotifyMessage(body);
|
||||
}
|
||||
|
||||
|
||||
// public void saveNotifyMessage(String body) {
|
||||
// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class);
|
||||
// String savenotify = Utils.get(getApplication(),ApiService.savenotify,"");
|
||||
// if(messageInfo!=null){
|
||||
// if(TextUtils.isEmpty(savenotify)){
|
||||
// GsonUtils.getListFromJSON(savenotify,)
|
||||
// }
|
||||
// }
|
||||
// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @param key 要设置的key
|
||||
// */
|
||||
// public static void set(Context activity, String key, String is) {
|
||||
// SharedPreferences nameSetting = getConfigShared(activity);
|
||||
// SharedPreferences.Editor namePref = nameSetting.edit();
|
||||
// namePref.putString(key, is);
|
||||
// namePref.commit();
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.web.petron777;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
|
||||
import com.tencent.smtt.export.external.TbsCoreSettings;
|
||||
import com.tencent.smtt.sdk.QbSdk;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class WebApplication extends Application {
|
||||
|
||||
|
||||
public static Context application;
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
// 设置开启优化方案
|
||||
application = this;
|
||||
HashMap map = new HashMap();
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true);
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true);
|
||||
QbSdk.initTbsSettings(map);
|
||||
QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() {
|
||||
@Override
|
||||
public void onCoreInitFinished() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewInitFinished(boolean b) {
|
||||
|
||||
}
|
||||
});
|
||||
QbSdk.setDownloadWithoutWifi(true);
|
||||
}
|
||||
}
|
||||
11
Petron777/src/main/res/drawable-anydpi/ic_action_back.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="#333333"
|
||||
android:alpha="0.8">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
|
||||
</vector>
|
||||
BIN
Petron777/src/main/res/drawable-hdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 182 B |
BIN
Petron777/src/main/res/drawable-mdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 150 B |
@@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
||||
BIN
Petron777/src/main/res/drawable-xhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 212 B |
BIN
Petron777/src/main/res/drawable-xxhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 324 B |
170
Petron777/src/main/res/drawable/ic_launcher_background.xml
Normal file
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
||||
20
Petron777/src/main/res/drawable/input_bg.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/white">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape>
|
||||
<solid android:color="@android:color/transparent" />
|
||||
<corners android:radius="23dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 默认显⽰效果-->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/dialog_input_bg"/>
|
||||
<corners
|
||||
android:radius="3dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
|
||||
28
Petron777/src/main/res/drawable/pass_word_bg.xml
Normal 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>
|
||||
|
||||
23
Petron777/src/main/res/drawable/pass_word_bg1.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#FF0000"
|
||||
android:centerColor="#FF5555"
|
||||
android:endColor="#FBD3D0"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
23
Petron777/src/main/res/drawable/pass_word_bg2.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#000000"
|
||||
android:centerColor="#888888"
|
||||
android:endColor="#FFFFFF"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
5
Petron777/src/main/res/drawable/shape_btn_bg.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="22dp" />
|
||||
<solid android:color="@color/jisuanqi" />
|
||||
</shape>
|
||||
6
Petron777/src/main/res/drawable/shape_dialog_bg2.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:topRightRadius="12dp"
|
||||
android:topLeftRadius="12dp"/>
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
Petron777/src/main/res/drawable/shape_dialog_bg3.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="12dp" />
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
Petron777/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
BIN
Petron777/src/main/res/mipmap-hdpi/ic_empty.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
Petron777/src/main/res/mipmap-hdpi/ic_pull_down.png
Normal file
|
After Width: | Height: | Size: 271 B |
BIN
Petron777/src/main/res/mipmap-xhdpi/ic_close.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
Petron777/src/main/res/mipmap-xhdpi/ic_facebook.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
Petron777/src/main/res/mipmap-xhdpi/ic_hometo.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
Petron777/src/main/res/mipmap-xhdpi/ic_link.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
Petron777/src/main/res/mipmap-xhdpi/ic_menu.png
Normal file
|
After Width: | Height: | Size: 779 B |
BIN
Petron777/src/main/res/mipmap-xhdpi/ic_shousuo.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
Petron777/src/main/res/mipmap-xhdpi/ic_tel.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
Petron777/src/main/res/mipmap-xhdpi/ic_whatsapp.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
Petron777/src/main/res/mipmap-xhdpi/ic_zhangkai.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
Petron777/src/main/res/mipmap-xxhdpi/app_logo.png
Normal file
|
After Width: | Height: | Size: 197 KiB |
54
Petron777/src/main/res/values-en/strings.xml
Normal file
@@ -0,0 +1,54 @@
|
||||
<resources>
|
||||
<string name="app_name">Petron777</string>
|
||||
<string name="qsrlwmm_txt">Please Set Your Password</string>
|
||||
<string name="cancel_txt">Cancel</string>
|
||||
<string name="sure_txt">Sure</string>
|
||||
<string name="banbengengxin_txt">New Version Update</string>
|
||||
<string name="xiacigengxin_txt">Next Update</string>
|
||||
<string name="lijigengxin_txt">Update Immediately</string>
|
||||
<string name="app_updater_error_notification_content">Click to close notification</string>
|
||||
<string name="app_updater_error_notification_content_re_download">Click to re-download</string>
|
||||
<string name="app_updater_error_notification_title">Download failed</string>
|
||||
<string name="app_updater_finish_notification_content">Click to install</string>
|
||||
<string name="app_updater_finish_notification_title">Download completed</string>
|
||||
<string name="app_updater_progress_notification_content">Downloading...</string>
|
||||
<string name="app_updater_progress_notification_title">Version update</string>
|
||||
<string name="app_updater_progress_notification_title_2">Downloading game</string>
|
||||
<string name="app_updater_start_notification_content">Getting download data...</string>
|
||||
<string name="app_updater_start_notification_title">Version update</string>
|
||||
<string name="app_updater_start_notification_title_2">Downloading game</string>
|
||||
<string name="notification_title_txt">Need to turn on mobile phone notification permission</string>
|
||||
<string name="notification_cancel_txt">Exit</string>
|
||||
<string name="notification_setting_txt">Setting</string>
|
||||
<string name="app_tishi">Tip</string>
|
||||
<string name="app_hint">Please enter the invitation code</string>
|
||||
<string name="app_sharetitle">My invitation code:</string>
|
||||
<string name="app_sharetitle2">Superior invitation code:</string>
|
||||
<string name="app_totalinvite">Total number of invites:</string>
|
||||
<string name="app_sharecontent">App download link:</string>
|
||||
<string name="app_share">Share</string>
|
||||
<string name="app_checklist">Check Invitation Records</string>
|
||||
<string name="app_invitetitle">Invitation Records</string>
|
||||
<string name="app_checklist_number">Total number of invitees: %d</string>
|
||||
<string name="app_nodata">No Data</string>
|
||||
<string name="app_withdrawtitle">Withdrawal Record</string>
|
||||
<string name="app_withdrawapply_title">Withdrawal Application</string>
|
||||
<string name="app_bankinfo_title">Edit Bank Card Information</string>
|
||||
<string name="app_bankinfo_countrycode">60</string>
|
||||
<string name="app_bankinfo_name">Name:</string>
|
||||
<string name="app_bankinfo_name_hint">Please enter the bank card name</string>
|
||||
<string name="app_bankinfo_code">Bank card account:</string>
|
||||
<string name="app_bankinfo_code_hint">Please enter the bank card account</string>
|
||||
<string name="app_bankinfo_bankcountry">Country:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">Please select a country</string>
|
||||
<string name="app_bankinfo_bankname">Bank Name:</string>
|
||||
<string name="app_bankinfo_bankname_hint">Please select a bank name</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">Note: Please enter the country code before selecting the bank name!</string>
|
||||
<string name="app_balance">Balance: %s</string>
|
||||
<string name="app_totalearning">Total Earnings: %s</string>
|
||||
<string name="app_withdraw_amount">Amount: %s</string>
|
||||
<string name="app_withdraw_apply_hint">Please enter the withdrawal amount</string>
|
||||
<string name="app_toastapply">Withdrawal application has been submitted</string>
|
||||
<string name="app_notinstall">App not installed</string>
|
||||
|
||||
</resources>
|
||||
69
Petron777/src/main/res/values-night/themes.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.Calculcator" parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_200</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/black</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_200</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</item>
|
||||
</style>
|
||||
</resources>
|
||||
19
Petron777/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="purple_200">#FFFFFF</color>
|
||||
<color name="purple_500">#FFFFFF</color>
|
||||
<color name="purple_700">#FFFFFF</color>
|
||||
<color name="teal_200">#FF03DAC5</color>
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="jisuanqi">#EF4723</color>
|
||||
<color name="notify_color">#FFFFFFFF</color>
|
||||
|
||||
<color name="dialog_bg">#2C2C2E</color>
|
||||
<color name="dialog_textcolor">#FFA722</color>
|
||||
<color name="dialog_input_bg">#434343</color>
|
||||
<color name="dialog_dark">#BCBCBC</color>
|
||||
<color name="color_red">#DC1927</color>
|
||||
|
||||
</resources>
|
||||
77
Petron777/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,77 @@
|
||||
<resources>
|
||||
<string name="app_name">Petron777</string>
|
||||
<string name="qsrlwmm_txt">请输入6位密码</string>
|
||||
<string name="cancel_txt">取消</string>
|
||||
<string name="sure_txt">确定</string>
|
||||
<string name="banbengengxin_txt">版本更新</string>
|
||||
<string name="xiacigengxin_txt">下次更新</string>
|
||||
<string name="lijigengxin_txt">立即更新</string>
|
||||
<string name="app_updater_error_notification_content">点击关闭通知</string>
|
||||
<string name="app_updater_error_notification_content_re_download">点击重新下载</string>
|
||||
<string name="app_updater_error_notification_title">下载失败</string>
|
||||
<string name="app_updater_finish_notification_content">点击安装</string>
|
||||
<string name="app_updater_finish_notification_title">下载完成</string>
|
||||
<string name="app_updater_progress_notification_content">正在下载…</string>
|
||||
<string name="app_updater_progress_notification_title">版本更新</string>
|
||||
<string name="app_updater_progress_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_title">版本更新</string>
|
||||
<string name="app_updater_start_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_content">正在获取下载数据…</string>
|
||||
<string name="notification_title_txt">需要打开手机通知权限</string>
|
||||
<string name="notification_cancel_txt">退出</string>
|
||||
<string name="notification_setting_txt">设置</string>
|
||||
<string name="app_tishi">提示</string>
|
||||
<string name="app_hint">请输入邀请码</string>
|
||||
<string name="app_sharetitle">我的邀请码:</string>
|
||||
<string name="app_sharetitle2">上级邀请码:</string>
|
||||
<string name="app_totalinvite">总邀请人数:</string>
|
||||
<string name="app_sharecontent">邀请您下载:</string>
|
||||
<string name="app_share">分享</string>
|
||||
<string name="app_checklist">查看邀请记录</string>
|
||||
<string name="app_invitetitle">邀请记录</string>
|
||||
<string name="app_checklist_number">总邀请人数: %d</string>
|
||||
<string name="app_nodata">暂无数据</string>
|
||||
<string name="app_withdrawtitle">提现记录</string>
|
||||
<string name="app_withdrawapply_title">提现申请</string>
|
||||
<string name="app_bankinfo_title">编辑银行卡信息</string>
|
||||
<string name="app_bankinfo_countrycode">86</string>
|
||||
<string name="app_bankinfo_name">持卡人姓名:</string>
|
||||
<string name="app_bankinfo_name_hint">请输入持卡人姓名</string>
|
||||
<string name="app_bankinfo_bankcountry">国家地区:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">请选择国家地区</string>
|
||||
<string name="app_bankinfo_bankname">开户行名称:</string>
|
||||
<string name="app_bankinfo_bankname_hint">请选择开户行名称</string>
|
||||
<string name="app_bankinfo_code">银行户口:</string>
|
||||
<string name="app_bankinfo_code_hint">请输入银行卡户口</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">(注:请先输入国家区号再选择开户行名称!)</string>
|
||||
<string name="app_balance">余额: %s</string>
|
||||
<string name="app_totalearning">总收益: %s</string>
|
||||
<string name="app_withdraw_amount">金额: %s</string>
|
||||
<string name="app_withdraw_apply_hint">请输入提现金额</string>
|
||||
<string name="app_toastapply">提现申请已提交</string>
|
||||
<string name="app_notinstall">应用未安装</string>
|
||||
|
||||
|
||||
<!-- <string name="app_name">SPEEDAU</string>-->
|
||||
<!-- <string name="qsrlwmm_txt">Please Set Your Password</string>-->
|
||||
<!-- <string name="cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="sure_txt">Sure</string>-->
|
||||
<!-- <string name="banbengengxin_txt">New Version Update</string>-->
|
||||
<!-- <string name="xiacigengxin_txt">Next Update</string>-->
|
||||
<!-- <string name="lijigengxin_txt">Update Immediately</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content">Click to close notification</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content_re_download">Click to re-download</string>-->
|
||||
<!-- <string name="app_updater_error_notification_title">Download failed</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_content">Click to install</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_title">Download completed</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_content">Downloading...</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="app_updater_start_notification_content">Getting download data...</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="notification_title_txt">Need to turn on mobile phone notification permission</string>-->
|
||||
<!-- <string name="notification_cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="notification_setting_txt">Setting</string>-->
|
||||
|
||||
</resources>
|
||||
20
Petron777/src/main/res/values/style.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="AppThemeStart1" parent="@style/Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="android:windowTranslucentStatus">true</item>
|
||||
<item name="android:windowTranslucentNavigation">false</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="colorPrimary">@android:color/transparent</item>
|
||||
<item name="colorPrimaryDark">@android:color/transparent</item>
|
||||
<item name="colorAccent">@android:color/transparent</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<!-- 隐藏Activity窗口的Title标题栏 -->
|
||||
<item name="windowNoTitle">true</item>
|
||||
<!-- <item name="android:windowFullscreen">true</item>-->
|
||||
<item name="android:windowBackground">@color/white</item>
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</item>
|
||||
</style>
|
||||
</resources>
|
||||
89
Petron777/src/main/res/values/themes.xml
Normal file
@@ -0,0 +1,89 @@
|
||||
<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. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
<item name="android:enforceNavigationBarContrast" tools:ignore="NewApi">false</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</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>
|
||||
10
Petron777/src/main/res/xml/app_updater_paths.xml
Normal 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>
|
||||
4
Petron777/src/main/res/xml/network_security_config.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<network-security-config>
|
||||
<base-config cleartextTrafficPermitted="true" />
|
||||
</network-security-config>
|
||||
13
Petron777/src/main/res/xml/provider_paths.xml
Normal 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"异常的问题 -->
|
||||
@@ -0,0 +1,35 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void TestPattern(){
|
||||
//
|
||||
Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$");
|
||||
String a="+45.5";
|
||||
boolean matches = compile.matcher(a).matches();
|
||||
System.out.println(matches);
|
||||
String result = compile.matcher(a).replaceAll("");
|
||||
System.out.println(result);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
94
README.md
@@ -1,93 +1,13 @@
|
||||
# web_fengzhuang
|
||||
# TestWeb App 封装APP Test版本,新需求修改版本
|
||||
|
||||
|
||||
# V1.0.0 ~ V1.0.1
|
||||
新增银行信息
|
||||
新增通知,跳转查看网页
|
||||
新增后台接口配置显示关闭权限,跳转打开facebook,telegram等
|
||||
|
||||
## Getting started
|
||||
|
||||
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
|
||||
# V1.0.2 2025年1月8日 start
|
||||
新增邮箱通知
|
||||
|
||||
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
|
||||
|
||||
## Add your files
|
||||
|
||||
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
|
||||
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
|
||||
|
||||
```
|
||||
cd existing_repo
|
||||
git remote add origin http://git.dengshikj.com/webapp/web_fengzhuang.git
|
||||
git branch -M master
|
||||
git push -uf origin master
|
||||
```
|
||||
|
||||
## Integrate with your tools
|
||||
|
||||
- [ ] [Set up project integrations](http://git.dengshikj.com/webapp/web_fengzhuang/-/settings/integrations)
|
||||
|
||||
## Collaborate with your team
|
||||
|
||||
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
|
||||
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
|
||||
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
|
||||
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
|
||||
- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
|
||||
|
||||
## Test and Deploy
|
||||
|
||||
Use the built-in continuous integration in GitLab.
|
||||
|
||||
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
|
||||
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
|
||||
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
|
||||
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
|
||||
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
|
||||
|
||||
***
|
||||
|
||||
# Editing this README
|
||||
|
||||
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
|
||||
|
||||
## Suggestions for a good README
|
||||
|
||||
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
|
||||
|
||||
## Name
|
||||
Choose a self-explaining name for your project.
|
||||
|
||||
## Description
|
||||
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
|
||||
|
||||
## Badges
|
||||
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
|
||||
|
||||
## Visuals
|
||||
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
|
||||
|
||||
## Installation
|
||||
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
|
||||
|
||||
## Usage
|
||||
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
|
||||
|
||||
## Support
|
||||
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
|
||||
|
||||
## Roadmap
|
||||
If you have ideas for releases in the future, it is a good idea to list them in the README.
|
||||
|
||||
## Contributing
|
||||
State if you are open to contributions and what your requirements are for accepting them.
|
||||
|
||||
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
|
||||
|
||||
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
|
||||
|
||||
## Authors and acknowledgment
|
||||
Show your appreciation to those who have contributed to the project.
|
||||
|
||||
## License
|
||||
For open source projects, say how it is licensed.
|
||||
|
||||
## Project status
|
||||
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
|
||||
|
||||
1
agn888new/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
BIN
agn888new/agn.jks
Normal file
94
agn888new/build.gradle
Normal file
@@ -0,0 +1,94 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'com.google.gms.google-services'
|
||||
}
|
||||
|
||||
android {
|
||||
//37
|
||||
compileSdkVersion 31
|
||||
|
||||
|
||||
defaultConfig {
|
||||
//37
|
||||
applicationId "com.web.agn888new"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 31
|
||||
versionCode 104
|
||||
versionName "v1.0.4"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
signingConfigs {
|
||||
debug {
|
||||
storeFile file('agn.jks')
|
||||
storePassword "android2025"
|
||||
keyAlias 'key0'
|
||||
keyPassword "android2025"
|
||||
}
|
||||
release {
|
||||
storeFile file('agn.jks')
|
||||
storePassword "android2025"
|
||||
keyAlias 'key0'
|
||||
keyPassword "android2025"
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'com.google.android.material:material:1.1.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
testImplementation 'junit:junit:4.+'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar')
|
||||
|
||||
// okhttp相关库
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
|
||||
|
||||
// JSON解析库
|
||||
implementation 'com.google.code.gson:gson:2.9.0'
|
||||
implementation 'com.alibaba:fastjson:1.1.71.android'
|
||||
api 'com.squareup.retrofit2:retrofit:2.5.0'
|
||||
api 'com.squareup.retrofit2:converter-scalars:2.3.0'
|
||||
api 'com.squareup.retrofit2:converter-gson:2.4.0'
|
||||
api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
|
||||
api 'io.reactivex.rxjava2:rxjava:2.1.16'
|
||||
api 'io.reactivex.rxjava2:rxandroid:2.0.2'
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选)
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选)
|
||||
implementation 'com.github.Justson:Downloader:v5.0.4-androidx'
|
||||
//implementation 'com.tencent.tbs:tbssdk:44286'
|
||||
// sdk 33
|
||||
// implementation platform('com.google.firebase:firebase-bom:32.7.0')
|
||||
// Firebase Cloud Messaging
|
||||
// implementation("com.google.firebase:firebase-messaging")
|
||||
// implementation("com.google.firebase:firebase-analytics")
|
||||
|
||||
implementation platform('com.google.firebase:firebase-bom:32.1.0')
|
||||
|
||||
// Add the dependencies for the Firebase Cloud Messaging and Analytics libraries
|
||||
// When using the BoM, you don't specify versions in Firebase library dependencies
|
||||
implementation 'com.google.firebase:firebase-messaging'
|
||||
implementation 'com.google.firebase:firebase-analytics'
|
||||
// implementation("com.google.firebase:firebase-messaging:23.2.1")
|
||||
// implementation("com.google.firebase:firebase-analytics:21.2.1")
|
||||
// implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式
|
||||
implementation("com.github.bumptech.glide:glide:4.13.1")
|
||||
implementation project(path: ':base')
|
||||
|
||||
}
|
||||
48
agn888new/google-services.json
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "908864777300",
|
||||
"project_id": "agn888-3b8ef",
|
||||
"storage_bucket": "agn888-3b8ef.firebasestorage.app"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:908864777300:android:682bf12a10bfa0dbac11c1",
|
||||
"android_client_info": {
|
||||
"package_name": "com.web.agn888new"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyB8ISe5W0zOSSvV88sH-u4DMAhO_0Mnjfg"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:908864777300:android:fc7d3cac6abe01c2ac11c1",
|
||||
"android_client_info": {
|
||||
"package_name": "com.web.agn888newnew"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyB8ISe5W0zOSSvV88sH-u4DMAhO_0Mnjfg"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
BIN
agn888new/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar
Normal file
32
agn888new/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
||||
-dontwarn dalvik.**
|
||||
-dontwarn com.tencent.smtt.**
|
||||
|
||||
-keep class com.tencent.smtt.** {
|
||||
*;
|
||||
}
|
||||
|
||||
-keep class com.tencent.tbs.** {
|
||||
*;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("Tptogiar.calculcator", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
126
agn888new/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.web.agn888new">
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera"
|
||||
android:required="false" />
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera2"
|
||||
android:required="false" />
|
||||
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS" /> <!-- 获取通讯录-->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<!-- 多媒体相关 -->
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
|
||||
<!-- 8.0+系统需要-->
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
|
||||
<!--推送权限-->
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_SECURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.RECORD_AUDIO" />-->
|
||||
|
||||
|
||||
<!-- <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_AUDIO_OUTPUT" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.autofocus" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.front" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.level.full" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.capability.raw" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.any" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.microphone" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera2" android:required="true" />-->
|
||||
|
||||
<queries>
|
||||
<intent>
|
||||
<action android:name="android.media.action.IMAGE_CAPTURE" />
|
||||
</intent>
|
||||
</queries>
|
||||
<application
|
||||
android:name=".WebApplication"
|
||||
android:allowBackup="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:icon="@mipmap/app_logo"
|
||||
android:label="@string/app_name"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:roundIcon="@mipmap/app_logo"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.AppTheme"
|
||||
android:usesCleartextTraffic="true">
|
||||
|
||||
|
||||
<!-- <activity-alias-->
|
||||
<!-- android:name=".MainActivityNew"-->
|
||||
<!-- android:icon="@mipmap/winway"-->
|
||||
<!-- android:roundIcon="@mipmap/winway"-->
|
||||
<!-- android:label="@string/app_name1"-->
|
||||
<!-- android:targetActivity=".MainActivity"-->
|
||||
<!-- android:enabled="false"-->
|
||||
<!-- android:exported="true"-->
|
||||
<!-- android:configChanges="orientation|navigation|keyboardHidden"-->
|
||||
<!-- android:launchMode="singleTop"-->
|
||||
<!-- android:excludeFromRecents="true"-->
|
||||
<!-- android:screenOrientation="portrait">-->
|
||||
<!-- <intent-filter>-->
|
||||
<!-- <action android:name="android.intent.action.MAIN" />-->
|
||||
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
|
||||
<!-- </intent-filter>-->
|
||||
<!-- </activity-alias>-->
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity2"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:exported="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:launchMode="singleTop"
|
||||
android:theme="@style/AppThemeStart">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
|
||||
<!-- android:directBootAware="true" 为应用启用消息处理直接启动模式-->
|
||||
<service
|
||||
android:name=".MyFirebaseMessageingService"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<!-- Set custom default icon. This is used when no icon is set for incoming notification messages.
|
||||
See README(https://goo.gl/l4GJaQ) for more. 设置推送默认图标 和颜色-->
|
||||
<meta-data
|
||||
android:name="com.google.firebase.messaging.default_notification_icon"
|
||||
android:resource="@mipmap/app_logo" />
|
||||
<!-- Set color used with incoming notification messages. This is used when no color is set for the incoming
|
||||
notification message. See README(https://goo.gl/6BKBk7) for more. -->
|
||||
<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" />
|
||||
<!-- 还可设置推送渠道 -->
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.google.firebase.messaging.default_notification_channel_id"-->
|
||||
<!-- android:value="@string/default_notification_channel_id" />-->
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
51
agn888new/src/main/java/com/web/agn888new/MainActivity2.java
Normal file
@@ -0,0 +1,51 @@
|
||||
package com.web.agn888new;
|
||||
|
||||
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.android.gms.tasks.OnCompleteListener;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.firebase.messaging.FirebaseMessaging;
|
||||
|
||||
public class MainActivity2 extends com.web.base.MainActivity2 {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
userId = 37;
|
||||
saveInt(MainActivity2.this,"user_code",userId);
|
||||
saveInt(MainActivity2.this,"version_code",getVersion());
|
||||
super.onCreate(savedInstanceState);
|
||||
//订阅主题
|
||||
FirebaseMessaging.getInstance().subscribeToTopic("demo")
|
||||
.addOnCompleteListener(new OnCompleteListener<Void>() {
|
||||
@Override
|
||||
public void onComplete(@NonNull Task<Void> task) {
|
||||
String msg = "Subscribed";
|
||||
if (!task.isSuccessful()) {
|
||||
msg = "Subscribe failed";
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public int getVersion(){
|
||||
try {
|
||||
PackageManager packageManager = getPackageManager();
|
||||
PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0);
|
||||
String StringversionName = packageInfo.versionName; // 版本号
|
||||
int versionCode = packageInfo.versionCode; // 版本码
|
||||
// 在这里可以使用versionName和versionCode进行相关的操作
|
||||
// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode);
|
||||
return versionCode;
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
package com.web.agn888new;
|
||||
|
||||
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.web.base.GsonUtils;
|
||||
import com.web.base.MainActivity2;
|
||||
import com.web.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);
|
||||
// if (remoteMessage.getNotification() != null) {
|
||||
// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
// }
|
||||
} else {
|
||||
//收到通知 创建notify
|
||||
if (remoteMessage.getNotification() != null) {
|
||||
showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void showNotification(MessageInfo messageInfo) {
|
||||
Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.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);
|
||||
|
||||
// Intent notifyIntent = new Intent(this, MainActivity2.class);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
// // notifyIntent.putExtra("message", messageInfo);
|
||||
// notifyIntent.setAction(Intent.ACTION_VIEW);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须
|
||||
// PendingIntent pendingIntent;
|
||||
// pendingIntent = PendingIntent.getActivity
|
||||
// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | 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(com.web.base.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(com.web.base.R.mipmap.app_logo)
|
||||
.setContentTitle(messageInfo.getTitle())
|
||||
.setContentText(messageInfo.getContent())
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.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, MainActivity2.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(com.web.base.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(com.web.base.R.mipmap.app_logo)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.R.mipmap.app_logo)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
}
|
||||
notificationManager.notify(0, notificationBuilder.build());
|
||||
//存储数据
|
||||
// saveNotifyMessage(body);
|
||||
}
|
||||
|
||||
|
||||
// public void saveNotifyMessage(String body) {
|
||||
// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class);
|
||||
// String savenotify = Utils.get(getApplication(),ApiService.savenotify,"");
|
||||
// if(messageInfo!=null){
|
||||
// if(TextUtils.isEmpty(savenotify)){
|
||||
// GsonUtils.getListFromJSON(savenotify,)
|
||||
// }
|
||||
// }
|
||||
// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @param key 要设置的key
|
||||
// */
|
||||
// public static void set(Context activity, String key, String is) {
|
||||
// SharedPreferences nameSetting = getConfigShared(activity);
|
||||
// SharedPreferences.Editor namePref = nameSetting.edit();
|
||||
// namePref.putString(key, is);
|
||||
// namePref.commit();
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.web.agn888new;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
|
||||
import com.tencent.smtt.export.external.TbsCoreSettings;
|
||||
import com.tencent.smtt.sdk.QbSdk;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class WebApplication extends Application {
|
||||
|
||||
|
||||
public static Context application;
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
// 设置开启优化方案
|
||||
application = this;
|
||||
HashMap map = new HashMap();
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true);
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true);
|
||||
QbSdk.initTbsSettings(map);
|
||||
QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() {
|
||||
@Override
|
||||
public void onCoreInitFinished() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewInitFinished(boolean b) {
|
||||
|
||||
}
|
||||
});
|
||||
QbSdk.setDownloadWithoutWifi(true);
|
||||
}
|
||||
}
|
||||
11
agn888new/src/main/res/drawable-anydpi/ic_action_back.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="#333333"
|
||||
android:alpha="0.8">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
|
||||
</vector>
|
||||
BIN
agn888new/src/main/res/drawable-hdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 182 B |
BIN
agn888new/src/main/res/drawable-mdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 150 B |
@@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
||||
BIN
agn888new/src/main/res/drawable-xhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 212 B |
BIN
agn888new/src/main/res/drawable-xxhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 324 B |
170
agn888new/src/main/res/drawable/ic_launcher_background.xml
Normal file
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
||||
20
agn888new/src/main/res/drawable/input_bg.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/white">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape>
|
||||
<solid android:color="@android:color/transparent" />
|
||||
<corners android:radius="23dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 默认显⽰效果-->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/dialog_input_bg"/>
|
||||
<corners
|
||||
android:radius="3dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
|
||||
28
agn888new/src/main/res/drawable/pass_word_bg.xml
Normal 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>
|
||||
|
||||
23
agn888new/src/main/res/drawable/pass_word_bg1.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#FF0000"
|
||||
android:centerColor="#FF5555"
|
||||
android:endColor="#FBD3D0"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
23
agn888new/src/main/res/drawable/pass_word_bg2.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#000000"
|
||||
android:centerColor="#888888"
|
||||
android:endColor="#FFFFFF"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
5
agn888new/src/main/res/drawable/shape_btn_bg.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="22dp" />
|
||||
<solid android:color="@color/jisuanqi" />
|
||||
</shape>
|
||||
6
agn888new/src/main/res/drawable/shape_dialog_bg2.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:topRightRadius="12dp"
|
||||
android:topLeftRadius="12dp"/>
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
agn888new/src/main/res/drawable/shape_dialog_bg3.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="12dp" />
|
||||
<solid android:color="@color/dialog_bg" />
|
||||
</shape>
|
||||
5
agn888new/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
BIN
agn888new/src/main/res/mipmap-hdpi/ic_empty.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
agn888new/src/main/res/mipmap-hdpi/ic_pull_down.png
Normal file
|
After Width: | Height: | Size: 271 B |
BIN
agn888new/src/main/res/mipmap-xhdpi/ic_close.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
agn888new/src/main/res/mipmap-xhdpi/ic_facebook.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
agn888new/src/main/res/mipmap-xhdpi/ic_hometo.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
agn888new/src/main/res/mipmap-xhdpi/ic_link.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
agn888new/src/main/res/mipmap-xhdpi/ic_menu.png
Normal file
|
After Width: | Height: | Size: 779 B |
BIN
agn888new/src/main/res/mipmap-xhdpi/ic_shousuo.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
agn888new/src/main/res/mipmap-xhdpi/ic_tel.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
agn888new/src/main/res/mipmap-xhdpi/ic_whatsapp.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
agn888new/src/main/res/mipmap-xhdpi/ic_zhangkai.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
agn888new/src/main/res/mipmap-xxhdpi/app_logo.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
54
agn888new/src/main/res/values-en/strings.xml
Normal file
@@ -0,0 +1,54 @@
|
||||
<resources>
|
||||
<string name="app_name">AGN888</string>
|
||||
<string name="qsrlwmm_txt">Please Set Your Password</string>
|
||||
<string name="cancel_txt">Cancel</string>
|
||||
<string name="sure_txt">Sure</string>
|
||||
<string name="banbengengxin_txt">New Version Update</string>
|
||||
<string name="xiacigengxin_txt">Next Update</string>
|
||||
<string name="lijigengxin_txt">Update Immediately</string>
|
||||
<string name="app_updater_error_notification_content">Click to close notification</string>
|
||||
<string name="app_updater_error_notification_content_re_download">Click to re-download</string>
|
||||
<string name="app_updater_error_notification_title">Download failed</string>
|
||||
<string name="app_updater_finish_notification_content">Click to install</string>
|
||||
<string name="app_updater_finish_notification_title">Download completed</string>
|
||||
<string name="app_updater_progress_notification_content">Downloading...</string>
|
||||
<string name="app_updater_progress_notification_title">Version update</string>
|
||||
<string name="app_updater_progress_notification_title_2">Downloading game</string>
|
||||
<string name="app_updater_start_notification_content">Getting download data...</string>
|
||||
<string name="app_updater_start_notification_title">Version update</string>
|
||||
<string name="app_updater_start_notification_title_2">Downloading game</string>
|
||||
<string name="notification_title_txt">Need to turn on mobile phone notification permission</string>
|
||||
<string name="notification_cancel_txt">Exit</string>
|
||||
<string name="notification_setting_txt">Setting</string>
|
||||
<string name="app_tishi">Tip</string>
|
||||
<string name="app_hint">Please enter the invitation code</string>
|
||||
<string name="app_sharetitle">My invitation code:</string>
|
||||
<string name="app_sharetitle2">Superior invitation code:</string>
|
||||
<string name="app_totalinvite">Total number of invites:</string>
|
||||
<string name="app_sharecontent">App download link:</string>
|
||||
<string name="app_share">Share</string>
|
||||
<string name="app_checklist">Check Invitation Records</string>
|
||||
<string name="app_invitetitle">Invitation Records</string>
|
||||
<string name="app_checklist_number">Total number of invitees: %d</string>
|
||||
<string name="app_nodata">No Data</string>
|
||||
<string name="app_withdrawtitle">Withdrawal Record</string>
|
||||
<string name="app_withdrawapply_title">Withdrawal Application</string>
|
||||
<string name="app_bankinfo_title">Edit Bank Card Information</string>
|
||||
<string name="app_bankinfo_countrycode">60</string>
|
||||
<string name="app_bankinfo_name">Name:</string>
|
||||
<string name="app_bankinfo_name_hint">Please enter the bank card name</string>
|
||||
<string name="app_bankinfo_code">Bank card account:</string>
|
||||
<string name="app_bankinfo_code_hint">Please enter the bank card account</string>
|
||||
<string name="app_bankinfo_bankcountry">Country:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">Please select a country</string>
|
||||
<string name="app_bankinfo_bankname">Bank Name:</string>
|
||||
<string name="app_bankinfo_bankname_hint">Please select a bank name</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">Note: Please enter the country code before selecting the bank name!</string>
|
||||
<string name="app_balance">Balance: %s</string>
|
||||
<string name="app_totalearning">Total Earnings: %s</string>
|
||||
<string name="app_withdraw_amount">Amount: %s</string>
|
||||
<string name="app_withdraw_apply_hint">Please enter the withdrawal amount</string>
|
||||
<string name="app_toastapply">Withdrawal application has been submitted</string>
|
||||
<string name="app_notinstall">App not installed</string>
|
||||
|
||||
</resources>
|
||||
69
agn888new/src/main/res/values-night/themes.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.Calculcator" parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_200</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/black</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_200</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</item>
|
||||
</style>
|
||||
</resources>
|
||||
19
agn888new/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="purple_200">#FFFFFF</color>
|
||||
<color name="purple_500">#FFFFFF</color>
|
||||
<color name="purple_700">#FFFFFF</color>
|
||||
<color name="teal_200">#FF03DAC5</color>
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="jisuanqi">#EF4723</color>
|
||||
<color name="notify_color">#FFFFFFFF</color>
|
||||
|
||||
<color name="dialog_bg">#2C2C2E</color>
|
||||
<color name="dialog_textcolor">#FFA722</color>
|
||||
<color name="dialog_input_bg">#434343</color>
|
||||
<color name="dialog_dark">#BCBCBC</color>
|
||||
<color name="color_red">#DC1927</color>
|
||||
|
||||
</resources>
|
||||
77
agn888new/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,77 @@
|
||||
<resources>
|
||||
<string name="app_name">AGN888</string>
|
||||
<string name="qsrlwmm_txt">请输入6位密码</string>
|
||||
<string name="cancel_txt">取消</string>
|
||||
<string name="sure_txt">确定</string>
|
||||
<string name="banbengengxin_txt">版本更新</string>
|
||||
<string name="xiacigengxin_txt">下次更新</string>
|
||||
<string name="lijigengxin_txt">立即更新</string>
|
||||
<string name="app_updater_error_notification_content">点击关闭通知</string>
|
||||
<string name="app_updater_error_notification_content_re_download">点击重新下载</string>
|
||||
<string name="app_updater_error_notification_title">下载失败</string>
|
||||
<string name="app_updater_finish_notification_content">点击安装</string>
|
||||
<string name="app_updater_finish_notification_title">下载完成</string>
|
||||
<string name="app_updater_progress_notification_content">正在下载…</string>
|
||||
<string name="app_updater_progress_notification_title">版本更新</string>
|
||||
<string name="app_updater_progress_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_title">版本更新</string>
|
||||
<string name="app_updater_start_notification_title_2">下载游戏中</string>
|
||||
<string name="app_updater_start_notification_content">正在获取下载数据…</string>
|
||||
<string name="notification_title_txt">需要打开手机通知权限</string>
|
||||
<string name="notification_cancel_txt">退出</string>
|
||||
<string name="notification_setting_txt">设置</string>
|
||||
<string name="app_tishi">提示</string>
|
||||
<string name="app_hint">请输入邀请码</string>
|
||||
<string name="app_sharetitle">我的邀请码:</string>
|
||||
<string name="app_sharetitle2">上级邀请码:</string>
|
||||
<string name="app_totalinvite">总邀请人数:</string>
|
||||
<string name="app_sharecontent">邀请您下载:</string>
|
||||
<string name="app_share">分享</string>
|
||||
<string name="app_checklist">查看邀请记录</string>
|
||||
<string name="app_invitetitle">邀请记录</string>
|
||||
<string name="app_checklist_number">总邀请人数: %d</string>
|
||||
<string name="app_nodata">暂无数据</string>
|
||||
<string name="app_withdrawtitle">提现记录</string>
|
||||
<string name="app_withdrawapply_title">提现申请</string>
|
||||
<string name="app_bankinfo_title">编辑银行卡信息</string>
|
||||
<string name="app_bankinfo_countrycode">86</string>
|
||||
<string name="app_bankinfo_name">持卡人姓名:</string>
|
||||
<string name="app_bankinfo_name_hint">请输入持卡人姓名</string>
|
||||
<string name="app_bankinfo_bankcountry">国家地区:</string>
|
||||
<string name="app_bankinfo_bankcountry_hint">请选择国家地区</string>
|
||||
<string name="app_bankinfo_bankname">开户行名称:</string>
|
||||
<string name="app_bankinfo_bankname_hint">请选择开户行名称</string>
|
||||
<string name="app_bankinfo_code">银行户口:</string>
|
||||
<string name="app_bankinfo_code_hint">请输入银行卡户口</string>
|
||||
<string name="app_bankinfo_bankinfo_tips">(注:请先输入国家区号再选择开户行名称!)</string>
|
||||
<string name="app_balance">余额: %s</string>
|
||||
<string name="app_totalearning">总收益: %s</string>
|
||||
<string name="app_withdraw_amount">金额: %s</string>
|
||||
<string name="app_withdraw_apply_hint">请输入提现金额</string>
|
||||
<string name="app_toastapply">提现申请已提交</string>
|
||||
<string name="app_notinstall">应用未安装</string>
|
||||
|
||||
|
||||
<!-- <string name="app_name">SPEEDAU</string>-->
|
||||
<!-- <string name="qsrlwmm_txt">Please Set Your Password</string>-->
|
||||
<!-- <string name="cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="sure_txt">Sure</string>-->
|
||||
<!-- <string name="banbengengxin_txt">New Version Update</string>-->
|
||||
<!-- <string name="xiacigengxin_txt">Next Update</string>-->
|
||||
<!-- <string name="lijigengxin_txt">Update Immediately</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content">Click to close notification</string>-->
|
||||
<!-- <string name="app_updater_error_notification_content_re_download">Click to re-download</string>-->
|
||||
<!-- <string name="app_updater_error_notification_title">Download failed</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_content">Click to install</string>-->
|
||||
<!-- <string name="app_updater_finish_notification_title">Download completed</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_content">Downloading...</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_progress_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="app_updater_start_notification_content">Getting download data...</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title">Version update</string>-->
|
||||
<!-- <string name="app_updater_start_notification_title_2">Downloading game</string>-->
|
||||
<!-- <string name="notification_title_txt">Need to turn on mobile phone notification permission</string>-->
|
||||
<!-- <string name="notification_cancel_txt">Cancel</string>-->
|
||||
<!-- <string name="notification_setting_txt">Setting</string>-->
|
||||
|
||||
</resources>
|
||||
20
agn888new/src/main/res/values/style.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="AppThemeStart1" parent="@style/Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="android:windowTranslucentStatus">true</item>
|
||||
<item name="android:windowTranslucentNavigation">false</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="colorPrimary">@android:color/transparent</item>
|
||||
<item name="colorPrimaryDark">@android:color/transparent</item>
|
||||
<item name="colorAccent">@android:color/transparent</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<!-- 隐藏Activity窗口的Title标题栏 -->
|
||||
<item name="windowNoTitle">true</item>
|
||||
<!-- <item name="android:windowFullscreen">true</item>-->
|
||||
<item name="android:windowBackground">@color/white</item>
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</item>
|
||||
</style>
|
||||
</resources>
|
||||
89
agn888new/src/main/res/values/themes.xml
Normal file
@@ -0,0 +1,89 @@
|
||||
<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. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
<item name="android:enforceNavigationBarContrast" tools:ignore="NewApi">false</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</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>
|
||||
10
agn888new/src/main/res/xml/app_updater_paths.xml
Normal 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>
|
||||
4
agn888new/src/main/res/xml/network_security_config.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<network-security-config>
|
||||
<base-config cleartextTrafficPermitted="true" />
|
||||
</network-security-config>
|
||||
13
agn888new/src/main/res/xml/provider_paths.xml
Normal 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"异常的问题 -->
|
||||
@@ -0,0 +1,35 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void TestPattern(){
|
||||
//
|
||||
Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$");
|
||||
String a="+45.5";
|
||||
boolean matches = compile.matcher(a).matches();
|
||||
System.out.println(matches);
|
||||
String result = compile.matcher(a).replaceAll("");
|
||||
System.out.println(result);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
1
amb88/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
86
amb88/build.gradle
Normal file
@@ -0,0 +1,86 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'com.google.gms.google-services'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 31
|
||||
buildToolsVersion "30.0.3"
|
||||
|
||||
defaultConfig {
|
||||
//61
|
||||
applicationId "com.web.amb88"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 31
|
||||
versionCode 11
|
||||
versionName "v1.0.1"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
signingConfigs {
|
||||
debug {
|
||||
storeFile file('dskjweb.jks')
|
||||
storePassword "dskj2024"
|
||||
keyAlias 'dskjalias'
|
||||
keyPassword "dskj2024"
|
||||
}
|
||||
release {
|
||||
storeFile file('dskjweb.jks')
|
||||
storePassword "dskj2024"
|
||||
keyAlias 'dskjalias'
|
||||
keyPassword "dskj2024"
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'com.google.android.material:material:1.1.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
testImplementation 'junit:junit:4.+'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar')
|
||||
|
||||
// okhttp相关库
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
|
||||
|
||||
// JSON解析库
|
||||
implementation 'com.google.code.gson:gson:2.9.0'
|
||||
implementation 'com.alibaba:fastjson:1.1.71.android'
|
||||
api 'com.squareup.retrofit2:retrofit:2.5.0'
|
||||
api 'com.squareup.retrofit2:converter-scalars:2.3.0'
|
||||
api 'com.squareup.retrofit2:converter-gson:2.4.0'
|
||||
api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
|
||||
api 'io.reactivex.rxjava2:rxjava:2.1.16'
|
||||
api 'io.reactivex.rxjava2:rxandroid:2.0.2'
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选)
|
||||
implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选)
|
||||
implementation 'com.github.Justson:Downloader:v5.0.4-androidx'
|
||||
//implementation 'com.tencent.tbs:tbssdk:44286'
|
||||
// sdk 33
|
||||
// implementation platform('com.google.firebase:firebase-bom:32.7.0')
|
||||
// Firebase Cloud Messaging
|
||||
// implementation("com.google.firebase:firebase-messaging")
|
||||
// implementation("com.google.firebase:firebase-analytics")
|
||||
|
||||
implementation("com.google.firebase:firebase-messaging:23.0.0")
|
||||
implementation("com.google.firebase:firebase-analytics:20.0.0")
|
||||
// implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式
|
||||
implementation project(path: ':base')
|
||||
|
||||
}
|
||||
BIN
amb88/dskjweb.jks
Normal file
29
amb88/google-services.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "12964289424",
|
||||
"project_id": "amb88-4af34",
|
||||
"storage_bucket": "amb88-4af34.appspot.com"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:12964289424:android:eefd01b1203cf5da60f115",
|
||||
"android_client_info": {
|
||||
"package_name": "com.web.amb88"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyBVWdVFuU_okeBn1M__2C0irSwcPNr5gns"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
BIN
amb88/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar
Normal file
32
amb88/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
||||
-dontwarn dalvik.**
|
||||
-dontwarn com.tencent.smtt.**
|
||||
|
||||
-keep class com.tencent.smtt.** {
|
||||
*;
|
||||
}
|
||||
|
||||
-keep class com.tencent.tbs.** {
|
||||
*;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package Tptogiar.calculcator;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("Tptogiar.calculcator", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
126
amb88/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.web.amb88">
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera"
|
||||
android:required="false" />
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera2"
|
||||
android:required="false" />
|
||||
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS" /> <!-- 获取通讯录-->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<!-- 多媒体相关 -->
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
|
||||
<!-- 8.0+系统需要-->
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
|
||||
<!--推送权限-->
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_SECURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_VIDEO_OUTPUT" />-->
|
||||
<!-- <uses-permission android:name="android.permission.RECORD_AUDIO" />-->
|
||||
|
||||
|
||||
<!-- <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CAPTURE_AUDIO_OUTPUT" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.autofocus" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.front" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.level.full" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.capability.raw" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera.any" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.microphone" android:required="true" />-->
|
||||
<!-- <uses-feature android:name="android.hardware.camera2" android:required="true" />-->
|
||||
|
||||
<queries>
|
||||
<intent>
|
||||
<action android:name="android.media.action.IMAGE_CAPTURE" />
|
||||
</intent>
|
||||
</queries>
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:icon="@mipmap/app_logo"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/app_logo"
|
||||
android:supportsRtl="true"
|
||||
android:name=".WebApplication"
|
||||
android:usesCleartextTraffic="true"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:theme="@style/Theme.AppTheme">
|
||||
|
||||
|
||||
<!-- <activity-alias-->
|
||||
<!-- android:name=".MainActivityNew"-->
|
||||
<!-- android:icon="@mipmap/winway"-->
|
||||
<!-- android:roundIcon="@mipmap/winway"-->
|
||||
<!-- android:label="@string/app_name1"-->
|
||||
<!-- android:targetActivity=".MainActivity"-->
|
||||
<!-- android:enabled="false"-->
|
||||
<!-- android:exported="true"-->
|
||||
<!-- android:configChanges="orientation|navigation|keyboardHidden"-->
|
||||
<!-- android:launchMode="singleTop"-->
|
||||
<!-- android:excludeFromRecents="true"-->
|
||||
<!-- android:screenOrientation="portrait">-->
|
||||
<!-- <intent-filter>-->
|
||||
<!-- <action android:name="android.intent.action.MAIN" />-->
|
||||
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
|
||||
<!-- </intent-filter>-->
|
||||
<!-- </activity-alias>-->
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity2"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:exported="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:launchMode="singleTop"
|
||||
android:theme="@style/AppThemeStart">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
|
||||
<!-- android:directBootAware="true" 为应用启用消息处理直接启动模式-->
|
||||
<service
|
||||
android:name=".MyFirebaseMessageingService"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<!-- Set custom default icon. This is used when no icon is set for incoming notification messages.
|
||||
See README(https://goo.gl/l4GJaQ) for more. 设置推送默认图标 和颜色-->
|
||||
<meta-data
|
||||
android:name="com.google.firebase.messaging.default_notification_icon"
|
||||
android:resource="@mipmap/app_logo" />
|
||||
<!-- Set color used with incoming notification messages. This is used when no color is set for the incoming
|
||||
notification message. See README(https://goo.gl/6BKBk7) for more. -->
|
||||
<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" />
|
||||
<!-- 还可设置推送渠道 -->
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.google.firebase.messaging.default_notification_channel_id"-->
|
||||
<!-- android:value="@string/default_notification_channel_id" />-->
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
52
amb88/src/main/java/com/web/amb88/MainActivity2.java
Normal file
@@ -0,0 +1,52 @@
|
||||
package com.web.amb88;
|
||||
|
||||
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.android.gms.tasks.OnCompleteListener;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.firebase.messaging.FirebaseMessaging;
|
||||
|
||||
public class MainActivity2 extends com.web.base.MainActivity2 {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
userId = 61;
|
||||
saveInt(MainActivity2.this,"user_code",userId);
|
||||
saveInt(MainActivity2.this,"version_code",getVersion());
|
||||
super.onCreate(savedInstanceState);
|
||||
//订阅主题
|
||||
FirebaseMessaging.getInstance().subscribeToTopic("demo")
|
||||
.addOnCompleteListener(new OnCompleteListener<Void>() {
|
||||
@Override
|
||||
public void onComplete(@NonNull Task<Void> task) {
|
||||
String msg = "Subscribed";
|
||||
if (!task.isSuccessful()) {
|
||||
msg = "Subscribe failed";
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public int getVersion(){
|
||||
try {
|
||||
PackageManager packageManager = getPackageManager();
|
||||
PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0);
|
||||
String StringversionName = packageInfo.versionName; // 版本号
|
||||
int versionCode = packageInfo.versionCode; // 版本码
|
||||
// 在这里可以使用versionName和versionCode进行相关的操作
|
||||
// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode);
|
||||
return versionCode;
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
package com.web.amb88;
|
||||
|
||||
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.web.base.GsonUtils;
|
||||
import com.web.base.MainActivity2;
|
||||
import com.web.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);
|
||||
// if (remoteMessage.getNotification() != null) {
|
||||
// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
// }
|
||||
} else {
|
||||
//收到通知 创建notify
|
||||
if (remoteMessage.getNotification() != null) {
|
||||
showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void showNotification(MessageInfo messageInfo) {
|
||||
Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.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);
|
||||
|
||||
// Intent notifyIntent = new Intent(this, MainActivity2.class);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
// // notifyIntent.putExtra("message", messageInfo);
|
||||
// notifyIntent.setAction(Intent.ACTION_VIEW);
|
||||
// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须
|
||||
// PendingIntent pendingIntent;
|
||||
// pendingIntent = PendingIntent.getActivity
|
||||
// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | 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(com.web.base.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(com.web.base.R.mipmap.app_logo)
|
||||
.setContentTitle(messageInfo.getTitle())
|
||||
.setContentText(messageInfo.getContent())
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.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, MainActivity2.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(com.web.base.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(com.web.base.R.mipmap.app_logo)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name))
|
||||
.setSmallIcon(com.web.base.R.mipmap.app_logo)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
}
|
||||
notificationManager.notify(0, notificationBuilder.build());
|
||||
//存储数据
|
||||
// saveNotifyMessage(body);
|
||||
}
|
||||
|
||||
|
||||
// public void saveNotifyMessage(String body) {
|
||||
// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class);
|
||||
// String savenotify = Utils.get(getApplication(),ApiService.savenotify,"");
|
||||
// if(messageInfo!=null){
|
||||
// if(TextUtils.isEmpty(savenotify)){
|
||||
// GsonUtils.getListFromJSON(savenotify,)
|
||||
// }
|
||||
// }
|
||||
// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @param key 要设置的key
|
||||
// */
|
||||
// public static void set(Context activity, String key, String is) {
|
||||
// SharedPreferences nameSetting = getConfigShared(activity);
|
||||
// SharedPreferences.Editor namePref = nameSetting.edit();
|
||||
// namePref.putString(key, is);
|
||||
// namePref.commit();
|
||||
// }
|
||||
}
|
||||
37
amb88/src/main/java/com/web/amb88/WebApplication.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.web.amb88;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
|
||||
import com.tencent.smtt.export.external.TbsCoreSettings;
|
||||
import com.tencent.smtt.sdk.QbSdk;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class WebApplication extends Application {
|
||||
|
||||
|
||||
public static Context application;
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
// 设置开启优化方案
|
||||
application = this;
|
||||
HashMap map = new HashMap();
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true);
|
||||
map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true);
|
||||
QbSdk.initTbsSettings(map);
|
||||
QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() {
|
||||
@Override
|
||||
public void onCoreInitFinished() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewInitFinished(boolean b) {
|
||||
|
||||
}
|
||||
});
|
||||
QbSdk.setDownloadWithoutWifi(true);
|
||||
}
|
||||
}
|
||||
11
amb88/src/main/res/drawable-anydpi/ic_action_back.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="#333333"
|
||||
android:alpha="0.8">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
|
||||
</vector>
|
||||
BIN
amb88/src/main/res/drawable-hdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 182 B |
BIN
amb88/src/main/res/drawable-mdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 150 B |
30
amb88/src/main/res/drawable-v24/ic_launcher_foreground.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
||||
BIN
amb88/src/main/res/drawable-xhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 212 B |
BIN
amb88/src/main/res/drawable-xxhdpi/ic_action_back.png
Normal file
|
After Width: | Height: | Size: 324 B |
170
amb88/src/main/res/drawable/ic_launcher_background.xml
Normal file
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
||||
28
amb88/src/main/res/drawable/pass_word_bg.xml
Normal 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>
|
||||
|
||||
23
amb88/src/main/res/drawable/pass_word_bg1.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#FF0000"
|
||||
android:centerColor="#FF5555"
|
||||
android:endColor="#FBD3D0"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
23
amb88/src/main/res/drawable/pass_word_bg2.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="360"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
>
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:innerRadiusRatio="3"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false"
|
||||
>
|
||||
<gradient
|
||||
android:type="sweep"
|
||||
android:useLevel="false"
|
||||
android:startColor="#000000"
|
||||
android:centerColor="#888888"
|
||||
android:endColor="#FFFFFF"
|
||||
android:centerY="0.50" />
|
||||
</shape>
|
||||
</animated-rotate>
|
||||
5
amb88/src/main/res/drawable/shape_dialog_bg_new.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="20dp" />
|
||||
<solid android:color="@color/white" />
|
||||
</shape>
|
||||
5
amb88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
BIN
amb88/src/main/res/mipmap-xxhdpi/app_logo.png
Normal file
|
After Width: | Height: | Size: 75 KiB |
24
amb88/src/main/res/values-en/strings.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<resources>
|
||||
<string name="app_name">AMB88</string>
|
||||
<string name="qsrlwmm_txt">Please Set Your Password</string>
|
||||
<string name="cancel_txt">Cancel</string>
|
||||
<string name="sure_txt">Sure</string>
|
||||
<string name="banbengengxin_txt">New Version Update</string>
|
||||
<string name="xiacigengxin_txt">Next Update</string>
|
||||
<string name="lijigengxin_txt">Update Immediately</string>
|
||||
<string name="app_updater_error_notification_content">Click to close notification</string>
|
||||
<string name="app_updater_error_notification_content_re_download">Click to re-download</string>
|
||||
<string name="app_updater_error_notification_title">Download failed</string>
|
||||
<string name="app_updater_finish_notification_content">Click to install</string>
|
||||
<string name="app_updater_finish_notification_title">Download completed</string>
|
||||
<string name="app_updater_progress_notification_content">Downloading...</string>
|
||||
<string name="app_updater_progress_notification_title">Version update</string>
|
||||
<string name="app_updater_progress_notification_title_2">Downloading game</string>
|
||||
<string name="app_updater_start_notification_content">Getting download data...</string>
|
||||
<string name="app_updater_start_notification_title">Version update</string>
|
||||
<string name="app_updater_start_notification_title_2">Downloading game</string>
|
||||
<string name="notification_title_txt">Need to turn on mobile phone notification permission</string>
|
||||
<string name="notification_cancel_txt">Exit</string>
|
||||
<string name="notification_setting_txt">Setting</string>
|
||||
|
||||
</resources>
|
||||
69
amb88/src/main/res/values-night/themes.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.Calculcator" parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_200</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/black</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_200</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</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/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/white</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:windowBackground">@color/white</item>
|
||||
|
||||
<item name="android:navigationBarColor">@color/white</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</item>
|
||||
</style>
|
||||
</resources>
|
||||