精简:替换FloatingActionButton组件

This commit is contained in:
pppscn 2022-01-30 14:23:38 +08:00
parent 4ce2419d9f
commit 049ce553b2
10 changed files with 78 additions and 42 deletions

View File

@ -31,9 +31,6 @@ android {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86'//, 'x86_64'
}
}
lintOptions {
checkReleaseBuilds false
}
signingConfigs {
release {
keyAlias keyProps['keyAlias']
@ -52,13 +49,13 @@ android {
release {
minifyEnabled false
//shrinkResources true
//proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
debug {
minifyEnabled false
//shrinkResources true
//proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.debug
}
}
@ -72,6 +69,11 @@ android {
}
}
def abiCodes = ['universal': 1, 'armeabi-v7a': 2, 'arm64-v8a': 3, 'x86': 4, 'x86_64': 5]
packagingOptions {
resources {
excludes += ['META-INF/DEPENDENCIES.txt', 'META-INF/LICENSE.txt', 'META-INF/NOTICE.txt', 'META-INF/NOTICE', 'META-INF/LICENSE', 'META-INF/DEPENDENCIES', 'META-INF/notice.txt', 'META-INF/license.txt', 'META-INF/dependencies.txt', 'META-INF/LGPL2.1']
}
}
android.applicationVariants.all { variant ->
// Assigns a different version code for each output APK.
variant.outputs.each {
@ -80,21 +82,12 @@ android {
def abiName = output.getFilter(com.android.build.OutputFile.ABI)
if (abiName == null) abiName = "universal"
output.versionCodeOverride = abiCodes.get(abiName, 0) * 100000 + variant.versionCode
output.outputFileName = "SmsForwarder_${variant.name}_${versionName}_${output.versionCodeOverride}_${date}_${abiName}.apk"
output.outputFileName = "SmsForwarder_${variant.name}_${versionName}_${output.versionCode}_${date}_${abiName}.apk"
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
lint {
checkReleaseBuilds false
}
}
@ -138,7 +131,6 @@ void cmdExecute(String cmd) {
println cmd.execute().text
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//noinspection GradleDependency
@ -146,7 +138,7 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
//noinspection GradleDependency
implementation 'com.google.firebase:firebase-crashlytics-buildtools:2.5.2'
implementation 'com.google.android.material:material:1.5.0'
//implementation 'com.google.android.material:material:1.5.0'
//noinspection GradleDynamicVersion
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
@ -160,12 +152,6 @@ dependencies {
//fastjson
implementation "com.alibaba:fastjson:1.2.79"
//SDK
implementation 'com.umeng.umsdk:common:9.4.6'//
implementation 'com.umeng.umsdk:asms:1.6.0'// asms包依赖必选
implementation 'com.umeng.umsdk:apm:1.5.2'// SDKcrash数据请一定集成
//implementation 'com.umeng.umsdk:abtest:1.0.0'//使U-App中ABTest能力
//XUpdate
implementation 'com.github.xuexiangjys:XUpdate:2.1.1'
implementation 'com.github.xuexiangjys.XUpdateAPI:xupdate-easy:1.0.1'
@ -194,4 +180,11 @@ dependencies {
implementation "org.eclipse.jetty:jetty-server:9.2.30.v20200428"
implementation "org.eclipse.jetty:jetty-servlet:9.2.30.v20200428"
//FloatingActionButton
implementation 'com.melnykov:floatingactionbutton:1.3.0'
//SDK
implementation 'com.umeng.umsdk:common:9.4.7'// ()
implementation 'com.umeng.umsdk:asms:1.6.0'//
}

View File

@ -26,7 +26,6 @@ import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.hjq.permissions.OnPermissionCallback;
import com.hjq.permissions.Permission;
import com.hjq.permissions.XXPermissions;
@ -50,6 +49,7 @@ import com.idormy.sms.forwarder.utils.SharedPreferencesHelper;
import com.idormy.sms.forwarder.utils.SmsUtil;
import com.idormy.sms.forwarder.utils.TimeUtil;
import com.idormy.sms.forwarder.view.StepBar;
import com.melnykov.fab.FloatingActionButton;
import com.umeng.commonsdk.UMConfigure;
import java.lang.reflect.Method;

View File

@ -23,7 +23,6 @@ import android.widget.Toast;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.idormy.sms.forwarder.adapter.RuleAdapter;
import com.idormy.sms.forwarder.model.RuleModel;
import com.idormy.sms.forwarder.model.SenderModel;
@ -35,6 +34,7 @@ import com.idormy.sms.forwarder.utils.LogUtil;
import com.idormy.sms.forwarder.utils.RuleUtil;
import com.idormy.sms.forwarder.utils.SettingUtil;
import com.idormy.sms.forwarder.view.StepBar;
import com.melnykov.fab.FloatingActionButton;
import java.util.ArrayList;
import java.util.Date;
@ -133,11 +133,11 @@ public class RuleActivity extends AppCompatActivity {
//计算浮动按钮位置
FloatingActionButton btnFloat = findViewById(R.id.btnFloat);
CommonUtil.calcMarginBottom(this, btnFloat, listView, null);
FloatingActionButton btnAddRule = findViewById(R.id.btnAddRule);
CommonUtil.calcMarginBottom(this, btnAddRule, listView, null);
//添加规则
btnFloat.setOnClickListener(v -> setRule(null, false));
btnAddRule.setOnClickListener(v -> setRule(null, false));
//步骤完成状态校验
StepBar stepBar = findViewById(R.id.stepBar);

View File

@ -38,7 +38,6 @@ import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import com.alibaba.fastjson.JSON;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.idormy.sms.forwarder.adapter.SenderAdapter;
import com.idormy.sms.forwarder.model.SenderModel;
import com.idormy.sms.forwarder.model.vo.BarkSettingVo;
@ -72,6 +71,7 @@ import com.idormy.sms.forwarder.utils.LogUtil;
import com.idormy.sms.forwarder.utils.RuleUtil;
import com.idormy.sms.forwarder.view.ClearEditText;
import com.idormy.sms.forwarder.view.StepBar;
import com.melnykov.fab.FloatingActionButton;
import java.net.Proxy;
import java.util.ArrayList;

View File

@ -17,9 +17,9 @@ import android.widget.ScrollView;
import androidx.core.app.ActivityCompat;
import androidx.core.app.NotificationManagerCompat;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.idormy.sms.forwarder.MyApplication;
import com.idormy.sms.forwarder.service.NotifyService;
import com.melnykov.fab.FloatingActionButton;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

View File

@ -4,7 +4,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.floatingactionbutton.FloatingActionButton
<!--<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/btnCleanLog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -17,7 +17,21 @@
android:src="@drawable/ic_delete"
app:borderWidth="0dp"
app:elevation="5dp"
app:fabSize="mini" />
app:fabSize="mini" />-->
<com.melnykov.fab.FloatingActionButton
android:id="@+id/btnCleanLog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginEnd="10dp"
android:layout_marginBottom="90dp"
android:src="@drawable/ic_delete"
app:fab_type="mini"
app:fab_colorNormal="@color/colorPrimary"
app:fab_colorPressed="@color/colorPrimaryDark"
app:fab_colorRipple="@color/colorAccent" />
<LinearLayout
android:id="@+id/radioGroup"

View File

@ -4,7 +4,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.floatingactionbutton.FloatingActionButton
<!--<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/btnFloat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -17,7 +17,21 @@
android:src="@drawable/ic_add"
app:borderWidth="0dp"
app:elevation="5dp"
app:fabSize="mini" />
app:fabSize="mini" />-->
<com.melnykov.fab.FloatingActionButton
android:id="@+id/btnAddRule"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginEnd="10dp"
android:layout_marginBottom="90dp"
android:src="@drawable/ic_add"
app:fab_type="mini"
app:fab_colorNormal="@color/colorPrimary"
app:fab_colorPressed="@color/colorPrimaryDark"
app:fab_colorRipple="@color/colorAccent" />
<LinearLayout
android:id="@+id/radioGroup"

View File

@ -1,10 +1,11 @@
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.floatingactionbutton.FloatingActionButton
<!--<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/btnAddSender"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -17,7 +18,21 @@
android:src="@drawable/ic_add"
app:borderWidth="0dp"
app:elevation="5dp"
app:fabSize="mini" />
app:fabSize="mini" />-->
<com.melnykov.fab.FloatingActionButton
android:id="@+id/btnAddSender"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginEnd="10dp"
android:layout_marginBottom="90dp"
android:src="@drawable/ic_add"
app:fab_type="mini"
app:fab_colorNormal="@color/colorPrimary"
app:fab_colorPressed="@color/colorPrimaryDark"
app:fab_colorRipple="@color/colorAccent" />
<ListView
android:id="@+id/list_view_sender"

View File

@ -153,7 +153,7 @@
<string name="ServerChanSendKey">ServerChan\'s SendKey</string>
<string name="TelegramApiToken">ApiToken or Custom address</string>
<string name="TelegramChatId">ChatId</string>
<string name="Method">Method</string>
<string name="Method" formatted="false">Method</string>
<string name="WebNotifyWebServer">WebServer</string>
<string name="WebNotifyWebServerTips">e.g. https://a.b.com/msg?token=xyz</string>
<string name="WebNotifyWebParams">WebParams</string>
@ -170,7 +170,7 @@
<string name="sim2_remark" tools:ignore="Typos">SIM2 Label</string>
<string name="carrier_mobile" tools:ignore="Typos">Label of SIM,\neg. AT&amp;T_88888888</string>
<string name="low_power_alarm_threshold">Low power alarm</string>
<string name="low_power_alarm_threshold_tips">Value range: 0100.\nLeft blank or 0 is disabled</string>
<string name="low_power_alarm_threshold_tips">Value range: 099.\nLeft blank or 0 is disabled</string>
<string name="retry_interval">Retry interval</string>
<string name="retry_interval_tips">Disabled when times = 0,\nthe interval is incremented</string>
<string name="forward_sms">Forward sms</string>

View File

@ -153,7 +153,7 @@
<string name="ServerChanSendKey">Server酱·Turbo版的SendKey</string>
<string name="TelegramApiToken">Telegram机器人的ApiToken 或 自定义地址(http开头)</string>
<string name="TelegramChatId">被通知人(或群组)的ChatId</string>
<string name="Method">请求方式</string>
<string name="Method" formatted="false">请求方式</string>
<string name="WebNotifyWebServer">WebServer</string>
<string name="WebNotifyWebServerTips">例如https://a.b.com/msg?token=xyz</string>
<string name="WebNotifyWebParams">WebParams</string>
@ -170,7 +170,7 @@
<string name="sim2_remark" tools:ignore="Typos">SIM2备注</string>
<string name="carrier_mobile">运营商_手机号</string>
<string name="low_power_alarm_threshold">电量预警阈值(%)</string>
<string name="low_power_alarm_threshold_tips">取值范围01000禁用</string>
<string name="low_power_alarm_threshold_tips">取值范围0990禁用</string>
<string name="retry_interval">请求接口失败重试</string>
<string name="retry_interval_tips">次数=0时禁用间隔逐次递增</string>
<string name="forward_sms">转发短信广播</string>