Merge remote-tracking branch 'origin/qa' into qa

This commit is contained in:
董宏宇
2020-06-29 15:48:47 +08:00
7 changed files with 57 additions and 11 deletions

View File

@@ -80,6 +80,11 @@ public class AppsPresenter extends Presenter< AppsView > {
Logger.d( TAG, "apps: %s", appInfoList );
final Map< Integer, List< AppInfo > > result = addOthersEntrances( appInfoList );
try {
filterSamePackage( result );
} catch ( Exception e ) {
Logger.e( TAG, e, "error." );
}
UiThreadHandler.post( () -> {
if ( mView != null ) {
mView.renderApps( result );
@@ -143,7 +148,7 @@ public class AppsPresenter extends Presenter< AppsView > {
}
}
}
// growthCapacity( result );
// growthCapacity( result )
// // 添加介绍入口
// result.get( result.size() - 1 ).add( new AppInfo( GuideShowLauncher.APP_INFO_NAME_GUIDE_SHOW, getContext().getPackageName(), null, 0, null, R.drawable.module_apps_ic_guide_show ) );
if ( DebugConfig.isDebug() ) {
@@ -154,6 +159,30 @@ public class AppsPresenter extends Presenter< AppsView > {
return result;
}
private void filterSamePackage( Map< Integer, List< AppInfo > > appInfoMap ) {
if ( appInfoMap == null || appInfoMap.isEmpty() ) {
return;
}
for ( Map.Entry< Integer, List< AppInfo > > integerListEntry : appInfoMap.entrySet() ) {
if ( integerListEntry == null ) {
continue;
}
List< AppInfo > oldList = integerListEntry.getValue();
if ( oldList == null
|| oldList.size() > AppsConst.TOTAL_SIZE_EACH_PAGE ) {
return;
}
List< AppInfo > appInfos = new ArrayList<>();
for ( AppInfo appInfo : oldList ) {
if ( appInfos.contains( appInfo ) ) {
continue;
}
appInfos.add( appInfo );
}
integerListEntry.setValue( appInfos );
}
}
/**
* 扩容
*

View File

@@ -1,6 +1,9 @@
package com.mogo.module.apps.model;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import java.util.Objects;
/**
* @author congtaowang
@@ -29,7 +32,7 @@ public class AppInfo {
}
public AppInfo( String mName, String mPackageName, String mVersionName, int mVersionCode, Drawable mIcon, int mIconResId ) {
this(mName, mPackageName, mVersionName, mVersionCode, mIcon, mIconResId, 0);
this( mName, mPackageName, mVersionName, mVersionCode, mIcon, mIconResId, 0 );
}
public int getIconResId() {
@@ -60,6 +63,19 @@ public class AppInfo {
return mTrackType;
}
@Override
public boolean equals( Object o ) {
if ( this == o ) return true;
if ( o == null || getClass() != o.getClass() ) return false;
AppInfo appInfo = ( AppInfo ) o;
return TextUtils.equals( mPackageName, appInfo.mPackageName );
}
@Override
public int hashCode() {
return Objects.hash( mPackageName );
}
@Override
public String toString() {
return "AppInfo{" +

View File

@@ -56,6 +56,7 @@ public class AppsModel {
if ( mPagedApps != null ) {
mPagedApps.clear();
}
mPagedApps = null;
mContext = null;
mAppFilter = null;
sInstance = null;

View File

@@ -17,11 +17,11 @@
<ImageView
android:id="@+id/ivIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="@dimen/module_service_marker_bubble_icon_width"
android:layout_height="@dimen/module_service_marker_bubble_icon_height"
android:layout_gravity="center"
android:layout_marginBottom="@dimen/module_service_marker_bubble_icon_marginBottom"
tools:src="@drawable/icon_map_marker_road_block_up" />
tools:src="@drawable/icon_map_marker_road_block_up2" />
</FrameLayout>

View File

@@ -32,8 +32,8 @@
<ImageView
android:id="@+id/ivIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="@dimen/module_service_marker_bubble_icon_width"
android:layout_height="@dimen/module_service_marker_bubble_icon_height"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/dp_15"
android:visibility="invisible"

View File

@@ -4,8 +4,8 @@
<dimen name="module_service_marker_dot_marginTop">8dp</dimen>
<dimen name="module_service_marker_bubble_width">100px</dimen>
<dimen name="module_service_marker_bubble_height">117px</dimen>
<dimen name="module_service_marker_bubble_icon_width">50px</dimen>
<dimen name="module_service_marker_bubble_icon_height">50px</dimen>
<dimen name="module_service_marker_bubble_icon_width">60px</dimen>
<dimen name="module_service_marker_bubble_icon_height">60px</dimen>
<dimen name="module_service_marker_bubble_icon_marginBottom">8px</dimen>
<!-- 导航查看全程显示范围-->

View File

@@ -4,8 +4,8 @@
<dimen name="module_service_marker_dot_marginTop">4dp</dimen>
<dimen name="module_service_marker_bubble_width">56px</dimen>
<dimen name="module_service_marker_bubble_height">65px</dimen>
<dimen name="module_service_marker_bubble_icon_width">27px</dimen>
<dimen name="module_service_marker_bubble_icon_height">27px</dimen>
<dimen name="module_service_marker_bubble_icon_width">35px</dimen>
<dimen name="module_service_marker_bubble_icon_height">35px</dimen>
<dimen name="module_service_marker_bubble_icon_marginBottom">4px</dimen>
<dimen name="module_service_marker_bounds_leftMargin">550px</dimen>