第一次提交
This commit is contained in:
2
workbuddy/.gitignore
vendored
Normal file
2
workbuddy/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/build
|
||||
/release
|
||||
100
workbuddy/build.gradle
Normal file
100
workbuddy/build.gradle
Normal file
@@ -0,0 +1,100 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'com.google.gms.google-services'
|
||||
}
|
||||
|
||||
def appOutPutName = "winway-calculator-v3.2.4-44"
|
||||
|
||||
android {
|
||||
namespace "com.webclip.base"
|
||||
compileSdk 36
|
||||
defaultConfig {
|
||||
minSdkVersion 24
|
||||
targetSdk 36
|
||||
versionCode 45
|
||||
versionName "3.2.5"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
//包名
|
||||
applicationId "com.claw.workbuddy"
|
||||
//app大背景色
|
||||
resValue('color', 'windows_color', '#FFFFFF')
|
||||
//底部导航栏颜色 大背景颜色为 windows_color——style_color的上下渐变色
|
||||
resValue('color', 'style_color', '#FFFFFF')
|
||||
//app 名字
|
||||
resValue('string', 'app_name', 'WORKBUDDY')
|
||||
//预埋订阅网址
|
||||
buildConfigField "String", "BASE_URL", "\"https://winway33.site/\""
|
||||
//后台唯一ID
|
||||
buildConfigField "int", "USERID", "4"
|
||||
//状态栏文字颜色是否为白色
|
||||
buildConfigField "boolean", "IS_WHITE", "false"
|
||||
//是否强转启动图为圆形
|
||||
buildConfigField "boolean", "IS_ROUND", "true"
|
||||
//IS_ROUND 为 true时 圆角启动logo的 圆角大小 为0 表示为圆形 否则为ROUND_RADIUS的 dp2px的 数字大小
|
||||
buildConfigField "int", "ROUND_RADIUS", "10"
|
||||
//已废弃
|
||||
buildConfigField "boolean", "HAS_CONTACT", "false"
|
||||
//已废弃
|
||||
buildConfigField "boolean", "HAS_HOOK", "false"
|
||||
|
||||
}
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
debug {
|
||||
storeFile file('justlet.jks')
|
||||
storePassword "123456"
|
||||
keyAlias 'key0'
|
||||
keyPassword "123456"
|
||||
}
|
||||
release {
|
||||
storeFile file('justlet.jks')
|
||||
storePassword "123456"
|
||||
keyAlias 'key0'
|
||||
keyPassword "123456"
|
||||
}
|
||||
}
|
||||
buildFeatures {
|
||||
viewBinding true
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
signingConfig signingConfigs.release
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
applicationVariants.all { variant ->
|
||||
variant.outputs.all {
|
||||
def outputDir = new File(rootProject.ext.outputPath)
|
||||
outputDir.mkdirs()
|
||||
def outputFileName = "${appOutPutName}.apk"
|
||||
setOutputFileName(outputFileName)
|
||||
def newOutputFile = new File(outputDir, outputFileName)
|
||||
newOutputFile.parentFile.mkdirs()
|
||||
variant.assemble.doLast {
|
||||
try {
|
||||
java.nio.file.Files.copy(
|
||||
outputFile.toPath(),
|
||||
newOutputFile.toPath(),
|
||||
java.nio.file.StandardCopyOption.REPLACE_EXISTING
|
||||
)
|
||||
} catch (java.io.IOException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation project(path: ':base')
|
||||
}
|
||||
29
workbuddy/google-services.json
Normal file
29
workbuddy/google-services.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "66230459052",
|
||||
"project_id": "just-way-eb6ae",
|
||||
"storage_bucket": "just-way-eb6ae.firebasestorage.app"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:66230459052:android:1782975166f8b0bb35dd09",
|
||||
"android_client_info": {
|
||||
"package_name": "com.claw.workbuddy"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyAMJUxbpF8L-HqRKzcm4v8PErxBgo8UAMI"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
BIN
workbuddy/justlet.jks
Normal file
BIN
workbuddy/justlet.jks
Normal file
Binary file not shown.
32
workbuddy/proguard-rules.pro
vendored
Normal file
32
workbuddy/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.** {
|
||||
*;
|
||||
}
|
||||
63
workbuddy/src/main/AndroidManifest.xml
Normal file
63
workbuddy/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<!-- 8.0+系统需要-->
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
<!--推送权限-->
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
|
||||
<application
|
||||
android:name=".WebApplication"
|
||||
android:allowBackup="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:icon="@mipmap/app_logo"
|
||||
android:label="@string/app_name"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:roundIcon="@mipmap/app_logo"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppThemeStart"
|
||||
android:usesCleartextTraffic="true">
|
||||
|
||||
|
||||
<activity
|
||||
android:name=".TestActivity"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:exported="true"
|
||||
android:hardwareAccelerated="true">
|
||||
|
||||
<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=".MyFirebaseMessageingService"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<meta-data
|
||||
android:name="com.google.firebase.messaging.default_notification_icon"
|
||||
android:resource="@mipmap/app_logo" />
|
||||
|
||||
<meta-data
|
||||
android:name="com.google.firebase.messaging.default_notification_color"
|
||||
android:resource="@color/notify_color" />
|
||||
<meta-data
|
||||
android:name="com.google.firebase.messaging.default_notification_channel_id"
|
||||
android:value="@string/app_name" />
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
80
workbuddy/src/main/java/com/webclip/base/IndexActivity.java
Normal file
80
workbuddy/src/main/java/com/webclip/base/IndexActivity.java
Normal file
@@ -0,0 +1,80 @@
|
||||
package com.webclip.base;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.google.firebase.messaging.FirebaseMessaging;
|
||||
|
||||
public class IndexActivity extends MainActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
initConfig();
|
||||
super.onCreate(savedInstanceState);
|
||||
initWinwdowLogoConfig();
|
||||
// registerFCM();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void regFcm() {
|
||||
super.regFcm();
|
||||
registerFCM();
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册FCM
|
||||
*/
|
||||
private void registerFCM() {
|
||||
//订阅主题
|
||||
LogUtils.i("支持FCM 去注册");
|
||||
try {
|
||||
FirebaseMessaging.getInstance().subscribeToTopic("demo")
|
||||
.addOnCompleteListener(task -> {
|
||||
String msg = "Subscribed";
|
||||
if (!task.isSuccessful()) {
|
||||
msg = "Subscribe failed";
|
||||
}else{
|
||||
checkNotify();
|
||||
}
|
||||
LogUtils.i("支持FCM 结果:"+msg);
|
||||
});
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
LogUtils.i("支持FCM Exception");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于修改大背景渐变色 不设置
|
||||
*/
|
||||
private void initWinwdowLogoConfig() {
|
||||
//全局大背景 一个上下渐变 不要动
|
||||
setBackDrawables(R.drawable.big_bg);
|
||||
setImageView(BuildConfig.IS_ROUND,BuildConfig.ROUND_RADIUS);
|
||||
getWindow().getDecorView().setBackgroundResource(R.drawable.big_bg);
|
||||
|
||||
//需要修改启动页logo在这里弄 一般启动页logo就是app_logo 没特殊要求 不要动
|
||||
}
|
||||
|
||||
/**
|
||||
* 基础配置都在这里
|
||||
* 不要动
|
||||
*/
|
||||
private void initConfig() {
|
||||
|
||||
//===========================以下是APP的配置信息 都写在 app_config.xml中==================================
|
||||
userId = BuildConfig.USERID;
|
||||
saveInt(IndexActivity.this,"user_code",userId);
|
||||
|
||||
saveString(this, "base_url",BuildConfig.BASE_URL);
|
||||
styleColor = getColor(R.color.style_color);
|
||||
windowsColor = getColor(R.color.windows_color);
|
||||
isWhite = BuildConfig.IS_WHITE;
|
||||
hasContact = BuildConfig.HAS_CONTACT;
|
||||
hasHook = BuildConfig.HAS_HOOK;
|
||||
|
||||
//===========================以上是APP的配置信息 都写在 app_config.xml中==================================
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
package com.webclip.base;
|
||||
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
import com.google.firebase.messaging.FirebaseMessagingService;
|
||||
import com.google.firebase.messaging.RemoteMessage;
|
||||
import com.google.gson.Gson;
|
||||
import com.webclip.base.GsonUtils;
|
||||
import com.webclip.base.MessageInfo;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
public class MyFirebaseMessageingService extends FirebaseMessagingService {
|
||||
|
||||
public MyFirebaseMessageingService() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMessageReceived(@NonNull RemoteMessage remoteMessage) {
|
||||
super.onMessageReceived(remoteMessage);
|
||||
Map<String, String> serviceData = remoteMessage.getData(); //后台推送数据
|
||||
if (serviceData != null && serviceData.containsKey("message")) {
|
||||
String value = serviceData.get("message");
|
||||
Gson gson = new Gson();
|
||||
MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class);
|
||||
showNotification(messageInfo);
|
||||
} else {
|
||||
//收到通知 创建notify
|
||||
if (remoteMessage.getNotification() != null) {
|
||||
showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void showNotification(MessageInfo messageInfo) {
|
||||
Intent notifyIntent = new Intent(this, IndexActivity.class);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) {
|
||||
ComponentName launchComponent = null;
|
||||
launchComponent = getApplication()
|
||||
.getPackageManager()
|
||||
.getLaunchIntentForPackage(getApplication().getPackageName())
|
||||
.getComponent();
|
||||
notifyIntent.setComponent(launchComponent);
|
||||
}
|
||||
notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
notifyIntent.setAction(Intent.ACTION_VIEW);
|
||||
notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须
|
||||
notifyIntent.putExtra("message", messageInfo);
|
||||
PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE);
|
||||
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
NotificationChannel channelwinway = null;
|
||||
NotificationCompat.Builder notificationBuilder = null;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
channelwinway = new NotificationChannel(getString(R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT);
|
||||
channelwinway.enableLights(true);
|
||||
channelwinway.enableVibration(true);
|
||||
notificationManager.createNotificationChannel(channelwinway);
|
||||
notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId())
|
||||
.setSmallIcon(R.mipmap.app_logo)
|
||||
.setContentTitle(messageInfo.getTitle())
|
||||
.setContentText(messageInfo.getContent())
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(R.string.app_name))
|
||||
.setSmallIcon(R.mipmap.app_logo)
|
||||
.setContentTitle(messageInfo.getTitle())
|
||||
.setContentText(messageInfo.getContent())
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
}
|
||||
notificationManager.notify(0, notificationBuilder.build());
|
||||
}
|
||||
|
||||
private void showNotification(String title, String body) {
|
||||
Intent notifyIntent = new Intent(this, IndexActivity.class);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) {
|
||||
ComponentName launchComponent = null;
|
||||
launchComponent = getApplication()
|
||||
.getPackageManager()
|
||||
.getLaunchIntentForPackage(getApplication().getPackageName())
|
||||
.getComponent();
|
||||
notifyIntent.setComponent(launchComponent);
|
||||
}
|
||||
notifyIntent.putExtra("message", body);
|
||||
notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
notifyIntent.setAction(Intent.ACTION_VIEW);
|
||||
notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须
|
||||
PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE);
|
||||
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
NotificationChannel channelwinway = null;
|
||||
NotificationCompat.Builder notificationBuilder = null;
|
||||
MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class);
|
||||
if (messageInfo != null) {
|
||||
body = messageInfo.getContent();
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
channelwinway = new NotificationChannel(getString(R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT);
|
||||
channelwinway.enableLights(true);
|
||||
channelwinway.enableVibration(true);
|
||||
notificationManager.createNotificationChannel(channelwinway);
|
||||
notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId())
|
||||
.setSmallIcon(R.mipmap.app_logo)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder = new NotificationCompat.Builder(this, getString(R.string.app_name))
|
||||
.setSmallIcon(R.mipmap.app_logo)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
}
|
||||
notificationManager.notify(0, notificationBuilder.build());
|
||||
}
|
||||
}
|
||||
79
workbuddy/src/main/java/com/webclip/base/TestActivity.java
Normal file
79
workbuddy/src/main/java/com/webclip/base/TestActivity.java
Normal file
@@ -0,0 +1,79 @@
|
||||
package com.webclip.base;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.webclip.base.comm.CommonAdapter;
|
||||
import com.webclip.base.comm.ViewHolder;
|
||||
import com.webclip.base.databinding.ScheduleMainBinding;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TestActivity extends AppCompatActivity {
|
||||
|
||||
ScheduleMainBinding activityStartBinding;
|
||||
|
||||
CommonAdapter commonHotGameAdapter;
|
||||
|
||||
List<Integer> liveList = new ArrayList<>();
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
getWindow().setNavigationBarColor(getColor(R.color.white));
|
||||
super.onCreate(savedInstanceState);
|
||||
View decor = getWindow().getDecorView();
|
||||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
|
||||
decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar != null) {
|
||||
actionBar.hide();
|
||||
}
|
||||
activityStartBinding = ScheduleMainBinding.inflate(getLayoutInflater());
|
||||
setContentView(activityStartBinding.getRoot());
|
||||
|
||||
initAdapter();
|
||||
initAdapterData();
|
||||
|
||||
}
|
||||
|
||||
private void initAdapterData() {
|
||||
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
|
||||
linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
|
||||
activityStartBinding.dateSelector.dateList.setLayoutManager(linearLayoutManager);
|
||||
commonHotGameAdapter = new CommonAdapter<Integer>(TestActivity.this, R.layout.date_item, liveList) {
|
||||
@Override
|
||||
public void convert(ViewHolder holder, Integer s, int index) {
|
||||
|
||||
}
|
||||
};
|
||||
activityStartBinding.dateSelector.dateList.setAdapter(commonHotGameAdapter);
|
||||
}
|
||||
|
||||
private void initAdapter() {
|
||||
|
||||
for (int i = 0 ;i<20;i++){
|
||||
liveList.add(i);
|
||||
}
|
||||
|
||||
activityStartBinding.scheduleList.setLayoutManager(new LinearLayoutManager(this));
|
||||
commonHotGameAdapter = new CommonAdapter<Integer>(TestActivity.this, R.layout.schedule_item, liveList) {
|
||||
@Override
|
||||
public void convert(ViewHolder holder, Integer s, int index) {
|
||||
|
||||
}
|
||||
};
|
||||
activityStartBinding.scheduleList.setAdapter(commonHotGameAdapter);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
}
|
||||
}
|
||||
19
workbuddy/src/main/java/com/webclip/base/WebApplication.java
Normal file
19
workbuddy/src/main/java/com/webclip/base/WebApplication.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package com.webclip.base;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
|
||||
import com.webclip.base.LogUtils;
|
||||
|
||||
public class WebApplication extends Application {
|
||||
|
||||
|
||||
public static Context application;
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
// 设置开启优化方案
|
||||
application = this;
|
||||
LogUtils.isDebug = BuildConfig.BUILD_TYPE.equals("debug");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.webclip.base.comm;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 通用列表适配器
|
||||
* @param <T>
|
||||
*/
|
||||
public abstract class CommonAdapter<T> extends RecyclerView.Adapter<ViewHolder> {
|
||||
|
||||
protected Context mContext;
|
||||
protected int mLayoutId;
|
||||
protected List<T> mDatas;
|
||||
protected LayoutInflater mInflater;
|
||||
|
||||
ViewHolder viewHolder;
|
||||
|
||||
|
||||
public CommonAdapter(Context context, int layoutId, List<T> datas) {
|
||||
mContext = context;
|
||||
mInflater = LayoutInflater.from(context);
|
||||
mLayoutId = layoutId;
|
||||
mDatas = datas;
|
||||
}
|
||||
public void setDates(List<T> dates){
|
||||
this.mDatas=dates;
|
||||
// notifyItemRangeChanged(0,mDatas.size());
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
public void addDates(List<T> dates){
|
||||
this.mDatas.addAll(dates);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void addDates(int localSize){
|
||||
int size=mDatas.size();
|
||||
notifyItemRangeChanged(size,localSize);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
viewHolder = ViewHolder.get(mContext, parent, mLayoutId);
|
||||
return viewHolder;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
|
||||
convert(holder, mDatas.get(position),position);
|
||||
}
|
||||
|
||||
public abstract void convert(ViewHolder holder, T t,int index);
|
||||
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mDatas.size();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.webclip.base.comm;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.SparseArray;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
/**
|
||||
* 通用列表ViewHolder
|
||||
*/
|
||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
private SparseArray<View> mViews;
|
||||
private View mConvertView;
|
||||
private Context mContext;
|
||||
|
||||
public ViewHolder(Context context, View itemView, ViewGroup parent) {
|
||||
super(itemView);
|
||||
mContext = context;
|
||||
mConvertView = itemView;
|
||||
mViews = new SparseArray<View>();
|
||||
}
|
||||
|
||||
public static ViewHolder get(Context context, ViewGroup parent, int layoutId) {
|
||||
|
||||
View itemView = LayoutInflater.from(context).inflate(layoutId, parent,
|
||||
false);
|
||||
ViewHolder holder = new ViewHolder(context, itemView, parent);
|
||||
return holder;
|
||||
}
|
||||
|
||||
|
||||
public <T extends View> T getView(int viewId) {
|
||||
View view = mViews.get(viewId);
|
||||
if (view == null) {
|
||||
view = mConvertView.findViewById(viewId);
|
||||
mViews.put(viewId, view);
|
||||
}
|
||||
return (T) view;
|
||||
}
|
||||
|
||||
|
||||
public ViewHolder setText(int viewId, String text)
|
||||
{
|
||||
TextView tv = getView(viewId);
|
||||
tv.setText(text);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ViewHolder setOnClickListener(int viewId, View.OnClickListener listener) {
|
||||
View view = getView(viewId);
|
||||
view.setOnClickListener(listener);
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
14
workbuddy/src/main/res/drawable/bg_button_outline.xml
Normal file
14
workbuddy/src/main/res/drawable/bg_button_outline.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="18dp" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#4CAF50" />
|
||||
<solid android:color="#FFFFFF" />
|
||||
<padding
|
||||
android:left="16dp"
|
||||
android:top="8dp"
|
||||
android:right="16dp"
|
||||
android:bottom="8dp" />
|
||||
</shape>
|
||||
11
workbuddy/src/main/res/drawable/bg_button_primary.xml
Normal file
11
workbuddy/src/main/res/drawable/bg_button_primary.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="18dp" />
|
||||
<solid android:color="#4CAF50" />
|
||||
<padding
|
||||
android:left="16dp"
|
||||
android:top="8dp"
|
||||
android:right="16dp"
|
||||
android:bottom="8dp" />
|
||||
</shape>
|
||||
8
workbuddy/src/main/res/drawable/bg_date_unselected.xml
Normal file
8
workbuddy/src/main/res/drawable/bg_date_unselected.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="#FFFFFF" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#E0E0E0" />
|
||||
</shape>
|
||||
10
workbuddy/src/main/res/drawable/bg_status_live.xml
Normal file
10
workbuddy/src/main/res/drawable/bg_status_live.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="10dp" />
|
||||
<solid android:color="#FF5722" />
|
||||
<gradient
|
||||
android:startColor="#FF5722"
|
||||
android:endColor="#FF9800"
|
||||
android:angle="90" />
|
||||
</shape>
|
||||
9
workbuddy/src/main/res/drawable/bg_today_button.xml
Normal file
9
workbuddy/src/main/res/drawable/bg_today_button.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?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="#E8F5E8" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#4CAF50" />
|
||||
</shape>
|
||||
10
workbuddy/src/main/res/drawable/big_bg.xml
Normal file
10
workbuddy/src/main/res/drawable/big_bg.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="270"
|
||||
android:startColor="@color/windows_color"
|
||||
android:centerColor="@color/windows_color"
|
||||
|
||||
android:endColor="@color/style_color"/>
|
||||
</shape>
|
||||
41
workbuddy/src/main/res/layout/date_item.xml
Normal file
41
workbuddy/src/main/res/layout/date_item.xml
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_horizontal"
|
||||
android:paddingVertical="8dp"
|
||||
android:paddingHorizontal="4dp">
|
||||
|
||||
<!-- 星期 -->
|
||||
<TextView
|
||||
android:id="@+id/day_of_week"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="周五"
|
||||
android:textColor="#666666"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<!-- 日期 -->
|
||||
<TextView
|
||||
android:id="@+id/day_number"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:gravity="center"
|
||||
android:text="13"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:background="@drawable/bg_date_unselected"
|
||||
android:layout_marginTop="4dp" />
|
||||
|
||||
<!-- 比赛数量指示器 -->
|
||||
<View
|
||||
android:id="@+id/match_indicator"
|
||||
android:layout_width="4dp"
|
||||
android:layout_height="4dp"
|
||||
android:background="#4CAF50"
|
||||
android:visibility="visible"
|
||||
android:layout_marginTop="4dp" />
|
||||
|
||||
</LinearLayout>
|
||||
72
workbuddy/src/main/res/layout/date_selector.xml
Normal file
72
workbuddy/src/main/res/layout/date_selector.xml
Normal file
@@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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:background="#FFFFFF"
|
||||
android:paddingVertical="12dp">
|
||||
|
||||
<!-- 左箭头 -->
|
||||
<ImageView
|
||||
android:id="@+id/btn_prev"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:tint="#666666"
|
||||
app:layout_constraintBottom_toBottomOf="@id/date_text"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/date_text" />
|
||||
|
||||
<!-- 当前日期 -->
|
||||
<TextView
|
||||
android:id="@+id/date_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="2025年3月13日 周五"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toStartOf="@id/btn_today"
|
||||
app:layout_constraintStart_toEndOf="@id/btn_prev"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!-- 今天按钮 -->
|
||||
<TextView
|
||||
android:id="@+id/btn_today"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_today_button"
|
||||
android:paddingHorizontal="12dp"
|
||||
android:paddingVertical="4dp"
|
||||
android:text="今天"
|
||||
android:textColor="#4CAF50"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintEnd_toStartOf="@id/btn_next"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!-- 右箭头 -->
|
||||
<ImageView
|
||||
android:id="@+id/btn_next"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:tint="#666666"
|
||||
app:layout_constraintBottom_toBottomOf="@id/date_text"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/date_text" />
|
||||
|
||||
<!-- 日期选择器 -->
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/date_list"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:clipToPadding="false"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/date_text" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
304
workbuddy/src/main/res/layout/schedule_item.xml
Normal file
304
workbuddy/src/main/res/layout/schedule_item.xml
Normal file
@@ -0,0 +1,304 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.cardview.widget.CardView 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_marginHorizontal="16dp"
|
||||
android:layout_marginVertical="8dp"
|
||||
app:cardCornerRadius="8dp"
|
||||
app:cardElevation="2dp"
|
||||
app:cardBackgroundColor="#FFFFFF">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp">
|
||||
|
||||
<!-- 状态标签 -->
|
||||
<TextView
|
||||
android:id="@+id/status_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_status_live"
|
||||
android:paddingHorizontal="8dp"
|
||||
android:paddingVertical="4dp"
|
||||
android:text="直播中"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!-- 比赛时间 -->
|
||||
<TextView
|
||||
android:id="@+id/match_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="15:30"
|
||||
android:textColor="#FF9800"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/match_date"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="3月13日 周五"
|
||||
android:textColor="#999999"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/match_time" />
|
||||
|
||||
<!-- 分隔线 -->
|
||||
<View
|
||||
android:id="@+id/divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="#E0E0E0"
|
||||
app:layout_constraintTop_toBottomOf="@id/match_date"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<!-- 主队 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/home_team_layout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_horizontal"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/divider"
|
||||
app:layout_constraintEnd_toStartOf="@id/score_layout"
|
||||
app:layout_constraintHorizontal_weight="2">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/home_team_logo"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@mipmap/app_logo"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/home_team_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Team A"
|
||||
android:textColor="#333333"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginTop="8dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/home_team_record"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="战绩: 15胜3负"
|
||||
android:textColor="#666666"
|
||||
android:textSize="12sp"
|
||||
android:layout_marginTop="4dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 比分区域 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/score_layout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="15dp"
|
||||
|
||||
app:layout_constraintTop_toBottomOf="@id/divider"
|
||||
app:layout_constraintStart_toEndOf="@id/home_team_layout"
|
||||
app:layout_constraintEnd_toStartOf="@id/away_team_layout"
|
||||
app:layout_constraintHorizontal_weight="2">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/match_status"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="第3节 08:30"
|
||||
android:textColor="#4CAF50"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="8dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/home_score"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="78"
|
||||
android:textColor="#333333"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=" - "
|
||||
android:textColor="#666666"
|
||||
android:textSize="20sp"
|
||||
android:layout_marginHorizontal="8dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/away_score"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="65"
|
||||
android:textColor="#333333"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/match_series"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="系列赛 2-1"
|
||||
android:textColor="#999999"
|
||||
android:textSize="12sp"
|
||||
android:layout_marginTop="4dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 客队 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/away_team_layout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginTop="10dp"
|
||||
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_marginEnd="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/divider"
|
||||
app:layout_constraintStart_toEndOf="@id/score_layout"
|
||||
app:layout_constraintHorizontal_weight="2">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/away_team_logo"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@mipmap/app_logo"
|
||||
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/away_team_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Team B"
|
||||
android:textColor="#333333"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginTop="8dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/away_team_record"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="战绩: 12胜6负"
|
||||
android:textColor="#666666"
|
||||
android:textSize="12sp"
|
||||
android:layout_marginTop="4dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 比赛地点和联赛 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/match_info"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/home_team_layout">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:src="@mipmap/app_logo"
|
||||
android:tint="#666666" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/match_location"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="北京国家体育场"
|
||||
android:textColor="#666666"
|
||||
android:textSize="13sp"
|
||||
android:layout_marginStart="8dp" />
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="12dp"
|
||||
android:layout_marginHorizontal="12dp"
|
||||
android:background="#E0E0E0" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:src="@mipmap/app_logo"
|
||||
android:tint="#666666" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/league_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="CBA 2025赛季"
|
||||
android:textColor="#666666"
|
||||
android:textSize="13sp"
|
||||
android:layout_marginStart="8dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 底部按钮 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/button_layout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="12dp"
|
||||
android:gravity="center"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/match_info">
|
||||
|
||||
<!-- 顶部边框 -->
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:background="#F0F0F0"
|
||||
app:layout_constraintTop_toBottomOf="@id/match_info" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_watch_live"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:background="@drawable/bg_button_primary"
|
||||
android:text="观看直播"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_statistics"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_button_outline"
|
||||
android:text="比赛数据"
|
||||
android:textColor="#4CAF50"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
170
workbuddy/src/main/res/layout/schedule_main.xml
Normal file
170
workbuddy/src/main/res/layout/schedule_main.xml
Normal file
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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:background="#F5F5F5">
|
||||
|
||||
<!-- 标题栏 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/title_bar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="56dp"
|
||||
android:background="#FFFFFF"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:gravity="center_vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="赛事赛程"
|
||||
android:textColor="#000000"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@mipmap/app_logo"
|
||||
android:tint="#666666"/>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 日期选择区域 -->
|
||||
<include
|
||||
android:id="@+id/date_selector"
|
||||
layout="@layout/date_selector"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_bar" />
|
||||
|
||||
<!-- 筛选标签 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/filter_layout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="?actionBarSize"
|
||||
android:orientation="horizontal"
|
||||
android:background="#FFFFFF"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:gravity="center_vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/date_selector">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tab_all"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="全部"
|
||||
android:textColor="#4CAF50"
|
||||
android:textSize="14sp"
|
||||
android:gravity="center"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:background="?attr/selectableItemBackground" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tab_live"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="进行中"
|
||||
android:textColor="#666666"
|
||||
android:textSize="14sp"
|
||||
android:gravity="center"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:background="?attr/selectableItemBackground" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tab_upcoming"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="即将开始"
|
||||
android:textColor="#666666"
|
||||
android:textSize="14sp"
|
||||
android:gravity="center"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:background="?attr/selectableItemBackground" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tab_finished"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="已结束"
|
||||
android:textColor="#666666"
|
||||
android:textSize="14sp"
|
||||
android:gravity="center"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:background="?attr/selectableItemBackground" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 赛程列表 -->
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/schedule_list"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:clipToPadding="false"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="16dp"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/filter_layout" />
|
||||
|
||||
<!-- 空状态 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/empty_state"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/filter_layout">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:tint="#CCCCCC" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="暂无比赛数据"
|
||||
android:textColor="#999999"
|
||||
android:textSize="16sp"
|
||||
android:layout_marginTop="16dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="今天没有安排比赛"
|
||||
android:textColor="#BBBBBB"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginTop="8dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 加载状态 -->
|
||||
<ProgressBar
|
||||
android:id="@+id/loading"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/filter_layout" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
BIN
workbuddy/src/main/res/mipmap-xxhdpi/app_logo.png
Normal file
BIN
workbuddy/src/main/res/mipmap-xxhdpi/app_logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 779 KiB |
91
workbuddy/src/main/res/values/themes.xml
Normal file
91
workbuddy/src/main/res/values/themes.xml
Normal file
@@ -0,0 +1,91 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.AppTheme" parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_500</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/white</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_700</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="android:windowBackground">#000000</item>
|
||||
|
||||
</style>
|
||||
|
||||
<style name="Theme.Calculcator1" parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_500</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/white</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_700</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<item name="android:windowFullscreen">true</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</style>
|
||||
|
||||
|
||||
<declare-styleable name="CircleImageView">
|
||||
<attr name="ease_border_color" format="color" />
|
||||
<attr name="ease_border_width" format="dimension" />
|
||||
<attr name="ease_press_alpha" format="integer" />
|
||||
<attr name="ease_press_color" format="color" />
|
||||
<attr name="ease_radius" format="dimension" />
|
||||
<attr name="es_shape_type" format="enum">
|
||||
<enum name="none" value="0" />
|
||||
<enum name="round" value="1" />
|
||||
<enum name="rectangle" value="2" />
|
||||
</attr>
|
||||
</declare-styleable>
|
||||
|
||||
|
||||
<!-- 注意:当前AppTheme主题,在values-v23中单独重复维护。原因是Android 6以下系统不支持设置
|
||||
系统状态栏颜色,如果按照设计,状态栏使用素色则在android6以下手机上就看不清系统状态栏文字了(
|
||||
因为系统文字是白色)。在values-v23表示当Android 23(即android 6)及以上版本将自动使用该目录
|
||||
下的主题(即 colorPrimaryDark 使用素色,从而跟标题栏颜色保持一致,实现沉浸式ui效果)。-->
|
||||
<style name="AppThemeStart" parent="@style/Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="android:windowTranslucentStatus">false</item>
|
||||
<item name="android:windowTranslucentNavigation">false</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="colorPrimary">@color/windows_color</item>
|
||||
<item name="colorPrimaryDark">@color/windows_color</item>
|
||||
<item name="colorAccent">@color/windows_color</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<!-- 隐藏Activity窗口的Title标题栏 -->
|
||||
<item name="windowNoTitle">true</item>
|
||||
<!-- <item name="android:windowFullscreen">true</item>-->
|
||||
<!-- <item name="android:windowBackground">@drawable/splah_bg</item>-->
|
||||
|
||||
<item name="android:navigationBarColor">@color/style_color</item>
|
||||
<!-- <item name="android:windowBackground">@mipmap/big_bg</item>-->
|
||||
<item name="android:forceDarkAllowed" tools:ignore="NewApi">false</item>
|
||||
<item name="android:windowBackground">@drawable/big_bg</item>
|
||||
|
||||
</style>
|
||||
|
||||
<style name="MaterialDesignDialog" parent="@style/Theme.AppCompat.Dialog">
|
||||
<!-- 背景透明 -->
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<!-- 浮于Activity之上 -->
|
||||
<item name="android:windowIsFloating">true</item>
|
||||
<!-- 边框 -->
|
||||
<item name="android:windowFrame">@null</item>
|
||||
<!-- Dialog以外的区域模糊效果 -->
|
||||
<item name="android:backgroundDimEnabled">true</item>
|
||||
<!-- 无标题 -->
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<!-- 半透明 -->
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowCloseOnTouchOutside">true</item>
|
||||
</style>
|
||||
</resources>
|
||||
10
workbuddy/src/main/res/xml/app_updater_paths.xml
Normal file
10
workbuddy/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
workbuddy/src/main/res/xml/network_security_config.xml
Normal file
4
workbuddy/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
workbuddy/src/main/res/xml/provider_paths.xml
Normal file
13
workbuddy/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"异常的问题 -->
|
||||
Reference in New Issue
Block a user