diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/bean/ShareBean.java b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/bean/ShareBean.java new file mode 100644 index 0000000000000000000000000000000000000000..89c6680d50bebd014946046acaf15270ccff1aa6 --- /dev/null +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/bean/ShareBean.java @@ -0,0 +1,46 @@ +package com.mindspore.himindspore.bean; + +public class ShareBean { + private String title; + private String url; + + public ShareBean(ShareBean.Builder builder) { + this.title = builder.title; + this.url = builder.url; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public static class Builder { + String title; + String url; + + public ShareBean.Builder title(String title) { + this.title = title; + return this; + } + + public ShareBean.Builder url(String url) { + this.url = url; + return this; + } + + public ShareBean build() { + return new ShareBean(this); + } + } +} diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/comment/Tools.java b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/comment/Tools.java new file mode 100644 index 0000000000000000000000000000000000000000..80d9a964eec683767a2b16b249aa538706a7b95c --- /dev/null +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/comment/Tools.java @@ -0,0 +1,19 @@ +package com.mindspore.himindspore.comment; + +import android.content.Context; +import android.content.Intent; + +import com.mindspore.himindspore.R; +import com.mindspore.himindspore.bean.ShareBean; + +public class Tools { + public static void onClickShare(Context context, ShareBean shareBean) { + Intent share_intent = new Intent(); + share_intent.setAction(Intent.ACTION_SEND); + share_intent.setType("text/plain"); + share_intent.putExtra(Intent.EXTRA_SUBJECT, context.getString(R.string.title_share)); + share_intent.putExtra(Intent.EXTRA_TEXT, shareBean.getTitle() +"\n"+ shareBean.getUrl()); + share_intent = Intent.createChooser(share_intent, context.getString(R.string.title_share)); + context.startActivity(share_intent); + } +} diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/courses/CoursesMainFragment.java b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/courses/CoursesMainFragment.java index ed8006b8aa93e28f352b374a5d98633fddd4a350..e031b1abb9d13dfe6765fa422d67edda806a74c5 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/courses/CoursesMainFragment.java +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/courses/CoursesMainFragment.java @@ -29,13 +29,13 @@ public class CoursesMainFragment extends Fragment { private static final String TAG = CoursesMainFragment.class.getSimpleName(); - private final static int[] tabs = { +/* private final static int[] tabs = { R.string.course_introductory_title, R.string.course_advanced_title, - R.string.course_expert_title}; + R.string.course_expert_title};*/ -// private final static int[] tabs = {R.string.course_ai_title_title, -// R.string.course_introductory_title, R.string.course_advanced_title, -// R.string.course_expert_title}; + private final static int[] tabs = {R.string.course_ai_title_title, + R.string.course_introductory_title, R.string.course_advanced_title, + R.string.course_expert_title}; private TabLayout tabLayout; private ViewPager viewPager; @@ -82,7 +82,7 @@ public class CoursesMainFragment extends Fragment { private void initViewPager() { List fragments = new ArrayList<>(); -// fragments.add(new CourseMapFragment()); + fragments.add(new CourseMapFragment()); fragments.add(new CoursesFragment(Constant.COURSES_INTRODUCTORY)); fragments.add(new CoursesFragment(Constant.COURSES_ADVANCED)); fragments.add(new CoursesFragment(Constant.COURSES_EXPERT)); diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/lessons/LessonsActivity.java b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/lessons/LessonsActivity.java index 88a94273e1719304b682d2315357c5e6d8fc76c3..38c7ba1cb5552e9fe88ca168ab1de3fbecf48bb4 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/lessons/LessonsActivity.java +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/lessons/LessonsActivity.java @@ -19,8 +19,11 @@ import com.mindspore.common.base.bean.BaseResponseBean; import com.mindspore.common.base.mvp.BaseActivity; import com.mindspore.common.exception.ErrorStatus; import com.mindspore.common.netbean.response.CourseDetailsBean; +import com.mindspore.common.utils.Utils; import com.mindspore.customview.ui.MyToast; import com.mindspore.himindspore.R; +import com.mindspore.himindspore.bean.ShareBean; +import com.mindspore.himindspore.comment.Tools; import com.mindspore.himindspore.ui.courses.mvp.CourseContract; import com.mindspore.himindspore.ui.courses.mvp.CourseDetailsPresenter; import com.mindspore.himindspore.ui.lessons.event.CurrentVideoChangedEvent; @@ -192,7 +195,7 @@ public class LessonsActivity extends BaseActivity implem @Override public void onPlayError(String url, Object... objects) { super.onPlayError(url, objects); - Log.e("AAA","onPlayError>>>"+objects.toString()); + Log.e("AAA", "onPlayError>>>" + objects.toString()); } @Override @@ -367,9 +370,19 @@ public class LessonsActivity extends BaseActivity implem switch (view.getId()) { case R.id.bullet_chat_layout: case R.id.store_layout: - case R.id.forward_layout: MyToast.FunctionNoOpen(); break; + case R.id.forward_layout: + if (data == null) { + MyToast.MakeText(getResources().getString(R.string.on_share_data), 1000); + } else { + Tools.onClickShare(this, + new ShareBean.Builder() + .title(data.getTitle()) + .url(data.getContent()) + .build()); + } + break; } } diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/activity_set_up_layout.xml b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/activity_set_up_layout.xml index 9debfdf266a335595a481cc8268fb45e5052650e..6eb1c627c29a5a5833124fd27464dcdc2504ec65 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/activity_set_up_layout.xml +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/activity_set_up_layout.xml @@ -23,7 +23,7 @@ android:id="@+id/account_number" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginTop="@dimen/spaceVerticalNoramlSize" + android:layout_marginTop="@dimen/spaceVerticalNormalSize" app:leftTextView="@string/set_up_account" app:rightImageView="@drawable/me_go" app:textLongLine="true" /> @@ -39,7 +39,7 @@ android:id="@+id/user_view" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginTop="@dimen/spaceVerticalNoramlSize" + android:layout_marginTop="@dimen/spaceVerticalNormalSize" app:leftTextView="@string/set_up_user_agreement" app:rightImageView="@drawable/me_go" app:textLongLine="true" /> @@ -55,7 +55,7 @@ android:id="@+id/sign_out_view" android:layout_width="match_parent" android:layout_height="40dp" - android:layout_marginTop="@dimen/spaceVerticalNoramlSize" + android:layout_marginTop="@dimen/spaceVerticalNormalSize" android:background="@color/white" style="@style/TextBlackTitle" android:gravity="center" diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/adapter_component_hor_view.xml b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/adapter_component_hor_view.xml index d614ed9173ad882d2b6c4819e854b216bb98558a..e6ea814cf06ca42956738288a626791e95ba52b6 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/adapter_component_hor_view.xml +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/adapter_component_hor_view.xml @@ -17,6 +17,6 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/component_title" - android:layout_marginTop="@dimen/spaceVerticalNoramlSize" /> + android:layout_marginTop="@dimen/spaceVerticalNormalSize" /> \ No newline at end of file diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/adapter_component_item.xml b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/adapter_component_item.xml index 658b9fd4fd265cfbb3fdd34829f666799e75f064..3cfbdfb7dcb70528fe2e4a044eb27085dc41438d 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/adapter_component_item.xml +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/adapter_component_item.xml @@ -31,7 +31,7 @@ android:maxLines="2" android:layout_height="wrap_content" android:layout_marginHorizontal="@dimen/spaceHorizontalSmallSize" - android:layout_marginTop="@dimen/spaceVerticalNoramlSize" + android:layout_marginTop="@dimen/spaceVerticalNormalSize" android:text="组件名称" /> diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/adapter_content_detail_top.xml b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/adapter_content_detail_top.xml index 1bf4ce765268c0b76b974f24f67c8274f4f7a6fd..145f0993f6890851ddb649d24eec04eb7271d719 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/adapter_content_detail_top.xml +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/adapter_content_detail_top.xml @@ -10,7 +10,7 @@ android:id="@+id/content_pic" android:layout_width="@dimen/iconDefaultImageSize" android:layout_height="@dimen/iconDefaultImageSize" - android:layout_marginVertical="@dimen/spaceVerticalNoramlSize" + android:layout_marginVertical="@dimen/spaceVerticalNormalSize" android:layout_marginStart="@dimen/spaceHorizontalSize" android:src="@drawable/icon_avatar_default" app:civ_border_color="@color/colorMSPrimary" diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/adapter_course_list_item.xml b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/adapter_course_list_item.xml index 2d2e90c8a434fecd1a48dbab446abd2884de4801..b9f922c74e9ac9041d622151e4dd262e480d9007 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/adapter_course_list_item.xml +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/adapter_course_list_item.xml @@ -6,7 +6,7 @@ android:layout_height="wrap_content" android:layout_marginTop="@dimen/itemVerticalSize" android:paddingHorizontal="@dimen/spaceHorizontalSize" - android:paddingVertical="@dimen/spaceVerticalNoramlSize" + android:paddingVertical="@dimen/spaceVerticalNormalSize" android:background="@color/white"> diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/adapter_lessons_catalogue_list_item.xml b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/adapter_lessons_catalogue_list_item.xml index 33e172a0699fb70c7675fe1b0ba98286702b1723..55580cbd9b79cffecc012fa426ca636687d45eb9 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/adapter_lessons_catalogue_list_item.xml +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/adapter_lessons_catalogue_list_item.xml @@ -6,7 +6,7 @@ android:layout_height="wrap_content" android:layout_marginTop="1dp" android:paddingHorizontal="@dimen/spaceHorizontalSize" - android:paddingTop="@dimen/spaceVerticalNoramlSize" + android:paddingTop="@dimen/spaceVerticalNormalSize" android:background="@color/white"> + android:paddingVertical="@dimen/spaceVerticalNormalSize"> @@ -221,7 +221,7 @@ android:id="@+id/publisher_portrait_iv" android:layout_width="@dimen/iconDefaultImageSize" android:layout_height="@dimen/iconDefaultImageSize" - android:layout_marginTop="@dimen/spaceVerticalNoramlSize" + android:layout_marginTop="@dimen/spaceVerticalNormalSize" android:src="@drawable/icon_avatar_default" app:civ_border_color="@color/colorMSPrimary" app:civ_border_width="0.5dp" diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/adapter_server_info_layout.xml b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/adapter_server_info_layout.xml index 53575b31b84e685415b2ae5f8644bf6f5fe0f4ff..34d92d5869e466b82d92ac85b55e354c7cd68a86 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/adapter_server_info_layout.xml +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/adapter_server_info_layout.xml @@ -5,7 +5,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_marginStart="14dp" android:layout_marginEnd="14dp" - android:layout_marginBottom="18dp" + android:layout_marginTop="@dimen/spaceVerticalBigSize" android:orientation="vertical"> \ No newline at end of file diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/adapter_trend_layout.xml b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/adapter_trend_layout.xml index 7d27bd9a9c8a3d9e4190f1925fd89d7633dec71e..edaf097466e17c01864f9fdcc3bf7a475f770871 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/adapter_trend_layout.xml +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/adapter_trend_layout.xml @@ -7,7 +7,7 @@ android:layout_marginTop="@dimen/itemVerticalSize" android:background="@color/white" android:paddingHorizontal="@dimen/spaceHorizontalSize" - android:paddingVertical="@dimen/spaceVerticalNoramlSize" + android:paddingVertical="@dimen/spaceVerticalNormalSize" tools:ignore="ResAuto"> @@ -35,19 +35,19 @@ android:id="@+id/per_recommend" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="@dimen/spaceVerticalBigSize" + android:layout_marginTop="@dimen/spaceVerticalHugeSize" style="@style/TextBlodBlackBigTitle" android:text="@string/per_recommend" /> + android:layout_height="wrap_content" /> diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/layout_more_service.xml b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/layout_more_service.xml index a5d0f6be3933d346616797b3c717ae89a6cf069b..91a548a7174db2f5210dce71a65da1aa97715c7a 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/layout_more_service.xml +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/layout_more_service.xml @@ -9,16 +9,17 @@ + android:text="@string/per_more_service" /> diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/layout_personal_user_name.xml b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/layout_personal_user_name.xml index 876f28d24937d23d5a24cd1426184d55c81de0a7..907bad90578a1097637518131bd441b25e0c3ef3 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/layout_personal_user_name.xml +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/layout_personal_user_name.xml @@ -12,11 +12,13 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent"> - @@ -58,6 +60,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/per_space" /> + 个性签名 历史观看课程 该功能暂未开放 + 没有可分享的数据 再按一次退出 \ No newline at end of file diff --git a/model_zoo/official/lite/MindSpore_inhand/common/src/main/res/values/dimens.xml b/model_zoo/official/lite/MindSpore_inhand/common/src/main/res/values/dimens.xml index 05b0785840c0646ebf21bf63207dd3bed9c08eb5..0c45cf8bfb93464b58a2633baa79f5803f8f7894 100644 --- a/model_zoo/official/lite/MindSpore_inhand/common/src/main/res/values/dimens.xml +++ b/model_zoo/official/lite/MindSpore_inhand/common/src/main/res/values/dimens.xml @@ -11,9 +11,9 @@ 15dp 10dp - 35dp + 20dp 15dp - 10dp + 10dp 5dp 5dp diff --git a/model_zoo/official/lite/MindSpore_inhand/customView/src/main/java/com/mindspore/customview/ui/TopImageBottomTextView.java b/model_zoo/official/lite/MindSpore_inhand/customView/src/main/java/com/mindspore/customview/ui/TopImageBottomTextView.java index c3e33025e1544228941e2cd7e2a447226c489a83..c8dc70e6f8303acf48633a3559ac406a63a9d679 100644 --- a/model_zoo/official/lite/MindSpore_inhand/customView/src/main/java/com/mindspore/customview/ui/TopImageBottomTextView.java +++ b/model_zoo/official/lite/MindSpore_inhand/customView/src/main/java/com/mindspore/customview/ui/TopImageBottomTextView.java @@ -19,6 +19,8 @@ import android.content.Context; import android.content.res.TypedArray; import android.graphics.drawable.Drawable; import android.util.AttributeSet; +import android.util.Log; +import android.util.TypedValue; import android.view.LayoutInflater; import android.view.View; import android.widget.ImageView; @@ -60,7 +62,7 @@ public class TopImageBottomTextView extends LinearLayout { imageMarginTop = typedArray.getDimension(R.styleable.TopImageBottomTextView_imageMarginTop, DisplayUtil.dp2px(context, 0)); imageMarginRight = typedArray.getDimension(R.styleable.TopImageBottomTextView_imageMarginRight, DisplayUtil.dp2px(context, 0)); imageMarginBottom = typedArray.getDimension(R.styleable.TopImageBottomTextView_imageMarginBottom, DisplayUtil.dp2px(context, 0)); - textSize = typedArray.getDimension(R.styleable.TopImageBottomTextView_textSize, 13); + textSize = typedArray.getDimensionPixelSize(R.styleable.TopImageBottomTextView_textSize, 12); typedArray.recycle(); } @@ -75,7 +77,7 @@ public class TopImageBottomTextView extends LinearLayout { textBottom.setText(bottomText); iconImage.getLayoutParams().width = (int) imageViewWidth; iconImage.getLayoutParams().height = (int) imageViewHeight; - textBottom.setTextSize(textSize); + textBottom.setTextSize(TypedValue.COMPLEX_UNIT_PX,textSize); MarginLayoutParams margin = new MarginLayoutParams( iconImage.getLayoutParams()); margin.setMargins((int) imageMarginLeft, (int) imageMarginTop, (int) imageMarginRight, (int) imageMarginBottom);