This commit is contained in:
unknown
2020-03-14 14:34:46 +08:00
105 changed files with 335 additions and 3143 deletions

View File

@@ -12,8 +12,8 @@
android:resumeWhilePausing="true"
android:screenOrientation="landscape"
android:stateNotNeeded="true"
android:theme="@style/Main"
android:taskAffinity=""
android:theme="@style/Main"
android:windowSoftInputMode="adjustPan">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@@ -23,6 +23,15 @@
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<data
android:host="launcher"
android:path="/main/switch2"
android:scheme="mogo" />
<category android:name="android.intent.category.DEFAULT" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
</application>
</manifest>

View File

@@ -314,7 +314,6 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
@Override
public boolean onMarkerClicked( IMogoMarker marker ) {
switch2Card( marker.getOwner(), false );
if ( mMogoModuleHandler != null ) {
mMogoModuleHandler.onMarkerClicked( marker );
}
@@ -367,6 +366,12 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
}
}
@Override
protected void onNewIntent( Intent intent ) {
super.onNewIntent( intent );
mPresenter.handleSchemeIntent( intent );
}
@Override
protected void onDestroy() {
super.onDestroy();

View File

@@ -1,5 +1,7 @@
package com.mogo.module.main;
import android.content.Intent;
import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
@@ -71,7 +73,7 @@ public class MainPresenter extends Presenter< MainView > {
if ( TextUtils.isEmpty( cardInfo.mCardName ) ) {
return;
}
mView.switch2Card( cardInfo.mCardName, true );
mView.switch2Card( cardInfo.mCardName, cardInfo.mLockCar );
} );
mAnalytics = ( IMogoAnalytics ) ARouter.getInstance().build( MogoServicePaths.PATH_UTILS_ANALYTICS ).navigation( getContext() );
mCardStartShowTime = System.currentTimeMillis();
@@ -136,4 +138,16 @@ public class MainPresenter extends Presenter< MainView > {
msg.what = MainConstants.MSG_LOAD_MODULES;
mMsgHandler.sendMessageDelayed( msg, 100 );
}
public void handleSchemeIntent( Intent intent ) {
if ( intent == null || intent.getData() == null ) {
return;
}
Uri target = intent.getData();
switch ( target.getPath() ) {
case "/main/switch2":
mView.switch2Card( target.getQueryParameter( "type" ), true );
break;
}
}
}

View File

@@ -1946,14 +1946,14 @@ public class OrientedViewPager extends ViewGroup {
Log.v(TAG, "Moved x to " + x + "," + y + " diff=" + xDiff + "," + yDiff);
}
if (dx != 0 && !isGutterDrag(mLastMotionX, dx) &&
canScroll(this, false, (int) dx, (int) x, (int) y)) {
// Nested view has scrollable area under this point. Let it be handled there.
mLastMotionX = x;
mLastMotionY = y;
mIsUnableToDrag = true;
return false;
}
//if (dx != 0 && !isGutterDrag(mLastMotionX, dx) &&
// canScroll(this, false, (int) dx, (int) x, (int) y)) {
// // Nested view has scrollable area under this point. Let it be handled there.
// mLastMotionX = x;
// mLastMotionY = y;
// mIsUnableToDrag = true;
// return false;
//}
if (xDiff > mTouchSlop && xDiff * 0.5f > yDiff) {
if (DEBUG) Log.v(TAG, "Starting drag!");
mIsBeingDragged = true;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -46,7 +46,7 @@
android:layout_width="match_parent"
android:layout_marginLeft="@dimen/dp_30"
android:layout_marginRight="@dimen/dp_30"
android:layout_height="@dimen/dp_600"
android:layout_height="@dimen/cards_container_dp_600"
android:clipToPadding="false"
android:overScrollMode="never" />
@@ -62,7 +62,7 @@
android:id="@+id/module_main_id_card_cover_up_bottom"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_26"
android:layout_marginTop="@dimen/dp_600"
android:layout_marginTop="@dimen/cards_container_dp_600"
android:layout_marginLeft="@dimen/dp_64"
android:layout_marginRight="@dimen/dp_64"
android:background="@drawable/module_main_card_cover_up_bottom"

View File

@@ -12,4 +12,7 @@
<dimen name="module_main_card_card_shadow_height_div">10px</dimen>
<dimen name="module_main_top_shadow_height">144px</dimen>
<dimen name="module_main_card_cover_up_margin">352px</dimen>
<dimen name="cards_container_dp_600">320px</dimen>
</resources>

View File

@@ -12,4 +12,6 @@
<dimen name="module_main_card_card_shadow_height_div">15px</dimen>
<dimen name="module_main_top_shadow_height">270px</dimen>
<dimen name="module_main_card_cover_up_margin">660px</dimen>
<dimen name="cards_container_dp_600">600px</dimen>
</resources>