Commit 851b6867 by 郑鹏

sdk修复bug

parent e6d72fa4
apply plugin: 'com.android.application'
/*apply plugin: 'com.android.library'
apply plugin: 'maven'*/
//apply plugin: 'com.android.application'
apply plugin: 'com.android.library'
apply plugin: 'maven'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
kapt {
arguments {
arg("moduleName", project.getName())
......@@ -16,8 +15,8 @@ android {
compileSdkVersion 30
defaultConfig {
multiDexEnabled true
applicationId "com.mhq.smartorder"
/*multiDexEnabled true
applicationId "com.mhq.smartorder"*/
minSdkVersion 26
targetSdkVersion 30
......@@ -34,15 +33,15 @@ android {
ndk {
abiFilters "armeabi-v7a", "armeabi", "x86"
}
manifestPlaceholders = [
MTA_APPKEY : "AIAF8SC17A3L",
MTA_CHANNEL: "GooglePay"
//极光推送
/* JPUSH_PKGNAME: applicationId,
JPUSH_APPKEY : "xx", //JPush上注册的包名对应的appkey.
JPUSH_CHANNEL: "xx-default", //暂时填写默认值即可.*/
]
/* manifestPlaceholders = [
MTA_APPKEY:"AIAF8SC17A3L",
MTA_CHANNEL:"GooglePay"
//极光推送
*//* JPUSH_PKGNAME: applicationId,
JPUSH_APPKEY : "xx", //JPush上注册的包名对应的appkey.
JPUSH_CHANNEL: "xx-default", //暂时填写默认值即可.*//*
]*/
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
......@@ -53,23 +52,26 @@ android {
timeOutInMs=5*1000
installOptions '-r','-s'
}
*/
/*signingConfigs {
/*=============================================================================================*/
/* signingConfigs {
def appStoreFilePath = System.getProperty('StoreFilePath')
def appStorePassword = System.getProperty('StorePassword')
def appKeyAlias = System.getProperty('KeyAlias')
def appKeyPassword = System.getProperty('KeyPassword')
Properties properties = new Properties()
if (rootProject.file("local.properties").exists()) {
properties.load(rootProject.file("local.properties").newDataInputStream())
storeFilePath = properties.get("STOREFILE")
storePassword = properties.get("STOREPASSWORD")
keyAlias = properties.get("KEYALIAS")
keyPassword = properties.get("KEYPASSWORD")
}
*//* Properties properties = new Properties()
if (rootProject.file("local.properties").exists()) {
properties.load(rootProject.file("local.properties").newDataInputStream())
storeFilePath= properties.get("STOREFILE")
storePassword= properties.get("STOREPASSWORD")
keyAlias= properties.get("KEYALIAS")
keyPassword= properties.get("KEYPASSWORD")
}*//*
if (!appStoreFilePath || !appStorePassword || !appKeyAlias || !appKeyPassword) {
//将.android下的debug.keystore放到app目录下
......@@ -88,9 +90,9 @@ android {
v2SigningEnabled true
}
}*/
}
/* buildTypes {
buildTypes {
debug {
// buildConfigField 'String','NAME','value'
zipAlignEnabled true
......@@ -113,9 +115,7 @@ android {
signingConfig signingConfigs.jenkins
}
}*/
}
sourceSets.main {
jniLibs.srcDirs = ['libs']
java.srcDirs += 'src/support/java'
......@@ -142,10 +142,11 @@ android {
//渠道,版本,构建时间
"Haha_${flavorName}_v${variant.versionName}_${buildTime()}.apk")
// output.outputFile=apkFile
// output.outputFile=apkFile
}
}
}
}*/
/*==============================================================================*/
}
def buildTime() {
......@@ -172,9 +173,7 @@ def getAppVersionCode() {
}
return stout.toString().split("\n").size()
}
/*ext {
ext {
GITHUB_REPO_PATH = "../../androidlibrary"
PUBLISH_GROUP_ID = 'com.mhq.smartorder'
PUBLISH_ARTIFACT_ID = 'smartorder'
......@@ -191,18 +190,14 @@ uploadArchives {
pom.version = project.PUBLISH_VERSION // 版本号
}
}
}*/
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
// api deps.support.multidex
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
//implementation 'com.google.android.gms:play-services-maps:16.1.0'
//annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
annotationProcessor 'com.alibaba:arouter-compiler:1.1.4'
//kapt 'com.jakewharton:butterknife-compiler:8.4.0'
......@@ -257,7 +252,6 @@ dependencies {
api 'com.github.anzaizai:EasySwipeMenuLayout:1.1.4'
api 'org.greenrobot:eventbus:3.1.1'
//api 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0-alpha-25'
//api 'com.google.android.gms:play-services-wallet:16.0.1'
api 'com.tencent.qcloud:cosxml:5.4.25'
api 'com.sunfusheng:marqueeview:1.3.3'
/* api 'com.google.firebase:firebase-core:16.0.8'
......
......@@ -29,8 +29,9 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".ui.home.FoodAllEvaluateActivity"
android:screenOrientation="portrait" >
<activity
android:name=".ui.home.FoodAllEvaluateActivity"
android:screenOrientation="portrait">
</activity>
<activity
......@@ -105,13 +106,13 @@
sign the APK for publishing.
You can define the keys for the debug and release targets in src/debug/ and src/release/.
-->
<!-- <meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_channel_id"
android:value="@string/default_notification_channel_id" />-->
<activity
<!-- <meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_channel_id"
android:value="@string/default_notification_channel_id" />-->
<!-- <activity
android:name=".ui.home.map.GoogleMapsActivity"
android:label="@string/title_activity_google_maps"
android:screenOrientation="portrait" />
......@@ -122,11 +123,11 @@
<activity
android:name=".ui.home.map.GoogleMapsMallActivity"
android:label="@string/title_activity_google_maps"
android:screenOrientation="portrait" />
<activity
android:screenOrientation="portrait" />-->
<!-- <activity
android:name=".ui.home.map.MapsActivity"
android:label="@string/title_activity_maps"
android:screenOrientation="portrait" />
android:screenOrientation="portrait" />-->
<activity
android:name=".ui.personal.QuestionDetailsActivity"
android:screenOrientation="portrait" />
......@@ -135,14 +136,14 @@
android:screenOrientation="portrait" />
<activity
android:name=".ui.personal.order.food.FoodEvaluationActivity"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
android:screenOrientation="portrait">
<!-- <intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>-->
</activity>
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="${applicationId}.genericFile.provider"
......@@ -150,8 +151,9 @@
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"/>
android:resource="@xml/provider_paths" />
</provider>
<activity
android:name=".ui.shop.MallSearchActivity"
android:screenOrientation="portrait" />
......@@ -283,11 +285,11 @@
<activity
android:name="cn.dankal.user.login.LanguageSelectActivity"
android:screenOrientation="portrait">
<!-- <intent-filter>
<action android:name="android.intent.action.MAIN" />
<!--<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>-->
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>-->
</activity>
<activity
android:name="com.mhq.smartorder.wxapi.WXPayEntryActivity"
......@@ -307,30 +309,30 @@
android:exported="true"
android:theme="@style/MyTranslucentTheme" />
<!-- <service android:name=".ui.service.MyFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>--> <!-- [END firebase_service] -->
<!-- <service
android:name=".ui.service.MyJobService"
android:exported="false">
<intent-filter>
<action android:name="com.firebase.jobdispatcher.ACTION_EXECUTE" />
</intent-filter>
</service>-->
<!-- <service android:name=".ui.service.MyFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>--> <!-- [END firebase_service] -->
<!-- <service
android:name=".ui.service.MyJobService"
android:exported="false">
<intent-filter>
<action android:name="com.firebase.jobdispatcher.ACTION_EXECUTE" />
</intent-filter>
</service>-->
<activity android:name="cn.dankal.basiclib.base.activity.BaseListActivity"></activity>
<activity
android:name="cn.dankal.basiclib.base.activity.BigPhotoActivity"
android:screenOrientation="portrait" />
<!-- <meta-data
android:name="firebase_messaging_auto_init_enabled"
android:value="false" />
<meta-data
android:name="firebase_analytics_collection_enabled"
android:value="false" />-->
<!-- <meta-data
android:name="firebase_messaging_auto_init_enabled"
android:value="false" />
<meta-data
android:name="firebase_analytics_collection_enabled"
android:value="false" />-->
<activity
android:name="com.yzq.zxinglibrary.android.CaptureActivity"
......@@ -340,13 +342,14 @@
<provider
android:name="com.luck.picture.lib.PictureFileProvider"
android:authorities="${applicationId}.provider"
android:authorities="cn.dankal.client.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
<activity
android:name="com.luck.picture.lib.PictureSelectorActivity"
android:windowSoftInputMode="adjustPan" />
......@@ -355,44 +358,63 @@
android:name="com.luck.picture.lib.PictureVideoPlayActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:screenOrientation="sensor" />
<activity android:name="com.luck.picture.lib.PictureExternalPreviewActivity"
android:screenOrientation="portrait" />
<activity android:name="com.uc.ucrop.UCropActivity"
android:screenOrientation="portrait" />
<activity android:name="com.uc.ucrop.PictureMultiCuttingActivity"
android:screenOrientation="portrait" />
<activity android:name="com.luck.picture.lib.PicturePlayAudioActivity"
android:screenOrientation="portrait" />
<activity android:name="cn.dankal.user.login.LockStateActivity"
android:screenOrientation="portrait"/>
<activity android:name="cn.dankal.user.wx.IsBindPhoneActivity"
android:screenOrientation="portrait"/>
<activity android:name="cn.dankal.user.wx.RegisterWXEmailActivity"
android:screenOrientation="portrait"/>
<activity android:name="cn.dankal.user.register.ProtocolActivity"
android:screenOrientation="portrait"/>
<activity android:name="cn.dankal.user.modify.EmailUpdatePasswordActivity"
android:screenOrientation="portrait"/>
<activity android:name="cn.dankal.user.modify.ModifyPasswordActivity"
android:screenOrientation="portrait"/>
<activity android:name="cn.dankal.user.modify.ModifyEmailActivity"
android:screenOrientation="portrait"/>
<activity android:name="cn.dankal.user.modify.ModifyPhoneActivity"
android:screenOrientation="portrait"/>
<activity android:name="cn.dankal.user.register.RegisterInputInfoActivity"
android:screenOrientation="portrait"/>
<activity android:name="cn.dankal.user.register.RegisterEmailActivity"
android:screenOrientation="portrait"/>
<activity android:name="cn.dankal.user.register.RegisterActivity"
android:screenOrientation="portrait"/>
<activity android:name="cn.dankal.user.forget.ForgetPasswordHomeActivity"
android:screenOrientation="portrait"/>
<activity android:name="cn.dankal.user.login.FindEmailTowActivity"
android:screenOrientation="portrait"/>
<activity android:name="cn.dankal.user.login.FindEmailActivity"
android:screenOrientation="portrait"/>
<activity android:name="cn.dankal.user.forget.ForgetPasswordActivity"
android:screenOrientation="portrait"/>
<activity
android:name="com.luck.picture.lib.PictureExternalPreviewActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.uc.ucrop.UCropActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.uc.ucrop.PictureMultiCuttingActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.luck.picture.lib.PicturePlayAudioActivity"
android:screenOrientation="portrait" />
<activity
android:name="cn.dankal.user.login.LockStateActivity"
android:screenOrientation="portrait" />
<activity
android:name="cn.dankal.user.wx.IsBindPhoneActivity"
android:screenOrientation="portrait" />
<activity
android:name="cn.dankal.user.wx.RegisterWXEmailActivity"
android:screenOrientation="portrait" />
<activity
android:name="cn.dankal.user.register.ProtocolActivity"
android:screenOrientation="portrait" />
<activity
android:name="cn.dankal.user.modify.EmailUpdatePasswordActivity"
android:screenOrientation="portrait" />
<activity
android:name="cn.dankal.user.modify.ModifyPasswordActivity"
android:screenOrientation="portrait" />
<activity
android:name="cn.dankal.user.modify.ModifyEmailActivity"
android:screenOrientation="portrait" />
<activity
android:name="cn.dankal.user.modify.ModifyPhoneActivity"
android:screenOrientation="portrait" />
<activity
android:name="cn.dankal.user.register.RegisterInputInfoActivity"
android:screenOrientation="portrait" />
<activity
android:name="cn.dankal.user.register.RegisterEmailActivity"
android:screenOrientation="portrait" />
<activity
android:name="cn.dankal.user.register.RegisterActivity"
android:screenOrientation="portrait" />
<activity
android:name="cn.dankal.user.forget.ForgetPasswordHomeActivity"
android:screenOrientation="portrait" />
<activity
android:name="cn.dankal.user.login.FindEmailTowActivity"
android:screenOrientation="portrait" />
<activity
android:name="cn.dankal.user.login.FindEmailActivity"
android:screenOrientation="portrait" />
<activity
android:name="cn.dankal.user.forget.ForgetPasswordActivity"
android:screenOrientation="portrait" />
</application>
</manifest>
\ No newline at end of file
......@@ -18,6 +18,8 @@ import org.litepal.LitePal;
import java.util.Locale;
import cn.dankal.basiclib.image.Utils;
import cn.dankal.basiclib.pojo.UserInfoBean;
import cn.dankal.basiclib.pojo.UserResponseBody;
import cn.dankal.basiclib.util.AppUtils;
import cn.dankal.basiclib.util.DensityAdaptationUtils;
import cn.dankal.basiclib.util.StringUtil;
......@@ -32,31 +34,30 @@ import cn.dankal.basiclib.widget.loadsir.core.LoadSir;
import cn.dankal.client.BuildConfig;
public class ModooApplication extends Application {
//개발 환경 인지 아 닌 지
public static final boolean isDev = false;
private static ModooApplication context;
private static ModooApplication mContext;
private static IWXAPI api;
@Override
public void onCreate() {
super.onCreate();
context = this;
mContext = this;
initARouter();
initStetho();
initLoadSir();
//적합 한 방안.
DensityAdaptationUtils.setDensity(context, 375);
AppUtils.init(context);
//DensityAdaptationUtils.setDensity(context, 375);
AppUtils.init(mContext);
//데이터베이스 초기 화 스 캔
LitePal.initialize(this);
Utils.mAppContext=this.getApplicationContext();
Utils.mAppContext = this.getApplicationContext();
//bugly
//CrashReport.initCrashReport(getApplicationContext(), "74a2fc949e", isDev);
......@@ -82,7 +83,7 @@ public class ModooApplication extends Application {
// [선택 가능] debug 출력 여 부 를 설정 합 니 다. 로그 인 할 때 닫 으 십시오. Logcat 레이 블 은 "MTasDK" 입 니 다.
//StatConfig.setDebugEnable(isDev);
// 기초 통계 API
// StatService.registerActivityLifecycleCallbacks(this);
// StatService.registerActivityLifecycleCallbacks(this);
String appkey = "AIAF8SC17A3L";
// MTA 초기 화 및 시작
......@@ -95,15 +96,15 @@ public class ModooApplication extends Application {
//처리 버튼 여러 번 클릭 방지, 기본 1s,https://www.jianshu.com/p/7f3e5c8b8643
ViewDoubleHelper.init(this);
Locale locale = context.getResources().getConfiguration().locale;
Locale locale = mContext.getResources().getConfiguration().locale;
String language = locale.getLanguage();
if ("en".equals(language)){
if ("en".equals(language)) {
SPUtil.getInstance(ModooApplication.getContext()).saveLanguage(2);
}else if ("ja".equals(language)){
} else if ("ja".equals(language)) {
SPUtil.getInstance(ModooApplication.getContext()).saveLanguage(3);
}else if ("ko".equals(language)){
} else if ("ko".equals(language)) {
SPUtil.getInstance(ModooApplication.getContext()).saveLanguage(1);
}else if ("zh".equals(language)){
} else if ("zh".equals(language)) {
SPUtil.getInstance(ModooApplication.getContext()).saveLanguage(0);
}
}
......@@ -131,9 +132,16 @@ public class ModooApplication extends Application {
}
public static Context getContext() {
return context;
return mContext;
}
public static ModooApplication getInstance() {
return mContext;
}
/**
* 페 이 스 북 제작 보조 개발 도구
*/
......@@ -167,7 +175,7 @@ public class ModooApplication extends Application {
public static IWXAPI getIWXAPI() {
//WXAPIFactory 공장 을 통 해 IWXAPI 의 인 스 턴 스 를 획득 합 니 다.
api = WXAPIFactory.createWXAPI(context, WxConstants.WX_APP_ID, true);
api = WXAPIFactory.createWXAPI(mContext, WxConstants.WX_APP_ID, true);
//애플 리 케 이 션 의 appid 를 위 챗 에 등록 합 니 다.
api.registerApp(WxConstants.WX_APP_ID);
......@@ -190,7 +198,7 @@ public class ModooApplication extends Application {
public static boolean isDarkMode() {
int nightMode = AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM;
if (nightMode == AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM) {
int applicationUiMode = context.getResources().getConfiguration().uiMode;
int applicationUiMode = mContext.getResources().getConfiguration().uiMode;
int systemMode = applicationUiMode & Configuration.UI_MODE_NIGHT_MASK;
return systemMode == Configuration.UI_MODE_NIGHT_YES;
} else {
......@@ -198,4 +206,40 @@ public class ModooApplication extends Application {
}
}
public static void setSDKLoginInfo(String token) {
ModooApplication.setLogin(true);
UserResponseBody userResponseBody = new UserResponseBody();
UserResponseBody.TokenBean tokenBean = new UserResponseBody.TokenBean();
tokenBean.token = token;
userResponseBody.setToken(tokenBean);
userResponseBody.setUserInfo(new UserInfoBean());
DKUserManager.saveUserInfo(userResponseBody);
DKUserManager.updateUserInfo(new UserInfoBean());
}
public static void outSDKLogin() {
ModooApplication.setLogin(false);
UserResponseBody userResponseBody = new UserResponseBody();
UserResponseBody.TokenBean tokenBean = new UserResponseBody.TokenBean();
tokenBean.token = "";
userResponseBody.setToken(tokenBean);
userResponseBody.setUserInfo(new UserInfoBean());
DKUserManager.saveUserInfo(userResponseBody);
}
public SDKLoginErrorListen mSDKLoginErrorListen;
public SDKLoginErrorListen getSDKLoginErrorListen() {
return mSDKLoginErrorListen;
}
public void setSDKLoginErrorListen(SDKLoginErrorListen mSDKLoginErrorListen) {
this.mSDKLoginErrorListen = mSDKLoginErrorListen;
}
public interface SDKLoginErrorListen {
void sdkLoginError(int code, String message);
}
}
......@@ -25,8 +25,9 @@ public class BaseApi {
/*public static final String BASE_URL = isDev ? "https://api-koreadc.dankal.cn/v1/"
: "https://modoo-api.mhqglobal.com/v1/";*/
public static final String BASE_URL = "https://api-koreadc.dankal.cn/v1/";
//public static final String BASE_URL = "https://api-koreadc.dankal.cn/v1/";
//public static final String BASE_URL = "https://modoo-api.mhqglobal.com/v1/";
public static final String BASE_URL = "https://modoo-ic-api.mhqglobal.com/v1/";
public static final String BASE_EXPRESS_URL = "https://info.sweettracker.co.kr/";
......
......@@ -17,7 +17,9 @@ import com.yanzhenjie.permission.Permission;
import java.io.File;
import cn.dankal.basiclib.ModooApplication;
import cn.dankal.basiclib.util.FileUtils;
import cn.dankal.client.R;
import kotlin.jvm.JvmStatic;
public final class CaptureAndCropManager
......@@ -25,6 +27,7 @@ public final class CaptureAndCropManager
public static final int REQUEST_CODE_CAPTURE = 200;
public static final int REQUEST_CODE_CROP = 300;
public static final int REQUEST_CODE_ALBUM = 400;
public static final int REQUEST_CODE_CAPTURE_CROP = 500;
public static final String AUTHORITY = ModooApplication.getContext().getPackageName() + ".genericFile.provider";
......@@ -168,7 +171,7 @@ public final class CaptureAndCropManager
}
// 填充裁剪的Intent
private static void fillCropIntent(Intent intent)
public static void fillCropIntent(Intent intent)
{
// 设置裁剪
intent.putExtra("crop", "true");
......@@ -270,7 +273,6 @@ public final class CaptureAndCropManager
{
mOutCameraCaptureImageFile = new File(FileUtil.getCacheDir(),
"capture_" + System.currentTimeMillis() + ".jpg");
Intent intentToTakePhoto = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
Uri imageUri;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
......
package cn.dankal.basiclib.image;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.os.Environment;
import android.provider.MediaStore;
......@@ -17,8 +19,14 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import cn.dankal.basiclib.ModooApplication;
import static android.os.Environment.DIRECTORY_PICTURES;
public final class FileUtil
{
private FileUtil()
......@@ -65,6 +73,42 @@ public final class FileUtil
return f;
}
public static File getAppRootDirPath() {
return ModooApplication.getContext().getExternalFilesDir(null).getAbsoluteFile();
}
public static File createImageFile(Context context,boolean isCrop) {
try {
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
String fileName = "";
if (isCrop) {
fileName = "IMG_" + timeStamp + "_CROP.jpg";
} else {
fileName = "IMG_" + timeStamp + ".jpg";
}
File rootFile = new File(getAppRootDirPath() + File.separator + "capture");
if (!rootFile.exists()) {
rootFile.mkdirs();
}
File imgFile;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
imgFile = new File(Environment.getExternalStoragePublicDirectory(DIRECTORY_PICTURES) + File.separator + fileName);
// 通过 MediaStore API 插入file 为了拿到系统裁剪要保存到的uri(因为App没有权限不能访问公共存储空间,需要通过 MediaStore API来操作)
ContentValues values = new ContentValues();
values.put(MediaStore.Images.Media.DATA, imgFile.getAbsolutePath());
values.put(MediaStore.Images.Media.DISPLAY_NAME, fileName);
values.put(MediaStore.Images.Media.MIME_TYPE, "image/jpeg");
//uri = context.getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
} else {
imgFile = new File(rootFile.getAbsolutePath() + File.separator + fileName);
}
return imgFile;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
// 取得App的文件目录,在sd卡根目录下用包名为目录名,或者在内部的存储目录,用/结尾
public static String getAppDir()
{
......
......@@ -35,7 +35,7 @@ public abstract class AbstractSubscriber<T> implements Observer<T> {
if (e instanceof LocalException) {
LocalException exception = (LocalException) e;
//401 重新获取access token , 如果还返回412 就是refresh token 也失效了。需要重新登录
if (exception.getErrorCode() == HttpStatusCode.TOKEN_INVAILD ||
/* if (exception.getErrorCode() == HttpStatusCode.TOKEN_INVAILD ||
exception.getErrorCode() == HttpStatusCode.UNAUTHORIZED) {
view.tokenInvalid();
view.showToast(ModooApplication.getContext().getString(R.string.login_Invalid));
......@@ -52,6 +52,10 @@ public abstract class AbstractSubscriber<T> implements Observer<T> {
}
} else {
view.showToast(exception.getMsg());
}*/
if (ModooApplication.getInstance().mSDKLoginErrorListen!=null){
ModooApplication.getInstance().mSDKLoginErrorListen.sdkLoginError(exception.getErrorCode(),exception.getMsg());
}
} else {
Log.e("SubscriberThrowable", e.getMessage());
......
......@@ -24,7 +24,7 @@ public final class AppUtils {
sActivityList.add(activity);
setTopActivityWeakRef(activity);
//适配方案
DensityAdaptationUtils.setDefault(activity);
//DensityAdaptationUtils.setDefault(activity);
}
@Override
......
package cn.dankal.basiclib.util;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
......@@ -31,6 +32,8 @@ import java.util.Locale;
import cn.dankal.basiclib.ModooApplication;
import static android.os.Environment.DIRECTORY_PICTURES;
/**
* @author vane
......@@ -403,4 +406,56 @@ public class FileUtils {
file.delete();
}
public static File getAppRootDirPath() {
return ModooApplication.getContext().getExternalFilesDir(null).getAbsoluteFile();
}
public static Uri uri;
public static File createImageFile(Context context,boolean isCrop) {
try {
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
String fileName = "";
if (isCrop) {
fileName = "IMG_"+timeStamp+"_CROP.jpg";
} else {
fileName = "IMG_"+timeStamp+".jpg";
}
File rootFile = new File(getAppRootDirPath() + File.separator + "capture");
if (!rootFile.exists()) {
rootFile.mkdirs();
}
File imgFile;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
imgFile = new File(Environment.getExternalStoragePublicDirectory(DIRECTORY_PICTURES) + File.separator + fileName);
// 通过 MediaStore API 插入file 为了拿到系统裁剪要保存到的uri(因为App没有权限不能访问公共存储空间,需要通过 MediaStore API来操作)
ContentValues values = new ContentValues();
values.put(MediaStore.Images.Media.DATA, imgFile.getAbsolutePath());
values.put(MediaStore.Images.Media.DISPLAY_NAME, fileName);
values.put(MediaStore.Images.Media.MIME_TYPE, "image/jpeg");
uri = context.getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
}else {
imgFile = new File(rootFile.getAbsolutePath() + File.separator + fileName);
}
return imgFile;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
public static File getCropFile(Context context,Uri uri){
String[] proj = { MediaStore.Images.Media.DATA };
Cursor cursor = context.getContentResolver().query(uri, proj, null, null, null);
if (cursor.moveToFirst()) {
int columnIndex = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
String path = cursor.getString(columnIndex);
cursor.close();
return new File(path);
}
return null;
}
}
......@@ -34,9 +34,9 @@ import cn.dankal.client.ui.home.ScanResultActivity
import cn.dankal.client.ui.home.details.MerchantDetailsActivity
import cn.dankal.client.ui.personal.PersonalFragment
import cn.dankal.client.ui.shop.ShopFragment
import com.google.android.gms.maps.GoogleMap
/*import com.google.android.gms.maps.GoogleMap
import com.google.android.gms.maps.OnMapReadyCallback
import com.google.android.gms.tasks.OnCompleteListener
import com.google.android.gms.tasks.OnCompleteListener*/
import com.google.gson.Gson
import com.yanzhenjie.permission.Permission
import com.yzq.zxinglibrary.common.Constant
......@@ -46,10 +46,10 @@ import okhttp3.ResponseBody
import java.lang.reflect.Field
class MainActivity : BaseActivity(), OnMapReadyCallback {
override fun onMapReady(p0: GoogleMap?) {
class MainActivity : BaseActivity() {
/* override fun onMapReady(p0: GoogleMap?) {
mMap = p0
}
}*/
/**
* 저번 에 리 턴 누 른 시간.
......@@ -68,7 +68,7 @@ class MainActivity : BaseActivity(), OnMapReadyCallback {
private var mRxPermissions: RxPermissions? = null
private var mMap: GoogleMap? = null
//private var mMap: GoogleMap? = null
private var mSectionsPagerAdapter: SectionsPagerAdapter? = null
......@@ -169,7 +169,7 @@ class MainActivity : BaseActivity(), OnMapReadyCallback {
//지 도 를 초기 화하 여 경 위 를 얻다.
private fun initializeMap() {
var location: Location? = mMap?.getMyLocation()
/* var location: Location? = mMap?.getMyLocation()
try {
location?.let {
SPUtils.put(ConstantsHomeType.LATITUDE, it.latitude.toString())
......@@ -177,7 +177,7 @@ class MainActivity : BaseActivity(), OnMapReadyCallback {
}
} catch (e: Exception) {
e.printStackTrace()
}
}*/
}
......
......@@ -25,7 +25,7 @@ import cn.dankal.basiclib.util.SPUtils
import cn.dankal.basiclib.util.ToastUtils
import cn.dankal.client.R
import cn.dankal.client.constants.ConstantsHomeType
import cn.dankal.client.ui.home.map.GoogleMapsActivity
//import cn.dankal.client.ui.home.map.GoogleMapsActivity
import cn.dankal.entities.event.LocationChangeEvent
import cn.dankal.entities.home.TopHomeInfoEntity
import com.scwang.smartrefresh.layout.header.ClassicsHeader
......@@ -38,6 +38,7 @@ import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
import cn.dankal.basiclib.protocol.MainProtocol
import cn.dankal.client.ui.home.details.MerchantDetailsActivity
import cn.dankal.client.ui.personal.MyQueueActivity
import cn.dankal.entities.home.QRCodeEntity
import com.alibaba.android.arouter.facade.annotation.Route
import com.google.gson.Gson
......@@ -61,9 +62,10 @@ class HomeActivity : BaseActivity(), View.OnClickListener {
requestPermission(Permission.CAMERA) {
startActivityForResult(Intent(this, CaptureActivity::class.java), ConstantsHomeType.SCAN)
}
//startActivity(Intent(this@HomeActivity, MyQueueActivity::class.java))
}
R.id.iv_home_location -> {
startActivity(Intent(this, GoogleMapsActivity::class.java))
//startActivity(Intent(this, GoogleMapsActivity::class.java))
}
}
}
......
......@@ -32,7 +32,7 @@ import cn.dankal.entities.home.TopHomeInfoEntity
import cn.dankal.client.constants.ConstantsShopType
import cn.dankal.client.ui.home.details.DishesDetailsTowActivity
import cn.dankal.client.ui.home.holder.BannerItemView
import cn.dankal.client.ui.home.map.GoogleMapsActivity
//import cn.dankal.client.ui.home.map.GoogleMapsActivity
import cn.dankal.client.ui.shop.ShopDetailActivity
import cn.dankal.client.ui.shop.WebViewContentActivity
import cn.dankal.entities.event.LocationChangeEvent
......@@ -68,7 +68,7 @@ class HomeFragment : BaseFragment(), View.OnClickListener {
}
}
R.id.iv_home_location -> {
activity?.startActivity(Intent(context, GoogleMapsActivity::class.java))
//activity?.startActivity(Intent(context, GoogleMapsActivity::class.java))
}
}
}
......
......@@ -49,7 +49,7 @@ import cn.dankal.client.adapter.MenuItemAdapter;
import cn.dankal.client.constants.ConstantsHomeType;
import cn.dankal.client.ui.home.details.MerchantDetailsActivity;
import cn.dankal.client.ui.home.details.RecommendMerchantActivity;
import cn.dankal.client.ui.home.map.GoogleMapsActivity;
//import cn.dankal.client.ui.home.map.GoogleMapsActivity;
import cn.dankal.client.util.UIUtile;
import io.reactivex.rxjava3.disposables.Disposable;
......@@ -271,7 +271,7 @@ public class MenuItemFragment extends BaseFragment {
ImageView ivSearch = view.findViewById(R.id.iv_home_search);
ImageView ivHomeSweep = view.findViewById(R.id.iv_home_sweep);
ivHomeLocation.setOnClickListener(v -> getActivity().startActivity(new Intent(getActivity(), GoogleMapsActivity.class)));
//ivHomeLocation.setOnClickListener(v -> getActivity().startActivity(new Intent(getActivity(), GoogleMapsActivity.class)));
ivSearch.setOnClickListener(v -> getActivity().startActivity(new Intent(getActivity(), SearchShopActivity.class)));
......
......@@ -9,7 +9,7 @@ import cn.dankal.basiclib.util.WebViewUtil
import cn.dankal.basiclib.widget.dialog.CallDialog
import cn.dankal.entities.home.RestaurantDetailEntity
import cn.dankal.client.R
import cn.dankal.client.ui.home.map.GoogleMapsMerchantActivity
//import cn.dankal.client.ui.home.map.GoogleMapsMerchantActivity
import kotlinx.android.synthetic.main.fragment_details_info.*
private const val ARG_PARAM1 = "param1"
......@@ -34,20 +34,20 @@ class DetailsInfoFragment : BaseFragment(), View.OnClickListener, CallDialog.OnC
// startActivity(Intent(activity, OrderResultActivity::class.java))
}
R.id.iv_location -> {
toMaps()
//toMaps()
}
R.id.tv_merchant_address -> {
toMaps()
//toMaps()
}
}
}
private fun toMaps() {
var intent = Intent(activity, GoogleMapsMerchantActivity::class.java)
/* var intent = Intent(activity, GoogleMapsMerchantActivity::class.java)
var bundle = Bundle()
bundle.putSerializable(ARG_PARAM1, param1)
intent.putExtras(bundle)
startActivity(intent)
startActivity(intent)*/
}
override fun getLayoutId(): Int {
......
......@@ -4,21 +4,16 @@ package cn.dankal.client.ui.home.details;
import android.content.Intent;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutCompat;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.util.ArrayMap;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
......@@ -401,6 +396,7 @@ public class DetailsShopFragment extends BaseFragment implements OnRefreshLoadMo
carAdapter = new ShopBottomListAdapter(R.layout.item_shop_bottom_list, listItemEntities, () -> findCarShop());
rvCar.setAdapter(carAdapter);
requestIsMerchantOrder();
}
......@@ -594,6 +590,8 @@ public class DetailsShopFragment extends BaseFragment implements OnRefreshLoadMo
}
} else if (beans.get(0).getIs_over_number() == 1) {//줄 서기 성공
setBottomState(2);
}else if (beans.get(0).getIs_over_number()==3){
setBottomState(1);
}
}
} else {
......@@ -618,7 +616,7 @@ public class DetailsShopFragment extends BaseFragment implements OnRefreshLoadMo
* @param entity
*/
private void showBottomDialog(ShopTypeContentEntity.DataBean dataBean, RestaurantSpecEntity entity) {
View view = LayoutInflater.from(getActivity()).inflate(R.layout.dialog_select_format, null, false);
View view = LayoutInflater.from(getActivity()).inflate(R.layout.dialog_select_format_tow, null, false);
final TagFlowLayout flowLayoutOne = view.findViewById(R.id.fl_tag_one);
TextView mainName = view.findViewById(R.id.tv_format);
......@@ -930,12 +928,12 @@ public class DetailsShopFragment extends BaseFragment implements OnRefreshLoadMo
enabledButton();
} else {
tvBottomShopButton.setBackgroundColor(getResources().getColor(R.color.btn_bg));
tvBottomShopButton.setTextColor(getResources().getColor(R.color.color_171717));
tvBottomShopButton.setTextColor(getResources().getColor(R.color.white));
tvBottomShopButton.setEnabled(true);
tvBottomShopButton.setText(R.string.selected);
tvSettlement.setBackgroundColor(getResources().getColor(R.color.btn_bg));
tvSettlement.setTextColor(getResources().getColor(R.color.color_171717));
tvSettlement.setTextColor(getResources().getColor(R.color.white));
tvSettlement.setEnabled(true);
tvSettlement.setText(R.string.go_to_settlement);
}
......
......@@ -268,7 +268,7 @@ class DishesDetailsActivity : BaseActivity(), View.OnClickListener {
}
private fun showBottomDialog(entity: RestaurantSpecEntity) {
val view = LayoutInflater.from(this).inflate(R.layout.dialog_select_format, null, false)
val view = LayoutInflater.from(this).inflate(R.layout.dialog_select_format_tow, null, false)
val flowLayoutOne = view.findViewById<TagFlowLayout>(R.id.fl_tag_one)
val mainName = view.findViewById<TextView>(R.id.tv_format)
val price = view.findViewById<TextView>(R.id.tv_restaurant_price)
......
......@@ -8,7 +8,10 @@ import android.support.v7.widget.LinearLayoutCompat
import android.support.v7.widget.LinearLayoutManager
import android.support.v7.widget.RecyclerView
import android.text.TextUtils
import android.view.*
import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.*
import cn.dankal.basiclib.api.RestaurantServiceFactory
import cn.dankal.basiclib.base.activity.BaseActivity
......@@ -20,7 +23,6 @@ import cn.dankal.basiclib.util.ButtonUtil
import cn.dankal.basiclib.util.ToastUtils
import cn.dankal.basiclib.util.WebViewUtil
import cn.dankal.basiclib.widget.banner.DkBanner
import cn.dankal.entities.home.*
import cn.dankal.client.R
import cn.dankal.client.adapter.home.ShopBottomListAdapter
import cn.dankal.client.adapter.home.ShopSpecListAdapter
......@@ -36,6 +38,7 @@ import cn.dankal.client.ui.shop.QueueResultActivity
import cn.dankal.client.util.FindUtil
import cn.dankal.client.util.UIUtile
import cn.dankal.entities.event.ShopCarRefreshEvent
import cn.dankal.entities.home.*
import com.google.gson.Gson
import com.yanzhenjie.permission.Permission
import com.yzq.zxinglibrary.android.CaptureActivity
......@@ -48,7 +51,7 @@ import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
import org.litepal.LitePal
import java.io.Serializable
import java.util.ArrayList
import java.util.*
class DishesDetailsTowActivity : BaseActivity(), View.OnClickListener, DishesView {
......@@ -81,6 +84,8 @@ class DishesDetailsTowActivity : BaseActivity(), View.OnClickListener, DishesVie
}, true)
} else if (beans[0].is_over_number == 1) {//줄 서기 성공
showState = 2
} else if (beans[0].is_over_number == 3) {
showState = 1
}
}
}
......@@ -307,7 +312,7 @@ class DishesDetailsTowActivity : BaseActivity(), View.OnClickListener, DishesVie
}
private fun showBottomDialog(entity: RestaurantSpecEntity) {
val view = LayoutInflater.from(this).inflate(R.layout.dialog_select_format, null, false)
val view = LayoutInflater.from(this).inflate(R.layout.dialog_select_format_tow, null, false)
val flowLayoutOne = view.findViewById<TagFlowLayout>(R.id.fl_tag_one)
val mainName = view.findViewById<TextView>(R.id.tv_format)
val price = view.findViewById<TextView>(R.id.tv_restaurant_price)
......
package cn.dankal.client.ui.home.map;
import android.Manifest;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.drawable.Drawable;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.sdk.glide.Glide;
import com.sdk.glide.request.RequestOptions;
import com.sdk.glide.request.target.SimpleTarget;
import com.sdk.glide.request.transition.Transition;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import cn.dankal.basiclib.api.HomeServiceFactory;
import cn.dankal.basiclib.base.activity.BaseActivity;
import cn.dankal.basiclib.rx.AbstractDialogSubscriber;
import cn.dankal.basiclib.util.SPUtils;
import cn.dankal.basiclib.util.image.PicUtils;
import cn.dankal.basiclib.widget.GradeStarView;
import cn.dankal.entities.home.BottomAroundEntity;
import cn.dankal.client.R;
import cn.dankal.client.constants.ConstantsHomeType;
import cn.dankal.client.ui.home.NearbyMerchantActivity;
import cn.dankal.client.ui.home.details.MerchantDetailsActivity;
import static cn.dankal.client.R.*;
public class GoogleMapsActivity extends BaseActivity implements OnMapReadyCallback {
private GoogleMap mMap;
private Context context;
private final int MY_PERMISSIONS_REQUEST_FINE_LOCATION = 100;
private LocationTracker locationTrackObj;
private final int ANIMATION_TYPE_RIPPLE = 0;
private GoogleMap.InfoWindowAdapter windowAdapter;
private List<BottomAroundEntity.DataBean> dataBeans;//근처 모든 상가 정보
private SupportMapFragment mapFragment;
private RelativeLayout relativeLayout;
private static final int LOCATION_PERMISSION_REQUEST_CODE = 1;
private Drawable drawable;//현재 표시 할 InforWindow 네트워크 맵
@Override
protected int getLayoutId() {
return R.layout.activity_google_maps;
}
@Override
protected void initComponents() {
addSingleTitleBar(getString(string.location));
setUpMap();
context = this;
relativeLayout = findViewById(id.rl_layout);
mapFragment = (SupportMapFragment) getSupportFragmentManager()
.findFragmentById(id.map);
mapFragment.getMapAsync(this);
locationTrackObj = new LocationTracker(context);
if (!locationTrackObj.canGetLocation()) {
locationTrackObj.showSettingsAlert();
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
checkLocationPermission();
}
}
}
@Override
public void onRequestPermissionsResult(int requestCode,
String permissions[], int[] grantResults) {
switch (requestCode) {
case MY_PERMISSIONS_REQUEST_FINE_LOCATION: {
if (grantResults.length > 0
&& grantResults[0] == PackageManager.PERMISSION_GRANTED) {
initializeMap(mMap);
} else {
}
return;
}
}
}
@Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (ActivityCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_FINE_LOCATION)
== PackageManager.PERMISSION_GRANTED) {
initializeMap(mMap);
}
} else {
initializeMap(mMap);
}
}
View infoWindow = null;
/**
* 지도 초기 화
*
* @param mMap
*/
private void initializeMap(GoogleMap mMap) {
if (mMap != null) {
windowAdapter = new GoogleMap.InfoWindowAdapter() {
@Override
public View getInfoWindow(Marker marker) {
if (infoWindow == null) {
infoWindow = LayoutInflater.from(GoogleMapsActivity.this).inflate(layout.custom_info_window, relativeLayout, false);
}
render(marker, infoWindow);
return infoWindow;
}
@Override
public View getInfoContents(Marker marker) {
if (infoWindow == null) {
infoWindow = LayoutInflater.from(GoogleMapsActivity.this).inflate(layout.custom_info_window, null);
}
render(marker, infoWindow);
return infoWindow;
}
};
mMap.setInfoWindowAdapter(windowAdapter);
mMap.setOnInfoWindowClickListener(marker -> {
int index = Integer.parseInt(marker.getSnippet());
if (dataBeans != null && index < dataBeans.size()) {
BottomAroundEntity.DataBean dataBean = dataBeans.get(index);
startActivity(new Intent(GoogleMapsActivity.this, MerchantDetailsActivity.class)
.putExtra(MerchantDetailsActivity.HOTELUUID, dataBean.getUuid()));
}
});
mMap.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() {
@Override
public boolean onMarkerClick(Marker marker) {
if (dataBeans != null) {
RequestOptions requestOptions = new RequestOptions();
requestOptions.disallowHardwareConfig();
Glide.with(context)
.applyDefaultRequestOptions(requestOptions)
.load(PicUtils.getUrl(dataBeans.get(Integer.valueOf(marker.getSnippet())).getImg_list()))
.into(new SimpleTarget<Drawable>() {
@Override
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
drawable = resource;
marker.showInfoWindow();
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(marker.getPosition(), 16));
}
});
}
return true;
}
});
mMap.getUiSettings().setMyLocationButtonEnabled(false);
mMap.getUiSettings().setScrollGesturesEnabled(true);
mMap.getUiSettings().setAllGesturesEnabled(true);
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
return;
}
mMap.setMyLocationEnabled(true);
Location location = mMap.getMyLocation();
if (location == null)
location = locationTrackObj.getLocation();
try {
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new
LatLng(location.getLatitude(),
location.getLongitude()), 16));
requestAllList();
} catch (Exception e) {
e.printStackTrace();
}
}
}
//데 이 터 를 요청 하여 그립 니 다. MarkerOptions();
private void requestAllList() {
Map<String, Object> maps = new HashMap<>();
maps.put("business_status", "");
maps.put("distance", "10");
maps.put("hotel_type_uuid", "");
maps.put("lat", SPUtils.get(ConstantsHomeType.LATITUDE, ""));
maps.put("lng", SPUtils.get(ConstantsHomeType.LONGITUDE, ""));
maps.put("page_index", "1");
maps.put("page_size", "20");
maps.put("queue_status", "");
maps.put("search", "");
//근처 상가 에 정보 요청
HomeServiceFactory.aroundList(maps).subscribe(new AbstractDialogSubscriber<BottomAroundEntity>(this) {
@Override
public void onNext(BottomAroundEntity bottomAroundEntity) {
if (bottomAroundEntity != null && bottomAroundEntity.getData() != null) {
dataBeans = bottomAroundEntity.getData();
for (int i = 0; i < dataBeans.size(); i++) {
BottomAroundEntity.DataBean dataBean = dataBeans.get(i);
LatLng latLng = new LatLng(dataBean.getLat(), dataBean.getLng());
MarkerOptions marker = new MarkerOptions()
.position(latLng)
.title(dataBean.getHotel_name())
.snippet(String.valueOf(i))
.icon(BitmapDescriptorFactory.fromResource(mipmap.ic_home_mall_location));
mMap.addMarker(marker);
}
}
}
});
}
/**
* 사용자 정의 Inforwinfow 창
*/
public void render(Marker marker, View view) {
int index = Integer.parseInt(marker.getSnippet());
if (dataBeans != null && index < dataBeans.size()) {
BottomAroundEntity.DataBean dataBean = dataBeans.get(index);
ImageView ivStore = view.findViewById(id.iv_store_name);
/* RequestOptions requestOptions = new RequestOptions();
requestOptions.disallowHardwareConfig();
RequestBuilder<Drawable> thumbnailRequest = Glide
.with(this)
.load(mipmap.pic_photo_holder);
Glide.with(this).applyDefaultRequestOptions(requestOptions)
.load(PicUtils.getUrl(dataBean.getImg_list()))
.error(thumbnailRequest).into(ivStore);*/
if (drawable != null) {
ivStore.setImageDrawable(drawable);
}
GradeStarView gradeStarView = view.findViewById(id.sv_shop_case);
gradeStarView.setCurrentChoose(dataBean.getStar_level());
TextView tvStoreName = view.findViewById(id.tv_store_name);
tvStoreName.setText(dataBean.getHotel_name());
TextView tvAddress = view.findViewById(R.id.tv_address);
tvAddress.setText(dataBean.getDistance() + "|" + dataBean.getAddress());
}
}
public boolean checkLocationPermission() {
if (ActivityCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_FINE_LOCATION)
!= PackageManager.PERMISSION_GRANTED) {
// Asking user if explanation is needed
if (ActivityCompat.shouldShowRequestPermissionRationale(this,
Manifest.permission.ACCESS_FINE_LOCATION)) {
// Show an explanation to the user *asynchronously* -- don't block
// this thread waiting for the user's response! After the user
// sees the explanation, try again to request the permission.
//Prompt the user once explanation has been shown
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
MY_PERMISSIONS_REQUEST_FINE_LOCATION);
} else {
// No explanation needed, we can request the permission.
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
MY_PERMISSIONS_REQUEST_FINE_LOCATION);
}
return false;
} else {
return true;
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// TODO: add setContentView(...) invocation
findViewById(id.iv_location).setOnClickListener(this::onViewClicked);
findViewById(id.iv_menu).setOnClickListener(this::onViewClicked);
}
public void onViewClicked(View view) {
if (view.getId() == R.id.iv_location) {
if (mMap == null) {
return;
}
Location location = mMap.getMyLocation();
if (location == null)
location = locationTrackObj.getLocation();
try {
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new
LatLng(location.getLatitude(),
location.getLongitude()), 16));
//requestAllList();
} catch (Exception e) {
e.printStackTrace();
}
} else if (view.getId() == R.id.iv_menu) {
startActivity(new Intent(GoogleMapsActivity.this, NearbyMerchantActivity.class));
}
}
private class LocationTracker implements LocationListener {
private final Context mContext;
// flag for GPS status
private boolean isGPSEnabled = false;
// flag for network status
private boolean isNetworkEnabled = false;
// flag for GPS status
private boolean canGetLocation = false;
private Location location; // location
private double latitude; // latitude
private double longitude; // longitude
// The minimum distance to change Updates in meters
private static final long MIN_DISTANCE_CHANGE_FOR_UPDATES = 1; // 1 meters
// The minimum time between updates in milliseconds
private static final long MIN_TIME_BW_UPDATES = 1000; // 1 sec
private final String TAG = "LocationTracker";
// Declaring a Location Manager
protected LocationManager locationManager;
public LocationTracker(Context context) {
this.mContext = context;
getLocation();
}
public Location getLocation() {
try {
locationManager = (LocationManager) mContext
.getSystemService(Context.LOCATION_SERVICE);
// getting GPS status
isGPSEnabled = locationManager
.isProviderEnabled(LocationManager.GPS_PROVIDER);
// getting network status
isNetworkEnabled = locationManager
.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
if (!isGPSEnabled && !isNetworkEnabled) {
// no network provider is enabled
this.canGetLocation = false;
} else {
this.canGetLocation = true;
// First get location from Network Provider
if (isNetworkEnabled) {
if (ActivityCompat.checkSelfPermission(GoogleMapsActivity.this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(GoogleMapsActivity.this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
}
locationManager.requestLocationUpdates(
LocationManager.NETWORK_PROVIDER,
MIN_TIME_BW_UPDATES,
MIN_DISTANCE_CHANGE_FOR_UPDATES, this);
Log.d("Network", "Network");
if (locationManager != null) {
location = locationManager
.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
if (location != null) {
latitude = location.getLatitude();
longitude = location.getLongitude();
}
}
}
// if GPS Enabled get lat/long using GPS Services
if (isGPSEnabled) {
if (location == null) {
locationManager.requestLocationUpdates(
LocationManager.GPS_PROVIDER,
MIN_TIME_BW_UPDATES,
MIN_DISTANCE_CHANGE_FOR_UPDATES, this);
Log.d("GPS Enabled", "GPS Enabled");
if (locationManager != null) {
location = locationManager
.getLastKnownLocation(LocationManager.GPS_PROVIDER);
if (location != null) {
latitude = location.getLatitude();
longitude = location.getLongitude();
}
}
}
}
}
} catch (Exception e) {
Log.e(TAG, Log.getStackTraceString(e));
}
return location;
}
/**
* Stop using GPS listener
* Calling this function will stop using GPS in your app
*/
public void stopUsingGPS() {
if (locationManager != null) {
locationManager.removeUpdates(LocationTracker.this);
}
}
/**
* Function to get latitude
*/
public double getLatitude() {
if (location != null) {
latitude = location.getLatitude();
}
// return latitude
return latitude;
}
/**
* Function to get longitude
*/
public double getLongitude() {
if (location != null) {
longitude = location.getLongitude();
}
// return longitude
return longitude;
}
/**
* Function to check GPS/wifi enabled
*
* @return boolean
*/
public boolean canGetLocation() {
return this.canGetLocation;
}
/**
* Function to show settings alert dialog
* On pressing Settings button will lauch Settings Options
*/
public void showSettingsAlert() {
AlertDialog.Builder alertDialog = new AlertDialog.Builder(mContext);
// Setting Dialog Title
alertDialog.setTitle("GPS Settings");
// Setting Dialog Message
alertDialog.setMessage("GPS is not enabled. Click on setting to enable and get location, please start app again after turning on GPS.");
alertDialog.setCancelable(false);
// On pressing Settings button
alertDialog.setPositiveButton("Settings", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
mContext.startActivity(intent);
}
});
// Showing Alert Message
alertDialog.show();
}
@Override
public void onLocationChanged(Location location) {
// mapRipple.withNumberOfRipples(3);
this.location = location;
// Toast.makeText(context, " " + location.getLatitude() + ", " + location.getLongitude(), Toast.LENGTH_SHORT).show();
}
@Override
public void onProviderDisabled(String provider) {
}
@Override
public void onProviderEnabled(String provider) {
location = getLocation();
}
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
}
}
private void setUpMap() {
if (ActivityCompat.checkSelfPermission(this,
android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, new String[]
{android.Manifest.permission.ACCESS_FINE_LOCATION}, LOCATION_PERMISSION_REQUEST_CODE);
return;
}
}
}
package cn.dankal.client.ui.home.map;
import android.Manifest;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.drawable.Drawable;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.support.v4.app.ActivityCompat;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.sdk.glide.Glide;
import com.sdk.glide.RequestBuilder;
import com.sdk.glide.request.RequestOptions;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;
import java.util.List;
import cn.dankal.basiclib.base.activity.BaseActivity;
import cn.dankal.basiclib.util.image.PicUtils;
import cn.dankal.entities.home.BottomAroundEntity;
import cn.dankal.entities.shop.MerchantHomeEntity;
import cn.dankal.client.R;
import cn.dankal.client.ui.home.NearbyMerchantActivity;
import cn.dankal.client.ui.home.details.MerchantDetailsActivity;
public class GoogleMapsMallActivity extends BaseActivity implements OnMapReadyCallback {
private GoogleMap mMap;
private Context context;
private final int MY_PERMISSIONS_REQUEST_FINE_LOCATION = 100;
private LocationTracker locationTrackObj;
private final int ANIMATION_TYPE_RIPPLE = 0;
private GoogleMap.InfoWindowAdapter windowAdapter;
private List<BottomAroundEntity.DataBean> dataBeans;//근처 모든 상가 정보
private SupportMapFragment mapFragment;
private RelativeLayout relativeLayout;
private static final int LOCATION_PERMISSION_REQUEST_CODE = 1;
private MerchantHomeEntity entity;
@Override
protected int getLayoutId() {
return R.layout.activity_google_maps;
}
@Override
protected void initComponents() {
addSingleTitleBar(getString(R.string.location));
setUpMap();
context = this;
relativeLayout = findViewById(R.id.rl_layout);
mapFragment = (SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
locationTrackObj = new LocationTracker(context);
if (!locationTrackObj.canGetLocation()) {
locationTrackObj.showSettingsAlert();
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
checkLocationPermission();
}
}
}
@Override
public void onRequestPermissionsResult(int requestCode,
String permissions[], int[] grantResults) {
switch (requestCode) {
case MY_PERMISSIONS_REQUEST_FINE_LOCATION: {
if (grantResults.length > 0
&& grantResults[0] == PackageManager.PERMISSION_GRANTED) {
initializeMap(mMap);
} else {
}
return;
}
}
}
@Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (ActivityCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_FINE_LOCATION)
== PackageManager.PERMISSION_GRANTED) {
initializeMap(mMap);
}
} else {
initializeMap(mMap);
}
}
View infoWindow = null;
/**
* 지도 초기 화
*
* @param mMap
*/
private void initializeMap(GoogleMap mMap) {
if (mMap != null) {
windowAdapter = new GoogleMap.InfoWindowAdapter() {
@Override
public View getInfoWindow(Marker marker) {
if (infoWindow == null) {
infoWindow = LayoutInflater.from(GoogleMapsMallActivity.this).inflate(
R.layout.custom_info_window, null);
}
render(marker, infoWindow);
return infoWindow;
}
@Override
public View getInfoContents(Marker marker) {
if (infoWindow == null) {
infoWindow = LayoutInflater.from(GoogleMapsMallActivity.this).inflate(
R.layout.custom_info_window, null);
}
render(marker, infoWindow);
return infoWindow;
}
};
mMap.setInfoWindowAdapter(windowAdapter);
mMap.setOnInfoWindowClickListener(marker -> {
startActivity(new Intent(GoogleMapsMallActivity.this, MerchantDetailsActivity.class)
.putExtra(MerchantDetailsActivity.HOTELUUID, entity.getUuid()));
});
mMap.getUiSettings().setMyLocationButtonEnabled(false);
mMap.getUiSettings().setScrollGesturesEnabled(true);
mMap.getUiSettings().setAllGesturesEnabled(true);
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
return;
}
mMap.setMyLocationEnabled(true);
Bundle bundle = getIntent().getExtras();
entity = (MerchantHomeEntity) bundle.getSerializable("param1");
try {
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new
LatLng(entity.getLat(),
entity.getLng()), 12));
LatLng latLng = new LatLng(entity.getLat(), entity.getLng());
MarkerOptions marker = new MarkerOptions()
.position(latLng)
.title(entity.getStore_name())
.icon(BitmapDescriptorFactory.fromResource(R.mipmap.ic_home_mall_location));
mMap.addMarker(marker);
} catch (Exception e) {
e.printStackTrace();
}
}
}
/**
* 사용자 정의 Inforwinfow 창
*/
public void render(Marker marker, View view) {
ImageView ivStore = view.findViewById(R.id.iv_store_name);
RequestOptions requestOptions = new RequestOptions();
requestOptions.disallowHardwareConfig();
RequestBuilder<Drawable> thumbnailRequest = Glide
.with(this)
.load(R.mipmap.pic_photo_holder);
Glide.with(this).applyDefaultRequestOptions(requestOptions)
.load(PicUtils.getUrl(entity.getImg_list()))
.error(thumbnailRequest).into(ivStore);
TextView tvStoreName = view.findViewById(R.id.tv_store_name);
tvStoreName.setText(entity.getStore_name());
}
public boolean checkLocationPermission() {
if (ActivityCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_FINE_LOCATION)
!= PackageManager.PERMISSION_GRANTED) {
// Asking user if explanation is needed
if (ActivityCompat.shouldShowRequestPermissionRationale(this,
Manifest.permission.ACCESS_FINE_LOCATION)) {
// Show an explanation to the user *asynchronously* -- don't block
// this thread waiting for the user's response! After the user
// sees the explanation, try again to request the permission.
//Prompt the user once explanation has been shown
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
MY_PERMISSIONS_REQUEST_FINE_LOCATION);
} else {
// No explanation needed, we can request the permission.
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
MY_PERMISSIONS_REQUEST_FINE_LOCATION);
}
return false;
} else {
return true;
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// TODO: add setContentView(...) invocation
findViewById(R.id.iv_location).setOnClickListener(this::onViewClicked);
findViewById(R.id.iv_menu).setOnClickListener(this::onViewClicked);
}
public void onViewClicked(View view) {
if (view.getId() == R.id.iv_location) {
if (mMap == null) {
return;
}
Location location = mMap.getMyLocation();
if (location == null)
location = locationTrackObj.getLocation();
try {
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new
LatLng(location.getLatitude(),
location.getLongitude()), 16));
//requestAllList();
} catch (Exception e) {
e.printStackTrace();
}
} else if (view.getId() == R.id.iv_menu) {
startActivity(new Intent(GoogleMapsMallActivity.this, NearbyMerchantActivity.class));
}
}
private class LocationTracker implements LocationListener {
private final Context mContext;
// flag for GPS status
private boolean isGPSEnabled = false;
// flag for network status
private boolean isNetworkEnabled = false;
// flag for GPS status
private boolean canGetLocation = false;
private Location location; // location
private double latitude; // latitude
private double longitude; // longitude
// The minimum distance to change Updates in meters
private static final long MIN_DISTANCE_CHANGE_FOR_UPDATES = 1; // 1 meters
// The minimum time between updates in milliseconds
private static final long MIN_TIME_BW_UPDATES = 1000; // 1 sec
private final String TAG = "LocationTracker";
// Declaring a Location Manager
protected LocationManager locationManager;
public LocationTracker(Context context) {
this.mContext = context;
getLocation();
}
public Location getLocation() {
try {
locationManager = (LocationManager) mContext
.getSystemService(Context.LOCATION_SERVICE);
// getting GPS status
isGPSEnabled = locationManager
.isProviderEnabled(LocationManager.GPS_PROVIDER);
// getting network status
isNetworkEnabled = locationManager
.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
if (!isGPSEnabled && !isNetworkEnabled) {
// no network provider is enabled
this.canGetLocation = false;
} else {
this.canGetLocation = true;
// First get location from Network Provider
if (isNetworkEnabled) {
if (ActivityCompat.checkSelfPermission(GoogleMapsMallActivity.this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(GoogleMapsMallActivity.this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
}
locationManager.requestLocationUpdates(
LocationManager.NETWORK_PROVIDER,
MIN_TIME_BW_UPDATES,
MIN_DISTANCE_CHANGE_FOR_UPDATES, this);
Log.d("Network", "Network");
if (locationManager != null) {
location = locationManager
.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
if (location != null) {
latitude = location.getLatitude();
longitude = location.getLongitude();
}
}
}
// if GPS Enabled get lat/long using GPS Services
if (isGPSEnabled) {
if (location == null) {
locationManager.requestLocationUpdates(
LocationManager.GPS_PROVIDER,
MIN_TIME_BW_UPDATES,
MIN_DISTANCE_CHANGE_FOR_UPDATES, this);
Log.d("GPS Enabled", "GPS Enabled");
if (locationManager != null) {
location = locationManager
.getLastKnownLocation(LocationManager.GPS_PROVIDER);
if (location != null) {
latitude = location.getLatitude();
longitude = location.getLongitude();
}
}
}
}
}
} catch (Exception e) {
Log.e(TAG, Log.getStackTraceString(e));
}
return location;
}
/**
* Stop using GPS listener
* Calling this function will stop using GPS in your app
*/
public void stopUsingGPS() {
if (locationManager != null) {
locationManager.removeUpdates(LocationTracker.this);
}
}
/**
* Function to get latitude
*/
public double getLatitude() {
if (location != null) {
latitude = location.getLatitude();
}
// return latitude
return latitude;
}
/**
* Function to get longitude
*/
public double getLongitude() {
if (location != null) {
longitude = location.getLongitude();
}
// return longitude
return longitude;
}
/**
* Function to check GPS/wifi enabled
*
* @return boolean
*/
public boolean canGetLocation() {
return this.canGetLocation;
}
/**
* Function to show settings alert dialog
* On pressing Settings button will lauch Settings Options
*/
public void showSettingsAlert() {
AlertDialog.Builder alertDialog = new AlertDialog.Builder(mContext);
// Setting Dialog Title
alertDialog.setTitle("GPS Settings");
// Setting Dialog Message
alertDialog.setMessage("GPS is not enabled. Click on setting to enable and get location, please start app again after turning on GPS.");
alertDialog.setCancelable(false);
// On pressing Settings button
alertDialog.setPositiveButton("Settings", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
mContext.startActivity(intent);
}
});
// Showing Alert Message
alertDialog.show();
}
@Override
public void onLocationChanged(Location location) {
// mapRipple.withNumberOfRipples(3);
this.location = location;
// Toast.makeText(context, " " + location.getLatitude() + ", " + location.getLongitude(), Toast.LENGTH_SHORT).show();
}
@Override
public void onProviderDisabled(String provider) {
}
@Override
public void onProviderEnabled(String provider) {
location = getLocation();
}
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
}
}
/**
* 신청 권한
*/
private void setUpMap() {
if (ActivityCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, new String[]
{Manifest.permission.ACCESS_FINE_LOCATION}, LOCATION_PERMISSION_REQUEST_CODE);
return;
}
}
}
package cn.dankal.client.ui.home.map;
import android.Manifest;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.drawable.Drawable;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.sdk.glide.Glide;
import com.sdk.glide.request.RequestOptions;
import com.sdk.glide.request.target.SimpleTarget;
import com.sdk.glide.request.transition.Transition;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;
import cn.dankal.basiclib.base.activity.BaseActivity;
import cn.dankal.basiclib.util.image.PicUtils;
import cn.dankal.basiclib.widget.GradeStarView;
import cn.dankal.entities.home.RestaurantDetailEntity;
import cn.dankal.client.R;
import cn.dankal.client.ui.home.NearbyMerchantActivity;
import cn.dankal.client.ui.home.details.MerchantDetailsActivity;
import cn.dankal.client.util.UIUtile;
public class GoogleMapsMerchantActivity extends BaseActivity implements OnMapReadyCallback {
private GoogleMap mMap;
private Context context;
private final int MY_PERMISSIONS_REQUEST_FINE_LOCATION = 100;
private LocationTracker locationTrackObj;
private final int ANIMATION_TYPE_RIPPLE = 0;
private GoogleMap.InfoWindowAdapter windowAdapter;
private SupportMapFragment mapFragment;
private RelativeLayout relativeLayout;
private static final int LOCATION_PERMISSION_REQUEST_CODE = 1;
private RestaurantDetailEntity entity;
private Drawable drawable;//현재 표시 할 InforWindow 네트워크 맵
private String distance = "0m";
@Override
protected int getLayoutId() {
return R.layout.activity_google_maps;
}
@Override
protected void initComponents() {
addSingleTitleBar(getString(R.string.location));
setUpMap();
context = this;
relativeLayout = findViewById(R.id.rl_layout);
mapFragment = (SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
locationTrackObj = new LocationTracker(context);
if (!locationTrackObj.canGetLocation()) {
locationTrackObj.showSettingsAlert();
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
checkLocationPermission();
}
}
}
@Override
public void onRequestPermissionsResult(int requestCode,
String permissions[], int[] grantResults) {
switch (requestCode) {
case MY_PERMISSIONS_REQUEST_FINE_LOCATION: {
if (grantResults.length > 0
&& grantResults[0] == PackageManager.PERMISSION_GRANTED) {
initializeMap(mMap);
} else {
}
return;
}
}
}
@Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (ActivityCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_FINE_LOCATION)
== PackageManager.PERMISSION_GRANTED) {
initializeMap(mMap);
}
} else {
initializeMap(mMap);
}
}
View infoWindow = null;
/**
* 지도 초기 화
*
* @param mMap
*/
private void initializeMap(GoogleMap mMap) {
if (mMap != null) {
windowAdapter = new GoogleMap.InfoWindowAdapter() {
@Override
public View getInfoWindow(Marker marker) {
if (infoWindow == null) {
infoWindow = LayoutInflater.from(GoogleMapsMerchantActivity.this).inflate(
R.layout.custom_info_window, null);
}
render(marker, infoWindow);
return infoWindow;
}
@Override
public View getInfoContents(Marker marker) {
if (infoWindow == null) {
infoWindow = LayoutInflater.from(GoogleMapsMerchantActivity.this).inflate(
R.layout.custom_info_window, null);
}
render(marker, infoWindow);
return infoWindow;
}
};
mMap.setInfoWindowAdapter(windowAdapter);
mMap.setOnInfoWindowClickListener(marker -> {
startActivity(new Intent(GoogleMapsMerchantActivity.this, MerchantDetailsActivity.class)
.putExtra(MerchantDetailsActivity.HOTELUUID, entity.getUuid()));
});
mMap.setOnMarkerClickListener(marker -> {
if (entity != null) {
RequestOptions requestOptions = new RequestOptions();
requestOptions.disallowHardwareConfig();
Glide.with(context)
.applyDefaultRequestOptions(requestOptions)
.load(PicUtils.getUrl(entity.getImg_list()))
.into(new SimpleTarget<Drawable>() {
@Override
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
drawable = resource;
marker.showInfoWindow();
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(marker.getPosition(), 16));
}
});
}
return true;
});
mMap.getUiSettings().setMyLocationButtonEnabled(false);
mMap.getUiSettings().setScrollGesturesEnabled(true);
mMap.getUiSettings().setAllGesturesEnabled(true);
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
return;
}
mMap.setMyLocationEnabled(true);
Bundle bundle = getIntent().getExtras();
entity = (RestaurantDetailEntity) bundle.getSerializable("param1");
try {
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new
LatLng(entity.getLat(),
entity.getLng()), 16));
Location location = mMap.getMyLocation();
if (location == null)
location = locationTrackObj.getLocation();
LatLng latLng = new LatLng(entity.getLat(), entity.getLng());
distance = UIUtile.getDistanceTow(entity.getLng(), entity.getLat(), location.getLongitude(), location.getLatitude());
MarkerOptions marker = new MarkerOptions()
.position(latLng)
.title(entity.getHotel_name())
.icon(BitmapDescriptorFactory.fromResource(R.mipmap.ic_home_mall_location));
mMap.addMarker(marker);
} catch (Exception e) {
e.printStackTrace();
}
}
}
/**
* 사용자 정의 Inforwinfow 창
*/
public void render(Marker marker, View view) {
ImageView ivStore = view.findViewById(R.id.iv_store_name);
GradeStarView gradeStarView = view.findViewById(R.id.sv_shop_case);
int level= (int) entity.getStar_level();
gradeStarView.setCurrentChoose(level);
/* RequestOptions requestOptions = new RequestOptions();
requestOptions.disallowHardwareConfig();
RequestBuilder<Drawable> thumbnailRequest = Glide
.with(this)
.load(R.mipmap.pic_photo_holder);
Glide.with(this).applyDefaultRequestOptions(requestOptions)
.load(PicUtils.getUrl(entity.getImg_list()))
.error(thumbnailRequest).into(ivStore);*/
if (drawable != null) {
ivStore.setImageDrawable(drawable);
}
TextView tvStoreName = view.findViewById(R.id.tv_store_name);
tvStoreName.setText(entity.getHotel_name());
TextView tvAddress = view.findViewById(R.id.tv_address);
tvAddress.setText(distance + "|" + entity.getAddress());
}
public boolean checkLocationPermission() {
if (ActivityCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_FINE_LOCATION)
!= PackageManager.PERMISSION_GRANTED) {
// Asking user if explanation is needed
if (ActivityCompat.shouldShowRequestPermissionRationale(this,
Manifest.permission.ACCESS_FINE_LOCATION)) {
// Show an explanation to the user *asynchronously* -- don't block
// this thread waiting for the user's response! After the user
// sees the explanation, try again to request the permission.
//Prompt the user once explanation has been shown
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
MY_PERMISSIONS_REQUEST_FINE_LOCATION);
} else {
// No explanation needed, we can request the permission.
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
MY_PERMISSIONS_REQUEST_FINE_LOCATION);
}
return false;
} else {
return true;
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// TODO: add setContentView(...) invocation
findViewById(R.id.iv_location).setOnClickListener(this::onViewClicked);
findViewById(R.id.iv_menu).setOnClickListener(this::onViewClicked);
}
public void onViewClicked(View view) {
if (view.getId() == R.id.iv_location) {
if (mMap == null) {
return;
}
Location location = mMap.getMyLocation();
if (location == null)
location = locationTrackObj.getLocation();
try {
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new
LatLng(location.getLatitude(),
location.getLongitude()), 16));
//requestAllList();
} catch (Exception e) {
e.printStackTrace();
}
} else if (view.getId() == R.id.iv_menu) {
startActivity(new Intent(GoogleMapsMerchantActivity.this, NearbyMerchantActivity.class));
}
}
private class LocationTracker implements LocationListener {
private final Context mContext;
// flag for GPS status
private boolean isGPSEnabled = false;
// flag for network status
private boolean isNetworkEnabled = false;
// flag for GPS status
private boolean canGetLocation = false;
private Location location; // location
private double latitude; // latitude
private double longitude; // longitude
// The minimum distance to change Updates in meters
private static final long MIN_DISTANCE_CHANGE_FOR_UPDATES = 1; // 1 meters
// The minimum time between updates in milliseconds
private static final long MIN_TIME_BW_UPDATES = 1000; // 1 sec
private final String TAG = "LocationTracker";
// Declaring a Location Manager
protected LocationManager locationManager;
public LocationTracker(Context context) {
this.mContext = context;
getLocation();
}
public Location getLocation() {
try {
locationManager = (LocationManager) mContext
.getSystemService(Context.LOCATION_SERVICE);
// getting GPS status
isGPSEnabled = locationManager
.isProviderEnabled(LocationManager.GPS_PROVIDER);
// getting network status
isNetworkEnabled = locationManager
.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
if (!isGPSEnabled && !isNetworkEnabled) {
// no network provider is enabled
this.canGetLocation = false;
} else {
this.canGetLocation = true;
// First get location from Network Provider
if (isNetworkEnabled) {
if (ActivityCompat.checkSelfPermission(GoogleMapsMerchantActivity.this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(GoogleMapsMerchantActivity.this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
}
locationManager.requestLocationUpdates(
LocationManager.NETWORK_PROVIDER,
MIN_TIME_BW_UPDATES,
MIN_DISTANCE_CHANGE_FOR_UPDATES, this);
Log.d("Network", "Network");
if (locationManager != null) {
location = locationManager
.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
if (location != null) {
latitude = location.getLatitude();
longitude = location.getLongitude();
}
}
}
// if GPS Enabled get lat/long using GPS Services
if (isGPSEnabled) {
if (location == null) {
locationManager.requestLocationUpdates(
LocationManager.GPS_PROVIDER,
MIN_TIME_BW_UPDATES,
MIN_DISTANCE_CHANGE_FOR_UPDATES, this);
Log.d("GPS Enabled", "GPS Enabled");
if (locationManager != null) {
location = locationManager
.getLastKnownLocation(LocationManager.GPS_PROVIDER);
if (location != null) {
latitude = location.getLatitude();
longitude = location.getLongitude();
}
}
}
}
}
} catch (Exception e) {
Log.e(TAG, Log.getStackTraceString(e));
}
return location;
}
/**
* Stop using GPS listener
* Calling this function will stop using GPS in your app
*/
public void stopUsingGPS() {
if (locationManager != null) {
locationManager.removeUpdates(LocationTracker.this);
}
}
/**
* Function to get latitude
*/
public double getLatitude() {
if (location != null) {
latitude = location.getLatitude();
}
// return latitude
return latitude;
}
/**
* Function to get longitude
*/
public double getLongitude() {
if (location != null) {
longitude = location.getLongitude();
}
// return longitude
return longitude;
}
/**
* Function to check GPS/wifi enabled
*
* @return boolean
*/
public boolean canGetLocation() {
return this.canGetLocation;
}
/**
* Function to show settings alert dialog
* On pressing Settings button will lauch Settings Options
*/
public void showSettingsAlert() {
AlertDialog.Builder alertDialog = new AlertDialog.Builder(mContext);
// Setting Dialog Title
alertDialog.setTitle("GPS Settings");
// Setting Dialog Message
alertDialog.setMessage("GPS is not enabled. Click on setting to enable and get location, please start app again after turning on GPS.");
alertDialog.setCancelable(false);
// On pressing Settings button
alertDialog.setPositiveButton("Settings", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
mContext.startActivity(intent);
}
});
// Showing Alert Message
alertDialog.show();
}
@Override
public void onLocationChanged(Location location) {
// mapRipple.withNumberOfRipples(3);
this.location = location;
// Toast.makeText(context, " " + location.getLatitude() + ", " + location.getLongitude(), Toast.LENGTH_SHORT).show();
}
@Override
public void onProviderDisabled(String provider) {
}
@Override
public void onProviderEnabled(String provider) {
location = getLocation();
}
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
}
}
/**
* 신청 권한
*/
private void setUpMap() {
if (ActivityCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, new String[]
{Manifest.permission.ACCESS_FINE_LOCATION}, LOCATION_PERMISSION_REQUEST_CODE);
return;
}
}
}
package cn.dankal.client.ui.home.map;
import android.Manifest;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import java.util.Random;
import cn.dankal.client.R;
public class MapsActivity extends AppCompatActivity implements OnMapReadyCallback {
private GoogleMap mMap;
private LatLng latLng = new LatLng(28.7938709, 77.1427639);
private Context context;
private final int MY_PERMISSIONS_REQUEST_FINE_LOCATION = 100;
private LocationTracker locationTrackObj;
/* private MapRipple mapRipple;
private MapRadar mapRadar;*/
private Button startstoprippleBtn;
private final int ANIMATION_TYPE_RIPPLE = 0;
private final int ANIMATION_TYPE_RADAR = 1;
private int whichAnimationWasRunning = ANIMATION_TYPE_RIPPLE;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_maps);
context = this;
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
locationTrackObj = new LocationTracker(context);
if (!locationTrackObj.canGetLocation()) {
locationTrackObj.showSettingsAlert();
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
checkLocationPermission();
}
}
startstoprippleBtn = (Button) findViewById(R.id.startstopripple);
}
@Override
public void onRequestPermissionsResult(int requestCode,
String permissions[], int[] grantResults) {
switch (requestCode) {
case MY_PERMISSIONS_REQUEST_FINE_LOCATION: {
// If request is cancelled, the result arrays are empty.
if (grantResults.length > 0
&& grantResults[0] == PackageManager.PERMISSION_GRANTED) {
initializeMap(mMap);
} else {
}
return;
}
}
}
@Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (ActivityCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_FINE_LOCATION)
== PackageManager.PERMISSION_GRANTED) {
initializeMap(mMap);
}
} else {
initializeMap(mMap);
}
}
private void initializeMap(GoogleMap mMap) {
if (mMap != null) {
mMap.getUiSettings().setScrollGesturesEnabled(true);
mMap.getUiSettings().setAllGesturesEnabled(true);
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
// TODO: Consider calling
// ActivityCompat#requestPermissions
// here to request the missing permissions, and then overriding
// public void onRequestPermissionsResult(int requestCode, String[] permissions,
// int[] grantResults)
// to handle the case where the user grants the permission. See the documentation
// for ActivityCompat#requestPermissions for more details.
return;
}
mMap.setMyLocationEnabled(true);
Location location = mMap.getMyLocation();
if (location == null)
location = locationTrackObj.getLocation();
try {
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new
LatLng(location.getLatitude(),
location.getLongitude()), 14));
} catch (Exception e) {
e.printStackTrace();
}
if (location != null)
latLng = new LatLng(location.getLatitude(), location.getLongitude());
else {
latLng = new LatLng(0.0, 0.0);
}
// mapRipple = new MapRipple(mMap, latLng, context);
// mapRipple.withNumberOfRipples(3);
// mapRipple.withFillColor(Color.parseColor("#FFA3D2E4"));
// mapRipple.withStrokeColor(Color.BLACK);
// mapRipple.withStrokewidth(0); // 10dp
// mapRipple.withDistance(2000); // 2000 metres radius
// mapRipple.withRippleDuration(12000); //12000ms
// mapRipple.withTransparency(0.5f);
/* mapRipple.startRippleMapAnimation();
mapRadar = new MapRadar(mMap, latLng, context);
//mapRadar.withClockWiseAnticlockwise(true);
mapRadar.withDistance(2000);
mapRadar.withClockwiseAnticlockwiseDuration(2);
//mapRadar.withOuterCircleFillColor(Color.parseColor("#12000000"));
mapRadar.withOuterCircleStrokeColor(Color.parseColor("#fccd29"));
//mapRadar.withRadarColors(Color.parseColor("#00000000"), Color.parseColor("#ff000000")); //starts from transparent to fuly black
mapRadar.withRadarColors(Color.parseColor("#00fccd29"), Color.parseColor("#fffccd29")); //starts from transparent to fuly black
//mapRadar.withOuterCircleStrokewidth(7);
//mapRadar.withRadarSpeed(5);
mapRadar.withOuterCircleTransparency(0.5f);
mapRadar.withRadarTransparency(0.5f);*/
}
}
public boolean checkLocationPermission() {
if (ActivityCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_FINE_LOCATION)
!= PackageManager.PERMISSION_GRANTED) {
// Asking user if explanation is needed
if (ActivityCompat.shouldShowRequestPermissionRationale(this,
Manifest.permission.ACCESS_FINE_LOCATION)) {
// Show an explanation to the user *asynchronously* -- don't block
// this thread waiting for the user's response! After the user
// sees the explanation, try again to request the permission.
//Prompt the user once explanation has been shown
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
MY_PERMISSIONS_REQUEST_FINE_LOCATION);
} else {
// No explanation needed, we can request the permission.
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
MY_PERMISSIONS_REQUEST_FINE_LOCATION);
}
return false;
} else {
return true;
}
}
public void startstopAnimation(View view) {
}
public void advancedRipple(View view) {
startstoprippleBtn.setText("Stop Animation");
whichAnimationWasRunning = ANIMATION_TYPE_RIPPLE;
}
public void radarAnimation(View view) {
startstoprippleBtn.setText("Stop Animation");
whichAnimationWasRunning = ANIMATION_TYPE_RADAR;
}
public void simpleRipple(View view) {
startstoprippleBtn.setText("Stop Animation");
whichAnimationWasRunning = ANIMATION_TYPE_RIPPLE;
}
@Override
protected void onDestroy() {
super.onDestroy();
}
private class LocationTracker implements LocationListener {
private final Context mContext;
// flag for GPS status
private boolean isGPSEnabled = false;
// flag for network status
private boolean isNetworkEnabled = false;
// flag for GPS status
private boolean canGetLocation = false;
private Location location; // location
private double latitude; // latitude
private double longitude; // longitude
// The minimum distance to change Updates in meters
private static final long MIN_DISTANCE_CHANGE_FOR_UPDATES = 1; // 1 meters
// The minimum time between updates in milliseconds
private static final long MIN_TIME_BW_UPDATES = 1000; // 1 sec
private final String TAG = "LocationTracker";
// Declaring a Location Manager
protected LocationManager locationManager;
public LocationTracker(Context context) {
this.mContext = context;
getLocation();
}
public Location getLocation() {
try {
locationManager = (LocationManager) mContext
.getSystemService(Context.LOCATION_SERVICE);
// getting GPS status
isGPSEnabled = locationManager
.isProviderEnabled(LocationManager.GPS_PROVIDER);
// getting network status
isNetworkEnabled = locationManager
.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
if (!isGPSEnabled && !isNetworkEnabled) {
// no network provider is enabled
this.canGetLocation = false;
} else {
this.canGetLocation = true;
// First get location from Network Provider
}
} catch (Exception e) {
Log.e(TAG, Log.getStackTraceString(e));
}
return location;
}
/**
* Stop using GPS listener
* Calling this function will stop using GPS in your app
*/
public void stopUsingGPS() {
if (locationManager != null) {
locationManager.removeUpdates(LocationTracker.this);
}
}
/**
* Function to get latitude
*/
public double getLatitude() {
if (location != null) {
latitude = location.getLatitude();
}
// return latitude
return latitude;
}
/**
* Function to get longitude
*/
public double getLongitude() {
if (location != null) {
longitude = location.getLongitude();
}
// return longitude
return longitude;
}
/**
* Function to check GPS/wifi enabled
*
* @return boolean
*/
public boolean canGetLocation() {
return this.canGetLocation;
}
/**
* Function to show settings alert dialog
* On pressing Settings button will lauch Settings Options
*/
public void showSettingsAlert() {
AlertDialog.Builder alertDialog = new AlertDialog.Builder(mContext);
// Setting Dialog Title
alertDialog.setTitle("GPS Settings");
// Setting Dialog Message
alertDialog.setMessage("GPS is not enabled. Click on setting to enable and get location, please start app again after turning on GPS.");
alertDialog.setCancelable(false);
// On pressing Settings button
alertDialog.setPositiveButton("Settings", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
mContext.startActivity(intent);
}
});
// Showing Alert Message
alertDialog.show();
}
Random rand = new Random();
@Override
public void onLocationChanged(Location location) {
// mapRipple.withNumberOfRipples(3);
this.location = location;
// Toast.makeText(context, " " + location.getLatitude() + ", " + location.getLongitude(), Toast.LENGTH_SHORT).show();
}
@Override
public void onProviderDisabled(String provider) {
}
@Override
public void onProviderEnabled(String provider) {
location = getLocation();
}
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
}
}
}
\ No newline at end of file
package cn.dankal.client.ui.personal.order.food
import android.app.Activity
import android.content.Intent
import android.net.Uri
import android.os.Build
import android.provider.MediaStore
import android.support.design.widget.BottomSheetDialog
import android.support.v4.content.ContextCompat
import android.support.v4.content.FileProvider
import android.support.v7.widget.AppCompatButton
import android.support.v7.widget.GridLayoutManager
import android.text.Editable
import android.text.TextUtils
import android.text.TextWatcher
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import cn.dankal.basiclib.api.RestaurantServiceFactory
......@@ -18,10 +20,13 @@ import cn.dankal.basiclib.base.activity.BaseActivity
import cn.dankal.basiclib.base.callback.DKCallBackBoolean
import cn.dankal.basiclib.cos.CosUploadUtil
import cn.dankal.basiclib.image.CaptureAndCropManager
import cn.dankal.basiclib.image.CaptureAndCropManager.*
import cn.dankal.basiclib.rx.AbstractDialogSubscriber
import cn.dankal.basiclib.util.FileUtils
import cn.dankal.basiclib.util.ToastUtils
import cn.dankal.basiclib.util.image.PicUtils
import cn.dankal.basiclib.widget.FullyGridLayoutManager
import cn.dankal.client.BuildConfig
import cn.dankal.client.R
import cn.dankal.client.adapter.shop.GridImageNewAdapter
import cn.dankal.entities.home.EvaluationCommitEntity
......@@ -31,6 +36,7 @@ import com.luck.picture.lib.entity.LocalMedia
import io.reactivex.rxjava3.disposables.Disposable
import kotlinx.android.synthetic.main.activity_food_evaluation.*
import okhttp3.ResponseBody
import java.io.File
/**
* 식당 평가
......@@ -152,8 +158,10 @@ class FoodEvaluationActivity : BaseActivity(), GridImageNewAdapter.onAddPicClick
mBottomDialog.dismiss()
}
bottomView.findViewById<AppCompatButton>(R.id.photodialog_btn_native).setOnClickListener {
CaptureAndCropManager.capturePhotoFromGallery(this,
CaptureAndCropManager.REQUEST_CODE_ALBUM)
/*CaptureAndCropManager.capturePhotoFromGallery(this,
CaptureAndCropManager.REQUEST_CODE_ALBUM)*/
val intent = Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI)
startActivityForResult(intent, REQUEST_CODE_ALBUM)
mBottomDialog.dismiss()
}
bottomView.findViewById<AppCompatButton>(R.id.photodialog_btn_cancel).setOnClickListener {
......@@ -192,24 +200,50 @@ class FoodEvaluationActivity : BaseActivity(), GridImageNewAdapter.onAddPicClick
})
}
var imageCropFile: File? = null
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (requestCode == REQUEST_CODE_CAPTURE) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
val uri = FileProvider.getUriForFile(this, "cn.dankal.client" + ".provider", CaptureAndCropManager.getLastCameraCaptureImageFile());
gotoCrop(uri)
} else {
gotoCrop(Uri.fromFile(CaptureAndCropManager.getLastCameraCaptureImageFile()));
}
if (resultCode == Activity.RESULT_OK) {
when (requestCode) {
CaptureAndCropManager.REQUEST_CODE_CAPTURE -> {
CaptureAndCropManager.cropPhotoAfterCapture(this,
CaptureAndCropManager.REQUEST_CODE_CROP)
}
CaptureAndCropManager.REQUEST_CODE_ALBUM -> if (data != null && data.data != null) {
} else if (requestCode == REQUEST_CODE_ALBUM) {
if (data != null && data.getData() != null) {
//打开系统裁剪
gotoCrop(data.getData());
}
} else if (resultCode == RESULT_OK && requestCode == REQUEST_CODE_CAPTURE_CROP) {
//显示页面上
if (imageCropFile != null && imageCropFile?.getAbsolutePath() != null) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
if (FileUtils.uri != null) {
// 通过存储的uri 查询File
imageCropFile = FileUtils.getCropFile(this, FileUtils.uri);
//GlideUtils.loadLocalImage(this, FileUtils.uri, -1, iv_avatar);
val file = imageCropFile
file?.apply {
var path = path
listImage.add(path)
val avatar = path.substring(path.lastIndexOf("/") + 1)
commitListImage.add(avatar)
tv_img_count.text = "(${listImage.size}/6)"
adapter?.let {
it.setList(listImage)
it.notifyDataSetChanged()
}
}
CaptureAndCropManager.cropPhotoFromUri(this, data.data,
CaptureAndCropManager.REQUEST_CODE_CROP)
}
CaptureAndCropManager.REQUEST_CODE_CROP -> {
if (data != null) {
val file = CaptureAndCropManager.getLastCropImageFile()
}
} else {
//GlideUtils.loadLocalImage(this, imageCropFile?.getAbsolutePath(), -1, iv_avatar);
val file = imageCropFile
file?.apply {
var path = file.path
listImage.add(path)
val avatar = path.substring(path.lastIndexOf("/") + 1)
......@@ -226,4 +260,29 @@ class FoodEvaluationActivity : BaseActivity(), GridImageNewAdapter.onAddPicClick
}
}
}
private fun gotoCrop(sourceUri: Uri?) {
imageCropFile = FileUtils.createImageFile(this, true)
if (imageCropFile != null) {
val intent = Intent("com.android.camera.action.CROP")
intent.flags = Intent.FLAG_GRANT_READ_URI_PERMISSION
/* intent.putExtra("crop", "true")
intent.putExtra("aspectX", 1) //X方向上的比例
intent.putExtra("aspectY", 1) //Y方向上的比例
intent.putExtra("outputX", 256) //裁剪区的宽
intent.putExtra("outputY", 256) //裁剪区的高
intent.putExtra("scale ", true) //是否保留比例
intent.putExtra("return-data", false)
intent.putExtra("outputFormat", Bitmap.CompressFormat.JPEG.toString())*/
CaptureAndCropManager.fillCropIntent(intent)
intent.setDataAndType(sourceUri, "image/*") //设置数据源
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
intent.putExtra(MediaStore.EXTRA_OUTPUT, FileUtils.uri)
} else {
val imgCropUri: Uri = Uri.fromFile(imageCropFile)
intent.putExtra(MediaStore.EXTRA_OUTPUT, imgCropUri)
}
startActivityForResult(intent, REQUEST_CODE_CAPTURE_CROP)
}
}
}
package cn.dankal.client.ui.personal.order.food
import android.content.Intent
import android.support.v4.content.ContextCompat
import android.support.v7.widget.LinearLayoutManager
import android.view.View
import cn.dankal.basiclib.api.UserServiceFactory
......@@ -173,19 +174,79 @@ class OrderDetailsActivity : BaseActivity(), View.OnClickListener, CallListDialo
mStoreUUID = hotel_store_uuid
var status = when (order_status) {
0 -> getString(R.string.to_be_paid)
1 -> getString(R.string.paymented)
2 -> getString(R.string.application_for_refund)
3 -> getString(R.string.to_be_received)
4 -> getString(R.string.completed)
5 -> getString(R.string.cancelled)
6 -> getString(R.string.only_refund)
7 -> getString(R.string.refund)
8 -> getString(R.string.successful_refund_only)
9 -> getString(R.string.successful_refund)
10 -> getString(R.string.refusal_of_refund)
11 -> getString(R.string.successful_partial_refund)
12 -> getString(R.string.successful_full_refund)
0 -> {
tv_details_restaurant_status.setTextColor(ContextCompat.getColor(this@OrderDetailsActivity, R.color.btn_bg))
getString(R.string.to_be_paid)
}
1 -> {
tv_details_restaurant_status.setTextColor(ContextCompat.getColor(this@OrderDetailsActivity, R.color.btn_bg))
getString(R.string.paymented)
}
2 -> {
tv_details_restaurant_status.setTextColor(ContextCompat.getColor(this@OrderDetailsActivity, R.color.btn_bg))
getString(R.string.application_for_refund)
}
3 -> {
tv_details_restaurant_status.setTextColor(ContextCompat.getColor(this@OrderDetailsActivity, R.color.btn_bg))
getString(R.string.to_be_received)
}
4 -> {
tv_details_restaurant_status.setTextColor(ContextCompat.getColor(this@OrderDetailsActivity, R.color.font_A2A2A2))
getString(R.string.completed)
}
5 -> {
tv_details_restaurant_status.setTextColor(ContextCompat.getColor(this@OrderDetailsActivity, R.color.font_A2A2A2))
getString(R.string.cancelled)
}
6 -> {
tv_details_restaurant_status.setTextColor(ContextCompat.getColor(this@OrderDetailsActivity, R.color.font_A2A2A2))
getString(R.string.only_refund)
}
7 -> {
tv_details_restaurant_status.setTextColor(ContextCompat.getColor(this@OrderDetailsActivity, R.color.font_A2A2A2))
getString(R.string.refund)
}
8 -> {
tv_details_restaurant_status.setTextColor(ContextCompat.getColor(this@OrderDetailsActivity, R.color.font_A2A2A2))
getString(R.string.successful_refund_only)
}
9 -> {
tv_details_restaurant_status.setTextColor(ContextCompat.getColor(this@OrderDetailsActivity, R.color.font_A2A2A2))
getString(R.string.successful_refund)
}
10 -> {
tv_details_restaurant_status.setTextColor(ContextCompat.getColor(this@OrderDetailsActivity, R.color.btn_bg))
getString(R.string.refusal_of_refund)
}
11 -> {
tv_details_restaurant_status.setTextColor(ContextCompat.getColor(this@OrderDetailsActivity, R.color.font_A2A2A2))
getString(R.string.successful_partial_refund)
}
12 -> {
tv_details_restaurant_status.setTextColor(ContextCompat.getColor(this@OrderDetailsActivity, R.color.font_A2A2A2))
getString(R.string.successful_full_refund)
}
else -> ""
}
......
......@@ -9,7 +9,7 @@ import cn.dankal.basiclib.util.WebViewUtil
import cn.dankal.basiclib.widget.dialog.CallDialog
import cn.dankal.entities.shop.MerchantHomeEntity
import cn.dankal.client.R
import cn.dankal.client.ui.home.map.GoogleMapsMallActivity
//import cn.dankal.client.ui.home.map.GoogleMapsMallActivity
import kotlinx.android.synthetic.main.fragment_details_info.*
private const val ARG_PARAM1 = "param1"
......@@ -43,11 +43,11 @@ class MerchantInfoFragment : BaseFragment(), View.OnClickListener, CallDialog.On
}
private fun toMaps() {
var intent = Intent(activity, GoogleMapsMallActivity::class.java)
/* var intent = Intent(activity, GoogleMapsMallActivity::class.java)
var bundle = Bundle()
bundle.putSerializable(ARG_PARAM1, param1)
intent.putExtras(bundle)
startActivity(intent)
startActivity(intent)*/
}
override fun getLayoutId(): Int {
......
......@@ -188,6 +188,7 @@ public class QueueResultActivity extends BaseActivity {
intent.putExtra(ConstantsRestaurantType.UUID, commitQueueEntity.getHotel_uuid());
}
startActivity(intent);
finish();
} else {//주문 할 게 요.
if (tablesNumber == 0) {//스 캔 을 가다
startActivityForResult(new Intent(QueueResultActivity.this, CaptureActivity.class), ConstantsHomeType.SCAN);
......
......@@ -16,7 +16,7 @@ import cn.dankal.client.R
import com.alibaba.android.arouter.facade.annotation.Autowired
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.google.android.gms.tasks.OnCompleteListener
//import com.google.android.gms.tasks.OnCompleteListener
import kotlinx.android.synthetic.main.activity_find_email_tow.*
import okhttp3.ResponseBody
......
......@@ -24,7 +24,7 @@ import cn.dankal.client.R
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import kotlinx.android.synthetic.main.activity_login_sdk.*
import com.google.android.gms.tasks.OnCompleteListener
//import com.google.android.gms.tasks.OnCompleteListener
import com.mhq.smartorder.wxapi.WXEntryActivity
import cn.dankal.basiclib.util.rx.RxPermissions
import com.tencent.mm.opensdk.modelmsg.SendAuth
......
......@@ -252,7 +252,7 @@ public class CaptureActivity extends BaseActivity implements SurfaceHolder.Callb
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(getString(R.string.scan_code));
builder.setMessage(getString(R.string.msg_camera_framework_bug));
builder.setPositiveButton(R.string.button_ok, new FinishListener(this));
builder.setPositiveButton(R.string.button_ok_tow, new FinishListener(this));
builder.setOnCancelListener(new FinishListener(this));
builder.show();
}
......
......@@ -2,7 +2,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#ffff6b5c" />
<solid android:color="@color/btn_bg" />
<corners android:radius="17dp" />
</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="#ffff6b5c" />
<solid android:color="@color/btn_bg" />
<corners android:radius="5dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/color_171717" android:state_checked="true" />
<item android:color="@color/white" android:state_checked="true" />
<item android:color="@color/font_313131" />
</selector>
\ 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="#FBBC39" />
<solid android:color="@color/color_89c7d4" />
<corners android:radius="3dp" />
</shape>
\ No newline at end of file
......@@ -2,6 +2,6 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#FEEAE6" />
<solid android:color="@color/color_89c7d4" />
</shape>
\ No newline at end of file
......@@ -9,7 +9,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_126"
android:src="@mipmap/ic_line_empty" />
android:src="@mipmap/pic_profiling_monochromatic" />
<TextView
android:id="@+id/tv_text_tip"
......
......@@ -12,7 +12,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/dp_80"
android:src="@mipmap/ic_home_pay_success"/>
android:src="@mipmap/ic_successful"/>
<TextView
android:layout_width="wrap_content"
......
......@@ -46,7 +46,7 @@
android:layout_gravity="center_horizontal"
android:layout_marginTop="400dp"
android:text="@string/wechat_two_dimensional_code"
android:textColor="#F7B938"
android:textColor="@color/color_89c7d4"
android:textSize="16sp" />
</FrameLayout>
......
......@@ -78,7 +78,7 @@
android:paddingRight="@dimen/dp_9"
android:paddingBottom="@dimen/dp_5"
android:text="@string/selection_of_specifications"
android:textColor="@color/color_171717"
android:textColor="@color/white"
android:textSize="@dimen/sp_12"
android:visibility="gone" />
......
......@@ -62,6 +62,7 @@
app:mImageHeight="@dimen/dp_15"
app:mImageWidth="@dimen/dp_15"
app:mMargin="@dimen/dp_5"
app:mIsClick="true"
app:mStarChoose="0" />
</LinearLayout>
</LinearLayout>
......
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/rl_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="cn.dankal.client.ui.home.map.GoogleMapsActivity">
<fragment
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="cn.dankal.client.ui.home.map.GoogleMapsActivity" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="@dimen/dp_45"
android:layout_marginRight="@dimen/dp_20"
android:orientation="vertical">
<ImageView
android:id="@+id/iv_location"
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_40"
android:background="@mipmap/ic_1" />
<ImageView
android:id="@+id/iv_menu"
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_40"
android:layout_marginTop="@dimen/dp_18"
android:background="@mipmap/ic_2" />
</LinearLayout>
</RelativeLayout>
......@@ -89,7 +89,7 @@
android:layout_height="@dimen/dp_30"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_17"
tl:tl_indicator_color="@color/color_ff6b5c"
tl:tl_indicator_color="@color/color_89c7d4"
tl:tl_indicator_height="@dimen/dp_2"
tl:tl_indicator_width_equal_title="true"
tl:tl_tab_padding="@dimen/dp_8"
......
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.arsy.googlemapsrippleeffect.MapsActivity" />
<LinearLayout
android:layout_width="40dp"
android:layout_height="match_parent"
android:layout_above="@+id/startstopripple"
android:layout_alignParentLeft="true"
android:layout_margin="6dp"
android:orientation="vertical">
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/colorPrimary"
android:onClick="simpleRipple"
android:text="S\ni\nm\np\nl\ne\n"
android:textColor="#ffffff" />
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="6dp"
android:layout_weight="1"
android:background="@color/colorPrimary"
android:onClick="advancedRipple"
android:text="M\nu\nl\nt\ni\np\nl\ne"
android:textColor="#ffffff" />
</LinearLayout>
<Button
android:layout_width="40dp"
android:layout_height="match_parent"
android:layout_above="@+id/startstopripple"
android:layout_alignParentRight="true"
android:layout_marginBottom="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="60dp"
android:background="@color/colorPrimary"
android:onClick="radarAnimation"
android:text="R\na\nd\na\nr\n"
android:textColor="#ffffff" />
<Button
android:id="@+id/startstopripple"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:layout_marginBottom="6dp"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:background="@color/colorPrimary"
android:onClick="startstopAnimation"
android:text="Stop Animation"
android:textColor="#ffffff" />
</RelativeLayout>
......@@ -60,7 +60,7 @@
android:paddingRight="@dimen/dp_10"
android:paddingBottom="@dimen/dp_5"
android:text="@string/change_table_number"
android:textColor="@color/color_171717"
android:textColor="@color/white"
android:textSize="@dimen/sp_12" />
</LinearLayout>
......@@ -237,7 +237,7 @@
style="@style/ButtonText"
android:layout_width="@dimen/dp_151"
android:layout_height="@dimen/dp_48"
android:textColor="@color/color_171717"
android:textColor="@color/white"
android:textSize="@dimen/sp_17"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/btn_cancel"
......
......@@ -94,7 +94,7 @@
android:layout_marginRight="@dimen/dp_20"
android:background="@drawable/bg_button_select_language"
android:text="@string/queue_number"
android:textColor="@color/color_171717"
android:textColor="@color/white"
android:textSize="16sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
......
......@@ -11,191 +11,192 @@
android:orientation="vertical">
<android.support.v7.widget.LinearLayoutCompat
android:id="@+id/ll_background"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_121"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_11"
android:layout_marginRight="@dimen/dp_10"
android:background="@mipmap/pic_home_queuing_bg_2"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_start_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_home_queuing" />
<TextView
android:id="@+id/tv_state"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_26"
android:text="@string/in_the_ine"
android:textColor="@color/white"
android:textSize="@dimen/sp_24" />
</android.support.v7.widget.LinearLayoutCompat>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:background="@mipmap/ic_line_background_01"
android:orientation="vertical">
<TextView
android:id="@+id/tv_you_queue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/dp_26"
android:text="@string/your_queue_number"
android:textColor="@color/font_gray_four"
android:textSize="@dimen/sp_15" />
<TextView
android:id="@+id/tv_queue_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
tools:text="B03"
android:textColor="#313131"
android:textSize="39sp" />
<TextView
android:id="@+id/tv_queue_spec"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
tools:text="中桌(2-4人)"
android:textColor="@color/font_gray_four" />
<TextView
<android.support.v7.widget.LinearLayoutCompat
android:id="@+id/ll_background"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="@dimen/dp_12"
android:layout_marginTop="@dimen/dp_19"
android:layout_marginRight="@dimen/dp_12"
android:textColor="#DCDCDC" />
android:layout_height="@dimen/dp_121"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_11"
android:layout_marginRight="@dimen/dp_10"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_start_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_home_queuing" />
<TextView
android:id="@+id/tv_state"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_26"
android:text="@string/in_the_ine"
android:textColor="@color/white"
android:textSize="@dimen/sp_24" />
</android.support.v7.widget.LinearLayoutCompat>
<LinearLayout
android:id="@+id/ll_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
android:background="@color/white"
android:orientation="vertical">
<android.support.constraint.ConstraintLayout
android:layout_width="0dp"
<TextView
android:id="@+id/tv_you_queue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1">
<TextView
android:id="@+id/tv_count"
android:layout_width="21dp"
android:layout_height="wrap_content"
android:text="0"
android:textColor="@color/font_orange"
android:textSize="@dimen/sp_34"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/tv_tag_one"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_tag_one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_7"
android:text="@string/table"
android:textColor="@color/font_gray_tow"
android:textSize="@dimen/sp_15"
app:layout_constraintBaseline_toBaselineOf="@id/tv_count"
app:layout_constraintLeft_toRightOf="@id/tv_count"
app:layout_constraintRight_toRightOf="parent" />
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/dp_26"
android:text="@string/your_queue_number"
android:textColor="@color/font_gray_four"
android:textSize="@dimen/sp_15" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/number_of_waiting_tables_ahead"
android:textColor="@color/font_gray_four"
android:textSize="@dimen/sp_15"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_count" />
<TextView
android:id="@+id/tv_queue_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textColor="#313131"
android:textSize="39sp"
tools:text="B03" />
</android.support.constraint.ConstraintLayout>
<TextView
android:id="@+id/tv_queue_spec"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textColor="@color/font_gray_four"
tools:text="中桌(2-4人)" />
<TextView
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginBottom="@dimen/dp_10"
android:background="#DCDCDC" />
<android.support.constraint.ConstraintLayout
android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="@dimen/dp_12"
android:layout_marginTop="@dimen/dp_19"
android:layout_marginRight="@dimen/dp_12"
android:textColor="#DCDCDC" />
<LinearLayout
android:id="@+id/ll_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
android:orientation="horizontal">
<TextView
android:id="@+id/tv_count_time"
android:layout_width="wrap_content"
<android.support.constraint.ConstraintLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
tools:text=">0"
android:textColor="@color/font_orange"
android:textSize="@dimen/sp_34"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/tv_tag"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
android:layout_weight="1">
<TextView
android:id="@+id/tv_count"
android:layout_width="21dp"
android:layout_height="wrap_content"
android:text="0"
android:textColor="@color/font_orange"
android:textSize="@dimen/sp_34"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/tv_tag_one"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_tag_one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_7"
android:text="@string/table"
android:textColor="@color/font_gray_tow"
android:textSize="@dimen/sp_15"
app:layout_constraintBaseline_toBaselineOf="@id/tv_count"
app:layout_constraintLeft_toRightOf="@id/tv_count"
app:layout_constraintRight_toRightOf="parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/number_of_waiting_tables_ahead"
android:textColor="@color/font_gray_four"
android:textSize="@dimen/sp_15"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_count" />
</android.support.constraint.ConstraintLayout>
<TextView
android:id="@+id/tv_tag"
android:layout_width="wrap_content"
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginBottom="@dimen/dp_10"
android:background="#DCDCDC" />
<android.support.constraint.ConstraintLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_7"
android:text="@string/minute"
android:textColor="@color/font_gray_tow"
android:textSize="@dimen/sp_15"
app:layout_constraintBaseline_toBaselineOf="@id/tv_count_time"
app:layout_constraintLeft_toRightOf="@id/tv_count_time"
app:layout_constraintRight_toRightOf="parent" />
android:layout_weight="1">
<TextView
android:id="@+id/tv_count_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/font_orange"
android:textSize="@dimen/sp_34"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/tv_tag"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text=">0" />
<TextView
android:id="@+id/tv_tag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_7"
android:text="@string/minute"
android:textColor="@color/font_gray_tow"
android:textSize="@dimen/sp_15"
app:layout_constraintBaseline_toBaselineOf="@id/tv_count_time"
app:layout_constraintLeft_toRightOf="@id/tv_count_time"
app:layout_constraintRight_toRightOf="parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/expected_waiting_time"
android:textColor="@color/font_gray_four"
android:textSize="@dimen/sp_15"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_count_time" />
</android.support.constraint.ConstraintLayout>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/expected_waiting_time"
android:textColor="@color/font_gray_four"
android:textSize="@dimen/sp_15"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_count_time" />
</android.support.constraint.ConstraintLayout>
<TextView
android:id="@+id/tv_show_tip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_46"
android:layout_marginTop="@dimen/dp_17"
android:layout_marginRight="@dimen/dp_46"
android:layout_marginBottom="@dimen/dp_41"
android:textColor="@color/font_gray_tow"
android:textSize="@dimen/sp_13"
tools:text="听到叫号请到迎宾台,过号3桌还没有下单成功则需要重新排队才可以下单。" />
</LinearLayout>
<TextView
android:id="@+id/tv_show_tip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_46"
android:layout_marginTop="@dimen/dp_17"
android:layout_marginRight="@dimen/dp_46"
android:layout_marginBottom="@dimen/dp_41"
tools:text="听到叫号请到迎宾台,过号3桌还没有下单成功则需要重新排队才可以下单。"
android:textColor="@color/font_gray_tow"
android:textSize="@dimen/sp_13" />
</LinearLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:background="@mipmap/pic_home_queuing_bg_1" />
</android.support.v7.widget.LinearLayoutCompat>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
......@@ -218,10 +219,10 @@
<Button
android:id="@+id/btn_order"
style="@style/ButtonText"
android:layout_width="@dimen/dp_151"
android:layout_height="@dimen/dp_48"
android:text="@string/i_would_like_to_order"
style="@style/ButtonText"
android:textColor="@color/white"
android:textSize="@dimen/sp_17"
app:layout_constraintBottom_toBottomOf="parent"
......
......@@ -34,7 +34,7 @@
android:paddingLeft="@dimen/dp_14"
android:paddingRight="@dimen/dp_15"
android:text="@string/search"
android:textColor="@color/font_orange"
android:textColor="@color/btn_bg"
android:textSize="@dimen/sp_14" />
</LinearLayout>
......
......@@ -9,7 +9,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="130dp"
android:src="@mipmap/ic_order_confirmation" />
android:src="@mipmap/ic_order_confirmation_food" />
<TextView
android:layout_width="wrap_content"
......
......@@ -9,7 +9,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_126"
android:src="@mipmap/pic_my_home_no_line_up" />
android:src="@mipmap/pic_profiling_monochromatic" />
<TextView
android:id="@+id/tv_text_tip"
......
......@@ -152,7 +152,7 @@
android:layout_width="0dp"
android:layout_height="@dimen/dp_50"
android:layout_weight="1"
android:background="@color/btn_bg"
android:background="@color/color_89c7d4"
android:gravity="center"
android:text="@string/complete"
android:textColor="@color/white"
......
......@@ -27,7 +27,7 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:textSize="@dimen/sp_18"
android:textColor="@color/color_171717"/>
android:textColor="@color/white"/>
<ImageView
android:id="@+id/iv_dialog_close"
......@@ -76,7 +76,7 @@
android:layout_height="@dimen/dp_38"
android:background="@color/btn_bg"
android:textSize="@dimen/sp_16"
android:textColor="@color/color_171717"
android:textColor="@color/white"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginRight="@dimen/dp_15"
android:layout_marginBottom="@dimen/dp_26"
......
......@@ -59,7 +59,7 @@
android:layout_marginRight="@dimen/dp_21"
android:background="@drawable/bg_dialog_btn_one_night"
android:text="@string/commit"
android:textColor="@color/color_171717" />
android:textColor="@color/white" />
</android.support.v7.widget.LinearLayoutCompat>
......
......@@ -144,7 +144,7 @@
android:layout_height="match_parent"
android:background="@color/btn_bg"
android:text="@string/add_menu"
android:textColor="@color/color_171717"
android:textColor="@color/white"
android:textSize="@dimen/sp_17"
android:visibility="gone" />
</FrameLayout>
......
......@@ -50,7 +50,7 @@
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_13"
android:text="已完成"
android:textColor="@color/font_A4A4A4"
android:textColor="@color/btn_bg"
android:textSize="@dimen/sp_14" />
</LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout 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="@dimen/dp_111"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:background="@mipmap/pic_my_line_up_bg_2">
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_queue_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_16"
android:text="汉拿山烤肉餐厅"
android:textColor="@color/color14"
android:textSize="@dimen/sp_16"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"/>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_111"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_10"
android:elevation="@dimen/dp_1"
android:layout_marginBottom="@dimen/dp_1"
android:layout_marginRight="@dimen/dp_10">
<TextView
android:id="@+id/tv_queue_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_11"
android:text="@string/queue_number_show"
android:textColor="@color/color33"
android:textSize="@dimen/sp_14"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_queue_title" />
<TextView
android:id="@+id/tv_queue_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_16"
android:text="汉拿山烤肉餐厅"
android:textColor="@color/color14"
android:textSize="@dimen/sp_16"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_queue_number_tow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="B03"
android:textColor="@color/btn_bg"
android:textSize="@dimen/sp_17"
app:layout_constraintBaseline_toBaselineOf="@id/tv_queue_number"
app:layout_constraintLeft_toRightOf="@id/tv_queue_number"
app:layout_constraintTop_toBottomOf="@id/tv_queue_title" />
<TextView
android:id="@+id/tv_queue_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_11"
android:text="@string/queue_number_show"
android:textColor="@color/color33"
android:textSize="@dimen/sp_14"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_queue_title" />
<TextView
android:id="@+id/tv_table_specs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="中桌(2-4人)"
android:textColor="@color/color33"
android:textSize="@dimen/sp_14"
android:layout_marginLeft="@dimen/dp_15"
app:layout_constraintBaseline_toBaselineOf="@id/tv_queue_number_tow"
app:layout_constraintLeft_toRightOf="@id/tv_queue_number_tow"
app:layout_constraintTop_toBottomOf="@id/tv_queue_title" />
<TextView
android:id="@+id/tv_queue_number_tow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="B03"
android:textColor="@color/btn_bg"
android:textSize="@dimen/sp_17"
app:layout_constraintBaseline_toBaselineOf="@id/tv_queue_number"
app:layout_constraintLeft_toRightOf="@id/tv_queue_number"
app:layout_constraintTop_toBottomOf="@id/tv_queue_title" />
<TextView
android:id="@+id/tv_queue_waiting"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:text="@string/number_of_waiting_tables_ahead_tow"
android:textColor="@color/color99"
android:textSize="@dimen/sp_14"
app:layout_constraintBaseline_toBaselineOf="@id/tv_queue_minute_time"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent" />
<TextView
android:id="@+id/tv_table_specs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_15"
android:text="中桌(2-4人)"
android:textColor="@color/color33"
android:textSize="@dimen/sp_14"
app:layout_constraintBaseline_toBaselineOf="@id/tv_queue_number_tow"
app:layout_constraintLeft_toRightOf="@id/tv_queue_number_tow"
app:layout_constraintTop_toBottomOf="@id/tv_queue_title" />
<TextView
android:id="@+id/tv_queue_waiting_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="5"
android:textColor="@color/btn_bg"
android:textSize="@dimen/sp_17"
app:layout_constraintBaseline_toBaselineOf="@id/tv_queue_waiting"
app:layout_constraintLeft_toRightOf="@id/tv_queue_waiting" />
<TextView
android:id="@+id/tv_queue_waiting"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:text="@string/number_of_waiting_tables_ahead_tow"
android:textColor="@color/color99"
android:textSize="@dimen/sp_14"
app:layout_constraintBaseline_toBaselineOf="@id/tv_queue_minute_time"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent" />
<TextView
android:id="@+id/tv_queue_waiting_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="5"
android:textColor="@color/btn_bg"
android:textSize="@dimen/sp_17"
app:layout_constraintBaseline_toBaselineOf="@id/tv_queue_waiting"
app:layout_constraintLeft_toRightOf="@id/tv_queue_waiting" />
<TextView
android:id="@+id/tv_queue_minute"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_20"
android:layout_marginBottom="@dimen/dp_15"
android:text="@string/minute"
android:textColor="@color/color99"
android:textSize="@dimen/sp_14"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<TextView
android:id="@+id/tv_queue_minute_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=">50"
android:textColor="@color/btn_bg"
app:layout_constraintBaseline_toBaselineOf="@id/tv_queue_minute"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toLeftOf="@id/tv_queue_minute" />
<TextView
android:id="@+id/tv_queue_minute"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_20"
android:layout_marginBottom="@dimen/dp_15"
android:text="@string/minute"
android:textColor="@color/color99"
android:textSize="@dimen/sp_14"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<TextView
android:id="@+id/tv_queue_minute_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=">50"
android:textColor="@color/btn_bg"
app:layout_constraintBaseline_toBaselineOf="@id/tv_queue_minute"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toLeftOf="@id/tv_queue_minute" />
<TextView
android:id="@+id/tv_queue_minute_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/expected_waiting_time_tow"
android:textColor="@color/color99"
android:textSize="@dimen/sp_14"
app:layout_constraintBaseline_toBaselineOf="@id/tv_queue_minute_count"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toLeftOf="@id/tv_queue_minute_count" />
</android.support.constraint.ConstraintLayout>
<TextView
android:id="@+id/tv_queue_minute_time"
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/expected_waiting_time_tow"
android:textColor="@color/color99"
android:textSize="@dimen/sp_14"
app:layout_constraintBaseline_toBaselineOf="@id/tv_queue_minute_count"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toLeftOf="@id/tv_queue_minute_count" />
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
android:layout_gravity="right"
android:layout_marginTop="@dimen/dp_6"
android:layout_marginRight="@dimen/dp_20"
android:src="@mipmap/ic_ding"/>
</FrameLayout>
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout 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_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:paddingBottom="@dimen/dp_16"
android:background="@mipmap/pic_my_line_up_bg_2">
<TextView
android:id="@+id/tv_queue_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_16"
android:text="汉拿山烤肉餐厅"
android:textColor="@color/color14"
android:textSize="@dimen/sp_16"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"/>
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:paddingBottom="@dimen/dp_16"
android:elevation="@dimen/dp_1"
android:layout_marginBottom="@dimen/dp_1">
<TextView
android:id="@+id/tv_queue_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_11"
android:text="@string/queue_number_show"
android:textColor="@color/color33"
android:textSize="@dimen/sp_14"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_queue_title" />
<TextView
android:id="@+id/tv_queue_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_16"
android:text="汉拿山烤肉餐厅"
android:textColor="@color/color14"
android:textSize="@dimen/sp_16"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"/>
<TextView
android:id="@+id/tv_queue_number_tow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="B03"
android:textColor="@color/btn_bg"
android:textSize="@dimen/sp_17"
app:layout_constraintBaseline_toBaselineOf="@id/tv_queue_number"
app:layout_constraintLeft_toRightOf="@id/tv_queue_number"
app:layout_constraintTop_toBottomOf="@id/tv_queue_title" />
<TextView
android:id="@+id/tv_queue_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_11"
android:text="@string/queue_number_show"
android:textColor="@color/color33"
android:textSize="@dimen/sp_14"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_queue_title" />
<TextView
android:id="@+id/tv_table_specs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="中桌(2-4人)"
android:textColor="@color/color33"
android:textSize="@dimen/sp_14"
android:layout_marginLeft="@dimen/dp_15"
app:layout_constraintBaseline_toBaselineOf="@id/tv_queue_number_tow"
app:layout_constraintLeft_toRightOf="@id/tv_queue_number_tow"
app:layout_constraintTop_toBottomOf="@id/tv_queue_title" />
<TextView
android:id="@+id/tv_queue_number_tow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="B03"
android:textColor="@color/btn_bg"
android:textSize="@dimen/sp_17"
app:layout_constraintBaseline_toBaselineOf="@id/tv_queue_number"
app:layout_constraintLeft_toRightOf="@id/tv_queue_number"
app:layout_constraintTop_toBottomOf="@id/tv_queue_title" />
<TextView
android:id="@+id/tv_table_specs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="中桌(2-4人)"
android:textColor="@color/color33"
android:textSize="@dimen/sp_14"
android:layout_marginLeft="@dimen/dp_15"
app:layout_constraintBaseline_toBaselineOf="@id/tv_queue_number_tow"
app:layout_constraintLeft_toRightOf="@id/tv_queue_number_tow"
app:layout_constraintTop_toBottomOf="@id/tv_queue_title" />
<cn.dankal.basiclib.widget.AdaptTextView
android:id="@+id/tv_queue_state"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="排队成功"
android:textColor="@color/btn_bg"
android:textSize="@dimen/sp_14"
android:maxLines="1"
android:layout_marginLeft="@dimen/dp_15"
app:layout_constraintBaseline_toBaselineOf="@id/tv_queue_number_tow"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toRightOf="@id/tv_table_specs"
app:layout_constrainedWidth="true"
android:layout_marginRight="@dimen/dp_12"
app:layout_constraintTop_toBottomOf="@id/tv_queue_title" />
<cn.dankal.basiclib.widget.AdaptTextView
android:id="@+id/tv_queue_state"
</android.support.constraint.ConstraintLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="排队成功"
android:textColor="@color/btn_bg"
android:textSize="@dimen/sp_14"
android:maxLines="1"
android:layout_marginLeft="@dimen/dp_15"
app:layout_constraintBaseline_toBaselineOf="@id/tv_queue_number_tow"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toRightOf="@id/tv_table_specs"
app:layout_constrainedWidth="true"
android:layout_marginRight="@dimen/dp_12"
app:layout_constraintTop_toBottomOf="@id/tv_queue_title" />
android:layout_gravity="right"
android:layout_marginTop="@dimen/dp_6"
android:layout_marginRight="@dimen/dp_20"
android:src="@mipmap/ic_ding"/>
</FrameLayout>
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
......@@ -68,7 +68,7 @@
android:paddingRight="@dimen/dp_9"
android:paddingBottom="@dimen/dp_5"
android:text="@string/selection_of_specifications"
android:textColor="@color/color00"
android:textColor="@color/white"
android:textSize="@dimen/sp_12" />
</LinearLayout>
......
......@@ -499,6 +499,7 @@
<string name="msg_camera_framework_bug">Camera is occupied or camera permissions are not available. Please check</string>
<string name="button_ok">exit</string>
<string name="button_ok_tow">exit</string>
<string name="scan_code">scan</string>
<string name="open_flash">turn ON flash</string>
<string name="close_flash">turn OFF flash</string>
......
......@@ -497,6 +497,7 @@
<string name="msg_camera_framework_bug">カメラが占有されているか、カメラの</string>
<string name="button_ok">中退</string>
<string name="button_ok_tow">中退</string>
<string name="scan_code">それを</string>
<string name="open_flash">フラッシュ</string>
<string name="close_flash">フラッシュ</string>
......
......@@ -103,7 +103,7 @@
<string name="audit_rejection">심사거절</string>
<string name="upload_pictures">이미지업로드</string>
<string name="personal_payment">개인구매</string>
<string name="people">개인</string>
<string name="people"></string>
<string name="consignee">수령인:</string>
<string name="about"></string>
<string name="minute"></string>
......@@ -140,7 +140,7 @@
<string name="please_scan_the_qr_code_on_the_table">테이블 QR코드를 스캔해주세요</string>
<string name="stamps_can_be_exchanged_for_goods_and_general_merchandise">스탬프 교환상품과 일반 결제상품은 동시에 결제가 불가능합니다</string>
<string name="in_the_ine">대기 중</string>
<string name="passed_number">고객님의 대기순서가 지났습니다</string>
<string name="passed_number">대기순서지남</string>
<string name="your_queue_has_been_numbered_please_requeue">다시 대기해주세요</string>
<string name="come_back">돌아가기</string>
<string name="requeue">줄서기</string>
......@@ -400,7 +400,7 @@
<string name="a_coupon_at_the_moment">사용가능한 쿠폰이 없습니다.</string>
<string name="you_are_not_queuing_for_the_time_being">대기 중인 팀이 없습니다.</string>
<string name="no_content">데이터가 없습니다</string>
<string name="whether_to_dial_the_customer_service_hotline">고객센터에 연락하시겠습니까?</string>
<string name="whether_to_dial_the_customer_service_hotline">매장에 연락하시겠습니까?</string>
<string name="dial">호출</string>
<string name="ordered_dishes">주문된 메뉴</string>
<string name="empty_menu">메뉴 비우기</string>
......@@ -513,6 +513,7 @@
<!--zxing-->
<string name="msg_camera_framework_bug">카메라가 꺼져있거나, 사용 권한이 없습니다. 카메라 설정을 확인해주세요.</string>
<string name="button_ok">로그아웃</string>
<string name="button_ok_tow">확인</string>
<string name="scan_code">스캔하기</string>
<string name="open_flash">플래시를 켜주세요.</string>
<string name="close_flash">플래시를 꺼주세요.</string>
......@@ -584,7 +585,7 @@
<string name="many_times_you_have_refused_authorization_has_been_detected_please_manually_open_the_camera_privileges_">인증 을 여러 번 거부 한 것 이 검출 되 었 습 니 다. 수 동 으로 카메라 권한 을 열 어 주 십시오.</string>
<string name="authorization_failed_and_the_camera_was_unavailable">인증 실패, 카메라 사용 불가</string>
<string name="sdk_photograph">사진 을 찍다.</string>
<string name="sdk_photograph">카메라</string>
<string name="sdk_album">앨범
</string>
......
......@@ -103,7 +103,7 @@
<string name="audit_rejection">심사거절</string>
<string name="upload_pictures">이미지업로드</string>
<string name="personal_payment">개인구매</string>
<string name="people">개인</string>
<string name="people"></string>
<string name="consignee">수령인:</string>
<string name="about"></string>
<string name="minute"></string>
......@@ -140,7 +140,7 @@
<string name="please_scan_the_qr_code_on_the_table">테이블 QR코드를 스캔해주세요</string>
<string name="stamps_can_be_exchanged_for_goods_and_general_merchandise">스탬프 교환상품과 일반 결제상품은 동시에 결제가 불가능합니다</string>
<string name="in_the_ine">대기 중</string>
<string name="passed_number">고객님의 대기순서가 지났습니다</string>
<string name="passed_number">대기순서지남</string>
<string name="your_queue_has_been_numbered_please_requeue">다시 대기해주세요</string>
<string name="come_back">돌아가기</string>
<string name="requeue">줄서기</string>
......@@ -400,7 +400,7 @@
<string name="a_coupon_at_the_moment">사용가능한 쿠폰이 없습니다.</string>
<string name="you_are_not_queuing_for_the_time_being">대기 중인 팀이 없습니다.</string>
<string name="no_content">데이터가 없습니다</string>
<string name="whether_to_dial_the_customer_service_hotline">고객센터에 연락하시겠습니까?</string>
<string name="whether_to_dial_the_customer_service_hotline">매장에 연락하시겠습니까?</string>
<string name="dial">호출</string>
<string name="ordered_dishes">주문된 메뉴</string>
<string name="empty_menu">메뉴 비우기</string>
......@@ -513,6 +513,7 @@
<!--zxing-->
<string name="msg_camera_framework_bug">카메라가 꺼져있거나, 사용 권한이 없습니다. 카메라 설정을 확인해주세요.</string>
<string name="button_ok">로그아웃</string>
<string name="button_ok_tow">로그아웃</string>
<string name="scan_code">스캔하기</string>
<string name="open_flash">플래시를 켜주세요.</string>
<string name="close_flash">플래시를 꺼주세요.</string>
......@@ -586,7 +587,7 @@
<string name="many_times_you_have_refused_authorization_has_been_detected_please_manually_open_the_camera_privileges_">인증 을 여러 번 거부 한 것 이 검출 되 었 습 니 다. 수 동 으로 카메라 권한 을 열 어 주 십시오.</string>
<string name="authorization_failed_and_the_camera_was_unavailable">인증 실패, 카메라 사용 불가</string>
<string name="sdk_photograph">사진 을 찍다.</string>
<string name="sdk_photograph">카메라</string>
<string name="sdk_album">앨범</string>
</resources>
......@@ -502,13 +502,14 @@
<string name="grading_order">评分顺序</string>
<!--zxing-->
<string name="msg_camera_framework_bug">The camera is occupied or has no camera permission, please check</string>
<string name="button_ok">Exit</string>
<string name="scan_code">Scan QR Code</string>
<string name="open_flash">Turn on the flash</string>
<string name="close_flash">Turn off the flash</string>
<string name="gallery">Gallery</string>
<string name="scan_failed_tip">Scan image failed, please retry.</string>
<string name="msg_camera_framework_bug">摄像头已被占用或没有摄像头权限,请检查</string>
<string name="button_ok">退出</string>
<string name="button_ok_tow">退出</string>
<string name="scan_code">扫一扫</string>
<string name="open_flash">打开闪光灯</string>
<string name="close_flash">关掉闪光灯</string>
<string name="gallery">相册</string>
<string name="scan_failed_tip">扫描图片失败请重试</string>
<string name="ucrop_label_original">Original</string>
<string name="ucrop_label_edit_photo">Edit Photo</string>
......
......@@ -9,9 +9,9 @@
<color name="colorE550">#50e5e5e5</color>
<color name="colorPrimary">#ffff6b5c</color>
<color name="colorPrimaryDark">#ffff6b5c</color>
<color name="colorAccent">#ffff6b5c</color>
<color name="colorPrimary">#89C7D4</color>
<color name="colorPrimaryDark">#89C7D4</color>
<color name="colorAccent">#89C7D4</color>
<color name="colorF5">#F5F5F5</color>
<color name="colorEF">#EFEFEF</color>
......@@ -48,7 +48,7 @@
<color name="font_FF3B30">#FF3B30</color>
<color name="font_f09473">#f09473</color>
<color name="btn_bg">#F7B938</color>
<color name="btn_bg">#89C7D4</color>
<color name="btn_bg_tow">#f0f2f5</color>
<color name="font_313131">#313131</color>
......@@ -86,29 +86,30 @@
<color name="color_ff6b5c">#FFFF6b5c</color>
<color name="color_3d3d3d">#FF3d3d3d</color>
<color name="color_171717">#FF171717</color>
<color name="color_ff7b836">#FFF7B938</color>
<color name="color_fffbbc39">#FFFBBC39</color>
<color name="color_ff7b836">#89C7D4</color>
<color name="color_fffbbc39">#89C7D4</color>
<color name="color_ff2f2f2f">#FF2F2F2F</color>
<color name="color_f36a29">#F36A29</color>
<color name="color_fbbc39">#FBBC39</color>
<color name="color_fbbc39">#89C7D4</color>
<color name="color_666666">#666666</color>
<color name="color_999999">#999999</color>
<color name="color_686868">#686868</color>
<color name="color_ebebeb">#EBEBEB</color>
<color name="color_29ebebeb">#29EBEBEB</color>
<color name="color_89c7d4">#89C7D4</color>
<!--zxing-->
<color name="contents_text">#000000</color>
<color name="encode_view">#ffffff</color>
<color name="possible_result_points">#ffbd21</color>
<color name="possible_result_points">#89C7D4</color>
<color name="result_minor_text">#c0c0c0</color>
<color name="result_points">#99cc00</color>
<color name="result_text">#ffffff</color>
<color name="result_view">#000000</color>
<color name="status_text">#ffffff</color>
<color name="viewfinder_mask">#50000000</color>
<color name="react">#F7B938</color>
<color name="scanLineColor">#F7B938</color>
<color name="react">#89C7D4</color>
<color name="scanLineColor">#89C7D4</color>
<color name="defaultColor">#ffffff</color>
<!--uCrop Activity-->
<color name="ucrop_color_toolbar">#FF6E40</color>
......
......@@ -499,6 +499,7 @@
<!--zxing-->
<string name="msg_camera_framework_bug">The camera is occupied or has no camera permission, please check</string>
<string name="button_ok">Exit</string>
<string name="button_ok_tow">Exit</string>
<string name="scan_code">Scan QR Code</string>
<string name="open_flash">Turn on the flash</string>
<string name="close_flash">Turn off the flash</string>
......
<resources>
<!--
TODO: Before you release your application, you need a Google Maps API key.
To do this, you can either add your release key credentials to your existing
key, or create a new key.
Note that this file specifies the API key for the release build target.
If you have previously set up a key for the debug target with the debug signing certificate,
you will also need to set up a key for your release certificate.
Follow the directions here:
https://developers.google.com/maps/documentation/android/signup
Once you have your key (it starts with "AIza"), replace the "google_maps_key"
string in this file.
-->
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">AIzaSyDwJv9yhHjoVEczxUngI33HgYtyi5ZtrXA</string>
</resources>
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