Commit 62cb3f96 by huahua

修改

parent 2b518366
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -41,14 +41,13 @@
<uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />
<uses-permission
android:name="android.permission.DEVICE_POWER"
tools:ignore="ProtectedPermissions" />
<!--android:theme="@style/AppTheme"-->
tools:ignore="ProtectedPermissions"/>
<application
android:name=".CustomApplication"
android:allowBackup="true"
android:fullBackupContent="true"
android:icon="@drawable/app_logo"
android:label="色彩手机壳"
android:label="自动色彩手机壳"
android:largeHeap="true"
android:networkSecurityConfig="@xml/network_security_config"
android:supportsRtl="true"
......@@ -67,7 +66,6 @@
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
<!--<category android:name="android.intent.category.FS_HOME" />-->
<category android:name="android.intent.category.HOME" />
</intent-filter>
</activity>
......@@ -77,33 +75,6 @@
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@style/AppTheme" />
<!--android:largeHeap="true"
android:hardwareAccelerated="false"-->
<activity
android:name=".view.home.make.RealMakeActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:largeHeap="true"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/AppTheme"
android:windowSoftInputMode="adjustResize|stateHidden" />
<activity
android:name=".view.pay.PaySuccessActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait"
android:theme="@style/AppTheme" />
<activity
android:name=".view.pay.PayActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/AppTheme" />
<activity
android:name=".view.online.OnLineActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/AppTheme" />
<activity
android:name=".view.process.ProcessActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
......@@ -111,23 +82,6 @@
android:screenOrientation="portrait"
android:theme="@style/AppTheme" />
<activity
android:name=".view.wrok.WorkActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/AppTheme" />
<activity
android:name=".view.wrok.detail.WorkDetailActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait"
android:theme="@style/AppTheme" />
<activity
android:name=".view.goodSize.GoodSizeActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:hardwareAccelerated="false"
android:screenOrientation="portrait"
android:theme="@style/AppTheme" />
<activity
android:name=".view.machine.MachineCodeActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait"
......@@ -145,22 +99,11 @@
android:screenOrientation="portrait"
android:theme="@style/AppTheme" />
<activity
android:name=".view.good.GoodSelectActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait"
android:theme="@style/AppTheme" />
<activity
android:name=".activities.testAnimationActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait"
android:theme="@style/AppTheme" />
<activity
android:name=".view.process.complete.ProcessCompleteActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/AppTheme" />
<service
android:name="live.nodiyphoneshell.cend.service.AutoInstallService"
android:label="@string/aby_label"
......
<!DOCTYPE html>
<html >
<meta charset="utf-8">
<body style="color: transparent;width:100%;height:100%;">
<div onclick="startfireworks()">点击开始</div>
<script>
var raf = (function() {
var TIME = Math.floor(1000 / 60);
var frame, cancel;
var frames = {};
var lastFrameTime = 0;
if (typeof requestAnimationFrame === 'function' && typeof cancelAnimationFrame === 'function') {
frame = function(cb) {
var id = Math.random();
frames[id] = requestAnimationFrame(function onFrame(time) {
if (lastFrameTime === time || lastFrameTime + TIME - 1 < time) {
lastFrameTime = time;
delete frames[id];
cb();
} else {
frames[id] = requestAnimationFrame(onFrame);
}
});
return id;
};
cancel = function(id) {
if (frames[id]) {
cancelAnimationFrame(frames[id]);
}
};
} else {
frame = function(cb) {
return setTimeout(cb, TIME);
};
cancel = function(timer) {
return clearTimeout(timer);
};
}
return {
frame: frame,
cancel: cancel
};
}());
function toDecimal(str) {
return parseInt(str, 16);
}
function hexToRgb(str) {
var val = String(str).replace(/[^0-9a-f]/gi, '');
if (val.length < 6) {
val = val[0] + val[0] + val[1] + val[1] + val[2] + val[2];
}
return {
r: toDecimal(val.substring(0, 2)),
g: toDecimal(val.substring(2, 4)),
b: toDecimal(val.substring(4, 6))
};
}
function updateFetti(context, fetti) {
var progress = (fetti.tick++) / fetti.totalTicks;
if (progress > 1) {
return;
}
fetti.x += Math.cos(fetti.angle2D) * fetti.velocity; // 左下角
fetti.y += Math.sin(fetti.angle2D) * fetti.velocity + fetti.gravity; // 左下角
fetti.velocity *= fetti.decay;
fetti.tiltAngle += 0.1;
fetti.tiltSin = Math.sin(fetti.tiltAngle);
fetti.tiltCos = Math.cos(fetti.tiltAngle);
fetti.random = Math.random() + 7;
var x1 = fetti.x;
var y1 = fetti.y;
var x2 = fetti.x + (fetti.random * fetti.tiltCos); // 左上角
var y2 = fetti.y + (fetti.random * fetti.tiltSin); // 左上角
var x3 = x2 + fetti.random;
var y3 = y2;
var x4 = fetti.x + fetti.random;
var y4 = fetti.y;
context.fillStyle = 'rgba(' + fetti.color.r + ', ' + fetti.color.g + ', ' + fetti.color.b + ', ' + (1 - progress) +
')';
context.beginPath();
context.moveTo(Math.floor(x1), Math.floor(y1));
context.lineTo(Math.floor(x2), Math.floor(y2));
context.lineTo(Math.floor(x3), Math.floor(y3));
context.lineTo(Math.floor(x4), Math.floor(y4));
context.closePath();
context.fill();
return fetti.tick < fetti.totalTicks;
}
function getCanvas(zIndex) {
var canvas = document.createElement('canvas');
canvas.style.position = 'fixed';
canvas.style.top = '0px';
canvas.style.left = '0px';
canvas.style.pointerEvents = 'none';
canvas.style.zIndex = zIndex;
return canvas;
}
function setCanvasWindowSize(canvas) {
canvas.width = document.documentElement.clientWidth;
canvas.height = document.documentElement.clientHeight;
}
const canvas = getCanvas(200);
setCanvasWindowSize(canvas);
document.body.appendChild(canvas);
var context = canvas.getContext('2d');
const colors = [
'#26ccff',
'#a25afd',
'#ff5e7e',
'#88ff5a',
'#fcff42',
'#ffa62d',
'#ff36ff',
'#7f7522',
'#2e3a1f',
'#181d4b',
'#0c212b',
'#d71345'
];
var arr = []
for (let i = 0; i < 20; i++) {
arr.push({
"x": 0,
"y": document.documentElement.clientHeight / 3,
"velocity": (45 * 0.5) + (Math.random() * 20),
"angle2D": 3 / 2 * Math.PI + Math.random() * 1 / 4 * Math.PI,
"tiltAngle": Math.random() * Math.PI,
"color": hexToRgb(colors[Math.floor(Math.random() * 12)]),
"tick": 0,
"totalTicks": 200,
"decay": 0.9,
"random": 0,
"tiltSin": 0,
"tiltCos": 0,
"gravity": 3,
"scalar": 1
})
}
var animationFrame = null;
function update() {
context.clearRect(0, 0, canvas.width, canvas.height);
arr = arr.filter(item => {
return updateFetti(context, item);
});
if (arr.length) {
animationFrame = raf.frame(update);
}
}
function startfireworks() {
alert("进来")
if (!animationFrame) {
//alert("进来")
animationFrame = raf.frame(update);
} else {
//alert("进来下面")
for (let i = 0; i < 20; i++) {
arr.push({
"x": 0,
//"y": 500,
"y": document.documentElement.clientHeight / 3,
"velocity": (45 * 0.5) + (Math.random() * 20),
"angle2D": 3 / 2 * Math.PI + Math.random() * 1 / 4 * Math.PI,
"tiltAngle": Math.random() * Math.PI,
"color": hexToRgb(colors[Math.floor(Math.random() * 12)]),
"tick": 100,
"totalTicks": 200,
"decay": 0.9,
"random": 0,
"tiltSin": 0,
"tiltCos": 0,
"gravity": 3,
"scalar": 1
})
}
}
}
start.onclick = () => {
if (!animationFrame) {
animationFrame = raf.frame(update);
} else {
for (let i = 0; i < 20; i++) {
arr.push({
"x": 0,
"y": document.documentElement.clientHeight / 3,
"velocity": (45 * 0.5) + (Math.random() * 20),
"angle2D": 3 / 2 * Math.PI + Math.random() * 1 / 4 * Math.PI,
"tiltAngle": Math.random() * Math.PI,
"color": hexToRgb(colors[Math.floor(Math.random() * 12)]),
"tick": 0,
"totalTicks": 200,
"decay": 0.9,
"random": 0,
"tiltSin": 0,
"tiltCos": 0,
"gravity": 3,
"scalar": 1
})
}
}
}
</script>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
//JS代码
<script>
//Android需要调用的方法
function callJS(color){
if(color == "" || color == null || color == undefined){
return "";
}
var values = color
.replace(/rgba?\(/, '')
.replace(/\)/, '')
.replace(/[\s+]/g, '')
.split(',')
var a = parseFloat(values[3] || 1),
r = Math.floor(a * parseInt(values[0]) + (1 - a) * 255),
g = Math.floor(a * parseInt(values[1]) + (1 - a) * 255),
b = Math.floor(a * parseInt(values[2]) + (1 - a) * 255)
return '#' +
('0' + r.toString(16)).slice(-2) +
('0' + g.toString(16)).slice(-2) +
('0' + b.toString(16)).slice(-2)
}
</script>
</head>
</html>
\ No newline at end of file
package live.nodiyphoneshell.cend;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.pm.PackageManager;
......@@ -25,7 +24,7 @@ public class BaseMianActivity extends AppCompatActivity {
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ScreenUtils.setDensityByWidth(this, getApplication());
// ScreenUtils.setCustomDensity(this);
//ScreenUtils.setCustomDensity(this);
}
@Override
......
......@@ -27,15 +27,13 @@ public class BasePresenter {
dialog = loadBuilder.create();
}
dialog.show();
}catch (Exception e){
}catch (Exception e){
}
}
}
public void showLoad(Context context,String message) {
try {
if(context==null){
return;
}
......@@ -53,9 +51,9 @@ public class BasePresenter {
dialog = loadBuilder.create();
}
dialog.show();
}catch (Exception e){
}catch (Exception e){
}
}
}
public void closeLoad() {
......@@ -68,5 +66,4 @@ public class BasePresenter {
}
}
}
......@@ -40,8 +40,6 @@ import live.nodiyphoneshell.cend.modules.ImageBanner;
import live.nodiyphoneshell.cend.modules.MachineInitRewriteBean;
import live.nodiyphoneshell.cend.modules.VideoBean;
import live.nodiyphoneshell.cend.modules.VideoInfoBean;
import live.nodiyphoneshell.cend.receiver.NetStateChangeReceiver;
import live.nodiyphoneshell.cend.receiver.NetworkUtil;
import live.nodiyphoneshell.cend.rxbus.RxBackHomeTimer;
import live.nodiyphoneshell.cend.rxbus.RxBus;
import live.nodiyphoneshell.cend.rxbus.RxConstants;
......@@ -88,15 +86,6 @@ public class MainActivity extends BaseActivity implements MainContract.View {
@BindView(R.id.fragment_home_banner_text)
TextView fragment_home_banner_text;
@BindView(R.id.layout_my_prompt_message_le)
LinearLayout layout_my_prompt_message_le;
@BindView(R.id.layout_my_prompt_message_image)
ImageView layout_my_prompt_message_image;
@BindView(R.id.layout_my_prompt_message_text)
TextView layout_my_prompt_message_text;
private Handler handler = new Handler();
private List<ViewItemBean> viewItemBeanList = new ArrayList<>();
private MainPresenter mainPresenter;
......@@ -146,13 +135,6 @@ public class MainActivity extends BaseActivity implements MainContract.View {
getScoketData();
}
//消息提示跑马灯
private void promptMessage() {
RxHomePromptMessageTimer.getInstance(this).initData(layout_my_prompt_message_le, layout_my_prompt_message_image, layout_my_prompt_message_text);
if (RxMakePromptMessageTimer.getInstance(this).orderNoticeBeanList != null && RxMakePromptMessageTimer.getInstance(this).orderNoticeBeanList.size() > 0) {
RxHomePromptMessageTimer.getInstance(this).interval();
}
}
//授权管理
private void authorizationManagement() {
......@@ -788,7 +770,6 @@ public class MainActivity extends BaseActivity implements MainContract.View {
@Override
public void onResume() {
super.onResume();
promptMessage();
MediaPlayerHelper.getInstance().stop();
RxBackHomeTimer.getInstance(MainActivity.this).initTimer(-1);
String machine_code = SPUtils.getStringValue("machine_code", "");
......
package live.nodiyphoneshell.cend.activities;
import android.content.Context;
import android.os.Environment;
import com.cretin.www.wheelsruflibrary.view.LotteryBean;
import com.cretin.www.wheelsruflibrary.view.WheelSurfView;
import com.zhy.http.okhttp.OkHttpUtils;
import com.zhy.http.okhttp.callback.FileCallBack;
import java.io.File;
import java.util.List;
import live.nodiyphoneshell.cend.BasePresenter;
import live.nodiyphoneshell.cend.config.Config;
import live.nodiyphoneshell.cend.modules.MachineInitRewriteBean;
......@@ -76,8 +73,6 @@ public class MainPresenter extends BasePresenter implements MainContract.Present
}
@Override
public void upLoadVideo(MachineInitRewriteBean.DataBean.VideoBean videoBean) {
XYDClient.getInstance(context).saveFileText("下载视频文件","开始下载....");
......@@ -96,6 +91,7 @@ public class MainPresenter extends BasePresenter implements MainContract.Present
});
}
@Override
public void updateUpLoadVideo(VideoBean videoBean) {
XYDClient.getInstance(context).saveFileText("推送更新视频文件","开始下载....");
......@@ -115,4 +111,5 @@ public class MainPresenter extends BasePresenter implements MainContract.Present
});
}
}
......@@ -36,6 +36,7 @@ public class SplashActivity extends AppCompatActivity {
}
private void launch() {
SPUtils.putStringValue("machine_code","100003");
AlphaAnimation animation = new AlphaAnimation(0.1f, 1.0f);
animation.setDuration(900);
mIvBackground.startAnimation(animation);
......
package live.nodiyphoneshell.cend.dialog;
import android.app.Dialog;
import android.content.Context;
import android.view.Gravity;
......@@ -11,6 +12,7 @@ import butterknife.BindView;
import butterknife.ButterKnife;
import live.nodiyphoneshell.cend.R;
import live.nodiyphoneshell.cend.utils.ScreenUtils;
/**
* @author MaYnaghua
* @version 1.0.0
......
package live.nodiyphoneshell.cend.dialog;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.TextView;
import live.nodiyphoneshell.cend.R;
import live.nodiyphoneshell.cend.utils.ScreenUtils;
/**
* @author MaYnaghua
* @version 1.0.0
* @date 2020/8/28 16:26
*/
public class ShowClearDialog {
private static volatile ShowClearDialog intance;
private OnClickSaveListener onClickSaveListener;
private OnClickUpLoadListener onClickUpLoadListener;
public interface OnClickSaveListener {
void OnClickSaveButton();
}
public interface OnClickUpLoadListener {
void OnClickUpLoadButton();
}
public void setOnClickUpLoadListener(OnClickUpLoadListener onClickUpLoadListener) {
this.onClickUpLoadListener = onClickUpLoadListener;
}
public void setOnClickSaveListener(OnClickSaveListener onClickSaveListener) {
this.onClickSaveListener = onClickSaveListener;
}
public static ShowClearDialog getIntance() {
if (intance == null) {
synchronized (ShowClearDialog.class) {
if (intance == null)
intance = new ShowClearDialog();
}
}
return intance;
}
public void showClearAll(Context ctx) {
try {
View vv = LayoutInflater.from(ctx).inflate(R.layout.layout_clear_all_dialog, null);
Dialog dialog = new AlertDialog.Builder(ctx).create();
TextView layout_clear_all_dialog_confirm = vv.findViewById(R.id.layout_clear_all_dialog_confirm);
layout_clear_all_dialog_confirm.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (onClickSaveListener != null) {
onClickSaveListener.OnClickSaveButton();
if (dialog != null) {
dialog.dismiss();
}
}
}
});
TextView layout_clear_all_dialog_cancel = vv.findViewById(R.id.layout_clear_all_dialog_cancel);
layout_clear_all_dialog_cancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (dialog != null) {
dialog.dismiss();
}
}
});
dialog.show();
dialog.setCancelable(true);
Window window = dialog.getWindow();
window.setBackgroundDrawableResource(R.color.transparent);
window.setGravity(Gravity.CENTER);
WindowManager.LayoutParams lp = window.getAttributes();
lp.width = ScreenUtils.dip2px(ctx, 245);
lp.height = ScreenUtils.dip2px(ctx, 165);
window.setAttributes(lp);
window.setContentView(vv);
}catch (Exception e){
}
}
}
package live.nodiyphoneshell.cend.dialog;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.os.Build;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import live.nodiyphoneshell.cend.R;
import live.nodiyphoneshell.cend.utils.ScreenUtils;
/**
* @author MaYnaghua
* @version 1.0.0
* @date 2020/7/23 17:15
*/
public class ShowFailDialog implements View.OnClickListener {
private static volatile ShowFailDialog intance;
private OnClickSaveListener onClickSaveListener;
private OnClickUpLoadListener onClickUpLoadListener;
public Dialog dialog;
@Override
public void onClick(View view) {
}
public interface OnClickSaveListener {
void OnClickSaveButton();
}
public interface OnClickUpLoadListener {
void OnClickUpLoadButton();
}
public void setOnClickUpLoadListener(OnClickUpLoadListener onClickUpLoadListener) {
this.onClickUpLoadListener = onClickUpLoadListener;
}
public void setOnClickSaveListener(OnClickSaveListener onClickSaveListener) {
this.onClickSaveListener = onClickSaveListener;
}
public static ShowFailDialog getIntance() {
if (intance == null) {
synchronized (ShowFailDialog.class) {
if (intance == null)
intance = new ShowFailDialog();
}
}
return intance;
}
public void showPayFail(Context ctx) {
View vv = LayoutInflater.from(ctx).inflate(R.layout.layout_pay_succeed_fail, null);
dialog = new AlertDialog.Builder(ctx).create();
dialog.show();
dialog.setCancelable(false);
Window window = dialog.getWindow();
window.setBackgroundDrawableResource(R.color.transparent);
window.setGravity(Gravity.CENTER);
WindowManager.LayoutParams lp = window.getAttributes();
lp.width = ScreenUtils.getScreenWidth(ctx) - ScreenUtils.dip2px(ctx, 140);
window.setAttributes(lp);
window.setContentView(vv);
}
public void dismissDiaLog() {
if (dialog != null) {
dialog.dismiss();
}
}
}
......@@ -38,10 +38,8 @@ public class NetworkConnectChangedReceiver extends BroadcastReceiver {
break;
}
}
// 这个监听wifi的连接状态即是否连上了一个有效无线路由,当上边广播的状态是WifiManager
// .WIFI_STATE_DISABLING,和WIFI_STATE_DISABLED的时候,根本不会接到这个广播。
// 在上边广播接到广播是WifiManager.WIFI_STATE_ENABLED状态的同时也会接到这个广播,
// 当然刚打开wifi肯定还没有连接到有效的无线
//这个监听wifi的连接状态即是否连上了一个有效无线路由,当上边广播的状态是WifiManager
//.WIFI_STATE_DISABLING,和WIFI_STATE_DISABLED的时候,根本不会接到这个广播。
if (WifiManager.NETWORK_STATE_CHANGED_ACTION.equals(intent.getAction())) {
Parcelable parcelableExtra = intent.getParcelableExtra(WifiManager.EXTRA_NETWORK_INFO);
if (null != parcelableExtra) {
......@@ -54,8 +52,6 @@ public class NetworkConnectChangedReceiver extends BroadcastReceiver {
}
}
// 这个监听网络连接的设置,包括wifi和移动数据的打开和关闭。.
// 最好用的还是这个监听。wifi如果打开,关闭,以及连接上可用的连接都会接到监听。见log
// 这个广播的最大弊端是比上边两个广播的反应要慢,如果只是要监听wifi,我觉得还是用上边两个配合比较合适
if (ConnectivityManager.CONNECTIVITY_ACTION.equals(intent.getAction())) {
ConnectivityManager manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetwork = manager.getActiveNetworkInfo();
......@@ -63,23 +59,16 @@ public class NetworkConnectChangedReceiver extends BroadcastReceiver {
if (activeNetwork.isConnected()) {
Log.e(TAG, "当前WiFi连接可用 ");
if (activeNetwork.getType() == ConnectivityManager.TYPE_WIFI) {
//connected to wifi
//APP.getInstance().setWifi(true);
//Log.e(TAG, "当前WiFi连接可用 ");
} else if (activeNetwork.getType() == ConnectivityManager.TYPE_MOBILE) {
//connected to the mobile provider's data plan
//APP.getInstance().setMobile(true);
//Log.e(TAG, "当前移动网络连接可用 ");
}
DialogManager.getIntance().dismissDiaLog();
} else {
//DialogManager.getIntance().showDisable(context,"当前没有网络连接,请确保你已经打开网络");
//Log.e(TAG, "当前没有网络连接,请确保你已经打开网络 ");
}
//Log.e(TAG1, "info.getTypeName()" + activeNetwork.getTypeName());
} else { // not connected to the internet
//DialogManager.getIntance().showDisable(context,"当前没有网络连接,请确保你已经打开网络");
//Log.e(TAG, "当前没有网络连接,请确保你已经打开网络 ");
} else {
}
}
}
......
......@@ -20,7 +20,6 @@ public class NetworkUtil {
NetworkType(String desc) {
this.desc = desc;
}
@Override
public String toString() {
return desc;
......@@ -39,7 +38,6 @@ public class NetworkUtil {
/**
* 获取当前网络类型
* 需添加权限 {@code <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>}
*/
@RequiresPermission("android.permission.ACCESS_NETWORK_STATE")
public static NetworkType getNetworkType(Context context) {
......@@ -51,7 +49,6 @@ public class NetworkUtil {
netType = NetworkType.NETWORK_WIFI;
} else if (info.getType() == ConnectivityManager.TYPE_MOBILE) {
switch (info.getSubtype()) {
case TelephonyManager.NETWORK_TYPE_TD_SCDMA:
case TelephonyManager.NETWORK_TYPE_EVDO_A:
case TelephonyManager.NETWORK_TYPE_UMTS:
......
......@@ -43,7 +43,6 @@ public class AccessibilityUtil {
dialog.getWindow().setAttributes(lp);
}
/**
* 检查系统设置:是否开启辅助服务
* @param service 辅助服务
......@@ -68,7 +67,6 @@ public class AccessibilityUtil {
return false;
}
/**
* 跳转到系统设置:开启辅助服务
*/
......@@ -91,7 +89,6 @@ public class AccessibilityUtil {
}
}
/**
* 唤醒点亮和解锁屏幕(60s)
*/
......@@ -114,5 +111,4 @@ public class AccessibilityUtil {
}
}
}
\ No newline at end of file
......@@ -66,7 +66,6 @@ public class InstallUtil {
Intent intent = new Intent(Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES, Uri.parse("package:" + cxt.getPackageName()));//使用系统设置+返回键 //ACTION_WIFI_SETTINGS
intent.putExtras(bundle);
cxt.startActivity(intent);
//cxt.startActivity(new Intent(Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES, Uri.parse("package:" + cxt.getPackageName())));
}else {
cxt.startActivity(new Intent(Settings.ACTION_SECURITY_SETTINGS));
}
......
......@@ -7,78 +7,5 @@ import live.nodiyphoneshell.cend.R;
*/
public class ColorUtils {
public static int getDrawable(String backColor) {
int drawable = 0;
switch (backColor) {
case "#FFFFFF":
drawable = R.drawable.sticker_white_background;
break;
case "#050BDE":
drawable = R.drawable.sticker_blue_background;
break;
case "#ff0000":
case "#E60012":
drawable = R.drawable.sticker_red_background;
break;
case "#E65C00":
drawable = R.drawable.sticker_orange_background;
break;
case "#000000":
drawable = R.drawable.sticker_black_background;
break;
}
return drawable;
}
public static int getColor(String colorValue) {
int drawable = 0;
switch (colorValue) {
case "#FFFFFF":
drawable = R.color.white_FFFFFF;
break;
case "#868686":
drawable = R.color.color868686;
break;
case "#050BDE":
drawable = R.color.color_050BDE;
break;
case "#ff0000":
case "#E60012":
drawable = R.color.color_E60012;
break;
case "#E65C00":
drawable = R.color.color_E65C00;
break;
case "#000000":
drawable = R.color.black_000000;
break;
default:
drawable = R.color.color868686;
break;
}
return drawable;
}
public static boolean getFirst(String backColor) {
boolean first = false;
if ("#00000000".equals(backColor)) {
first = false;
} else {
first = true;
}
return first;
}
public static boolean getLast(String font) {
boolean last = false;
if ("regular".equals(font)) {
last = false;
} else {
last = true;
}
return last;
}
}
package live.nodiyphoneshell.cend.utils;
/**
* @author MaYnaghua
* @version 1.0.0
......
......@@ -70,17 +70,17 @@ public class ProcessActivity extends BaseActivity {
@BindView(R.id.activity_process_print_fireworks)
ImageView activity_process_print_fireworks;
@BindView(R.id.activity_process_top_start_come)
ImageView activity_process_top_start_come;
/*@BindView(R.id.activity_process_top_start_come)
ImageView activity_process_top_start_come;*/
@BindView(R.id.activity_process_top_on_start_come)
ImageView activity_process_top_on_start_come;
/*@BindView(R.id.activity_process_top_on_start_come)
ImageView activity_process_top_on_start_come;*/
@BindView(R.id.activity_process_online_image_bacl_all_le)
LinearLayout activity_process_online_image_bacl_all_le;
@BindView(R.id.activity_process_top_on_start_come_le)
LinearLayout activity_process_top_on_start_come_le;
/*@BindView(R.id.activity_process_top_on_start_come_le)
LinearLayout activity_process_top_on_start_come_le;*/
@BindView(R.id.activity_process_diy_image_back_le)
LinearLayout activity_process_diy_image_back_le;
......@@ -137,18 +137,18 @@ public class ProcessActivity extends BaseActivity {
protected void initData() {
//测试
//status = 1;
//position = 4;
//position = 4;
//backUrl = "http://img.colorpark.cn/back/1628055499610a27cb1b984.png";
//imageUrl = "http://img.colorpark.cn/yun/10962_16284751746847.png";*/
//imageUrl = "http://img.colorpark.cn/yun/10962_16284751746847.png";*/
selctStatus(status);
//startBrushImage();
/*handler.postDelayed(new Runnable() {
/*handler.postDelayed(new Runnable() {
@Override
public void run() {
startBrushImage();
}
}, 12000);*/
/* handler.postDelayed(new Runnable() {
/*handler.postDelayed(new Runnable() {
@Override
public void run() {
//backUrl = "http://img.colorpark.cn/back/16274542866100fb4e7002a.png";
......@@ -275,12 +275,14 @@ public class ProcessActivity extends BaseActivity {
}
}
@Override
public void onDestroy() {
super.onDestroy();//销毁
clearBitmapView();
}
//0:等待出料,1:生产中 , 2: 生产完成待取货, 3:取消生产,4:出料中,5: 等待取料 6:等待入货,7:取货完成',
//根据状态选择对应颜色
private void selctStatus(int status) {
......@@ -618,14 +620,23 @@ public class ProcessActivity extends BaseActivity {
//开始进来动画 //IsComeProcess true 进入打印区域 type 进入状态
private void statProcessPrintImage(boolean IsComeProcess, int type) {
isBushImage = false;
activity_process_top_on_start_come.setBackgroundResource(R.drawable.icon_pay_back);
activity_process_diy_image_back_le.setVisibility(View.GONE);
//activity_process_top_on_start_come.setBackgroundResource(R.drawable.icon_pay_back);
/*activity_process_diy_image_back_le.setVisibility(View.GONE);
activity_process_online_image_bacl_all_le.setVisibility(View.GONE);
LinearLayout.LayoutParams layoutParamsImage = (LinearLayout.LayoutParams) activity_process_top_start_come.getLayoutParams();
layoutParamsImage.topMargin = -ScreenUtils.dip2px(ProcessActivity.this, (float) 1.5);
activity_process_top_start_come.setLayoutParams(layoutParamsImage);
activity_process_top_start_come.setBackgroundResource(R.drawable.icon_process_print_strat);
AnimationUtil.getInstance(ProcessActivity.this).translationXAnimation(activity_process_top_on_start_come_le, 4000, new AnimationUtil.onAnimationAction() {
layoutParamsImage.topMargin = -ScreenUtils.dip2px(ProcessActivity.this, (float) 1.5);*/
//activity_process_top_start_come.setLayoutParams(layoutParamsImage);
//activity_process_top_start_come.setBackgroundResource(R.drawable.icon_process_print_strat);
/*activity_process_diy_image_back_le.setTranslationX(0);
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) activity_process_diy_image_back_le.getLayoutParams();
layoutParams.leftMargin = -ScreenUtils.dip2px(ProcessActivity.this, 40);
activity_process_diy_image_back_le.setLayoutParams(layoutParams);
activity_process_diy_image_back_le.setVisibility(View.VISIBLE);
activity_process_online_image_bacl_all_le.setVisibility(View.VISIBLE);*/
if (IsComeProcess && type != 0) {
startPrintprogress(type);
}
/*AnimationUtil.getInstance(ProcessActivity.this).translationXAnimation(activity_process_top_on_start_come_le, 4000, new AnimationUtil.onAnimationAction() {
@Override
public void onAnimationEnd() {
activity_process_diy_image_back_le.setTranslationX(0);
......@@ -638,13 +649,13 @@ public class ProcessActivity extends BaseActivity {
startPrintprogress(type);
}
}
}, 0, -ScreenUtils.dip2px(ProcessActivity.this, 360));
}, 0, -ScreenUtils.dip2px(ProcessActivity.this, 360));*/
}
//开始排队进来动画
private void statProcessOnLineImage() {
activity_process_diy_image_back_le.setTranslationX(0);
/*activity_process_diy_image_back_le.setTranslationX(0);
activity_process_diy_image_back_le.setVisibility(View.GONE);
activity_process_online_image_bacl_all_le.setVisibility(View.GONE);
activity_process_top_start_come.setBackgroundResource(R.drawable.icon_process_online_strat);
......@@ -666,7 +677,7 @@ public class ProcessActivity extends BaseActivity {
}
}, ScreenUtils.dip2px(ProcessActivity.this, 90));
}
}, 0, -ScreenUtils.dip2px(ProcessActivity.this, 360));
}, 0, -ScreenUtils.dip2px(ProcessActivity.this, 360));*/
}
......@@ -674,7 +685,7 @@ public class ProcessActivity extends BaseActivity {
private void statProcessPrintAgainImage(boolean IsComeProcess, int type) {
isBushImage = false;
activity_proces_diy_image.starClearDrawBitmapImage();
activity_process_top_on_start_come.setBackgroundResource(R.drawable.icon_process_online_strat);
/*activity_process_top_on_start_come.setBackgroundResource(R.drawable.icon_process_online_strat);
activity_process_diy_image_back_le.setVisibility(View.VISIBLE);
LinearLayout.LayoutParams layoutParamsImage = (LinearLayout.LayoutParams) activity_process_top_start_come.getLayoutParams();
layoutParamsImage.topMargin = -ScreenUtils.dip2px(ProcessActivity.this, (float) 1.5);
......@@ -685,7 +696,7 @@ public class ProcessActivity extends BaseActivity {
public void onAnimationEnd() {
}
}, 0, -ScreenUtils.dip2px(ProcessActivity.this, 360));
}, 0, -ScreenUtils.dip2px(ProcessActivity.this, 360));*/
}
......
package live.nodiyphoneshell.cend.view.process.cancel;
import android.graphics.Color;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.Nullable;
import com.bumptech.glide.Glide;
import com.lake.banner.BannerStyle;
import com.lake.banner.HBanner;
import com.lake.banner.ImageGravityType;
import com.lake.banner.Transformer;
import com.lake.banner.VideoGravityType;
import com.lake.banner.loader.ViewItemBean;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.OnClick;
import live.nodiyphoneshell.cend.BaseActivity;
import live.nodiyphoneshell.cend.CustomApplication;
import live.nodiyphoneshell.cend.R;
import live.nodiyphoneshell.cend.modules.BannerBean;
import live.nodiyphoneshell.cend.modules.ImageBanner;
import live.nodiyphoneshell.cend.rxbus.RxBackHomeTimer;
import live.nodiyphoneshell.cend.rxbus.RxTimer;
import live.nodiyphoneshell.cend.utils.JsonUtils;
import live.nodiyphoneshell.cend.utils.SPUtils;
import static com.lake.banner.BannerConfig.IMAGE;
/**
* Created by MaYangHua on 2017/2/21.
*/
public class ProcessCancelActivity extends BaseActivity implements ProcessCancelContract.View {
@BindView(R.id.activity_process_cancel_banner)
HBanner activity_process_cancel_banner;
@BindView(R.id.activity_process_cancel_contet)
TextView activity_process_cancel_contet;
......@@ -48,11 +23,8 @@ public class ProcessCancelActivity extends BaseActivity implements ProcessCancel
@BindView(R.id.activity_process_cancel_customer_phone)
TextView activity_process_cancel_customer_phone;
@BindView(R.id.activity_process_cancel_banner_image)
ImageView activity_process_cancel_banner_image;
private ProcessCancelPresenter processCancelPresenter;
private List<ViewItemBean> viewItemBeanList = new ArrayList<>();
private String gooSize;
@Override
......@@ -68,6 +40,7 @@ public class ProcessCancelActivity extends BaseActivity implements ProcessCancel
@Override
//初始化视图
protected void initView() {
processCancelPresenter = new ProcessCancelPresenter(this, this);
try {
gooSize = getIntent().getStringExtra("goodSize");
if (!TextUtils.isEmpty(gooSize)) {
......@@ -80,86 +53,38 @@ public class ProcessCancelActivity extends BaseActivity implements ProcessCancel
String phoneNumber = getResources().getString(R.string.callPhoneNumber);
phoneNumber = String.format(phoneNumber, SPUtils.getStringValue("phoneNumber", "18938664545"));
activity_process_cancel_phone.setText(phoneNumber);
phoneNumber = getResources().getString(R.string.phoneNumber);
phoneNumber = String.format(phoneNumber, SPUtils.getStringValue("phoneNumber", "18938664545"));
activity_process_cancel_customer_phone.setText(phoneNumber);
processCancelPresenter = new ProcessCancelPresenter(this, this);
activity_process_cancel_banner.setViews(viewItemBeanList)
.setBannerAnimation(Transformer.Default)//换场方式
.setBannerStyle(BannerStyle.CIRCLE_INDICATOR)//指示器模式*/
.setCache(true)//可以不用设置,默认为true
.setCachePath(getExternalFilesDir(Environment.DIRECTORY_MOVIES).getAbsolutePath() + File.separator + "hbanner")
.setVideoGravity(VideoGravityType.FULL_SCREEN)//视频布局方式
.setImageGravity(ImageGravityType.FIT_XY)//图片布局方式
.setPageBackgroundColor(Color.TRANSPARENT)//设置背景
.setShowTitle(false)//是否显示标题
.setViewPagerIsScroll(true)//是否支持手滑
.start();
}
@Override
protected void initData() {
getBanner(SPUtils.getStringValue("partner_id", ""), "phone_shell_pay");
}
@OnClick({
R.id.activity_process_cancel_back_home,
R.id.activity_process_cancel_le
})
void onclick(View button) {
switch (button.getId()) {
case R.id.activity_process_cancel_back_home:
RxTimer.getInstance(this).cancel();
SPUtils.putBooleanValue("stepFinish", false);
CustomApplication.allfinish();
finish();
break;
default:
break;
}
}
@Override
protected void onResume() {
super.onResume();
RxBackHomeTimer.getInstance(this).initTimer(300);
if (activity_process_cancel_banner != null) {
activity_process_cancel_banner.onResume();
}
}
@Override
protected void onPause() {
super.onPause();
if (activity_process_cancel_banner != null) {
activity_process_cancel_banner.onPause();
}
}
@Override
protected void onStop() {
super.onStop();
if (activity_process_cancel_banner != null) {
activity_process_cancel_banner.onStop();
}
}
@Override
public void onDestroy() {
super.onDestroy();//销毁
if (processCancelPresenter != null) {
processCancelPresenter = null;
}
if (activity_process_cancel_banner != null) {
activity_process_cancel_banner.onStop();
activity_process_cancel_banner = null;
}
}
@Override
......@@ -169,58 +94,9 @@ public class ProcessCancelActivity extends BaseActivity implements ProcessCancel
@Override
public void getBannerSuccessed(String data) {
BannerBean bannerBean = JsonUtils.deserialize(data, BannerBean.class);
if (bannerBean == null) {
return;
}
List<BannerBean.DataBean> dataBeanList = bannerBean.getData();
if (dataBeanList == null || dataBeanList.size() == 0) {
return;
}
viewItemBeanList.clear();
List<ImageBanner> bannerList = new ArrayList<ImageBanner>();
for (BannerBean.DataBean dataBean : dataBeanList) {
ImageBanner imageBanner = new ImageBanner();
imageBanner.setName(dataBean.getFull_name());
imageBanner.setUrl(dataBean.getContent());
if (dataBean.getPlay_time() <= 0) {
imageBanner.setPlay_time(10);
} else {
imageBanner.setPlay_time(dataBean.getPlay_time());
}
bannerList.add(imageBanner);
}
for (ImageBanner imageBanner : bannerList) {
if (imageBanner.getName().contains("index_top_video")) {
//Uri path1 = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.video62);
//viewItemBeanList.add(new ViewItemBean(VIDEO, "标题1", path1, 38 * 1000));
} else {
Uri path2 = Uri.parse(imageBanner.getUrl());
viewItemBeanList.add(new ViewItemBean(IMAGE, "图片banner", path2, imageBanner.getPlay_time() * 1000));
}
}
if (viewItemBeanList == null || viewItemBeanList.size() == 0) {
activity_process_cancel_banner.setVisibility(View.GONE);
} else {
if (viewItemBeanList.size() == 1) {
activity_process_cancel_banner_image.setVisibility(View.VISIBLE);
activity_process_cancel_banner.setVisibility(View.GONE);
Glide.with(this).load(viewItemBeanList.get(0).getUrl()).into(activity_process_cancel_banner_image);
} else {
activity_process_cancel_banner_image.setVisibility(View.GONE);
activity_process_cancel_banner.setVisibility(View.VISIBLE);
activity_process_cancel_banner_image.setBackgroundResource(0);
}
activity_process_cancel_banner.setVisibility(View.VISIBLE);
}
if (viewItemBeanList != null && activity_process_cancel_banner != null) {
activity_process_cancel_banner.update(viewItemBeanList);
}
}
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) { //禁用返回键
......
......@@ -35,7 +35,6 @@ public class ProcessCancelPresenter extends BasePresenter implements ProcessCanc
public void onError(Call call, Exception e, int id) {
closeLoad();
}
@Override
public void onResponse(String response, int id) {
closeLoad();
......
......@@ -79,10 +79,9 @@ public class DragScaleView extends View implements View.OnTouchListener {
oriBottom = v.getBottom();
lastY = (int) event.getRawY();
lastX = (int) event.getRawX();
dragDirection = getDirection(v, (int) event.getX(),
(int) event.getY());
dragDirection = getDirection(v, (int) event.getX(), (int) event.getY());
}
// 处理拖动事件
//处理拖动事件
delDrag(v, event, action);
invalidate();
return false;
......@@ -90,7 +89,6 @@ public class DragScaleView extends View implements View.OnTouchListener {
/**
* 处理拖动事件
*
* @param v
* @param event
* @param action
......
package live.nodiyphoneshell.cend.widget;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Camera;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import live.nodiyphoneshell.cend.R;
public class MainView extends View {
//Camera类
private Camera mCamera;
private Bitmap face;
private Matrix mMatrix = new Matrix();
private Paint mPaint = new Paint();
private int mLastMotionX, mLastMotionY;
//图片旋转时的中心点坐标
private int centerX, centerY;
//转动的总距离,跟度数比例1:1
private int deltaX, deltaY;
//图片宽度高度
private int bWidth, bHeight;
public MainView(Context context, AttributeSet attributeSet) {
super(context,attributeSet);
setWillNotDraw(false);
mCamera = new Camera();
mPaint.setAntiAlias(true);
face = BitmapFactory.decodeResource(getResources(), R.drawable.icon_phone_rote_one);
bWidth = face.getWidth();
bHeight = face.getHeight();
centerX = bWidth>>1;
centerY = bHeight>>1;
}
void rotate(int degreeX, int degreeY) {
deltaX += degreeX;
deltaY += degreeY;
mCamera.save();
mCamera.rotateY(deltaX);
mCamera.rotateX(-deltaY);
mCamera.translate(0, 0, -centerX);
mCamera.getMatrix(mMatrix);
mCamera.restore();
//以图片的中心点为旋转中心,如果不加这两句,就是以(0,0)点为旋转中心
mMatrix.preTranslate(-centerX, -centerY);
mMatrix.postTranslate(centerX, centerY);
mCamera.save();
postInvalidate();
}
@Override
public boolean onTouchEvent(MotionEvent event) {
int x = (int) event.getX();
int y = (int) event.getY();
switch(event.getAction()) {
case MotionEvent.ACTION_DOWN:
mLastMotionX = x;
mLastMotionY = y;
break;
case MotionEvent.ACTION_MOVE:
int dx = x - mLastMotionX;
int dy = y - mLastMotionY;
rotate(dx, dy);
mLastMotionX = x;
mLastMotionY = y;
break;
case MotionEvent.ACTION_UP:
break;
}
return true;
}
@Override
public void dispatchDraw(Canvas canvas) {
super.dispatchDraw(canvas);
canvas.drawBitmap(face, mMatrix, mPaint);
}
}
<?xml version="1.0" encoding="utf-8"?>
<animation-list
xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="true">
<item android:drawable="@drawable/icon_phone_rote_three" android:duration="700" />
<item android:drawable="@drawable/icon_phone_rote_four" android:duration="700" />
<item android:drawable="@drawable/icon_phone_rote_five" android:duration="700" />
<item android:drawable="@drawable/icon_phone_rote_six" android:duration="700" />
<item android:drawable="@drawable/icon_phone_rote_seven" android:duration="700" />
</animation-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/white_FFFFFF" />
<corners android:radius="30dp" />
<size android:width="50dp" android:height="20dip"/>
</shape>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/color_999999" />
<corners
android:bottomRightRadius="3dp"
android:topRightRadius="3dp" />
<size
android:width="42dip"
android:height="30dip"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<size
android:width="70dp"
android:height="25dp"></size>
<solid android:color="@color/color_4A8D46" />
<corners android:radius="40dp"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#984ace" />
<size android:height="50dp" android:width="140dp"/>
<gradient
android:angle="180"
android:endColor="#984ACE"
android:startColor="#178CE6"
android:type="linear"
android:useLevel="true" />
<corners
android:radius="30dp"/>
</shape>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/color_282932" />
<corners
android:radius="3dp" />
<size android:width="150dp" android:height="46dip"/>
<!-- 150dp
46.67dp-->
</shape>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#984ace" />
<size
android:width="38dp"
android:height="110dp" />
<gradient
android:angle="180"
android:endColor="#984ACE"
android:startColor="#178CE6"
android:type="linear"
android:useLevel="true" />
<corners android:radius="30dp" />
</shape>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="#282932" />
<corners android:bottomRightRadius="5dp" android:topLeftRadius="5dp" android:topRightRadius="5dip" />
<size android:width="80dp" android:height="20dip"/>
<stroke android:color="#B5B5B5" android:width="1dip"/>
<!-- 150dp
46.67dp-->
</shape>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment