diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/AndroidManifest.xml b/model_zoo/official/lite/MindSpore_inhand/app/src/main/AndroidManifest.xml index 906bb33a3a9f957e10e3e4d092c2982e74913566..3af3cf451137102ab403cdcea2dd8bf5117436db 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/AndroidManifest.xml +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/AndroidManifest.xml @@ -24,6 +24,22 @@ android:theme="@style/AppTheme" android:usesCleartextTraffic="true" tools:replace="android:label"> + + + + implements Ca smartRefreshLayout = view.findViewById(R.id.refreshLayout); multipleStatusView = view.findViewById(R.id.multipleStatusView); mRecyclerView = view.findViewById(R.id.recyclerView); - mFrameLayout = view.findViewById(R.id.trend_layout); + mFrameLayout = view.findViewById(R.id.fragmentRefreshLayout); initView(); } private void initView() { + mFrameLayout.setBackgroundColor(getContext().getResources().getColor(R.color.portal_layout_gray_bg)); smartRefreshLayout.setEnableRefresh(true); smartRefreshLayout.setEnableLoadMore(true); smartRefreshLayout.setEnableHeaderTranslationContent(true); diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/gateway/TrendFragment.java b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/gateway/TrendFragment.java index 23e55c25ae85a54f3d0ae3542c4b009965b5f6b1..284a5404ff9b909ba7b716a17009b5b82e50a480 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/gateway/TrendFragment.java +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/gateway/TrendFragment.java @@ -16,6 +16,7 @@ package com.mindspore.himindspore.ui.gateway; import android.content.Context; +import android.graphics.Color; import android.graphics.drawable.BitmapDrawable; import android.os.Bundle; import android.util.DisplayMetrics; @@ -54,6 +55,8 @@ import org.jetbrains.annotations.NotNull; import java.util.ArrayList; import java.util.List; +import static com.mindspore.himindspore.R.color.*; + /** * A simple {@link Fragment} subclass. * Use the {@link TrendFragment#newInstance} factory method to @@ -110,11 +113,12 @@ public class TrendFragment extends BaseFragment implements T smartRefreshLayout = view.findViewById(R.id.refreshLayout); multipleStatusView = view.findViewById(R.id.multipleStatusView); mRecyclerView = view.findViewById(R.id.recyclerView); - mFrameLayout = view.findViewById(R.id.trend_layout); + mFrameLayout = view.findViewById(R.id.fragmentRefreshLayout); initView(); } private void initView() { + mFrameLayout.setBackgroundColor(getContext().getResources().getColor(R.color.portal_layout_gray_bg)); smartRefreshLayout.setEnableRefresh(true); smartRefreshLayout.setEnableLoadMore(true); smartRefreshLayout.setEnableHeaderTranslationContent(true); @@ -138,7 +142,7 @@ public class TrendFragment extends BaseFragment implements T } }); - smartRefreshLayout.setPrimaryColorsId(R.color.gray_divider, R.color.purple_200); + smartRefreshLayout.setPrimaryColorsId(gray_divider, purple_200); trendAdapter = new TrendAdapter(getContext(), mList); LinearLayoutManager manager = new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false); mRecyclerView.setLayoutManager(manager); diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/guide/SplashActivity.java b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/guide/SplashActivity.java index a0a3edb322e0491f31bff7d51b7528e0803f35d2..99e1cd738b20f37b8b514ee60b7627372db44e04 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/guide/SplashActivity.java +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/guide/SplashActivity.java @@ -195,9 +195,7 @@ public class SplashActivity extends BaseActivity implements EasyPermissions.Perm private void showPrivacy() { mContentView = LayoutInflater.from(SplashActivity.this).inflate(R.layout.layout_popup_user, null, false); -// mPopupW = new PopupWindow(mContentView, (int) (getWindowManager().getDefaultDisplay().getWidth() * 0.8), (int) (getWindowManager().getDefaultDisplay() -// .getHeight() * 0.8), false); - mPopupW = new PopupWindow(mContentView, (int) (getWindowManager().getDefaultDisplay().getWidth() * 0.8), WindowManager.LayoutParams.WRAP_CONTENT, false); + mPopupW = new PopupWindow(mContentView, getResources().getDisplayMetrics().widthPixels * 8 / 10, WindowManager.LayoutParams.WRAP_CONTENT, false); mPopupW.showAtLocation(getWindow().getDecorView(), Gravity.CENTER, 0, 0); mPopupW.setContentView(mContentView); mPopupW.setTouchable(true); diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/CacheActivity.java b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/CacheActivity.java index 193924803d77182bc45ee18dd0be04003c530512..db8932bd90ac5337fc45d2b379e2063a875c2b70 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/CacheActivity.java +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/CacheActivity.java @@ -18,7 +18,6 @@ package com.mindspore.himindspore.ui.me; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; -import android.view.View; import com.mindspore.customview.ui.AppTitleView; import com.mindspore.himindspore.R; @@ -30,12 +29,13 @@ public class CacheActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.activity_cache); + setContentView(R.layout.activity_refresh_layout_title); init(); } private void init() { - appTitle = findViewById(R.id.cache_app_title); - appTitle.setNavigationOnClickListener(view -> finish()); + appTitle = findViewById(R.id.refreshLayoutTitle); + appTitle.setTitleThreeImage(R.drawable.cache_edit); + appTitle.setTitleTextName(getResources().getString(R.string.per_cache)); } } \ No newline at end of file diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/MyBuddyActivity.java b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/MyBuddyActivity.java new file mode 100644 index 0000000000000000000000000000000000000000..7e5744c0de833ff6c6f88944a10606acd3151bc0 --- /dev/null +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/MyBuddyActivity.java @@ -0,0 +1,16 @@ +package com.mindspore.himindspore.ui.me; + +import androidx.appcompat.app.AppCompatActivity; + +import android.os.Bundle; + +import com.mindspore.himindspore.R; + +public class MyBuddyActivity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_buddy_layout); + } +} \ No newline at end of file diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/MyCoursesActivity.java b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/MyCoursesActivity.java new file mode 100644 index 0000000000000000000000000000000000000000..d86ab9cfbf61530d97e0bcdb61f70e951b1d572e --- /dev/null +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/MyCoursesActivity.java @@ -0,0 +1,25 @@ +package com.mindspore.himindspore.ui.me; + +import androidx.appcompat.app.AppCompatActivity; + +import android.os.Bundle; + +import com.mindspore.customview.ui.AppTitleView; +import com.mindspore.himindspore.R; + +public class MyCoursesActivity extends AppCompatActivity { + + private AppTitleView appTitle; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_refresh_layout_title); + init(); + } + + private void init(){ + appTitle = findViewById(R.id.refreshLayoutTitle); + appTitle.setTitleTextName(getResources().getString(R.string.per_curriculum)); + } +} \ No newline at end of file diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/MyQRCodeActivity.java b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/MyQRCodeActivity.java index 3deaafc3ab232d027cbd40a44460df85e33a7613..471ac5d1ed951f58dfc74dfb2a51a4a12bc096b4 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/MyQRCodeActivity.java +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/MyQRCodeActivity.java @@ -43,7 +43,6 @@ public class MyQRCodeActivity extends AppCompatActivity { private void init() { appTitle = findViewById(R.id.segmentation_toolbar); - appTitle.setNavigationOnClickListener(view -> finish()); mMy_layout = (RelativeLayout) findViewById(R.id.my_relativelayout); mQr_code_image = findViewById(R.id.img_origin); setOnClickMore(); diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/PersonalActivity.java b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/PersonalActivity.java index d5c35457fd1a2c5353328222c69b9cbf7b82f42a..34561ed2754bebfc0a287b4edfe37a7dafe1ea51 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/PersonalActivity.java +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/PersonalActivity.java @@ -21,10 +21,12 @@ import android.content.Intent; import android.os.Bundle; import android.view.View; +import com.mindspore.common.config.MSLinkUtils; import com.mindspore.customview.ui.TopImageBottomTextView; import com.mindspore.himindspore.R; +import com.mindspore.himindspore.ui.webview.WebViewUtilsActivity; -public class PersonalActivity extends AppCompatActivity { +public class PersonalActivity extends AppCompatActivity implements View.OnClickListener { private TopImageBottomTextView mCurriculum; @@ -32,7 +34,45 @@ public class PersonalActivity extends AppCompatActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_personal); - findViewById(R.id.per_set_up).setOnClickListener(view -> startActivity(new Intent(PersonalActivity.this, SetActivity.class))); - findViewById(R.id.per_cache_view).setOnClickListener(view -> startActivity(new Intent(PersonalActivity.this, CacheActivity.class))); + findViewById(R.id.per_set_up).setOnClickListener(this); + findViewById(R.id.per_cache_view).setOnClickListener(this); + findViewById(R.id.per_curriculum_view).setOnClickListener(this); + findViewById(R.id.rewarded_tasks_layout).setOnClickListener(this); + findViewById(R.id.per_user_layout).setOnClickListener(this); + findViewById(R.id.per_gitee_view).setOnClickListener(this); + findViewById(R.id.per_official_view).setOnClickListener(this); + findViewById(R.id.per_award_view).setOnClickListener(this); + } + + @Override + public void onClick(View view) { + switch (view.getId()) { + case R.id.per_set_up: + startActivity(new Intent(PersonalActivity.this, SetActivity.class)); + break; + case R.id.per_cache_view: + startActivity(new Intent(PersonalActivity.this, CacheActivity.class)); + break; + case R.id.per_curriculum_view: + startActivity(new Intent(PersonalActivity.this, MyCoursesActivity.class)); + break; + case R.id.rewarded_tasks_layout: + startActivity(new Intent(PersonalActivity.this, TasksActivity.class)); + break; + case R.id.per_user_layout: + startActivity(new Intent(PersonalActivity.this, SpaceActivity.class)); + break; + case R.id.per_award_view: + startActivity(new Intent(PersonalActivity.this, WebViewUtilsActivity.class).putExtra(MSLinkUtils.INTENT_WEB_VIEW, MSLinkUtils.ME_HELP_URL)); + break; + case R.id.per_gitee_view: + startActivity(new Intent(PersonalActivity.this, WebViewUtilsActivity.class).putExtra(MSLinkUtils.INTENT_WEB_VIEW, MSLinkUtils.ME_CODE_URL)); + break; + case R.id.per_official_view: + startActivity(new Intent(PersonalActivity.this, WebViewUtilsActivity.class).putExtra(MSLinkUtils.INTENT_WEB_VIEW, MSLinkUtils.BASE_URL)); + break; + default: + break; + } } } \ No newline at end of file diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/SetActivity.java b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/SetActivity.java index 101509929bae2cc334e04303f4617ab6a9721338..67760afed467c7bd68bed020f0fe4c8d91b5bc7d 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/SetActivity.java +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/SetActivity.java @@ -18,21 +18,15 @@ package com.mindspore.himindspore.ui.me; import androidx.appcompat.app.AppCompatActivity; import android.app.AlertDialog; -import android.app.Dialog; -import android.content.DialogInterface; import android.os.Bundle; import android.util.Log; -import android.view.Display; import android.view.Gravity; -import android.view.LayoutInflater; import android.view.View; import android.view.WindowManager; import android.widget.TextView; -import android.widget.ToggleButton; -import com.mindspore.customview.ui.AppTitleView; +import com.mindspore.common.utils.ScreenUtils; import com.mindspore.himindspore.R; -import com.mindspore.himindspore.ui.main.MainActivity; public class SetActivity extends AppCompatActivity { @@ -49,8 +43,6 @@ public class SetActivity extends AppCompatActivity { } private void init() { - AppTitleView setTitle = findViewById(R.id.setup_title); - setTitle.setNavigationOnClickListener(view -> finish()); mSignOut = findViewById(R.id.sign_out_view); mSignOut.setOnClickListener(view -> signOutDialog()); } @@ -60,14 +52,13 @@ public class SetActivity extends AppCompatActivity { final View view = getLayoutInflater().inflate(R.layout.layout_signout_dialog, null); dialog = builder.create(); dialog.show(); + dialog.getWindow().setBackgroundDrawableResource(R.drawable.set_dialog_bg); WindowManager.LayoutParams params = dialog.getWindow().getAttributes(); params.gravity = Gravity.TOP; - params.y = 714; - params.width = (int) (getWindowManager().getDefaultDisplay().getWidth() * 0.8); - params.height = (int) (getWindowManager().getDefaultDisplay() - .getHeight() * 0.24); + params.y = ScreenUtils.screenHeight(SetActivity.this) * 32 / 100; + params.width = ScreenUtils.screenWidth(SetActivity.this)* 7 / 10; + params.height = ScreenUtils.screenHeight(SetActivity.this) * 20 / 100; dialog.getWindow().setAttributes(params); - WindowManager.LayoutParams layoutParams = dialog.getWindow().getAttributes(); dialog.setContentView(view); dialog.setCancelable(false); view.findViewById(R.id.dialog_cancel).setOnClickListener(view1 -> { diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/SpaceActivity.java b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/SpaceActivity.java new file mode 100644 index 0000000000000000000000000000000000000000..7defd1dbebb2a9395aba2d54b1283e41248c6d64 --- /dev/null +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/SpaceActivity.java @@ -0,0 +1,78 @@ +package com.mindspore.himindspore.ui.me; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentPagerAdapter; +import androidx.viewpager.widget.ViewPager; + +import android.os.Bundle; +import android.util.Log; +import android.view.View; +import android.widget.TableLayout; + +import com.google.android.material.tabs.TabLayout; +import com.mindspore.common.base.adapter.BasePagerAdapter; +import com.mindspore.himindspore.R; +import com.mindspore.himindspore.ui.gateway.CaseFragment; +import com.mindspore.himindspore.ui.gateway.IntroduceFragment; +import com.mindspore.himindspore.ui.gateway.TrendFragment; +import com.mindspore.himindspore.ui.me.fragment.SpaceFavoritesFragment; +import com.mindspore.himindspore.ui.me.fragment.SpaceHomeFragment; + +import java.util.ArrayList; +import java.util.List; + +public class SpaceActivity extends AppCompatActivity { + + private TabLayout spaceTab; + private ViewPager spaceVp; + private final String TAG = SpaceActivity.class.getSimpleName(); + private final static int[] tabs = {R.string.space_home_page, R.string.space_favorites}; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_space); + spaceTab = findViewById(R.id.space_tab); + spaceVp = findViewById(R.id.space_vp); + initTabLayout(); + initViewPager(); + } + + private void initViewPager() { + + List fList = new ArrayList<>(); + fList.add(SpaceHomeFragment.newInstance()); + fList.add(SpaceFavoritesFragment.newInstance()); + + BasePagerAdapter adapter = new BasePagerAdapter(getSupportFragmentManager(), fList); + spaceVp.setAdapter(adapter); + spaceVp.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(spaceTab)); + spaceVp.setOffscreenPageLimit(2); + } + + private void initTabLayout() { + for (int i = 0; i < tabs.length; i++) { + spaceTab.addTab(spaceTab.newTab().setText(getResources().getString(tabs[i]))); + } + spaceTab.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { + @Override + public void onTabSelected(TabLayout.Tab tab) { + spaceVp.setCurrentItem(tab.getPosition(), true); + + } + + @Override + public void onTabUnselected(TabLayout.Tab tab) { + + } + + @Override + public void onTabReselected(TabLayout.Tab tab) { + + } + }); + } +} \ No newline at end of file diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/TasksActivity.java b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/TasksActivity.java new file mode 100644 index 0000000000000000000000000000000000000000..41301eeafedd39d151234d041158018f9f265cd6 --- /dev/null +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/TasksActivity.java @@ -0,0 +1,25 @@ +package com.mindspore.himindspore.ui.me; + +import androidx.appcompat.app.AppCompatActivity; + +import android.os.Bundle; + +import com.mindspore.customview.ui.AppTitleView; +import com.mindspore.himindspore.R; + +public class TasksActivity extends AppCompatActivity { + + private AppTitleView appTitle; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_refresh_layout_title); + init(); + } + + private void init(){ + appTitle = findViewById(R.id.refreshLayoutTitle); + appTitle.setTitleTextName(getResources().getString(R.string.per_rewarded_tasks)); + } +} \ No newline at end of file diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/fragment/SpaceFavoritesFragment.java b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/fragment/SpaceFavoritesFragment.java new file mode 100644 index 0000000000000000000000000000000000000000..a3db83c2c508b2779c72c23b4f24c2212ecc01c5 --- /dev/null +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/fragment/SpaceFavoritesFragment.java @@ -0,0 +1,38 @@ +package com.mindspore.himindspore.ui.me.fragment; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; + +import com.mindspore.himindspore.R; + +public class SpaceFavoritesFragment extends Fragment { + + public static SpaceFavoritesFragment newInstance() { + SpaceFavoritesFragment fragment = new SpaceFavoritesFragment(); + Bundle args = new Bundle(); + fragment.setArguments(args); + return fragment; + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + return inflater.inflate(R.layout.fragment_space_favorites, container, false); + } + + @Override + public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + initView(view); + } + + private void initView(View view) { + + } +} diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/fragment/SpaceHomeFragment.java b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/fragment/SpaceHomeFragment.java new file mode 100644 index 0000000000000000000000000000000000000000..7d1a3eebe6bbbd822342c805e3d19d0bf87d91bd --- /dev/null +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/me/fragment/SpaceHomeFragment.java @@ -0,0 +1,38 @@ +package com.mindspore.himindspore.ui.me.fragment; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; + +import com.mindspore.himindspore.R; + +public class SpaceHomeFragment extends Fragment { + + public static SpaceHomeFragment newInstance() { + SpaceHomeFragment fragment = new SpaceHomeFragment(); + Bundle args = new Bundle(); + fragment.setArguments(args); + return fragment; + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + return inflater.inflate(R.layout.fragment_space_home, container, false); + } + + @Override + public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + initView(view); + } + + private void initView(View view) { + + } +} diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/webview/WebViewUtilsActivity.java b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/webview/WebViewUtilsActivity.java index 110a7ed0230c62e9f798ddd4684e2a00ebc1790c..d4ab96b49842376ca1fff996a95c270c7e717271 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/webview/WebViewUtilsActivity.java +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/webview/WebViewUtilsActivity.java @@ -49,7 +49,6 @@ public class WebViewUtilsActivity extends AppCompatActivity { private void initView() { progressBar = findViewById(R.id.progress); appTitle = findViewById(R.id.mWebView_toolbar); - appTitle.setNavigationOnClickListener(view -> finish()); mWebView = findViewById(R.id.mWebView); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.getSettings().setDomStorageEnabled(true); diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable-xxhdpi/personal_space_bg.jpg b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable-xxhdpi/personal_space_bg.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f0336a21c46174f087fd46cb72922e52e53e5ca9 Binary files /dev/null and b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable-xxhdpi/personal_space_bg.jpg differ diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable-xxhdpi/space_back.png b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable-xxhdpi/space_back.png new file mode 100644 index 0000000000000000000000000000000000000000..d71b7a5ee270b7cb595f21655b612c2c5266d19d Binary files /dev/null and b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable-xxhdpi/space_back.png differ diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable-xxhdpi/space_more.png b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable-xxhdpi/space_more.png new file mode 100644 index 0000000000000000000000000000000000000000..5a832487668dbfb93f6705e29d4fa305e3438567 Binary files /dev/null and b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable-xxhdpi/space_more.png differ diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable-xxhdpi/space_search.png b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable-xxhdpi/space_search.png new file mode 100644 index 0000000000000000000000000000000000000000..4279b3fcfacc887ae9e5d043fd1b2001e55f1480 Binary files /dev/null and b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable-xxhdpi/space_search.png differ diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable/component_assembly_bg.xml b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable/component_assembly_bg.xml deleted file mode 100644 index c5e9142d7c7ee592606061656acf31c3f9248009..0000000000000000000000000000000000000000 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable/component_assembly_bg.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable/set_dialog_bg.xml b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable/set_dialog_bg.xml index f63798c93110cdb02e6a966b93b6eede49974961..fc78e2de6f7f34f8ce71dee0deca0a3dbc4b33b0 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable/set_dialog_bg.xml +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable/set_dialog_bg.xml @@ -1,7 +1,7 @@ - + \ No newline at end of file diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable/space_bg_radius.xml b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable/space_bg_radius.xml new file mode 100644 index 0000000000000000000000000000000000000000..9dc827e84493b2bf3181133c8f12f6f57d53dc6e --- /dev/null +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable/space_bg_radius.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable/space_big_member_bg.xml b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable/space_big_member_bg.xml new file mode 100644 index 0000000000000000000000000000000000000000..03afc8ba9b9699d5719add09d4852a77006777f7 --- /dev/null +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable/space_big_member_bg.xml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable/space_edit_button_bg_blue.xml b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable/space_edit_button_bg_blue.xml new file mode 100644 index 0000000000000000000000000000000000000000..b0006c6f3f21f1be72db33ad0037ccadf3c8473f --- /dev/null +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/drawable/space_edit_button_bg_blue.xml @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/activity_buddy_layout.xml b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/activity_buddy_layout.xml new file mode 100644 index 0000000000000000000000000000000000000000..7abcb47c4a80bea2d22eac7e9f5e2b2bf28116fd --- /dev/null +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/activity_buddy_layout.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/activity_cache.xml b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/activity_refresh_layout_title.xml similarity index 57% rename from model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/activity_cache.xml rename to model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/activity_refresh_layout_title.xml index aa0cc5cf1874d67dc0ccb738aabe31c0ecbc7b34..56fd5f0a134905b10ebae58249dc75208576e73e 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/activity_cache.xml +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/activity_refresh_layout_title.xml @@ -5,15 +5,18 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" - android:background="@color/white" - tools:context=".ui.me.CacheActivity"> + android:background="@color/white"> + app:iconLeftBlack="@drawable/icon_back"/> + + \ No newline at end of file diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/activity_space.xml b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/activity_space.xml new file mode 100644 index 0000000000000000000000000000000000000000..84ecb05195a9f146036047f58ad638cc0a11c55b --- /dev/null +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/activity_space.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/fragment_refresh_layout.xml b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/fragment_refresh_layout.xml index 10f8cf741f74b6d480cbcc9b8d3bd1a0274b46ce..1e107ebe819d390ff277d1e387b0ea82a436299d 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/fragment_refresh_layout.xml +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/fragment_refresh_layout.xml @@ -1,6 +1,6 @@ diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/fragment_space_favorites.xml b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/fragment_space_favorites.xml new file mode 100644 index 0000000000000000000000000000000000000000..fc1a5080949fefe535d809f4132171a3d79b0b44 --- /dev/null +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/fragment_space_favorites.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/fragment_space_home.xml b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/fragment_space_home.xml new file mode 100644 index 0000000000000000000000000000000000000000..fc1a5080949fefe535d809f4132171a3d79b0b44 --- /dev/null +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/fragment_space_home.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file 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 c5985520badf771eb9baffd8c326d9cb0ed538af..b8a0af83c54b18a2a9ed95e10f933c3603761cd4 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 @@ -5,66 +5,76 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - - - + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent"> - + - + + android:textSize="10dp" + app:layout_constraintStart_toEndOf="@id/per_avatar" + app:layout_constraintTop_toBottomOf="@id/user_name" /> - + + + + + + + + - + app:layout_constraintTop_toBottomOf="@id/per_user_layout" /> + app:layout_constraintTop_toBottomOf="@id/per_user_layout" /> + app:layout_constraintTop_toBottomOf="@id/per_user_layout" /> diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/layout_signout_dialog.xml b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/layout_signout_dialog.xml index a81cfa5a94d6fb24157a4d3b7c7f19746cbff68b..1a52234ccb6797d31a2cd474115b56dcbc4740bc 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/layout_signout_dialog.xml +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/layout_signout_dialog.xml @@ -33,7 +33,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/layout_task_personal.xml b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/layout_task_personal.xml index 2e4027aedd6e90579264602c5c7b6b8d947313c9..626a75ebdba72c33a93d7d53e3dcbb64d5afb827 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/layout_task_personal.xml +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/layout/layout_task_personal.xml @@ -43,6 +43,7 @@ app:layout_constraintTop_toBottomOf="@id/per_up" /> diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/values-en/strings.xml b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/values-en/strings.xml index 86480aafce859ecf2123ca650b2b0cc9bbccf279..2d11830023d0537427ac8661565f01728f52a05b 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/values-en/strings.xml +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/values-en/strings.xml @@ -142,4 +142,11 @@ Remaining to complete the task space More service + Rewarded tasks + my good friend + Edit material + lauded + Home page + Favorites + Big member \ No newline at end of file diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/values-zh/strings.xml b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/values-zh/strings.xml index 5dac900a39dcb4a89e2a3752adf7b786a45dbae1..315f4b3912812ab6f6fea7fa690e242899b2b1ac 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/values-zh/strings.xml +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/values-zh/strings.xml @@ -129,4 +129,11 @@ 剩余完成任务 空间 更多服务 + 有奖任务 + 我的好友 + 编辑资料 + 获赞 + 主页 + 收藏 + 大会员 \ No newline at end of file diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/values/colors.xml b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/values/colors.xml index 0a261f54a7cf4e89b36ea96780d103a7c4ce3363..9315da37e03e62e69bcdcba7a7522e164aa335b4 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/values/colors.xml +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/values/colors.xml @@ -47,6 +47,7 @@ #66000000 #FBFBFB #F0F0F0 + #EFEFEF #E5E5E5 #E6E6E6 #FFE3F8FE diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/values/strings.xml b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/values/strings.xml index db4826c5ed41aa0b1301ee5df2b7db541addb967..b4f9a9083623a18b3d1b72a5a9657808a7f2492b 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/values/strings.xml +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/res/values/strings.xml @@ -186,5 +186,11 @@ 剩余完成任务 空间 更多服务 - + 有奖任务 + 我的好友 + 编辑资料 + 获赞 + 主页 + 收藏 + 大会员 \ No newline at end of file diff --git a/model_zoo/official/lite/MindSpore_inhand/common/src/main/java/com/mindspore/common/utils/ScreenUtils.java b/model_zoo/official/lite/MindSpore_inhand/common/src/main/java/com/mindspore/common/utils/ScreenUtils.java new file mode 100644 index 0000000000000000000000000000000000000000..2d6ee300ece9a6c9ff31349a9564ac2951814eb0 --- /dev/null +++ b/model_zoo/official/lite/MindSpore_inhand/common/src/main/java/com/mindspore/common/utils/ScreenUtils.java @@ -0,0 +1,19 @@ +package com.mindspore.common.utils; +import android.content.Context; +import android.util.DisplayMetrics; + + +public class ScreenUtils { + + public static int screenWidth(Context context){ + DisplayMetrics metrics = context.getResources().getDisplayMetrics(); + int mScreenWidth = metrics.widthPixels; + return mScreenWidth; + } + + public static int screenHeight(Context context){ + DisplayMetrics metrics = context.getResources().getDisplayMetrics(); + int mScreenHeight = metrics.heightPixels; + return mScreenHeight; + } +} diff --git a/model_zoo/official/lite/MindSpore_inhand/customView/src/main/java/com/mindspore/customview/ui/AppTitleView.java b/model_zoo/official/lite/MindSpore_inhand/customView/src/main/java/com/mindspore/customview/ui/AppTitleView.java index 861476f141f7e70d1e4f252cd9936c7b30061af2..211b952be060aef4af690935badbfee99ac772ca 100644 --- a/model_zoo/official/lite/MindSpore_inhand/customView/src/main/java/com/mindspore/customview/ui/AppTitleView.java +++ b/model_zoo/official/lite/MindSpore_inhand/customView/src/main/java/com/mindspore/customview/ui/AppTitleView.java @@ -62,8 +62,10 @@ public class AppTitleView extends LinearLayout { public AppTitleView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs); + if (context instanceof Activity) { + this.activity = (Activity) context; + } TypedArray ToolbarTile = context.obtainStyledAttributes(attrs, R.styleable.AppTitleView); - nameTitle = ToolbarTile.getText(R.styleable.AppTitleView_nameTitle); iconLeftBlack = ToolbarTile.getDrawable(R.styleable.AppTitleView_iconLeftBlack); iconRightOne = ToolbarTile.getDrawable(R.styleable.AppTitleView_iconRightOne); diff --git a/model_zoo/official/lite/MindSpore_inhand/modelcamera/src/main/java/com/mindspore/modelcamera/ui/CameraResultActivity.java b/model_zoo/official/lite/MindSpore_inhand/modelcamera/src/main/java/com/mindspore/modelcamera/ui/CameraResultActivity.java index 5026057e4ae741649886511ac7724a2f0538b57a..43a0ca58462472624222894cce7fd97f71f3b51a 100644 --- a/model_zoo/official/lite/MindSpore_inhand/modelcamera/src/main/java/com/mindspore/modelcamera/ui/CameraResultActivity.java +++ b/model_zoo/official/lite/MindSpore_inhand/modelcamera/src/main/java/com/mindspore/modelcamera/ui/CameraResultActivity.java @@ -91,7 +91,6 @@ public class CameraResultActivity extends BaseActivity im appTitle = findViewById(R.id.camera_toolbar); titleName = appTitle.findViewById(R.id.title_name); appTitle.setTitleText(CameraConstants.CAMERA_MODEL[model]); - appTitle.setNavigationOnClickListener(view -> finish()); preImage = findViewById(R.id.preIamge); cancleLayout = findViewById(R.id.cancleLayout); diff --git a/model_zoo/official/lite/MindSpore_inhand/modelcamera/src/main/java/com/mindspore/modelcamera/ui/MainCameraActivity.java b/model_zoo/official/lite/MindSpore_inhand/modelcamera/src/main/java/com/mindspore/modelcamera/ui/MainCameraActivity.java index bb1af3f18d013baf557e4bbca83ab5efed13bc82..a7d54472f2eda7f0babc4d1033a6a97ae98ffa55 100644 --- a/model_zoo/official/lite/MindSpore_inhand/modelcamera/src/main/java/com/mindspore/modelcamera/ui/MainCameraActivity.java +++ b/model_zoo/official/lite/MindSpore_inhand/modelcamera/src/main/java/com/mindspore/modelcamera/ui/MainCameraActivity.java @@ -108,7 +108,6 @@ public class MainCameraActivity extends AppCompatActivity implements ICameraPrev private void init() { appTitle = findViewById(R.id.camera_toolbar); - appTitle.setNavigationOnClickListener(view -> finish()); appTitle.setTitleText(CameraConstants.CAMERA_MODEL[model]); viewPager = findViewById(R.id.viewPager); diff --git a/model_zoo/official/lite/MindSpore_inhand/modelcamera/src/main/java/com/mindspore/modelcamera/ui/TextTranslationActivity.java b/model_zoo/official/lite/MindSpore_inhand/modelcamera/src/main/java/com/mindspore/modelcamera/ui/TextTranslationActivity.java index d0b976c9466f5048ca6b2427f9d9d2cf2569c341..3bdf71493d224665bfbaf32616ff9ce26e145247 100644 --- a/model_zoo/official/lite/MindSpore_inhand/modelcamera/src/main/java/com/mindspore/modelcamera/ui/TextTranslationActivity.java +++ b/model_zoo/official/lite/MindSpore_inhand/modelcamera/src/main/java/com/mindspore/modelcamera/ui/TextTranslationActivity.java @@ -102,7 +102,6 @@ public class TextTranslationActivity extends AppCompatActivity { private void init() { AppTitleView appTitle = findViewById(R.id.text_online_activity_toolbar); - appTitle.setNavigationOnClickListener(view -> finish()); mEditText = findViewById(R.id.text_edit); mEditText.setMovementMethod(ScrollingMovementMethod.getInstance()); mTextView = findViewById(R.id.text_view);