add light mode res
|
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 |
@@ -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>
|
||||
|
||||
@@ -45,6 +45,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;
|
||||
@@ -292,7 +293,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 -> {
|
||||
|
||||
@@ -61,6 +61,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
protected View mApps;
|
||||
protected View mEntrance;
|
||||
protected View mEventPanel;
|
||||
protected View mHistoryMessagePanel;
|
||||
protected FrameLayout mFloatingLayout;
|
||||
protected View mCoverUpLayout;
|
||||
protected FrameLayout mLeftPanelLayout;
|
||||
@@ -84,6 +85,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
mLeftShadowFrame = findViewById( R.id.module_main_id_map_left_shadow_frame );
|
||||
mCoverUpLayout = findViewById( R.id.module_main_id_cover_up );
|
||||
mLeftPanelLayout = findViewById( R.id.module_main_id_left_panel_fragment_container );
|
||||
mHistoryMessagePanel = findViewById( R.id.module_main_id_message_history_fragment_container );
|
||||
|
||||
// 避免事件穿透导致地图被滑动
|
||||
mLeftShadowFrame.setOnClickListener( view -> {
|
||||
@@ -166,6 +168,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
|
||||
mMogoFragmentManager = mServiceApis.getFragmentManagerApi();
|
||||
mMogoFragmentManager.init( this, R.id.module_main_id_search_fragment );
|
||||
mMogoFragmentManager.initMessageHistoryContainerId( R.id.module_main_id_message_history_fragment_container );
|
||||
mMogoFragmentManager.registerMainFragmentStackTransactionListener( ( size ) -> {
|
||||
if ( size == 0 ) {
|
||||
showLayout();
|
||||
|
||||
@@ -55,6 +55,12 @@
|
||||
android:layout_marginLeft="@dimen/module_main_id_entrance_fragment_container_marginLeft"
|
||||
android:padding="@dimen/module_main_entrance_fragment_container_padding" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/module_main_id_message_history_fragment_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/module_main_id_entrance_fragment_container_marginLeft"/>
|
||||
|
||||
<!-- 浮层-->
|
||||
<FrameLayout
|
||||
android:id="@+id/module_main_id_floating_view"
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<dimen name="cards_container_shadow_dp_margin_top">599px</dimen>
|
||||
|
||||
<dimen name="module_main_apps_fragment_container_width">200px</dimen>
|
||||
<dimen name="module_main_apps_fragment_container_padding">30px</dimen>
|
||||
<dimen name="module_main_apps_fragment_container_padding">20px</dimen>
|
||||
<dimen name="module_main_header_fragment_container_marginTop">30px</dimen>
|
||||
<dimen name="module_main_header_fragment_container_marginLeft">830px</dimen>
|
||||
<dimen name="module_main_id_entrance_fragment_container_marginLeft">590px</dimen>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<dimen name="cards_container_shadow_dp_margin_top">599px</dimen>
|
||||
|
||||
<dimen name="module_main_apps_fragment_container_width">200px</dimen>
|
||||
<dimen name="module_main_apps_fragment_container_padding">30px</dimen>
|
||||
<dimen name="module_main_apps_fragment_container_padding">20px</dimen>
|
||||
<dimen name="module_main_header_fragment_container_marginTop">30px</dimen>
|
||||
<dimen name="module_main_header_fragment_container_marginLeft">830px</dimen>
|
||||
<dimen name="module_main_id_entrance_fragment_container_marginLeft">800px</dimen>
|
||||
|
||||
@@ -277,6 +277,9 @@ public class MapPresenter extends Presenter< MapView > implements
|
||||
for ( String cmd : VoiceConstants.sUnUnRegisterCmds ) {
|
||||
mMogoIntentManager.registerIntentListener( cmd, this );
|
||||
}
|
||||
for ( Map.Entry< String, String[] > entry : VoiceConstants.sUnRegisterVoiceCmds.entrySet() ) {
|
||||
AIAssist.getInstance( getContext() ).registerUnWakeupCommand( entry.getKey(), entry.getValue(), this );
|
||||
}
|
||||
|
||||
initBroadcast();
|
||||
mCustomVoiceCommandHandler = new MapControlCommandHandler();
|
||||
@@ -313,6 +316,13 @@ public class MapPresenter extends Presenter< MapView > implements
|
||||
}
|
||||
mRegisterCenter.unregisterMogoNaviListener( TAG );
|
||||
mRegisterCenter.unregisterADASControlStatusChangedListener( TAG );
|
||||
|
||||
for ( String cmd : VoiceConstants.sUnUnRegisterCmds ) {
|
||||
mMogoIntentManager.unregisterIntentListener( cmd, this );
|
||||
}
|
||||
for ( Map.Entry< String, String[] > entry : VoiceConstants.sUnRegisterVoiceCmds.entrySet() ) {
|
||||
AIAssist.getInstance( getContext() ).unregisterUnWakeupCommand( entry.getKey(), this );
|
||||
}
|
||||
}
|
||||
|
||||
private void registerVoiceCmd() {
|
||||
@@ -365,4 +375,5 @@ public class MapPresenter extends Presenter< MapView > implements
|
||||
public void onStopNavi() {
|
||||
MapBroadCastHelper.getInstance( getContext() ).stopNavi();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -158,8 +158,13 @@ public class VoiceConstants {
|
||||
public static final String CMD_MAP_SPEAK_REMAIN_UN_WAKEUP = "CMD_MAP_SPEAK_REMAIN_UN_WAKEUP";
|
||||
public static final String[] CMD_MAP_SPEAK_REMAIN_TRIGGER_WORDS = {"还有多久", "多久到", "还有多远"};
|
||||
|
||||
// 免唤醒
|
||||
public static final Map< String, String[] > sVoiceCmds = new HashMap<>();
|
||||
// 不注销的免唤醒
|
||||
public static final Map< String, String[] > sUnRegisterVoiceCmds = new HashMap<>();
|
||||
// 唤醒
|
||||
public static final List< String > sCmds = new ArrayList<>();
|
||||
// 不注销的唤醒
|
||||
public static final List< String > sUnUnRegisterCmds = new ArrayList<>();
|
||||
|
||||
static {
|
||||
@@ -168,9 +173,6 @@ public class VoiceConstants {
|
||||
sVoiceCmds.put( VoiceConstants.CMD_MAP_ZOOM_OUT_UN_WAKEUP, VoiceConstants.CMD_MAP_ZOOM_OUT_TRIGGER_WORDS );
|
||||
//sVoiceCmds.put( VoiceConstants.CMD_MAP_2D_UN_WAKEUP, VoiceConstants.CMD_MAP_2D_TRIGGER_WORDS );
|
||||
//sVoiceCmds.put( VoiceConstants.CMD_MAP_3D_UN_WAKEUP, VoiceConstants.CMD_MAP_3D_TRIGGER_WORDS );
|
||||
sVoiceCmds.put( VoiceConstants.CMD_MAP_DAY_TIME_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_DAY_TIME_MODE_TRIGGER_WORDS );
|
||||
sVoiceCmds.put( VoiceConstants.CMD_MAP_NIGHT_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_NIGHT_MODE_TRIGGER_WORDS );
|
||||
sVoiceCmds.put( VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE_TRIGGER_WORDS );
|
||||
sVoiceCmds.put( VoiceConstants.CMD_MAP_TRAFFIC_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_TRAFFIC_MODE_TRIGGER_WORDS );
|
||||
sVoiceCmds.put( VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE_TRIGGER_WORDS );
|
||||
//sVoiceCmds.put( VoiceConstants.CMD_MAP_DISPLAY_OVERVIEW_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_DISPLAY_OVERVIEW_MODE_TRIGGER_WORDS );
|
||||
@@ -185,16 +187,18 @@ public class VoiceConstants {
|
||||
sVoiceCmds.put( VoiceConstants.CMD_MAP_SPEAK_DETAIL_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_SPEAK_DETAIL_MODE_TRIGGER_WORDS );
|
||||
sVoiceCmds.put( VoiceConstants.CMD_MAP_SPEAK_DRAFT_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_SPEAK_DRAFT_MODE_TRIGGER_WORDS );
|
||||
//sVoiceCmds.put( VoiceConstants.CMD_MAP_SPEAK_REMAIN_UN_WAKEUP, VoiceConstants.CMD_MAP_SPEAK_REMAIN_TRIGGER_WORDS );
|
||||
|
||||
sUnRegisterVoiceCmds.put( VoiceConstants.CMD_MAP_DAY_TIME_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_DAY_TIME_MODE_TRIGGER_WORDS );
|
||||
sUnRegisterVoiceCmds.put( VoiceConstants.CMD_MAP_NIGHT_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_NIGHT_MODE_TRIGGER_WORDS );
|
||||
sUnRegisterVoiceCmds.put( VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE_TRIGGER_WORDS );
|
||||
|
||||
// 唤醒
|
||||
sCmds.add( VoiceConstants.CMD_MAP_ZOOM_IN );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_ZOOM_OUT );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_2D );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_3D );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_DAY_TIME_MODE );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_NIGHT_MODE );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_TRAFFIC_MODE );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_CAR_UP_MODE );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_NORTH_UP_MODE );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_STOP_NAVI_MODE );
|
||||
@@ -206,5 +210,8 @@ public class VoiceConstants {
|
||||
sUnUnRegisterCmds.add( VoiceConstants.CMD_MAP_CONTINUE_NAVI_MODE );
|
||||
sUnUnRegisterCmds.add( VoiceConstants.CMD_MAP_DISPLAY_OVERVIEW_MODE );
|
||||
sUnUnRegisterCmds.add( VoiceConstants.CMD_MAP_HISTORY );
|
||||
sUnUnRegisterCmds.add( VoiceConstants.CMD_MAP_DAY_TIME_MODE );
|
||||
sUnUnRegisterCmds.add( VoiceConstants.CMD_MAP_NIGHT_MODE );
|
||||
sUnUnRegisterCmds.add( VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,14 +43,14 @@ android {
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
// 小智语音,免唤醒词等服务
|
||||
compileOnly rootProject.ext.dependencies.mogoserviceapi
|
||||
compileOnly rootProject.ext.dependencies.arouter
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
|
||||
if( Boolean.valueOf(RELEASE) ){
|
||||
implementation rootProject.ext.dependencies.modulepushbase
|
||||
implementation rootProject.ext.dependencies.mogoserviceapi
|
||||
} else {
|
||||
implementation project(":modules:mogo-module-push-base")
|
||||
implementation project(':services:mogo-service-api')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.mogo.module.push;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.module.push.base.PushUIConstants;
|
||||
import com.mogo.module.push.fragment.MessageHistoryFragment;
|
||||
import com.mogo.service.fragmentmanager.IFragmentProvider;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/9/1
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
@Route( path = PushUIConstants.Push_MESSAGE_ACTIVITY_PATH )
|
||||
class PushHistoryUiProvider implements IFragmentProvider {
|
||||
|
||||
@Override
|
||||
public Fragment createFragment( FragmentActivity activity, int containerId, Bundle date ) {
|
||||
Fragment fragment = new MessageHistoryFragment();
|
||||
activity.getSupportFragmentManager()
|
||||
.beginTransaction()
|
||||
.add( containerId, fragment, PushUIConstants.Push_MESSAGE_ACTIVITY_PATH )
|
||||
.show( fragment )
|
||||
.commitNowAllowingStateLoss();
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -5,11 +5,9 @@ import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.module.push.Config
|
||||
import com.mogo.module.push.R
|
||||
import com.mogo.module.push.adapter.PushMessageAdapter
|
||||
import com.mogo.module.push.base.PushUIConstants
|
||||
import com.mogo.module.push.model.PushBean
|
||||
import com.mogo.module.push.repository.PushRepository
|
||||
import com.mogo.module.push.utils.AnalyticsUtils
|
||||
@@ -24,7 +22,6 @@ import com.mogo.utils.UiThreadHandler
|
||||
import com.mogo.utils.logger.Logger
|
||||
import kotlinx.android.synthetic.main.module_push_message_activity.*
|
||||
|
||||
@Route(path = PushUIConstants.Push_MESSAGE_ACTIVITY_PATH)
|
||||
class PushMessageActivity : AppCompatActivity(), IMogoIntentListener {
|
||||
private lateinit var viewModel: MessageViewModel
|
||||
private var adapter = PushMessageAdapter()
|
||||
|
||||
@@ -45,7 +45,7 @@ class PushMessageAdapter : RecyclerView.Adapter<PushMessageAdapter.MessageViewHo
|
||||
val position = it.indexOf(bean)
|
||||
if (position >= 0) {
|
||||
it.removeAt(position)
|
||||
notifyItemRemoved(position)
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
if (itemCount == 0) {
|
||||
deletePushBean.lastItemShow(false)
|
||||
|
||||
@@ -0,0 +1,187 @@
|
||||
package com.mogo.module.push.fragment;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.analytics.AnalyticsUtils;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.module.push.Config;
|
||||
import com.mogo.module.push.R;
|
||||
import com.mogo.module.push.adapter.PushMessageAdapter;
|
||||
import com.mogo.module.push.model.PushBean;
|
||||
import com.mogo.module.push.repository.PushRepository;
|
||||
import com.mogo.module.push.utils.AnimatorUtilsKt;
|
||||
import com.mogo.module.push.utils.HandlerUtils;
|
||||
import com.mogo.module.push.view.GlobalToolsKt;
|
||||
import com.mogo.module.push.view.PushItemAnimator;
|
||||
import com.mogo.module.push.view.SwipeItemLayout;
|
||||
import com.mogo.module.push.viewmodel.MessageViewModel;
|
||||
import com.mogo.service.statusmanager.IMogoMsgCenterListener;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/9/1
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
class MessageHistoryFragment extends MvpFragment< MessageHistoryView, MessageHistoryPresenter > implements MessageHistoryView, IMogoMsgCenterListener {
|
||||
|
||||
private View mClear;
|
||||
private RecyclerView mHistoryList;
|
||||
private TextView mTitle;
|
||||
private View mEmptyPlaceHolder;
|
||||
private View mClose;
|
||||
|
||||
private boolean mClearing = false;
|
||||
private PushMessageAdapter mAdapter = new PushMessageAdapter();
|
||||
private MessageViewModel mViewModel;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.module_push_message_hisotry_fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews() {
|
||||
mClear = findViewById( R.id.module_push_activity_clear );
|
||||
mHistoryList = findViewById( R.id.module_push_activity_recycler_view );
|
||||
mTitle = findViewById( R.id.module_push_activity_title );
|
||||
mEmptyPlaceHolder = findViewById( R.id.module_push_activity_not_data );
|
||||
mClose = findViewById( R.id.module_push_activity_close );
|
||||
|
||||
AnalyticsUtils.track( Config.NEWS_HISTORY_OPEN, null );
|
||||
mClose.setOnClickListener( view -> {
|
||||
exitSelf();
|
||||
} );
|
||||
mClear.setOnClickListener( view -> {
|
||||
AnalyticsUtils.track( Config.NEWS_HISTORY_ALL_CLEAR, null );
|
||||
if ( !mClearing ) {
|
||||
mClearing = true;
|
||||
AnimatorUtilsKt.startClearAnimator(
|
||||
mHistoryList,
|
||||
() -> {
|
||||
mViewModel.deleteAll();
|
||||
mClearing = false;
|
||||
return null;
|
||||
}
|
||||
);
|
||||
}
|
||||
} );
|
||||
mAdapter.deletePushBean = new PushMessageAdapter.PushAdapterListener() {
|
||||
@Override
|
||||
public void deleteBean( @NotNull PushBean bean, boolean action ) {
|
||||
if ( mClearing ) {
|
||||
return;
|
||||
}
|
||||
mViewModel.delete( bean );
|
||||
if ( action ) {
|
||||
Map< String, Object > prop = new HashMap<>();
|
||||
prop.put( "title", bean.getTitle() );
|
||||
AnalyticsUtils.track( Config.NEWS_HISTORY_ONE_CLICK, prop );
|
||||
exitSelf();
|
||||
} else {
|
||||
AnalyticsUtils.track( Config.NEWS_HISTORY_ONE_CLEAR, null );
|
||||
mAdapter.removeItem( bean );
|
||||
if ( mAdapter.getItemCount() == 0 ) {
|
||||
mEmptyPlaceHolder.setVisibility( View.VISIBLE );
|
||||
}
|
||||
updateHistoryMessageCount();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void lastItemShow( boolean show ) {
|
||||
if ( !show && !mClearing ) {
|
||||
int size = mViewModel.getList().size();
|
||||
if ( size > 0 && size < mHistoryList.getChildCount() ) {
|
||||
return;
|
||||
}
|
||||
mClear.setVisibility( show ? View.VISIBLE : View.GONE );
|
||||
}
|
||||
}
|
||||
};
|
||||
mViewModel = new MessageViewModel( list -> {
|
||||
UiThreadHandler.post( () -> {
|
||||
int size = list == null ? 0 : list.size();
|
||||
mAdapter.setDatas( list );
|
||||
mEmptyPlaceHolder.setVisibility( size > 0 ? View.GONE : View.VISIBLE );
|
||||
updateHistoryMessageCount();
|
||||
} );
|
||||
} );
|
||||
|
||||
mHistoryList.setLayoutManager( new LinearLayoutManager( AbsMogoApplication.getApp() ) );
|
||||
mHistoryList.setAdapter( mAdapter );
|
||||
mHistoryList.setItemAnimator( new PushItemAnimator() );
|
||||
mHistoryList.addOnItemTouchListener( new SwipeItemLayout.OnSwipeItemTouchListener( getContext() ) );
|
||||
|
||||
GlobalToolsKt.getApis( getContext() ).getMsgCenterApi().registerMsgCenterListener( this );
|
||||
}
|
||||
|
||||
private void exitSelf() {
|
||||
try {
|
||||
getActivity().getSupportFragmentManager().beginTransaction()
|
||||
.remove( this )
|
||||
.commitNowAllowingStateLoss();
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void updateHistoryMessageCount() {
|
||||
HandlerUtils.INSTANCE.getMBgHandler().post( () -> {
|
||||
int count = 0;
|
||||
try {
|
||||
count = PushRepository.Companion.getPushRepository().getPushBeanDao().getAllCount();
|
||||
} catch ( Exception e ) {
|
||||
count = 0;
|
||||
}
|
||||
renderHistoryMessageCount( count );
|
||||
} );
|
||||
}
|
||||
|
||||
private void renderHistoryMessageCount( int count ) {
|
||||
UiThreadHandler.post( () -> {
|
||||
try {
|
||||
mTitle.setText( count > 0 ? "历史消息(" + count + ")" : "历史消息" );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMsgChanged( boolean hasMsg, int amount ) {
|
||||
HandlerUtils.INSTANCE.getMBgHandler().post( () -> {
|
||||
mViewModel.setList( PushRepository.Companion.getPushRepository().getAll() );
|
||||
} );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected MessageHistoryPresenter createPresenter() {
|
||||
return new MessageHistoryPresenter( this );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
GlobalToolsKt.getApis( getContext() ).getMsgCenterApi().unregisterMsgCenterListener( this );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.mogo.module.push.fragment;
|
||||
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/9/1
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
class MessageHistoryPresenter extends Presenter< MessageHistoryView > {
|
||||
|
||||
public MessageHistoryPresenter( MessageHistoryView view ) {
|
||||
super( view );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.mogo.module.push.fragment;
|
||||
|
||||
import com.mogo.commons.mvp.IView;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/9/1
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
interface MessageHistoryView extends IView {
|
||||
}
|
||||
@@ -85,6 +85,12 @@ class PushRepository(mContext: Context) {
|
||||
}
|
||||
pushBeanQueue.offer(bean)
|
||||
}
|
||||
if ( bean != null) {
|
||||
HandlerUtils.mBgHandler.post {
|
||||
pushBeanDao.insertAll(bean)
|
||||
updateMsgNum()
|
||||
}
|
||||
}
|
||||
startIterate()
|
||||
}
|
||||
})
|
||||
@@ -158,13 +164,6 @@ class PushRepository(mContext: Context) {
|
||||
}
|
||||
|
||||
fun iterateNext(needSave: Boolean = false) {
|
||||
if (needSave && pushViewModel.pushBean != null) {
|
||||
val bean = pushViewModel.pushBean!!
|
||||
HandlerUtils.mBgHandler.post {
|
||||
pushBeanDao.insertAll(bean)
|
||||
updateMsgNum()
|
||||
}
|
||||
}
|
||||
try {
|
||||
val nextBean = pushBeanQueue.peek()
|
||||
if (nextBean == null) {
|
||||
|
||||
BIN
modules/mogo-module-push/src/main/res/drawable-ldpi/module_push_close.png
Normal file → Executable file
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 434 B |
BIN
modules/mogo-module-push/src/main/res/drawable-xhdpi/module_push_close.png
Normal file → Executable file
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.2 KiB |
BIN
modules/mogo-module-push/src/main/res/drawable/module_push_close.png
Normal file → Executable file
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 434 B |
@@ -2,4 +2,5 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#FA36374A"/>
|
||||
<corners android:radius="@dimen/module_push_panel_corner"/>
|
||||
</shape>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<corners android:radius="@dimen/module_push_button_margin_top" />
|
||||
<solid android:color="#242736" />
|
||||
<corners android:radius="@dimen/module_push_panel_item_corner" />
|
||||
<solid android:color="#1F2131" />
|
||||
<!-- <gradient
|
||||
android:angle="-90"
|
||||
android:endColor="#2F3047"
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/module_push_panel_marginTop"
|
||||
android:layout_marginBottom="@dimen/module_push_panel_marginBottom"
|
||||
android:layout_marginRight="@dimen/module_push_panel_marginRight"
|
||||
android:layout_marginLeft="@dimen/module_push_panel_marginRight"
|
||||
android:paddingLeft="@dimen/module_push_panel_paddingLeft"
|
||||
android:paddingRight="@dimen/module_push_panel_paddingLeft"
|
||||
android:paddingBottom="@dimen/module_push_panel_paddingBottom"
|
||||
android:background="@drawable/module_push_message_activity_background"
|
||||
android:layout_gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_push_activity_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/module_push_activity_title_margin_top"
|
||||
android:text="历史消息"
|
||||
android:textColor="@color/module_push_panel_title_textColor"
|
||||
android:textSize="@dimen/module_push_activity_title_text_size" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/module_push_activity_close"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="@dimen/module_push_activity_close_margin_top"
|
||||
android:src="@drawable/module_push_close" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/module_push_activity_recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:overScrollMode="never"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/module_push_activity_recycler_view_margin_top" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_push_activity_not_data"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:text="暂无消息"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/module_push_activity_not_data_text_size" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_push_activity_clear"
|
||||
android:layout_width="@dimen/module_push_content_only_height"
|
||||
android:layout_height="@dimen/module_push_button_height"
|
||||
android:layout_gravity="bottom|center_horizontal"
|
||||
android:layout_marginBottom="@dimen/module_push_activity_clear_margin_bottom"
|
||||
android:background="@drawable/module_push_activity_clear_bg"
|
||||
android:gravity="center"
|
||||
android:text="清空历史消息"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/module_push_title_text_size"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</FrameLayout>
|
||||
@@ -14,7 +14,6 @@
|
||||
android:id="@+id/module_push_item_click"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="@dimen/module_push_activity_close_margin_end"
|
||||
android:background="@drawable/module_push_recycler_item_background">
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
@@ -22,6 +21,7 @@
|
||||
android:layout_width="@dimen/module_push_message_app_icon_size"
|
||||
android:layout_height="@dimen/module_push_message_app_icon_size"
|
||||
android:layout_marginStart="@dimen/module_push_message_margin_start"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -37,7 +37,7 @@
|
||||
android:gravity="left"
|
||||
android:maxLines="1"
|
||||
android:text="push title"
|
||||
android:textColor="@android:color/white"
|
||||
android:textColor="@color/module_push_item_title_textColor"
|
||||
android:textSize="@dimen/module_push_title_text_size"
|
||||
app:layout_constraintBottom_toTopOf="@+id/module_push_item_content"
|
||||
app:layout_constraintLeft_toRightOf="@+id/module_push_item_app_icon"
|
||||
@@ -54,7 +54,7 @@
|
||||
android:gravity="left"
|
||||
android:maxLines="1"
|
||||
android:text="发现系统新版本,共140.3M。部分功能优化,建议下载升级。"
|
||||
android:textColor="#80FFFFFF"
|
||||
android:textColor="@color/module_push_item_content_textColor"
|
||||
android:textSize="@dimen/module_push_item_content_text_size"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@+id/module_push_item_title" />
|
||||
@@ -75,15 +75,14 @@
|
||||
android:id="@+id/module_push_item_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/module_push_image_margin_top"
|
||||
android:layout_marginEnd="@dimen/module_push_image_margin_top"
|
||||
android:gravity="right"
|
||||
android:maxLines="1"
|
||||
android:text="3:20"
|
||||
android:textColor="#80FFFFFF"
|
||||
android:layout_marginTop="@dimen/module_push_item_time_textSize"
|
||||
android:textColor="@color/module_push_item_time_textColor"
|
||||
android:textSize="@dimen/module_push_massage_time_text_size"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintLeft_toLeftOf="@+id/module_push_item_content"
|
||||
app:layout_constraintTop_toBottomOf="@+id/module_push_item_content" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</FrameLayout>
|
||||
|
||||
@@ -100,7 +99,7 @@
|
||||
android:background="@drawable/module_push_recycler_item_background"
|
||||
android:gravity="center"
|
||||
android:text="清除"
|
||||
android:textColor="@android:color/white"
|
||||
android:textColor="@color/module_push_item_title_textColor"
|
||||
android:textSize="@dimen/module_push_title_text_size" />
|
||||
</FrameLayout>
|
||||
</com.mogo.module.push.view.SwipeItemLayout>
|
||||
@@ -23,18 +23,18 @@
|
||||
<dimen name="module_push_button_height">48px</dimen>
|
||||
<dimen name="module_push_button_margin_top">10px</dimen>
|
||||
<dimen name="module_push_button_margin_bottom">14px</dimen>
|
||||
<dimen name="module_push_activity_title_margin_top">35px</dimen>
|
||||
<dimen name="module_push_activity_title_margin_top">28px</dimen>
|
||||
<dimen name="module_push_activity_title_text_size">20px</dimen>
|
||||
<dimen name="module_push_activity_close_margin_top">29px</dimen>
|
||||
<dimen name="module_push_activity_close_margin_top">20px</dimen>
|
||||
<dimen name="module_push_activity_close_margin_end">90px</dimen>
|
||||
<dimen name="module_push_activity_close_padding">5px</dimen>
|
||||
<dimen name="module_push_activity_recycler_view_margin_top">92px</dimen>
|
||||
<dimen name="module_push_activity_recycler_view_margin_top">84px</dimen>
|
||||
<dimen name="module_push_activity_not_data_text_size">38px</dimen>
|
||||
<dimen name="module_push_activity_clear_margin_bottom">36px</dimen>
|
||||
<dimen name="module_push_message_item_height">106px</dimen>
|
||||
<dimen name="module_push_message_item_height">100px</dimen>
|
||||
<dimen name="module_push_message_app_icon_size">64px</dimen>
|
||||
<dimen name="module_push_message_margin_start">24px</dimen>
|
||||
<dimen name="module_push_item_title_margin_top">25px</dimen>
|
||||
<dimen name="module_push_item_title_margin_top">12px</dimen>
|
||||
<dimen name="module_push_item_title_gone_margin_bottom">44px</dimen>
|
||||
<dimen name="module_push_item_title_margin_bottom">2px</dimen>
|
||||
<dimen name="module_push_item_content_margin_end">20px</dimen>
|
||||
@@ -42,7 +42,7 @@
|
||||
<dimen name="module_push_item_content_text_size">16px</dimen>
|
||||
<dimen name="module_push_message_item_image_size">64px</dimen>
|
||||
<dimen name="module_push_message_item_image_margin_end">100px</dimen>
|
||||
<dimen name="module_push_massage_time_text_size">14px</dimen>
|
||||
<dimen name="module_push_massage_time_text_size">12px</dimen>
|
||||
|
||||
<dimen name="module_push_image_margin_bottom">22px</dimen>
|
||||
<dimen name="module_push_button_radius">27px</dimen>
|
||||
@@ -87,4 +87,12 @@
|
||||
<dimen name="module_push_item_minHeight_vertical">310px</dimen>
|
||||
<dimen name="module_push_item_maxHeight_vertical">350px</dimen>
|
||||
<dimen name="module_push_content_paddingBottom_vertical">60px</dimen>
|
||||
<dimen name="module_push_panel_marginTop">16px</dimen>
|
||||
<dimen name="module_push_panel_marginBottom">16px</dimen>
|
||||
<dimen name="module_push_panel_marginRight">16px</dimen>
|
||||
<dimen name="module_push_panel_paddingLeft">28px</dimen>
|
||||
<dimen name="module_push_panel_paddingBottom">16px</dimen>
|
||||
<dimen name="module_push_panel_corner">16px</dimen>
|
||||
<dimen name="module_push_panel_item_corner">12px</dimen>
|
||||
<dimen name="module_push_item_time_textSize">5px</dimen>
|
||||
</resources>
|
||||
@@ -23,18 +23,18 @@
|
||||
<dimen name="module_push_button_height">48px</dimen>
|
||||
<dimen name="module_push_button_margin_top">10px</dimen>
|
||||
<dimen name="module_push_button_margin_bottom">14px</dimen>
|
||||
<dimen name="module_push_activity_title_margin_top">35px</dimen>
|
||||
<dimen name="module_push_activity_title_margin_top">28px</dimen>
|
||||
<dimen name="module_push_activity_title_text_size">20px</dimen>
|
||||
<dimen name="module_push_activity_close_margin_top">29px</dimen>
|
||||
<dimen name="module_push_activity_close_margin_top">20px</dimen>
|
||||
<dimen name="module_push_activity_close_margin_end">90px</dimen>
|
||||
<dimen name="module_push_activity_close_padding">5px</dimen>
|
||||
<dimen name="module_push_activity_recycler_view_margin_top">92px</dimen>
|
||||
<dimen name="module_push_activity_recycler_view_margin_top">84px</dimen>
|
||||
<dimen name="module_push_activity_not_data_text_size">38px</dimen>
|
||||
<dimen name="module_push_activity_clear_margin_bottom">36px</dimen>
|
||||
<dimen name="module_push_message_item_height">106px</dimen>
|
||||
<dimen name="module_push_message_item_height">100px</dimen>
|
||||
<dimen name="module_push_message_app_icon_size">64px</dimen>
|
||||
<dimen name="module_push_message_margin_start">24px</dimen>
|
||||
<dimen name="module_push_item_title_margin_top">25px</dimen>
|
||||
<dimen name="module_push_item_title_margin_top">12px</dimen>
|
||||
<dimen name="module_push_item_title_gone_margin_bottom">44px</dimen>
|
||||
<dimen name="module_push_item_title_margin_bottom">2px</dimen>
|
||||
<dimen name="module_push_item_content_margin_end">20px</dimen>
|
||||
@@ -42,7 +42,7 @@
|
||||
<dimen name="module_push_item_content_text_size">16px</dimen>
|
||||
<dimen name="module_push_message_item_image_size">64px</dimen>
|
||||
<dimen name="module_push_message_item_image_margin_end">100px</dimen>
|
||||
<dimen name="module_push_massage_time_text_size">14px</dimen>
|
||||
<dimen name="module_push_massage_time_text_size">12px</dimen>
|
||||
|
||||
<dimen name="module_push_image_margin_bottom">22px</dimen>
|
||||
<dimen name="module_push_button_radius">27px</dimen>
|
||||
@@ -87,4 +87,12 @@
|
||||
<dimen name="module_push_item_minHeight_vertical">310px</dimen>
|
||||
<dimen name="module_push_item_maxHeight_vertical">350px</dimen>
|
||||
<dimen name="module_push_content_paddingBottom_vertical">60px</dimen>
|
||||
<dimen name="module_push_panel_marginTop">16px</dimen>
|
||||
<dimen name="module_push_panel_marginBottom">16px</dimen>
|
||||
<dimen name="module_push_panel_marginRight">16px</dimen>
|
||||
<dimen name="module_push_panel_paddingLeft">28px</dimen>
|
||||
<dimen name="module_push_panel_paddingBottom">16px</dimen>
|
||||
<dimen name="module_push_panel_corner">16px</dimen>
|
||||
<dimen name="module_push_panel_item_corner">12px</dimen>
|
||||
<dimen name="module_push_item_time_textSize">5px</dimen>
|
||||
</resources>
|
||||
@@ -23,27 +23,27 @@
|
||||
<dimen name="module_push_button_height">90px</dimen>
|
||||
<dimen name="module_push_button_margin_top">20px</dimen>
|
||||
<dimen name="module_push_button_margin_bottom">26px</dimen>
|
||||
<dimen name="module_push_activity_title_margin_top">66px</dimen>
|
||||
<dimen name="module_push_activity_title_text_size">38px</dimen>
|
||||
<dimen name="module_push_activity_close_margin_top">54px</dimen>
|
||||
<dimen name="module_push_activity_title_margin_top">50px</dimen>
|
||||
<dimen name="module_push_activity_title_text_size">36px</dimen>
|
||||
<dimen name="module_push_activity_close_margin_top">36px</dimen>
|
||||
<dimen name="module_push_activity_close_margin_end">160px</dimen>
|
||||
<dimen name="module_push_activity_close_padding">10px</dimen>
|
||||
<dimen name="module_push_activity_recycler_view_margin_top">173px</dimen>
|
||||
<dimen name="module_push_activity_recycler_view_margin_top">151px</dimen>
|
||||
<dimen name="module_push_activity_not_data_text_size">72px</dimen>
|
||||
<dimen name="module_push_activity_clear_margin_bottom">68px</dimen>
|
||||
<dimen name="module_push_message_item_height">200px</dimen>
|
||||
<dimen name="module_push_message_item_height">180px</dimen>
|
||||
<dimen name="module_push_message_app_icon_size">120px</dimen>
|
||||
<dimen name="module_push_message_margin_start">50px</dimen>
|
||||
<dimen name="module_push_item_title_margin_top">43px</dimen>
|
||||
<dimen name="module_push_item_title_margin_top">21px</dimen>
|
||||
<dimen name="module_push_item_title_margin_bottom">6px</dimen>
|
||||
<dimen name="module_push_item_title_gone_margin_bottom">84px</dimen>
|
||||
|
||||
<dimen name="module_push_item_content_margin_end">40px</dimen>
|
||||
<dimen name="module_push_item_content_margin_bottom">52px</dimen>
|
||||
<dimen name="module_push_item_content_text_size">30px</dimen>
|
||||
<dimen name="module_push_item_content_text_size">28px</dimen>
|
||||
<dimen name="module_push_message_item_image_size">120px</dimen>
|
||||
<dimen name="module_push_message_item_image_margin_end">180px</dimen>
|
||||
<dimen name="module_push_massage_time_text_size">34px</dimen>
|
||||
<dimen name="module_push_massage_time_text_size">26px</dimen>
|
||||
<dimen name="module_push_image_margin_bottom">42px</dimen>
|
||||
<dimen name="module_push_button_radius">51px</dimen>
|
||||
<dimen name="module_push_timer_inner_radius">27px</dimen>
|
||||
@@ -87,4 +87,12 @@
|
||||
<dimen name="module_push_item_minHeight_vertical">618px</dimen>
|
||||
<dimen name="module_push_item_maxHeight_vertical">350px</dimen>
|
||||
<dimen name="module_push_content_paddingBottom_vertical">120px</dimen>
|
||||
<dimen name="module_push_panel_marginTop">30px</dimen>
|
||||
<dimen name="module_push_panel_marginBottom">30px</dimen>
|
||||
<dimen name="module_push_panel_marginRight">30px</dimen>
|
||||
<dimen name="module_push_panel_paddingLeft">50px</dimen>
|
||||
<dimen name="module_push_panel_paddingBottom">28px</dimen>
|
||||
<dimen name="module_push_panel_corner">29px</dimen>
|
||||
<dimen name="module_push_panel_item_corner">22px</dimen>
|
||||
<dimen name="module_push_item_time_textSize">11px</dimen>
|
||||
</resources>
|
||||
7
modules/mogo-module-push/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="module_push_panel_title_textColor">#FFFFFFFF</color>
|
||||
<color name="module_push_item_title_textColor">#FFFFFF</color>
|
||||
<color name="module_push_item_content_textColor">#B2FFFFFF</color>
|
||||
<color name="module_push_item_time_textColor">#B2FFFFFF</color>
|
||||
</resources>
|
||||
@@ -23,18 +23,18 @@
|
||||
<dimen name="module_push_button_height">48px</dimen>
|
||||
<dimen name="module_push_button_margin_top">10px</dimen>
|
||||
<dimen name="module_push_button_margin_bottom">14px</dimen>
|
||||
<dimen name="module_push_activity_title_margin_top">35px</dimen>
|
||||
<dimen name="module_push_activity_title_margin_top">50px</dimen>
|
||||
<dimen name="module_push_activity_title_text_size">20px</dimen>
|
||||
<dimen name="module_push_activity_close_margin_top">29px</dimen>
|
||||
<dimen name="module_push_activity_close_margin_top">20px</dimen>
|
||||
<dimen name="module_push_activity_close_margin_end">90px</dimen>
|
||||
<dimen name="module_push_activity_close_padding">5px</dimen>
|
||||
<dimen name="module_push_activity_recycler_view_margin_top">92px</dimen>
|
||||
<dimen name="module_push_activity_recycler_view_margin_top">84px</dimen>
|
||||
<dimen name="module_push_activity_not_data_text_size">38px</dimen>
|
||||
<dimen name="module_push_activity_clear_margin_bottom">36px</dimen>
|
||||
<dimen name="module_push_message_item_height">106px</dimen>
|
||||
<dimen name="module_push_message_item_height">100px</dimen>
|
||||
<dimen name="module_push_message_app_icon_size">64px</dimen>
|
||||
<dimen name="module_push_message_margin_start">24px</dimen>
|
||||
<dimen name="module_push_item_title_margin_top">25px</dimen>
|
||||
<dimen name="module_push_item_title_margin_top">12px</dimen>
|
||||
<dimen name="module_push_item_title_gone_margin_bottom">44px</dimen>
|
||||
<dimen name="module_push_item_title_margin_bottom">2px</dimen>
|
||||
<dimen name="module_push_item_content_margin_end">20px</dimen>
|
||||
@@ -42,7 +42,7 @@
|
||||
<dimen name="module_push_item_content_text_size">16px</dimen>
|
||||
<dimen name="module_push_message_item_image_size">64px</dimen>
|
||||
<dimen name="module_push_message_item_image_margin_end">100px</dimen>
|
||||
<dimen name="module_push_massage_time_text_size">14px</dimen>
|
||||
<dimen name="module_push_massage_time_text_size">12px</dimen>
|
||||
|
||||
<dimen name="module_push_image_margin_bottom">22px</dimen>
|
||||
<dimen name="module_push_button_radius">27px</dimen>
|
||||
@@ -87,4 +87,12 @@
|
||||
<dimen name="module_push_item_minHeight_vertical">310px</dimen>
|
||||
<dimen name="module_push_item_maxHeight_vertical">350px</dimen>
|
||||
<dimen name="module_push_content_paddingBottom_vertical">60px</dimen>
|
||||
<dimen name="module_push_panel_marginTop">16px</dimen>
|
||||
<dimen name="module_push_panel_marginBottom">16px</dimen>
|
||||
<dimen name="module_push_panel_marginRight">16px</dimen>
|
||||
<dimen name="module_push_panel_paddingLeft">28px</dimen>
|
||||
<dimen name="module_push_panel_paddingBottom">16px</dimen>
|
||||
<dimen name="module_push_panel_corner">16px</dimen>
|
||||
<dimen name="module_push_panel_item_corner">12px</dimen>
|
||||
<dimen name="module_push_item_time_textSize">5px</dimen>
|
||||
</resources>
|
||||
@@ -52,7 +52,7 @@ public class MapMarkerInfoView extends MapMarkerBaseView {
|
||||
}
|
||||
|
||||
protected void initView( Context context ) {
|
||||
LayoutInflater.from( context ).inflate( R.layout.view_map_marker_info, this );
|
||||
LayoutInflater.from( context ).inflate( R.layout.modudle_services_marker_layout_info, this );
|
||||
ivUserHead = findViewById( R.id.ivUserHead );
|
||||
ivIcon = findViewById( R.id.ivIcon );
|
||||
clMarkerContent = findViewById( R.id.clMarkerContent );
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.mogo.module.service.marker;
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
@@ -43,7 +42,7 @@ public class MapMarkerView extends MapMarkerBaseView {
|
||||
}
|
||||
|
||||
protected void initView( Context context ) {
|
||||
LayoutInflater.from( context ).inflate( R.layout.view_map_marker, this );
|
||||
LayoutInflater.from( context ).inflate( R.layout.modudle_services_marker_layout, this );
|
||||
ivIcon = findViewById( R.id.ivIcon );
|
||||
ivCar = findViewById( R.id.ivCar );
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.network.SubscribeImpl;
|
||||
import com.mogo.map.marker.IMogoInfoWindowAdapter;
|
||||
@@ -22,7 +21,6 @@ import com.mogo.module.service.R;
|
||||
import com.mogo.module.service.network.RefreshApiService;
|
||||
import com.mogo.module.service.network.RefreshModel;
|
||||
import com.mogo.module.service.network.bean.DemoUserInfoEntity;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.imageloader.MogoImageView;
|
||||
import com.mogo.service.network.IMogoNetwork;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
@@ -92,7 +90,7 @@ public class UserDataMarkerInfoWindowAdapter implements IMogoInfoWindowAdapter {
|
||||
}
|
||||
|
||||
if ( mInfoWindowView == null ) {
|
||||
mInfoWindowView = LayoutInflater.from( mContext ).inflate( R.layout.view_map_data_user_info_window, null );
|
||||
mInfoWindowView = LayoutInflater.from( mContext ).inflate( R.layout.modudle_services_marker_info_window_layout, null );
|
||||
mContentContainer = mInfoWindowView.findViewById( R.id.module_service_id_marker_content );
|
||||
mUserHeader = mInfoWindowView.findViewById( R.id.module_service_id_user_header );
|
||||
mContent = mInfoWindowView.findViewById( R.id.module_service_id_content );
|
||||
|
||||
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 9.1 KiB |
@@ -12,7 +12,7 @@
|
||||
<FrameLayout
|
||||
android:id="@+id/clMarkerTopView"
|
||||
android:layout_width="@dimen/module_service_marker_bubble_width"
|
||||
android:background="@drawable/bg_map_marker_dark"
|
||||
android:background="@drawable/module_services_marker_bkg"
|
||||
android:layout_height="@dimen/module_service_marker_bubble_height">
|
||||
|
||||
<ImageView
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.mogo.service.fragmentmanager;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/9/1
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
interface IFragmentProvider extends IProvider {
|
||||
|
||||
Fragment createFragment( FragmentActivity activity, int containerId, Bundle date );
|
||||
}
|
||||
@@ -64,4 +64,12 @@ public interface IMogoFragmentManager extends IProvider {
|
||||
* @param containerId
|
||||
*/
|
||||
void init( AppCompatActivity activity, int containerId );
|
||||
|
||||
/**
|
||||
* 缓存历史消息
|
||||
* @param layoutId
|
||||
*/
|
||||
void initMessageHistoryContainerId(int layoutId);
|
||||
|
||||
int getMessageHistoryContainerId();
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ public class FragmentStack {
|
||||
|
||||
private FragmentStackTransactionListener mFragmentStackTransactionListener;
|
||||
private List< FragmentStackTransactionListener > mFragmentStackTransactionListeners = new ArrayList<>();
|
||||
private int mMessageHistoryContainerId;
|
||||
|
||||
private FragmentStack() {
|
||||
}
|
||||
@@ -60,6 +61,18 @@ public class FragmentStack {
|
||||
mContainerId = containerId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 缓存历史消息
|
||||
* @param layoutId
|
||||
*/
|
||||
public void initMessageHistoryContainerId(int layoutId){
|
||||
mMessageHistoryContainerId = layoutId;
|
||||
}
|
||||
|
||||
public int getMessageHistoryContainerId() {
|
||||
return mMessageHistoryContainerId;
|
||||
}
|
||||
|
||||
public void push( FragmentDescriptor descriptor ) {
|
||||
if ( descriptor == null || descriptor.getFragment() == null ) {
|
||||
return;
|
||||
|
||||
@@ -59,6 +59,16 @@ public class MogoFragmentManager implements IMogoFragmentManager {
|
||||
FragmentStack.getInstance().init( activity, containerId );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initMessageHistoryContainerId( int layoutId ) {
|
||||
FragmentStack.getInstance().initMessageHistoryContainerId( layoutId );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMessageHistoryContainerId() {
|
||||
return FragmentStack.getInstance().getMessageHistoryContainerId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ android {
|
||||
'src/main/module-services-res',
|
||||
'src/main/module-push-res',
|
||||
'src/main/module-share-res',
|
||||
'src/main/module-main-res',
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 949 B |
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape>
|
||||
<gradient android:angle="0" android:centerX="0.6" android:centerColor="#7fffffff" android:endColor="#00000000" android:startColor="#ffffff" android:type="linear" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#FFFFFF"/>
|
||||
<corners android:radius="@dimen/module_push_panel_corner"/>
|
||||
</shape>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<corners android:radius="@dimen/module_push_panel_item_corner" />
|
||||
<solid android:color="#DDDDDD" />
|
||||
<!-- <gradient
|
||||
android:angle="-90"
|
||||
android:endColor="#2F3047"
|
||||
android:startColor="#3F4057"
|
||||
android:type="linear" />-->
|
||||
</shape>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<resources>
|
||||
<dimen name="module_push_panel_corner">16px</dimen>
|
||||
<dimen name="module_push_panel_item_corner">12px</dimen>
|
||||
</resources>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<resources>
|
||||
<dimen name="module_push_panel_corner">16px</dimen>
|
||||
<dimen name="module_push_panel_item_corner">12px</dimen>
|
||||
</resources>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<resources>
|
||||
<dimen name="module_push_panel_corner">29px</dimen>
|
||||
<dimen name="module_push_panel_item_corner">22px</dimen>
|
||||
</resources>
|
||||
@@ -1,3 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="module_push_panel_title_textColor_light">#333333</color>
|
||||
<color name="module_push_item_content_textColor_light">#666666</color>
|
||||
<color name="module_push_item_time_textColor_light">#666666</color>
|
||||
</resources>
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<resources>
|
||||
<dimen name="module_push_panel_corner">16px</dimen>
|
||||
<dimen name="module_push_panel_item_corner">12px</dimen>
|
||||
</resources>
|
||||
|
After Width: | Height: | Size: 3.4 KiB |