Commit 2fd128e9 authored by Star Diao's avatar Star Diao

update ios

parent f6cc673e
## 介绍
> lm-weex app 快速开发模板,可通过脚手架 lm-weex-cli `init` 指令快速生成。
### 运行命令:```lm-weex dev```
### 项目构建:```lm-weex build```
### 打包到IOS:```lm-weex pack ios```
### 打包到安卓:```lm-weex pack android```
> sl-weex app 安装。
###手脚架安装命令
```
npm install -g sl-weex-cli --registry=http://nexus.gsstcloud.com:8090/nexus/repository/npm-public
```
> sl-weex app 快速开发模板,可通过脚手架 sl-weex-cli `init` 指令快速生成。
### 运行命令:```sl-weex dev```
### 项目构建:```sl-weex build```
### 打包到IOS:```sl-weex pack ios```
### 打包到安卓:```sl-weex pack android```
### 热更新:
``` sl-weex pack -s https://weex-publish.gsstcloud.com/app/add```
......@@ -15,10 +15,10 @@ module.exports = {
},
'url': {
'image': 'http://www.superlinksoft.com/img-company/XXX',
'bundleUpdate': 'http://localhosts:3001/app/check'
'bundleUpdate': 'https://weex-publish.gsstcloud.com/app/check'
},
'zipFolder': {
'iOS': '/ios/LMWeex/LMWeex',
'iOS': '/ios/GSST/GSST',
'android': '/android/GSST/app/src/main/assets'
},
'getui': {
......
......@@ -7,10 +7,10 @@ android {
flavorDimensions 'default'
defaultConfig {
applicationId APPLICATION_ID
minSdkVersion 16
minSdkVersion 17
targetSdkVersion 26
versionCode 1
versionName "1.0"
versionName "1.0.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true
......@@ -27,9 +27,9 @@ android {
signingConfigs {
ddlStaff {
keyAlias 'com.gsst.ddl.staff'
keyAlias 'com.gsst.ddl.store'
keyPassword '123qazwsx'
storeFile file('../com.gsst.ddl.staff.keystore')
storeFile file('../com.gsst.ddl.store.keystore')
storePassword '123qazwsx'
v2SigningEnabled false
}
......@@ -115,7 +115,7 @@ dependencies {
// compile 'com.gsst.mobile:gsst-weex-base-library:0.0.04-SNAPSHOT'
compile project(':nexus')
compile project(':weex-framework')
compile project(':gsstJPush')
compile project(':wechatplugin')
// compile project(':gsstJPush')
// compile project(':wechatplugin')
compile project(':pgyplugin')
}
......@@ -34,7 +34,6 @@
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"/>
<application
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
......@@ -42,9 +41,6 @@
android:name="com.gsst.App"
android:theme="@style/AppTheme.NoActionBar"
>
<activity android:name="com.eros.framework.activity.MainActivity" android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
......
"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"
......@@ -2,6 +2,7 @@ package com.gsst.activity;
import android.app.Activity;
import android.os.Bundle;
import android.view.WindowManager;
import com.eros.framework.proxy.SplashActivityProxy;
import com.gsst.clotee.R;
......@@ -19,6 +20,13 @@ public class SplashActivity extends Activity {
setContentView(R.layout.activity_splash);
activityProxy = new SplashActivityProxy();
activityProxy.onCreateInit(this);
SystemUIUtils.setStickFullScreen(getWindow().getDecorView());
}
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
SystemUIUtils.setStickFullScreen(getWindow().getDecorView());
}
@Override
......
package com.gsst.activity;
import android.view.View;
class SystemUIUtils {
public static void setStickFullScreen(View view) {
int systemUiVisibility = view.getSystemUiVisibility();
int flags = View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
| View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
systemUiVisibility |= flags;
view.setSystemUiVisibility(systemUiVisibility);
}
}
......@@ -2,5 +2,5 @@
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
<color name="colorAccent">#2db7f5</color>
</resources>
<resources>
<string name="app_name">店店联:服务人员</string>
<string name="app_name">店店联</string>
<string name="umeng_socialize_female"></string>
<string name="umeng_socialize_male"></string>
</resources>
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1},"path":"app-yingyongbao-release.apk","properties":{"packageId":"com.gsst.ddlstaff","split":"","minSdkVersion":"16"}}]
\ No newline at end of file
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1},"path":"app-yingyongbao-release.apk","properties":{"packageId":"com.gsst.ddl.store","split":"","minSdkVersion":"17"}}]
\ No newline at end of file
......@@ -34,6 +34,7 @@ subprojects {
repositories {
google()
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'http://192.168.12.122:8090/nexus/repository/maven-snapshots/' }
}
buildscript {
repositories {
......
......@@ -7,7 +7,7 @@ android {
defaultConfig {
minSdkVersion 16
minSdkVersion 17
targetSdkVersion 25
versionCode 1
versionName "1.0"
......@@ -29,8 +29,9 @@ android {
}
dependencies {
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:25.3.1'
implementation 'com.android.support:appcompat-v7:25.3.1'
testCompile 'junit:junit:4.12'
androidTestCompile('com.android.support.test.espresso:espresso-core:3.0.2', {
exclude group: 'com.android.support', module: 'support-annotations'
......@@ -38,23 +39,23 @@ dependencies {
/**
* debug调试要用到的
*/
compile 'com.taobao.android.weex_inspection:protocol:1.1.4.1'
compile 'com.taobao.android:weex_inspector:0.13.4'
compile 'com.squareup.okhttp:okhttp-ws:2.3.0'
compile 'com.squareup.okhttp3:okhttp:3.8.0'
compile 'com.lzy.widget:imagepicker:0.6.1'
compile 'com.journeyapps:zxing-android-embedded:3.4.0'
compile 'com.github.chrisbanes.photoview:library:1.2.4'
compile 'com.android.support:multidex:1.0.1'
implementation 'com.taobao.android.weex_inspection:protocol:1.1.4.1'
implementation 'com.taobao.android:weex_inspector:0.13.4'
implementation 'com.squareup.okhttp:okhttp-ws:2.3.0'
implementation 'com.squareup.okhttp3:okhttp:3.8.0'
implementation 'com.lzy.widget:imagepicker:0.6.1'
implementation 'com.journeyapps:zxing-android-embedded:3.4.0'
implementation 'com.github.chrisbanes.photoview:library:1.2.4'
implementation 'com.android.support:multidex:1.0.1'
//bs patch
compile 'me.ele:bspatch:1.0.6'
implementation 'me.ele:bspatch:1.0.6'
//weex analyzer
compile 'com.taobao.android:weex_analyzer:0.1.0.5'
implementation 'com.taobao.android:weex_analyzer:0.1.0.5'
//Bindigx
compile 'com.alibaba.android:bindingx-core:1.0.1'
compile 'com.alibaba.android:bindingx_weex_plugin:1.0.2'
compile 'org.weex.plugin:plugin-loader:1.0.0'
compile ('com.github.niorgai:StatusBarCompat:2.1.4', {
implementation 'com.alibaba.android:bindingx-core:1.0.1'
implementation 'com.alibaba.android:bindingx_weex_plugin:1.0.2'
implementation 'org.weex.plugin:plugin-loader:1.0.0'
compile('com.github.niorgai:StatusBarCompat:2.1.4', {
exclude group: 'com.android.support'
})
// compile 'com.gsst.mobile:gsst-weex-base-plugin:0.0.03-SNAPSHOT'
......@@ -62,7 +63,6 @@ dependencies {
compile project(':nexus')
// debugImplementation "com.squareup.leakcanary:leakcanary-android:1.5.4"
// releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:1.5.4"
}
......
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.eros.framework">
<application
tools:replace="android:allowBackup"
android:allowBackup="false"
android:label="@string/app_name"
android:supportsRtl="true"></application>
android:supportsRtl="true"
tools:replace="android:allowBackup">
<activity android:name=".activity.SubDisplayActivity"></activity>
</application>
</manifest>
</manifest>
\ No newline at end of file
......@@ -156,6 +156,12 @@ public class AbstractWeexActivity extends AppCompatActivity implements IWXRender
}
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(true);
setStickFullScreen(getWindow().getDecorView());
}
private void initDebug() {
if (!DebugableUtil.isDebug()) return;
......@@ -930,20 +936,34 @@ public class AbstractWeexActivity extends AppCompatActivity implements IWXRender
}
public void statusBarHidden(boolean isFullScreen){
if (isFullScreen) {
setFullScreen(this);
} else {
quitFullScreen(this);
}
setFullScreen(this);
// if (isFullScreen) {
// setFullScreen(this);
// } else {
// quitFullScreen(this);
// }
}
private void setFullScreen(Activity activity) {
if (!isStatusBarHidden) {
activity.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
activity.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN , WindowManager.LayoutParams.FLAG_FULLSCREEN);
isStatusBarHidden = true;
setStickFullScreen(getWindow().getDecorView());
}
}
public static void setStickFullScreen(View view) {
int systemUiVisibility = view.getSystemUiVisibility();
int flags = View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
| View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
systemUiVisibility |= flags;
view.setSystemUiVisibility(systemUiVisibility);
}
private void quitFullScreen(Activity activity) {
if (isStatusBarHidden) {
......
......@@ -4,10 +4,15 @@ import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ActivityInfo;
import android.hardware.display.DisplayManager;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.content.LocalBroadcastManager;
import android.util.Log;
import android.view.Display;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewStub;
import android.view.WindowManager;
......@@ -22,10 +27,12 @@ import com.eros.framework.manager.impl.GlobalEventManager;
import com.eros.framework.model.RouterModel;
import com.eros.framework.model.TabbarBadgeModule;
import com.eros.framework.model.WeexEventBean;
import com.eros.framework.presentation.SubDisplay;
import com.eros.framework.utils.SharePreferenceUtil;
import com.eros.framework.view.TableView;
import com.taobao.weex.WXSDKEngine;
import com.taobao.weex.WXSDKInstance;
import com.taobao.weex.utils.WXLogUtils;
public class MainActivity extends AbstractWeexActivity {
private FrameLayout layout_container;
......@@ -38,6 +45,8 @@ public class MainActivity extends AbstractWeexActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// hideBottomUIMenu();
// AndroidBug5497Workaround.assistActivity(this);
routerModel = (RouterModel) getIntent().getSerializableExtra(Constant.ROUTERPARAMS);
if (Constant.TABBAR.equals(routerModel.url)) {
......@@ -50,7 +59,29 @@ public class MainActivity extends AbstractWeexActivity {
initReloadReceiver();
statusBarHidden(BMWXApplication.getWXApplication().IS_FULL_SCREEN);
// getWindow().addFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
// 副屏内容展示
Display display = getPresentationDisplays();
if(display != null){
SubDisplay textDisplay = new SubDisplay(this, display);
textDisplay.show();
}
}
// protected void hideBottomUIMenu() {
// //隐藏虚拟按键,并且全屏
// if (Build.VERSION.SDK_INT > 11 && Build.VERSION.SDK_INT < 19) { // lower api
// View v = this.getWindow().getDecorView();
// v.setSystemUiVisibility(View.GONE);
// } else if (Build.VERSION.SDK_INT >= 19) {
// //for new api versions.
// View decorView = getWindow().getDecorView();
// int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
// | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.SYSTEM_UI_FLAG_FULLSCREEN;
// decorView.setSystemUiVisibility(uiOptions);
// }
// }
private void initReloadReceiver() {
......@@ -142,6 +173,22 @@ public class MainActivity extends AbstractWeexActivity {
return -1;
}
// 获取副屏
public Display getPresentationDisplays() {
DisplayManager manager = (DisplayManager) getSystemService(Context.DISPLAY_SERVICE);
Display[] displays = manager.getDisplays();
for (int i = 0; i < displays.length; i++) {
Log.e("SUB_DISPLAY", "屏幕" + displays[i]);
if ((displays[i].getFlags() & Display.FLAG_SECURE) != 0
&& (displays[i].getFlags() & Display.FLAG_SUPPORTS_PROTECTED_BUFFERS) != 0
&& (displays[i].getFlags() & Display.FLAG_PRESENTATION) != 0) {
Log.e("SUB_DISPLAY", "第一个真实存在的副屏屏幕" + displays[i]);
return displays[i];
}
}
return null;
}
@Override
protected void onDestroy() {
super.onDestroy();
......
package com.eros.framework.activity;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.eros.framework.R;
public class SubDisplayActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sub_display);
}
}
......@@ -104,6 +104,7 @@ public class ModalManager extends Manager {
Toast mToast = Toast.makeText(context, message, duration);
mToast.setDuration(duration);
mToast.setText(message);
mToast.setGravity(Gravity.CENTER, 0, 0);
mToast.show();
} else {
Log.i("BMModalManager", "toast can not show in child thread");
......
......@@ -3,6 +3,7 @@ package com.eros.framework.manager.impl;
import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import android.util.Log;
import com.eros.framework.BMWXEnvironment;
import com.eros.framework.constant.Constant;
......@@ -28,6 +29,7 @@ import java.util.HashMap;
*/
public class VersionManager extends Manager {
private static final String TAG = "VersionManager";
public long prepareJsBundle(Context context) {
long startTime = new Date().getTime();
......@@ -138,6 +140,7 @@ public class VersionManager extends Manager {
params.put("appName", BMWXEnvironment.mPlatformConfig.getAppName());
params.put("android", BaseCommonUtil.getVersionName(context));
String versionInfo = SharePreferenceUtil.getDownLoadVersion(context);
Log.e(TAG, "getDownLoadVersion:" + versionInfo);
if (TextUtils.isEmpty(versionInfo)) {
versionInfo = SharePreferenceUtil.getVersion(context);
}
......@@ -151,6 +154,7 @@ public class VersionManager extends Manager {
versionInfo = "";
} else {
versionInfo = jsVersionInfoBean.getJsVersion();
Log.e(TAG, "versionInfo:" + versionInfo);
}
}
if (TextUtils.isEmpty(versionInfo)) {
......@@ -164,6 +168,7 @@ public class VersionManager extends Manager {
public void downloadBundle(String url, FileCallBack fileCallBack) {
AxiosManager axiosManager = ManagerFactory.getManagerService(AxiosManager.class);
Log.e(TAG, "下载包:" + url);
axiosManager.download(url, fileCallBack);
}
......
package com.eros.framework.presentation;
import android.app.Presentation;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.Display;
import android.widget.ImageView;
import com.eros.framework.R;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
public class SubDisplay extends Presentation {
private static final String TAG = "SubDisplay";
private ImageView imageView;
final String url = "https://file.cdn.sunmi.com/newebsite/home/P2Pro-banner-PC.jpg";
public SubDisplay(Context outerContext, Display display){
super(outerContext, display);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sub_display);
imageView = (ImageView) findViewById(R.id.sub_display2);
// new Thread(new Runnable() {
// @Override
// public void run() {
// Bitmap bmp = getURLimage(url);
// Message msg = new Message();
// msg.what = 0;
// msg.obj = bmp;
// System.out.println("000");
// handle.sendMessage(msg);
// }
// }).start();
}
//在消息队列中实现对控件的更改
private Handler handle = new Handler() {
public void handleMessage(Message msg) {
switch (msg.what) {
case 0:
System.out.println("111");
Bitmap bmp=(Bitmap)msg.obj;
imageView.setImageBitmap(bmp);
break;
}
}
};
//加载图片
public Bitmap getURLimage(String url) {
Bitmap bmp = null;
try {
URL myurl = new URL(url);
// 获得连接
HttpURLConnection conn = (HttpURLConnection) myurl.openConnection();
conn.setConnectTimeout(6000);//设置超时
conn.setDoInput(true);
conn.setUseCaches(false);//不缓存
conn.connect();
InputStream is = conn.getInputStream();//获得图片的数据流
bmp = BitmapFactory.decodeStream(is);//读取图像数据
//读取文本数据
//byte[] buffer = new byte[100];
//inputStream.read(buffer);
//text = new String(buffer);
is.close();
} catch (Exception e) {
e.printStackTrace();
}
return bmp;
}
}
package com.eros.framework.proxy;
import android.view.View;
class SystemUIUtils {
public static void setStickFullScreen(View view) {
int systemUiVisibility = view.getSystemUiVisibility();
int flags = View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
| View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
systemUiVisibility |= flags;
view.setSystemUiVisibility(systemUiVisibility);
}
}
......@@ -30,12 +30,14 @@ import com.eros.framework.utils.SharePreferenceUtil;
import com.squareup.otto.Subscribe;
import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.Collections;
import java.util.List;
import me.ele.patch.BsPatch;
import okhttp3.Call;
import okhttp3.Response;
/**
* Created by Carry on 2017/11/23.
......@@ -58,7 +60,7 @@ public class VersionChecker {
public void checkVersion() {
if (mCurrentStatus == Constant.Version.UPDATING || mCustomerUpdate) return;
readyUpdate(null, true);
readyUpdate(null, false);
}
......@@ -93,12 +95,14 @@ public class VersionChecker {
Activity activity = RouterTracker.peekActivity();
//此时说明栈中没有可用activity 监听入栈事件
if (activity != null) {
Log.e(TAG, "弹出更新提示");
ModalManager.BmAlert.showAlert(activity, mContext.getResources()
.getString(R.string.str_update_title), mContext.getResources()
.getString(R.string.str_update_tips), mContext.getResources().getString(R.string
.str_ensure), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Log.e(TAG, "重启");
restartApp();
}
}, null, null, null, null, false);
......@@ -136,7 +140,7 @@ public class VersionChecker {
post(9, msg);
}
private void readyUpdate(String path, boolean diff) {
private void readyUpdate(String path, final boolean diff) {
mUpdateUrl = BMWXEnvironment.mPlatformConfig.getUrl().getBundleUpdate();
if (!TextUtils.isEmpty(path)) {
mUpdateUrl = path;
......@@ -150,6 +154,7 @@ public class VersionChecker {
VersionManager versionManager = ManagerFactory.getManagerService(VersionManager.class);
versionManager.checkBundleUpdate(mContext, mUpdateUrl,
diff, new StringCallback() {
final Boolean _diff = diff;
@Override
public void onError(Call call, Exception e, int id) {
Log.e(TAG, "获取更新失败");
......@@ -157,6 +162,11 @@ public class VersionChecker {
mCurrentStatus = Constant.Version.SLEEP;
}
@Override
public String parseNetworkResponse(Response response, int id) throws IOException {
return super.parseNetworkResponse(response, id);
}
@Override
public void onResponse(String response, int id) {
VersionBean version = ManagerFactory.getManagerService(ParseManager
......@@ -179,12 +189,12 @@ public class VersionChecker {
} else {
//下载全量包
Log.e(TAG, "检查全量包");
downloadCompleteZip();
downloadCompleteZip(_diff);
}
} else {
//下载全量包
Log.e(TAG, "检查全量包");
downloadCompleteZip();
downloadCompleteZip(_diff);
}
break;
case 401:
......@@ -214,8 +224,9 @@ public class VersionChecker {
/**
* 下载全量包
*/
private void downloadCompleteZip() {
private void downloadCompleteZip(Boolean diff) {
VersionManager versionManager = ManagerFactory.getManagerService(VersionManager.class);
final Boolean _diff = diff;
versionManager.checkBundleUpdate(mContext, mUpdateUrl,
false, new StringCallback() {
@Override
......@@ -232,7 +243,7 @@ public class VersionChecker {
.class);
if (version != null && !TextUtils.isEmpty(version.data.path)) {
L.e(TAG, "检查全量包成功!,开始下载");
download(version, true);
download(version, _diff);
}
}
});
......@@ -255,7 +266,7 @@ public class VersionChecker {
public void onError(Call call, Exception e, int id) {
Log.e(TAG, "下载插分包出错");
if (!complete) {
downloadCompleteZip();
downloadCompleteZip(complete);
} else {
postFailed("下载全量包失败");
mCurrentStatus = Constant.Version.SLEEP;
......@@ -271,6 +282,7 @@ public class VersionChecker {
File download = new File(FileManager.getTempBundleDir(mContext)
, FileManager.TEMP_BUNDLE_NAME);
if (checkZipValidate(download)) {
Log.e(TAG, "更新包md5校验成功");
RenameDeleteFile();
//更改本地jsversion
SharePreferenceUtil.setDownLoadVersion(mContext,
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".activity.SubDisplayActivity"
>
<ImageView
android:id="@+id/sub_display2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@drawable/sub_display"
/>
</LinearLayout>
\ No newline at end of file
......@@ -2,6 +2,6 @@
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
<color name="colorAccent">#2db7f5</color>
<color name="msg_point_red">#ff1300</color>
</resources>
org.gradle.jvmargs=-Xmx1536m
android.enableAapt2=false
APPLICATION_ID=com.gsst.ddl.staff
APPLICATION_ID=com.gsst.ddl.store
GRADLE_TOOL_VERSION=3.0.0
GRADLE_VERSION=https\://services.gradle.org/distributions/gradle-4.1-all.zip
MIN_SDK_VERSION=14
......@@ -30,6 +30,46 @@ PROJECT_SUPPORTLIBVERSION=25.3.1
......
......@@ -3,7 +3,7 @@ apply plugin: 'com.android.library'
android {
compileSdkVersion 25
defaultConfig {
minSdkVersion 16
minSdkVersion 17
targetSdkVersion 26
versionCode 1
versionName "1.0"
......
include ':app',':weex-framework',':nexus',':gsstJPush',':pgyplugin', ':wechatplugin'
include ':app',':weex-framework',':sdk',':nexus',':pgyplugin'
project(':weex-framework').projectDir = new File(settingsDir,'/eros-framework')
project(':sdk').projectDir = new File(settingsDir,'/nexus/sdk')
project(':nexus').projectDir = new File(settingsDir,'/nexus')
project(':gsstJPush').projectDir = new File(settingsDir,'/gsstJPush')
//project(':gsstJPush').projectDir = new File(settingsDir,'/gsstJPush')
project(':pgyplugin').projectDir = new File(settingsDir,'/pgyplugin')
project(':wechatplugin').projectDir = new File(settingsDir,'/wechatplugin')
//project(':wechatplugin').projectDir = new File(settingsDir,'/wechatplugin')
......@@ -7,7 +7,7 @@ android {
// baseFeature true
defaultConfig {
minSdkVersion 16
minSdkVersion 17
targetSdkVersion 26
versionCode 1
versionName "1.0"
......
......@@ -2,5 +2,5 @@
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
<color name="colorAccent">#2db7f5</color>
</resources>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
LastUpgradeVersion = "1120"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
......@@ -15,9 +15,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9737F9E71F384AFD00000800"
BuildableName = "LMWeex.app"
BlueprintName = "LMWeex"
ReferencedContainer = "container:LMWeex.xcodeproj">
BuildableName = "GSSTStorePos.app"
BlueprintName = "GSST"
ReferencedContainer = "container:GSST.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
......@@ -29,17 +29,6 @@
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9737F9E71F384AFD00000800"
BuildableName = "LMWeex.app"
BlueprintName = "LMWeex"
ReferencedContainer = "container:LMWeex.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
......@@ -56,13 +45,11 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9737F9E71F384AFD00000800"
BuildableName = "LMWeex.app"
BlueprintName = "LMWeex"
ReferencedContainer = "container:LMWeex.xcodeproj">
BuildableName = "GSSTStorePos.app"
BlueprintName = "GSST"
ReferencedContainer = "container:GSST.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
......@@ -75,9 +62,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9737F9E71F384AFD00000800"
BuildableName = "LMWeex.app"
BlueprintName = "LMWeex"
ReferencedContainer = "container:LMWeex.xcodeproj">
BuildableName = "GSSTStorePos.app"
BlueprintName = "GSST"
ReferencedContainer = "container:GSST.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
......
//
// AppDelegate.h
// LMWeex
// GSST
//
// Created by XHY on 2017/8/7.
// Copyright © 2019年 gsst. All rights reserved.
......
//
// AppDelegate.m
// LMWeex
// GSST
//
// Created by XHY on 2017/8/7.
// Copyright © 2019年 gsst. All rights reserved.
......@@ -17,9 +17,9 @@
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
BOOL result = [super application:application didFinishLaunchingWithOptions:launchOptions];
//do something
return result;
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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