合并黑夜白天模式等需求
@@ -14,21 +14,24 @@ public class AppsListChangedLiveData extends MutableLiveData {
|
||||
|
||||
private Observer mObserver;
|
||||
|
||||
private AppsListChangedLiveData(){
|
||||
// private constructor
|
||||
}
|
||||
private static volatile AppsListChangedLiveData sInstance;
|
||||
|
||||
private static final class InstanceHolder{
|
||||
private static final AppsListChangedLiveData INSTANCE = new AppsListChangedLiveData();
|
||||
}
|
||||
private AppsListChangedLiveData(){}
|
||||
|
||||
public static AppsListChangedLiveData getInstance(){
|
||||
return InstanceHolder.INSTANCE;
|
||||
if( sInstance == null ){
|
||||
synchronized( AppsListChangedLiveData.class ) {
|
||||
if( sInstance == null ){
|
||||
sInstance = new AppsListChangedLiveData();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
private Object readResolve(){
|
||||
// 阻止反序列化,必须实现 Serializable 接口
|
||||
return InstanceHolder.INSTANCE;
|
||||
private Object readResolve() {
|
||||
// 阻止反序列化,必须实现 Serializable 接口
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -37,7 +40,9 @@ public class AppsListChangedLiveData extends MutableLiveData {
|
||||
mObserver = observer;
|
||||
}
|
||||
|
||||
public void release(){
|
||||
public synchronized void release(){
|
||||
removeObserver( mObserver );
|
||||
mObserver = null;
|
||||
sInstance = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,12 +174,7 @@ public class AppsPresenter extends Presenter< AppsView > {
|
||||
int page = 0;
|
||||
int counter = 0;
|
||||
for ( AppInfo appInfo : list ) {
|
||||
if ( counter < AppsConst.TOTAL_SIZE_EACH_PAGE ) {
|
||||
counter++;
|
||||
} else {
|
||||
page++;
|
||||
counter = 0;
|
||||
}
|
||||
page = counter++ / AppsConst.TOTAL_SIZE_EACH_PAGE;
|
||||
if ( !result.containsKey( page ) ) {
|
||||
result.put( page, new ArrayList<>() );
|
||||
}
|
||||
@@ -221,6 +216,12 @@ public class AppsPresenter extends Presenter< AppsView > {
|
||||
AppsListChangedLiveData.getInstance().release();
|
||||
mView = null;
|
||||
mLauncher.destroy();
|
||||
mAnalytics = null;
|
||||
mCardManager = null;
|
||||
if ( mLauncher != null ) {
|
||||
mLauncher.destroy();
|
||||
}
|
||||
mLauncher = null;
|
||||
}
|
||||
|
||||
public void exit() {
|
||||
|
||||
@@ -28,17 +28,8 @@ public class AnimWrapper implements Anim {
|
||||
public void initAnim( ImageView target ) {
|
||||
mTarget = target;
|
||||
if ( CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X ) {
|
||||
ThreadPoolService.execute( () -> {
|
||||
final AnimationDrawable drawable = new AnimationDrawable();
|
||||
for ( int i = 0; i < AnimRes.sRes.length; i++ ) {
|
||||
drawable.addFrame( target.getResources().getDrawable( AnimRes.sRes[i] ), 100 );
|
||||
}
|
||||
UiThreadHandler.post( () -> {
|
||||
target.setBackground( drawable );
|
||||
mDelegate = new OthersAnim( drawable );
|
||||
start();
|
||||
} );
|
||||
} );
|
||||
mDelegate = new OthersAnim( target );
|
||||
start();
|
||||
} else {
|
||||
mTarget.setImageResource( R.drawable.mogo_tts_icon_00000 );
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.mogo.module.apps.anim;
|
||||
|
||||
import android.graphics.drawable.AnimationDrawable;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.widget.ImageView;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -8,25 +11,44 @@ import android.graphics.drawable.AnimationDrawable;
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class OthersAnim implements Anim{
|
||||
public class OthersAnim implements Anim {
|
||||
|
||||
private AnimationDrawable mDrawable;
|
||||
private int mStartIndex = 0;
|
||||
|
||||
public OthersAnim( AnimationDrawable drawable ) {
|
||||
this.mDrawable = drawable;
|
||||
private final static int MSG_LOOP = 3003;
|
||||
public static final long INTERVAL = 100L;
|
||||
private boolean mStarted = false;
|
||||
|
||||
private final ImageView mImageView;
|
||||
|
||||
private Handler mHandler = new Handler( Looper.getMainLooper() ) {
|
||||
@Override
|
||||
public void handleMessage( Message msg ) {
|
||||
super.handleMessage( msg );
|
||||
switch ( msg.what ) {
|
||||
case MSG_LOOP:
|
||||
if ( mStarted ) {
|
||||
mImageView.setImageResource( AnimRes.sRes[mStartIndex++ % AnimRes.sRes.length] );
|
||||
mHandler.sendEmptyMessageDelayed( MSG_LOOP, INTERVAL );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public OthersAnim( ImageView imageView ) {
|
||||
this.mImageView = imageView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
if ( mDrawable != null ) {
|
||||
mDrawable.start();
|
||||
}
|
||||
mStarted = true;
|
||||
mHandler.sendEmptyMessage( MSG_LOOP );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
if ( mDrawable != null ) {
|
||||
mDrawable.stop();
|
||||
}
|
||||
mStarted = false;
|
||||
mHandler.removeMessages( MSG_LOOP );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,6 +103,7 @@ public class InternalFunctionLauncher extends BaseAppLauncher {
|
||||
public void destroy() {
|
||||
if ( getNext() != null ) {
|
||||
getNext().destroy();
|
||||
setNext( null );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public class AppsModel {
|
||||
private Map< Integer, List< AppInfo > > mPagedApps = new HashMap<>();
|
||||
|
||||
private AppsModel( Context context ) {
|
||||
mContext = context;
|
||||
mContext = context.getApplicationContext();
|
||||
}
|
||||
|
||||
public static AppsModel getInstance( Context context ) {
|
||||
|
||||
|
After Width: | Height: | Size: 500 B |
BIN
modules/mogo-module-apps/src/main/res/drawable-mdpi/module_apps_ic_navigator_applist.png
Normal file → Executable file
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 2.4 KiB |
BIN
modules/mogo-module-apps/src/main/res/drawable-mdpi/module_apps_ic_navigator_im.png
Normal file → Executable file
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.4 KiB |
BIN
modules/mogo-module-apps/src/main/res/drawable-mdpi/module_apps_ic_navigator_media.png
Normal file → Executable file
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 1.9 KiB |
BIN
modules/mogo-module-apps/src/main/res/drawable-mdpi/module_apps_ic_navigator_navi.png
Normal file → Executable file
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 2.2 KiB |
BIN
modules/mogo-module-apps/src/main/res/drawable-mdpi/module_apps_ic_navigator_navi_disable.png
Normal file → Executable file
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 2.2 KiB |
BIN
modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_ai_assist_bkg.png
Normal file → Executable file
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 880 B |
0
modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_apps.png
Executable file → Normal file
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_chat_icon.png
Executable file → Normal file
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_chat_unchecked.png
Executable file → Normal file
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_equlizer.png
Executable file → Normal file
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_fm.png
Executable file → Normal file
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_fota.png
Executable file → Normal file
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_icon_map.png
Executable file → Normal file
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_interest.png
Executable file → Normal file
|
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 9.0 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_interest_unchecked.png
Executable file → Normal file
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_lrts.png
Executable file → Normal file
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_media_center.png
Executable file → Normal file
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_media_center_checked.png
Executable file → Normal file
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_music.png
Executable file → Normal file
|
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 8.8 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_navigation.png
Executable file → Normal file
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 5.3 KiB |
BIN
modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_navigator_im.png
Executable file → Normal file
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 4.8 KiB |
BIN
modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_navigator_navi_disable.png
Normal file → Executable file
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 3.9 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_news.png
Executable file → Normal file
|
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_news_unchecked.png
Executable file → Normal file
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_online_car.png
Executable file → Normal file
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_online_car_unchecked.png
Executable file → Normal file
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_qiyi.png
Executable file → Normal file
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_qq_music.png
Executable file → Normal file
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_retract.png
Executable file → Normal file
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_stee_product.png
Executable file → Normal file
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_tanlu.png
Executable file → Normal file
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.1 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_tanlu_unchecked.png
Executable file → Normal file
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_welfare.png
Executable file → Normal file
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_ximalaya.png
Executable file → Normal file
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
@@ -4,7 +4,7 @@
|
||||
android:id="@+id/module_apps_id_apps_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#0C0C0C">
|
||||
android:background="@color/module_app_page_bkg_color">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/module_apps_id_apps_exit"
|
||||
|
||||
@@ -20,6 +20,6 @@
|
||||
android:layout_marginTop="@dimen/module_apps_app_name_marginTop"
|
||||
android:gravity="center"
|
||||
android:maxLines="2"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textColor="@color/module_apps_id_app_name_textColor"
|
||||
android:textSize="@dimen/module_apps_app_name_textSize" />
|
||||
</LinearLayout>
|
||||
@@ -21,8 +21,8 @@
|
||||
<dimen name="module_apps_all_icon_width">94px</dimen>
|
||||
<dimen name="module_apps_all_icon_height">94px</dimen>
|
||||
|
||||
<dimen name="module_apps_navigator_icon_width">140px</dimen>
|
||||
<dimen name="module_apps_navigator_icon_height">140px</dimen>
|
||||
<dimen name="module_apps_navigator_icon_width">160px</dimen>
|
||||
<dimen name="module_apps_navigator_icon_height">160px</dimen>
|
||||
<dimen name="module_apps_navigator_icon_divider">30px</dimen>
|
||||
<dimen name="module_apps_voice_icon_width">100px</dimen>
|
||||
<dimen name="module_apps_voice_icon_height">100px</dimen>
|
||||
|
||||
@@ -16,5 +16,7 @@
|
||||
|
||||
<color name="bg_common">#080625</color>
|
||||
<color name="txt_blue">#3E7FFC</color>
|
||||
<color name="module_app_page_bkg_color">#E6000000</color>
|
||||
<color name="module_apps_id_app_name_textColor">#FFFFFF</color>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
<dimen name="module_apps_navigator_icon_width">78px</dimen>
|
||||
<dimen name="module_apps_navigator_icon_height">78px</dimen>
|
||||
<dimen name="module_apps_navigator_icon_divider">17px</dimen>
|
||||
<dimen name="module_apps_voice_icon_width">60px</dimen>
|
||||
<dimen name="module_apps_voice_icon_height">60px</dimen>
|
||||
<dimen name="module_apps_voice_icon_width">55px</dimen>
|
||||
<dimen name="module_apps_voice_icon_height">55px</dimen>
|
||||
</resources>
|
||||
@@ -12,6 +12,7 @@ import com.mogo.map.navi.IMogoNaviListener
|
||||
import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant.Companion.PATH_AGREEMENT_MODULE_NAME
|
||||
import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.Companion.AUTHORIZE_TYPE_LAUNCHER_MAIN
|
||||
import com.mogo.module.authorize.authprovider.launcher.MogoMainAuthorize.Companion.mogoAuthShow
|
||||
import com.mogo.module.authorize.util.SharedPreferenceUtil.hasGuide
|
||||
import com.mogo.service.MogoServicePaths
|
||||
import com.mogo.service.auth.IMogoAuthManager
|
||||
import com.mogo.service.module.IMogoModuleLifecycle
|
||||
@@ -24,7 +25,7 @@ class MogoAuthorizeProvider : IMogoAuthManager {
|
||||
const val TAG = "MogoAuthorizeProvider"
|
||||
}
|
||||
|
||||
private var mContext:Context? = null
|
||||
private var mContext: Context? = null
|
||||
|
||||
override fun createFragment(context: Context?, data: Bundle?): Fragment? {
|
||||
return null
|
||||
@@ -62,10 +63,11 @@ class MogoAuthorizeProvider : IMogoAuthManager {
|
||||
return null
|
||||
}
|
||||
|
||||
override fun showAuth(context: Context?) {
|
||||
override fun showAuth(context: Context) {
|
||||
mContext = context
|
||||
if (mogoAuthShow.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_MAIN)) {
|
||||
mogoAuthShow.invokeAuthorizeForShow(mContext!!)
|
||||
mogoAuthShow.initContext(context)
|
||||
if (hasGuide() && mogoAuthShow.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_MAIN)) {
|
||||
mogoAuthShow.invokeAuthorizeForShow()
|
||||
} else {
|
||||
//首次进入Launcher同步一下授权状态,防止由于用户清除数据造成首次加载还会出现授权状态不同步问题
|
||||
mogoAuthShow.updateAuthorizeStatus(AUTHORIZE_TYPE_LAUNCHER_MAIN)
|
||||
@@ -78,9 +80,7 @@ class MogoAuthorizeProvider : IMogoAuthManager {
|
||||
}
|
||||
|
||||
override fun init(context: Context) {
|
||||
//todo 引导判断暂时去掉 后续引导流程更改完再放开
|
||||
// todo if (isDeviceOfD() && hasGuide() && mogoAuthShow.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_MAIN)) {
|
||||
// todo F系列暂时没有授权功能 1.1需求中添加 全量上
|
||||
|
||||
}
|
||||
|
||||
override fun getAppPackage(): String? {
|
||||
|
||||
@@ -39,8 +39,11 @@ class MogoMainAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMog
|
||||
MogoAuthorizeMainController.disAgreeAuthorize(tag, agrId, onSuccess, onError)
|
||||
}
|
||||
|
||||
fun invokeAuthorizeForShow(context: Context) {
|
||||
mContext = context
|
||||
fun initContext(mContext: Context) {
|
||||
this.mContext = mContext
|
||||
}
|
||||
|
||||
fun invokeAuthorizeForShow() {
|
||||
pushLayoutToMainWindow(AUTHORIZE_TYPE_LAUNCHER_MAIN)
|
||||
}
|
||||
|
||||
@@ -74,6 +77,10 @@ class MogoMainAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMog
|
||||
}
|
||||
|
||||
private fun pushLayoutToMainWindow(tag: String) {
|
||||
if (mContext == null) {
|
||||
Logger.d(TAG, "Because of mContext has no init, the application has in background now")
|
||||
return
|
||||
}
|
||||
if (authorizeDialog == null) {
|
||||
authorizeDialog = AuthorizeDialog(tag, mContext!!)
|
||||
authorizeDialog!!.setOnDismissListener {
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
package com.mogo.module.authorize.authprovider.module
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.module.authorize.authprovider.biz.MogoAuthorizeManagerImpl
|
||||
import com.mogo.module.authorize.authprovider.biz.MogoAuthorizeRegisterHandler
|
||||
import com.mogo.module.authorize.authprovider.launcher.MogoMainAuthorize.Companion.mogoAuthShow
|
||||
import com.mogo.module.authorize.util.SharedPreferenceUtil
|
||||
import com.mogo.module.authorize.util.isDeviceOfD
|
||||
import com.mogo.service.module.IMogoModuleProvider
|
||||
|
||||
class MogoModuleAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMogoAuthorizeModuleProvider {
|
||||
|
||||
@@ -14,13 +18,21 @@ class MogoModuleAuthorize private constructor() : MogoAuthorizeManagerImpl(), IM
|
||||
}
|
||||
|
||||
override fun invokeAuthorizeForShow() {
|
||||
mogoAuthShow.invokeAuthorizeForShow(AbsMogoApplication.getApp().applicationContext)
|
||||
mogoAuthShow.invokeAuthorizeForShow()
|
||||
}
|
||||
|
||||
override fun invokeAuthorization(tag: String) {
|
||||
if(isDeviceOfD() && !SharedPreferenceUtil.hasGuide()){
|
||||
val guideService = ARouter.getInstance().build("/guide/showFragment").navigation()
|
||||
if(guideService is IMogoModuleProvider){
|
||||
guideService.init(AbsMogoApplication.getApp().applicationContext)
|
||||
}
|
||||
val listener = MogoAuthorizeRegisterHandler.getAuthorizeListener(tag)
|
||||
listener?.authorizeFailed("需要先执行用户引导")
|
||||
return
|
||||
}
|
||||
mogoAuthShow.showAuthorizeView(tag, {
|
||||
//todo SP存储状态
|
||||
|
||||
}, { errorMsg ->
|
||||
val listener = MogoAuthorizeRegisterHandler.getAuthorizeListener(tag)
|
||||
listener?.authorizeFailed(errorMsg)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.module.authorize.layout
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.text.Html
|
||||
import android.view.View
|
||||
import android.widget.Button
|
||||
@@ -14,6 +15,7 @@ import com.mogo.module.authorize.voice.IVoiceAuthorizeIntentListener
|
||||
import com.mogo.module.authorize.voice.IVoiceCommandListener
|
||||
import com.mogo.module.authorize.voice.VoiceUtil
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog
|
||||
import com.mogo.module.common.utils.CarSeries
|
||||
import com.mogo.utils.TipToast
|
||||
import com.mogo.utils.logger.Logger
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@@ -62,7 +64,12 @@ class AuthorizeDialog : BaseFloatDialog, View.OnClickListener, IVoiceCommandList
|
||||
private fun setWrapContent() {
|
||||
val mWindow = window
|
||||
if(DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_BYD){
|
||||
if (mWindow != null) {
|
||||
if (mWindow != null && CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X) {
|
||||
val lp = mWindow.attributes
|
||||
lp.width = 1920
|
||||
lp.height = 1080
|
||||
mWindow.attributes = lp
|
||||
}else{
|
||||
val lp = mWindow.attributes
|
||||
lp.width = 1024
|
||||
lp.height = 600
|
||||
@@ -78,7 +85,7 @@ class AuthorizeDialog : BaseFloatDialog, View.OnClickListener, IVoiceCommandList
|
||||
}
|
||||
}
|
||||
|
||||
fun initViews() {
|
||||
private fun initViews() {
|
||||
Logger.d(TAG, "initView ")
|
||||
AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_AUTHORIZE_SHOW)
|
||||
init()
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.mogo.module.authorize.util
|
||||
|
||||
import com.mogo.module.common.utils.CarSeries.*
|
||||
|
||||
fun isDeviceOfD(): Boolean {
|
||||
return when (getSeries()) {
|
||||
CAR_SERIES_D80X, CAR_SERIES_D81X, CAR_SERIES_D82X, CAR_SERIES_D84X -> true
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.mogo.module.authorize.util
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.debug.DebugConfig.getSpGuide
|
||||
import com.mogo.utils.storage.SharedPrefsMgr
|
||||
|
||||
object SharedPreferenceUtil {
|
||||
|
||||
private const val HAS_AUTH = "HAS_AUTH"
|
||||
private const val HAS_GUIDE = "HAS_GUIDE"
|
||||
private const val AUTHORIZE_UPDATE_TIME = "AUTHORIZE_UPDATE_TIME"
|
||||
|
||||
fun needAuthorization(type: Int): Boolean {
|
||||
@@ -30,6 +30,6 @@ object SharedPreferenceUtil {
|
||||
}
|
||||
|
||||
fun hasGuide(): Boolean {
|
||||
return SharedPrefsMgr.getInstance(AbsMogoApplication.getApp()).getBoolean(HAS_GUIDE, false)
|
||||
return SharedPrefsMgr.getInstance(AbsMogoApplication.getApp()).getBoolean(getSpGuide(), false)
|
||||
}
|
||||
}
|
||||
@@ -3,13 +3,13 @@
|
||||
<item android:state_pressed="true">
|
||||
<shape>
|
||||
<corners android:radius="@dimen/dp_59" />
|
||||
<gradient android:endColor="#805CC1FF" android:startColor="#803E7FFC" />
|
||||
<gradient android:angle="0" android:endColor="#805CC1FF" android:startColor="#80256BFF" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape>
|
||||
<corners android:radius="@dimen/dp_59" />
|
||||
<gradient android:endColor="#5CC1FF" android:startColor="#3E7FFC" />
|
||||
<gradient android:angle="0" android:endColor="#5CC1FF" android:startColor="#256BFF" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -3,13 +3,13 @@
|
||||
<item android:state_pressed="true">
|
||||
<shape>
|
||||
<corners android:bottomLeftRadius="@dimen/dp_30" />
|
||||
<gradient android:endColor="#805CC1FF" android:startColor="#803E7FFC" />
|
||||
<gradient android:endColor="#805CC1FF" android:startColor="#80256BFF" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape>
|
||||
<corners android:bottomLeftRadius="@dimen/dp_30" />
|
||||
<gradient android:endColor="#5CC1FF" android:startColor="#3E7FFC" />
|
||||
<gradient android:endColor="#5CC1FF" android:startColor="#256BFF" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -2,6 +2,7 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="@dimen/dp_30" />
|
||||
<gradient
|
||||
android:angle="135"
|
||||
android:endColor="#3F4057"
|
||||
android:startColor="#50526E " />
|
||||
android:startColor="#2A2B38 " />
|
||||
</shape>
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:topLeftRadius="@dimen/dp_30" android:topRightRadius="@dimen/dp_30" />
|
||||
<gradient
|
||||
android:endColor="#2A2B38"
|
||||
android:startColor="#3F4057" />
|
||||
</shape>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<shape>
|
||||
<corners android:radius="@dimen/dp_45" />
|
||||
<gradient android:angle="0" android:endColor="#805CC1FF" android:startColor="#80256BFF" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape>
|
||||
<corners android:radius="@dimen/dp_45" />
|
||||
<gradient android:angle="0" android:endColor="#5CC1FF" android:startColor="#256BFF" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -2,14 +2,14 @@
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<shape>
|
||||
<corners android:radius="@dimen/dp_53" />
|
||||
<gradient android:endColor="#805CC1FF" android:startColor="#803E7FFC" />
|
||||
<corners android:bottomLeftRadius="@dimen/dp_30" />
|
||||
<gradient android:endColor="#805CC1FF" android:startColor="#80256BFF" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape>
|
||||
<corners android:radius="@dimen/dp_53" />
|
||||
<gradient android:endColor="#5CC1FF" android:startColor="#3E7FFC" />
|
||||
<corners android:bottomLeftRadius="@dimen/dp_30" />
|
||||
<gradient android:endColor="#5CC1FF" android:startColor="#256BFF" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="@dimen/dp_30" />
|
||||
<gradient
|
||||
android:angle="135"
|
||||
android:endColor="#3F4057"
|
||||
android:startColor="#2A2B38 " />
|
||||
</shape>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<shape>
|
||||
<corners android:bottomRightRadius="@dimen/dp_30" />
|
||||
<gradient android:endColor="#803F4057" android:startColor="#8050526E" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape>
|
||||
<corners android:bottomRightRadius="@dimen/dp_30" />
|
||||
<gradient android:endColor="#3F4057" android:startColor="#50526E " />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners
|
||||
android:topLeftRadius="@dimen/dp_30"
|
||||
android:topRightRadius="@dimen/dp_30" />
|
||||
<gradient
|
||||
android:angle="135"
|
||||
android:endColor="#19757DB9"
|
||||
android:startColor="#19525681" />
|
||||
</shape>
|
||||
@@ -2,14 +2,14 @@
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<shape>
|
||||
<corners android:radius="@dimen/dp_59" />
|
||||
<gradient android:endColor="#805CC1FF" android:startColor="#803E7FFC" />
|
||||
<corners android:radius="@dimen/dp_45" />
|
||||
<gradient android:angle="0" android:endColor="#805CC1FF" android:startColor="#80256BFF" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape>
|
||||
<corners android:radius="@dimen/dp_59" />
|
||||
<gradient android:endColor="#5CC1FF" android:startColor="#3E7FFC" />
|
||||
<corners android:radius="@dimen/dp_45" />
|
||||
<gradient android:angle="0" android:endColor="#5CC1FF" android:startColor="#256BFF" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -3,13 +3,13 @@
|
||||
<item android:state_pressed="true">
|
||||
<shape>
|
||||
<corners android:bottomLeftRadius="@dimen/dp_22" />
|
||||
<gradient android:endColor="#805CC1FF" android:startColor="#803E7FFC" />
|
||||
<gradient android:endColor="#805CC1FF" android:startColor="#80256BFF" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape>
|
||||
<corners android:bottomLeftRadius="@dimen/dp_22" />
|
||||
<gradient android:endColor="#5CC1FF" android:startColor="#3E7FFC" />
|
||||
<gradient android:endColor="#5CC1FF" android:startColor="#256BFF" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -2,6 +2,7 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="@dimen/dp_22" />
|
||||
<gradient
|
||||
android:angle="135"
|
||||
android:endColor="#3F4057"
|
||||
android:startColor="#50526E " />
|
||||
android:startColor="#2A2B38" />
|
||||
</shape>
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:topLeftRadius="@dimen/dp_22" android:topRightRadius="@dimen/dp_22" />
|
||||
<gradient
|
||||
android:endColor="#2A2B38"
|
||||
android:startColor="#3F4057" />
|
||||
</shape>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners
|
||||
android:topLeftRadius="@dimen/dp_22"
|
||||
android:topRightRadius="@dimen/dp_22" />
|
||||
<gradient
|
||||
android:angle="135"
|
||||
android:endColor="#19757DB9"
|
||||
android:startColor="#19525681" />
|
||||
</shape>
|
||||
@@ -207,4 +207,4 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -0,0 +1,236 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/clAuthorizeTopParent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/module_authorize_color">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/clLoadingAuthorizeContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/dp_275"
|
||||
android:layout_marginTop="@dimen/dp_125"
|
||||
android:layout_marginRight="@dimen/dp_275"
|
||||
android:layout_marginBottom="@dimen/dp_125"
|
||||
android:background="@drawable/module_authorize_selector_dark_corner"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/clAuthorizeLoading"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivAuthorizeLoading"
|
||||
android:layout_width="@dimen/dp_147"
|
||||
android:layout_height="@dimen/dp_147"
|
||||
android:src="@mipmap/module_authorize_loading"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAuthorizeLoading"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_44"
|
||||
android:text="@string/module_authorize_agreement_loading"
|
||||
android:textColor="@color/module_authorize_loading_text"
|
||||
android:textSize="@dimen/dp_31"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivAuthorizeLoading" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/clLoadingErrorContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/dp_275"
|
||||
android:layout_marginTop="@dimen/dp_125"
|
||||
android:layout_marginRight="@dimen/dp_275"
|
||||
android:layout_marginBottom="@dimen/dp_125"
|
||||
android:background="@drawable/module_authorize_selector_dark_corner"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAuthorizeLoadingError"
|
||||
android:layout_width="@dimen/dp_282"
|
||||
android:layout_height="@dimen/dp_90"
|
||||
android:layout_marginTop="@dimen/dp_71"
|
||||
android:background="@drawable/module_authorize_selector_blue_corner"
|
||||
android:gravity="center"
|
||||
android:text="@string/module_authorize_agreement_retry"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_34"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvAuthorizeLoadingError" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivAuthorizeLoadingError"
|
||||
android:layout_width="@dimen/dp_94"
|
||||
android:layout_height="@dimen/dp_94"
|
||||
android:layout_marginTop="@dimen/dp_254"
|
||||
android:src="@mipmap/module_authorize_loading_error"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAuthorizeLoadingError"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:text="@string/module_authorize_agreement_error"
|
||||
android:textColor="@color/module_authorize_text"
|
||||
android:textSize="@dimen/dp_32"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivAuthorizeLoadingError" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/clAuthorizeContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/dp_275"
|
||||
android:layout_marginTop="@dimen/dp_125"
|
||||
android:layout_marginRight="@dimen/dp_275"
|
||||
android:layout_marginBottom="@dimen/dp_125"
|
||||
android:background="@drawable/module_authorize_selector_dark_corner"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAuthorizeAgree"
|
||||
android:layout_width="0px"
|
||||
android:layout_height="@dimen/dp_156"
|
||||
android:background="@drawable/module_authorize_selector_blue_left_corner"
|
||||
android:gravity="center"
|
||||
android:text="@string/module_authorize_agreement_agree"
|
||||
android:textColor="@color/module_authorize_affirm_text"
|
||||
android:textSize="@dimen/dp_55"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintHorizontal_weight="1"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@+id/btnAuthorizeDisAgree" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAuthorizeDisAgree"
|
||||
android:layout_width="0px"
|
||||
android:layout_height="@dimen/dp_156"
|
||||
android:background="@drawable/module_authorize_selector_dark_right_corner"
|
||||
android:gravity="center"
|
||||
android:text="@string/module_authorize_agreement_disagree"
|
||||
android:textColor="@color/module_authorize_text"
|
||||
android:textSize="@dimen/dp_55"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintHorizontal_weight="1"
|
||||
app:layout_constraintLeft_toRightOf="@+id/btnAuthorizeAgree"
|
||||
app:layout_constraintRight_toRightOf="parent" />
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="0px"
|
||||
android:layout_height="0px"
|
||||
android:scrollbarSize="@dimen/dp_207"
|
||||
android:scrollbarThumbVertical="@drawable/module_authorize_scrollbar"
|
||||
android:scrollbarTrackHorizontal="@drawable/module_authorize_scrollbar"
|
||||
app:layout_constraintBottom_toTopOf="@+id/btnAuthorizeDisAgree"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/clAuthorizeTitle">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_38"
|
||||
android:layout_marginLeft="@dimen/dp_55"
|
||||
android:layout_marginRight="@dimen/dp_55"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAuthorizeContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:lineSpacingExtra="@dimen/dp_15"
|
||||
android:textColor="@color/module_authorize_text"
|
||||
android:textSize="@dimen/dp_44" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAuthorizeButtonContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:textColor="@color/module_authorize_text"
|
||||
android:textSize="@dimen/dp_44" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAuthorizeLastContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
android:textColor="@color/module_authorize_text"
|
||||
android:textSize="@dimen/dp_44" />
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/clAuthorizeTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_130"
|
||||
android:background="@drawable/module_authorize_shape_top_corner"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_32"
|
||||
android:layout_height="@dimen/dp_32"
|
||||
android:layout_marginLeft="@dimen/dp_438"
|
||||
android:layout_marginTop="@dimen/dp_49"
|
||||
android:src="@mipmap/module_authorize_title_left_symbol"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_32"
|
||||
android:layout_height="@dimen/dp_32"
|
||||
android:layout_marginTop="@dimen/dp_49"
|
||||
android:layout_marginRight="@dimen/dp_438"
|
||||
android:src="@mipmap/module_authorize_title_right_symbol"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAuthorizeTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_34"
|
||||
android:textColor="@color/module_authorize_text"
|
||||
android:textSize="@dimen/dp_44"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -4,16 +4,16 @@
|
||||
android:id="@+id/clAuthorizeTopParent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#CC000000">
|
||||
android:background="@color/module_authorize_color">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/clLoadingAuthorizeContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/dp_330"
|
||||
android:layout_marginTop="@dimen/dp_90"
|
||||
android:layout_marginRight="@dimen/dp_330"
|
||||
android:layout_marginBottom="@dimen/dp_90"
|
||||
android:layout_marginLeft="@dimen/dp_275"
|
||||
android:layout_marginTop="@dimen/dp_125"
|
||||
android:layout_marginRight="@dimen/dp_275"
|
||||
android:layout_marginBottom="@dimen/dp_125"
|
||||
android:background="@drawable/module_authorize_selector_dark_corner"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -43,8 +43,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_44"
|
||||
android:text="@string/module_authorize_agreement_loading"
|
||||
android:textColor="#99FFFFFF"
|
||||
android:textSize="@dimen/dp_44"
|
||||
android:textColor="@color/module_authorize_loading_text"
|
||||
android:textSize="@dimen/dp_31"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivAuthorizeLoading" />
|
||||
@@ -57,10 +57,10 @@
|
||||
android:id="@+id/clLoadingErrorContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/dp_330"
|
||||
android:layout_marginTop="@dimen/dp_90"
|
||||
android:layout_marginRight="@dimen/dp_330"
|
||||
android:layout_marginBottom="@dimen/dp_90"
|
||||
android:layout_marginLeft="@dimen/dp_275"
|
||||
android:layout_marginTop="@dimen/dp_125"
|
||||
android:layout_marginRight="@dimen/dp_275"
|
||||
android:layout_marginBottom="@dimen/dp_125"
|
||||
android:background="@drawable/module_authorize_selector_dark_corner"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -69,22 +69,22 @@
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAuthorizeLoadingError"
|
||||
android:layout_width="@dimen/dp_461"
|
||||
android:layout_height="@dimen/dp_97"
|
||||
android:layout_marginTop="@dimen/dp_33"
|
||||
android:layout_width="@dimen/dp_282"
|
||||
android:layout_height="@dimen/dp_90"
|
||||
android:layout_marginTop="@dimen/dp_71"
|
||||
android:background="@drawable/module_authorize_selector_blue_corner"
|
||||
android:gravity="center"
|
||||
android:text="@string/module_authorize_agreement_retry"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_44"
|
||||
android:textSize="@dimen/dp_34"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvAuthorizeLoadingError" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivAuthorizeLoadingError"
|
||||
android:layout_width="@dimen/dp_147"
|
||||
android:layout_height="@dimen/dp_147"
|
||||
android:layout_width="@dimen/dp_94"
|
||||
android:layout_height="@dimen/dp_94"
|
||||
android:layout_marginTop="@dimen/dp_254"
|
||||
android:src="@mipmap/module_authorize_loading_error"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -95,10 +95,10 @@
|
||||
android:id="@+id/tvAuthorizeLoadingError"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_33"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:text="@string/module_authorize_agreement_error"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_44"
|
||||
android:textColor="@color/module_authorize_text"
|
||||
android:textSize="@dimen/dp_32"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivAuthorizeLoadingError" />
|
||||
@@ -108,10 +108,10 @@
|
||||
android:id="@+id/clAuthorizeContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/dp_330"
|
||||
android:layout_marginTop="@dimen/dp_90"
|
||||
android:layout_marginRight="@dimen/dp_330"
|
||||
android:layout_marginBottom="@dimen/dp_90"
|
||||
android:layout_marginLeft="@dimen/dp_275"
|
||||
android:layout_marginTop="@dimen/dp_125"
|
||||
android:layout_marginRight="@dimen/dp_275"
|
||||
android:layout_marginBottom="@dimen/dp_125"
|
||||
android:background="@drawable/module_authorize_selector_dark_corner"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -125,7 +125,7 @@
|
||||
android:background="@drawable/module_authorize_selector_blue_left_corner"
|
||||
android:gravity="center"
|
||||
android:text="@string/module_authorize_agreement_agree"
|
||||
android:textColor="@android:color/white"
|
||||
android:textColor="@color/module_authorize_affirm_text"
|
||||
android:textSize="@dimen/dp_55"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintHorizontal_weight="1"
|
||||
@@ -139,7 +139,7 @@
|
||||
android:background="@drawable/module_authorize_selector_dark_right_corner"
|
||||
android:gravity="center"
|
||||
android:text="@string/module_authorize_agreement_disagree"
|
||||
android:textColor="@android:color/white"
|
||||
android:textColor="@color/module_authorize_text"
|
||||
android:textSize="@dimen/dp_55"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintHorizontal_weight="1"
|
||||
@@ -149,19 +149,18 @@
|
||||
<ScrollView
|
||||
android:layout_width="0px"
|
||||
android:layout_height="0px"
|
||||
android:layout_marginBottom="@dimen/dp_160"
|
||||
android:scrollbarSize="@dimen/dp_207"
|
||||
android:layout_marginTop="@dimen/dp_54"
|
||||
android:scrollbarTrackHorizontal="@drawable/module_authorize_scrollbar"
|
||||
android:scrollbarThumbVertical="@drawable/module_authorize_scrollbar"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:scrollbarTrackHorizontal="@drawable/module_authorize_scrollbar"
|
||||
app:layout_constraintBottom_toTopOf="@+id/btnAuthorizeDisAgree"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvAuthorizeTitle">
|
||||
app:layout_constraintTop_toBottomOf="@+id/clAuthorizeTitle">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_38"
|
||||
android:layout_marginLeft="@dimen/dp_55"
|
||||
android:layout_marginRight="@dimen/dp_55"
|
||||
android:orientation="vertical">
|
||||
@@ -171,7 +170,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:lineSpacingExtra="@dimen/dp_15"
|
||||
android:textColor="@android:color/white"
|
||||
android:textColor="@color/module_authorize_text"
|
||||
android:textSize="@dimen/dp_44" />
|
||||
|
||||
<TextView
|
||||
@@ -179,7 +178,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:textColor="@android:color/white"
|
||||
android:textColor="@color/module_authorize_text"
|
||||
android:textSize="@dimen/dp_44" />
|
||||
|
||||
<TextView
|
||||
@@ -188,23 +187,50 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
android:textColor="@android:color/white"
|
||||
android:textColor="@color/module_authorize_text"
|
||||
android:textSize="@dimen/dp_44" />
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAuthorizeTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_62"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_55"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/clAuthorizeTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_130"
|
||||
android:background="@drawable/module_authorize_shape_top_corner"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_32"
|
||||
android:layout_height="@dimen/dp_32"
|
||||
android:layout_marginLeft="@dimen/dp_438"
|
||||
android:layout_marginTop="@dimen/dp_49"
|
||||
android:src="@mipmap/module_authorize_title_left_symbol"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_32"
|
||||
android:layout_height="@dimen/dp_32"
|
||||
android:layout_marginTop="@dimen/dp_49"
|
||||
android:layout_marginRight="@dimen/dp_438"
|
||||
android:src="@mipmap/module_authorize_title_right_symbol"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAuthorizeTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_34"
|
||||
android:textColor="@color/module_authorize_text"
|
||||
android:textSize="@dimen/dp_44"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 9.9 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 623 B |
|
After Width: | Height: | Size: 627 B |
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="module_authorize_loading_text">#99FFFFFF</color>
|
||||
<color name="module_authorize_text">#FFFFFF</color>
|
||||
<color name="module_authorize_affirm_text">#FFFFFF</color>
|
||||
<color name="module_authorize_color">#7F000000</color>
|
||||
</resources>
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.mogo.module.common.glide;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.bumptech.glide.request.target.SimpleTarget;
|
||||
import com.bumptech.glide.request.transition.Transition;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/9/2
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
class SkinAbleBitmapTarget extends SimpleTarget< Bitmap > {
|
||||
|
||||
private ImageView mTarget;
|
||||
private RequestOptions mOptions;
|
||||
|
||||
public SkinAbleBitmapTarget( ImageView mTarget, RequestOptions mOptions ) {
|
||||
super();
|
||||
this.mTarget = mTarget;
|
||||
this.mOptions = mOptions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResourceReady( @NonNull Bitmap resource, @Nullable Transition< ? super Bitmap > transition ) {
|
||||
try {
|
||||
mTarget.setImageResource( 0 );
|
||||
mTarget.setImageBitmap(resource);
|
||||
} catch( Exception e ){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadCleared( @Nullable Drawable placeholder ) {
|
||||
super.onLoadCleared( placeholder );
|
||||
try {
|
||||
mTarget.setImageResource( mOptions.getPlaceholderId() );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadStarted( @Nullable Drawable placeholder ) {
|
||||
super.onLoadStarted( placeholder );
|
||||
try {
|
||||
mTarget.setImageResource( mOptions.getPlaceholderId() );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed( @Nullable Drawable errorDrawable ) {
|
||||
super.onLoadFailed( errorDrawable );
|
||||
try {
|
||||
mTarget.setImageResource( mOptions.getErrorId() );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,6 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="@dimen/dp_30" />
|
||||
<solid android:color="#3F4057" />
|
||||
<gradient android:startColor="#3F4057" android:endColor="#2A2B38"/>
|
||||
</shape>
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#7f000000"
|
||||
android:background="@color/module_commons_dlg_bkg"
|
||||
android:layout_gravity="center">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="@dimen/dp_790"
|
||||
android:layout_height="@dimen/dp_440"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/module_commons_shape_round_gray">
|
||||
android:background="@drawable/module_commons_shape_dlg_round_bkg">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_commons_wm_dialog_content"
|
||||
@@ -19,7 +19,7 @@
|
||||
android:layout_height="@dimen/dp_56"
|
||||
android:layout_marginTop="@dimen/dp_134"
|
||||
android:maxLines="1"
|
||||
android:textColor="@android:color/white"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textSize="@dimen/sp_40"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
@@ -31,9 +31,9 @@
|
||||
android:id="@+id/module_commons_wm_dialog_button_ok"
|
||||
android:layout_width="@dimen/dp_395"
|
||||
android:layout_height="@dimen/dp_128"
|
||||
android:background="@drawable/moddule_commons_shape_react_blue_grident"
|
||||
android:background="@drawable/module_commons_shape_left_btn_bkg"
|
||||
android:gravity="center"
|
||||
android:textColor="@android:color/white"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textSize="@dimen/dp_40"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
@@ -43,9 +43,9 @@
|
||||
android:id="@+id/module_commons_wm_dialog_button_cancel"
|
||||
android:layout_width="@dimen/dp_395"
|
||||
android:layout_height="@dimen/dp_128"
|
||||
android:background="@drawable/module_commons_shape_react_gray_grident"
|
||||
android:background="@drawable/module_commons_shape_right_btn_bkg"
|
||||
android:gravity="center"
|
||||
android:textColor="@android:color/white"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textSize="@dimen/dp_40"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
|
||||
@@ -1052,5 +1052,6 @@
|
||||
<dimen name="sp_40">40px</dimen>
|
||||
<dimen name="sp_42">42px</dimen>
|
||||
<dimen name="sp_48">48px</dimen>
|
||||
<dimen name="module_common_shadow_width">-10px</dimen>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="module_commons_dlg_bkg">#7f000000</color>
|
||||
<color name="module_commons_wm_dialog_text_textColor">#FFFFFF</color>
|
||||
</resources>
|
||||
@@ -1043,4 +1043,5 @@
|
||||
<dimen name="sp_40">21.8750px</dimen>
|
||||
<dimen name="sp_42">22.9688px</dimen>
|
||||
<dimen name="sp_48">26.2500px</dimen>
|
||||
<dimen name="module_common_shadow_width">-8px</dimen>
|
||||
</resources>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<item name="android:windowFrame">@null</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:backgroundDimAmount">0.85</item>
|
||||
<item name="android:backgroundDimAmount">0.4</item>
|
||||
<item name="android:backgroundDimEnabled">true</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:fullBright">@android:color/transparent</item>
|
||||
|
||||
@@ -32,6 +32,12 @@ android {
|
||||
sourceCompatibility 1.8
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
res.srcDirs = ['src/main/res', 'src/main/res-light']
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.mogo.module.extensions.bean;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 底层view封装
|
||||
*
|
||||
@@ -12,7 +14,8 @@ public class BottomLayerViewWrapper {
|
||||
private int x;
|
||||
private int y;
|
||||
|
||||
public BottomLayerViewWrapper(){}
|
||||
public BottomLayerViewWrapper() {
|
||||
}
|
||||
|
||||
public BottomLayerViewWrapper(View view, int x, int y) {
|
||||
this.view = view;
|
||||
@@ -20,6 +23,25 @@ public class BottomLayerViewWrapper {
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
BottomLayerViewWrapper wrapper = (BottomLayerViewWrapper) o;
|
||||
return x == wrapper.x &&
|
||||
y == wrapper.y &&
|
||||
view.equals(wrapper.view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(view);
|
||||
}
|
||||
|
||||
public View getView() {
|
||||
return view;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.mogo.module.extensions.entrance;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Bundle;
|
||||
@@ -9,15 +8,16 @@ import android.util.TypedValue;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.constraintlayout.widget.ConstraintSet;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
@@ -33,6 +33,7 @@ import com.mogo.map.navi.MogoTraffic;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.module.common.dialog.WMDialog;
|
||||
import com.mogo.module.common.glide.SkinAbleBitmapTarget;
|
||||
import com.mogo.module.common.map.CustomNaviInterrupter;
|
||||
import com.mogo.module.common.map.MapCenterPointStrategy;
|
||||
import com.mogo.module.common.map.Scene;
|
||||
@@ -47,6 +48,7 @@ import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
import com.mogo.service.entrance.ButtonIndex;
|
||||
import com.mogo.service.fragmentmanager.IFragmentProvider;
|
||||
import com.mogo.service.fragmentmanager.IMogoFragmentManager;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.mogo.service.map.IMogoMapService;
|
||||
@@ -57,6 +59,8 @@ import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.mogo.service.windowview.IMogoTopViewStatusListener;
|
||||
import com.mogo.utils.LaunchUtils;
|
||||
import com.mogo.utils.ResourcesHelper;
|
||||
import com.mogo.utils.TipDrawable;
|
||||
import com.mogo.utils.TipToast;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.glide.GlideApp;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -65,7 +69,6 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-01-07
|
||||
@@ -78,7 +81,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
IMogoMapListener,
|
||||
IMogoAimlessModeListener,
|
||||
IMogoStatusChangedListener,
|
||||
IMogoIntentListener{
|
||||
IMogoIntentListener {
|
||||
|
||||
private static final String TAG = "EntranceFragment";
|
||||
|
||||
@@ -189,11 +192,6 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
mMove2CurrentLocation.setOnClickListener(view -> {
|
||||
final MogoLocation location = mMogoLocationClient.getLastKnowLocation();
|
||||
if (location != null) {
|
||||
if (!mStatusManager.isV2XShow()) {
|
||||
mStatusManager.setUserInteractionStatus(TAG, true, false);
|
||||
mMApUIController.setLockZoom(16);
|
||||
mMApUIController.changeZoom(16.0f);
|
||||
}
|
||||
if (mStatusManager.isDisplayOverview()) {
|
||||
mStatusManager.setDisplayOverview(TAG, false);
|
||||
UiThreadHandler.removeCallbacks(mLockCarRunnable);
|
||||
@@ -209,7 +207,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
return true;
|
||||
});
|
||||
|
||||
mUploadRoadCondition.setOnLongClickListener(view->{
|
||||
mUploadRoadCondition.setOnLongClickListener(view -> {
|
||||
mApis.getMogoMonitorApi().showLogDebugDialog();
|
||||
return true;
|
||||
});
|
||||
@@ -293,7 +291,12 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
mMsgContainer = findViewById(R.id.module_ext_id_msg);
|
||||
|
||||
mMsgContainer.setOnClickListener(view -> {
|
||||
ARouter.getInstance().build("/push/ui/message").navigation(getContext());
|
||||
try {
|
||||
IFragmentProvider provider = (IFragmentProvider)ARouter.getInstance().build("/push/ui/message").navigation(getContext());
|
||||
provider.createFragment( getActivity(), mMogoFragmentManager.getMessageHistoryContainerId(), null );
|
||||
} catch( Exception e ){
|
||||
|
||||
}
|
||||
});
|
||||
mMsgCounter = findViewById(R.id.module_ext_id_msg_counter);
|
||||
mUserHeadImg.setOnClickListener(view -> {
|
||||
@@ -302,7 +305,8 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
// 埋点
|
||||
final Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("type", 3);
|
||||
ServiceApisManager.serviceApis.getAnalyticsApi().track("Launcher_APP_Icon", properties);
|
||||
ServiceApisManager.serviceApis.getAnalyticsApi().track("Launcher_APP_Icon",
|
||||
properties);
|
||||
} catch (Exception e) {
|
||||
Logger.e(TAG, e, "打开个人中心Exception");
|
||||
}
|
||||
@@ -310,18 +314,36 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
|
||||
mUserHeadImg.setVisibility(DebugConfig.isLauncher() ? View.VISIBLE : View.GONE);
|
||||
|
||||
mUploadButtonAnimatorController = new UploadButtonAnimatorController(mUploading, mUpload, mStatusManager);
|
||||
mUploadButtonAnimatorController = new UploadButtonAnimatorController(mUploading, mUpload,
|
||||
mStatusManager);
|
||||
|
||||
dealWeatherContainer();
|
||||
|
||||
debugTopView();
|
||||
}
|
||||
|
||||
/**
|
||||
* 由于Launcher和Independent对于天气的表现形式不太一样,所以通过此方法区分处理
|
||||
*/
|
||||
private void dealWeatherContainer(){
|
||||
if (!DebugConfig.isLauncher()) {
|
||||
ConstraintSet constraintSet = new ConstraintSet();
|
||||
constraintSet.clone((ConstraintLayout) getView());
|
||||
constraintSet.clear(R.id.module_ext_id_weather_container,ConstraintSet.START);
|
||||
constraintSet.connect(R.id.module_ext_id_weather_container, ConstraintSet.END,
|
||||
getView().getId(), ConstraintSet.END);
|
||||
constraintSet.applyTo((ConstraintLayout) getView());
|
||||
}
|
||||
}
|
||||
|
||||
public void showShareDialog() {
|
||||
isClickShare = true;
|
||||
mApis.getShareManager().showShareDialog();
|
||||
traceData("1");
|
||||
}
|
||||
|
||||
private static final String AUTONAVI_STANDARD_BROADCAST_RECV = "AUTONAVI_STANDARD_BROADCAST_RECV";
|
||||
private static final String AUTONAVI_STANDARD_BROADCAST_RECV =
|
||||
"AUTONAVI_STANDARD_BROADCAST_RECV";
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
@@ -451,7 +473,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
return;
|
||||
}
|
||||
|
||||
if (descriptor == StatusDescriptor.UPLOADING) {
|
||||
if (descriptor == StatusDescriptor.UPLOADING&&DebugConfig.isLauncher()) {
|
||||
if (isTrue) {
|
||||
mUploading.setVisibility(View.VISIBLE);
|
||||
mUpload.setVisibility(View.GONE);
|
||||
@@ -511,7 +533,9 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
public void renderUserInfo(UserInfo userInfo) {
|
||||
if (userInfo != null) {
|
||||
Logger.d(TAG, "renderUserInfo: " + userInfo);
|
||||
GlideApp.with(getContext()).load(userInfo.getHeadImgurl()).placeholder(R.drawable.model_ext_default_user_head).circleCrop().into(mUserHeadImg);
|
||||
RequestOptions options =
|
||||
new RequestOptions().circleCrop().placeholder(R.drawable.model_ext_default_user_head).error(R.drawable.model_ext_default_user_head);
|
||||
GlideApp.with(getContext()).asBitmap().apply( options ).load(userInfo.getHeadImgurl()).into(new SkinAbleBitmapTarget(mUserHeadImg, options));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -586,36 +610,53 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
});
|
||||
});
|
||||
|
||||
findViewById(R.id.btnDebugAddBottomLayerView).setOnClickListener(v->{
|
||||
findViewById(R.id.btnDebugAddBottomLayerView).setOnClickListener(v -> {
|
||||
TextView tv = new TextView(getContext());
|
||||
tv.setText("entrance add");
|
||||
mApis.getEntranceButtonController().addBottomLayerView(tv, 50, 50);
|
||||
});
|
||||
findViewById(R.id.btnShowTextTip).setOnClickListener(v-> TipToast.tip("分享成功"));
|
||||
|
||||
findViewById(R.id.btnShowDrawableTip).setOnClickListener(v->{
|
||||
mMsgContainer.setVisibility(View.VISIBLE);
|
||||
TipDrawable drawable =
|
||||
new TipDrawable(getResources().getDrawable(R.drawable.model_ext_default_user_head), 150, 150);
|
||||
TipToast.tip("分享成功",drawable);
|
||||
});
|
||||
|
||||
findViewById(R.id.btnShowDrawableTipNoSize).setOnClickListener(v->{
|
||||
mMsgContainer.setVisibility(View.GONE);
|
||||
TipDrawable drawable =
|
||||
new TipDrawable(getResources().getDrawable(R.drawable.model_ext_default_user_head));
|
||||
TipToast.tip("分享成功",drawable);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapModeChanged( EnumMapUI ui ) {
|
||||
if ( mCameraMode == null ) {
|
||||
public void onMapModeChanged(EnumMapUI ui) {
|
||||
if (mCameraMode == null) {
|
||||
return;
|
||||
}
|
||||
mCameraMode.setSelected(ui == EnumMapUI.NorthUP_2D);
|
||||
mCameraMode.setText(getString(ui == EnumMapUI.NorthUP_2D ? R.string.mode_car_up : R.string.mode_north_up));
|
||||
mCameraMode.setText(getString(ui == EnumMapUI.NorthUP_2D ? R.string.mode_car_up :
|
||||
R.string.mode_north_up));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
if ( mMogoRegisterCenter != null ) {
|
||||
if (mMogoRegisterCenter != null) {
|
||||
mMogoRegisterCenter.unregisterMogoNaviListener(ExtensionsModuleConst.TYPE_ENTRANCE);
|
||||
mMogoRegisterCenter.unregisterMogoMapListener(ExtensionsModuleConst.TYPE_ENTRANCE);
|
||||
mMogoRegisterCenter.unregisterMogoAimlessModeListener(TAG);
|
||||
}
|
||||
if ( mStatusManager != null ) {
|
||||
if (mStatusManager != null) {
|
||||
mStatusManager.unregisterStatusChangedListener(TAG, StatusDescriptor.UPLOADING, this);
|
||||
mStatusManager.unregisterStatusChangedListener(TAG, StatusDescriptor.DISPLAY_OVERVIEW, this);
|
||||
mStatusManager.unregisterStatusChangedListener(TAG, StatusDescriptor.DISPLAY_OVERVIEW
|
||||
, this);
|
||||
}
|
||||
if ( mApis != null ) {
|
||||
if ( mApis.getIntentManagerApi() != null ) {
|
||||
if (mApis != null) {
|
||||
if (mApis.getIntentManagerApi() != null) {
|
||||
mApis.getIntentManagerApi().unregisterIntentListener(AUTONAVI_STANDARD_BROADCAST_RECV, this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,12 +58,26 @@ public class EntranceViewHolder {
|
||||
"\n x: " + x + ", y: " + y);
|
||||
BottomLayerViewWrapper wrapper = new BottomLayerViewWrapper(view, x, y);
|
||||
if(rootViewGroup == null) {
|
||||
preAddView.add(wrapper);
|
||||
if(!preAddView.contains(wrapper)) {
|
||||
preAddView.add(wrapper);
|
||||
}
|
||||
}else{
|
||||
realAddView(wrapper);
|
||||
if(!containView(view)) {
|
||||
realAddView(wrapper);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean containView(View view) {
|
||||
int count = rootViewGroup.getChildCount();
|
||||
for (int i = 0; i < count; i++) {
|
||||
if(rootViewGroup.getChildAt(i).equals(view)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用的时候需要预先判断rootViewGroup是否为空,本方法默认rootViewGroup不为空
|
||||
*/
|
||||
|
||||
@@ -671,6 +671,7 @@ public class TopViewAnimHelper {
|
||||
viewCaches.remove(child);
|
||||
IMogoTopViewStatusListener listener = statusListenerMap.remove(child);
|
||||
if (listener != null) {
|
||||
listener.beforeViewRemoveAnim(child);
|
||||
listener.onViewRemoved(child);
|
||||
}
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 668 B |
|
After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 657 B After Width: | Height: | Size: 865 B |
|
After Width: | Height: | Size: 668 B |
|
After Width: | Height: | Size: 2.4 KiB |