Commit 69a307869cc9f9d0b751cb6760f267be4a179c97

Authored by 姚旭斌
1 parent 11f0c65b

no message

app/src/main/AndroidManifest.xml
... ... @@ -57,6 +57,9 @@
57 57 <activity android:name=".ui.activity.LoginAndRegistActivity"
58 58 android:screenOrientation="portrait"
59 59 />
  60 + <activity android:name=".ui.activity.MyChildActivity"
  61 + android:screenOrientation="portrait"
  62 + />
60 63 </application>
61 64  
62 65 </manifest>
63 66 \ No newline at end of file
... ...
app/src/main/java/com/shunzhi/parent/contract/mine/MineContract.java 0 → 100644
... ... @@ -0,0 +1,28 @@
  1 +package com.shunzhi.parent.contract.mine;
  2 +
  3 +import com.share.mvpsdk.base.BasePresenter;
  4 +import com.share.mvpsdk.base.IBaseFragment;
  5 +import com.share.mvpsdk.base.IBaseModel;
  6 +
  7 +/**
  8 + * Created by Administrator on 2018/3/8 0008.
  9 + */
  10 +
  11 +public interface MineContract {
  12 +
  13 + abstract class MinePresenter extends BasePresenter<IMineModel,IMineView> {
  14 +
  15 + }
  16 +
  17 +
  18 + interface IMineModel extends IBaseModel {
  19 +
  20 +
  21 + }
  22 + interface IMineView extends IBaseFragment {
  23 +
  24 +
  25 +
  26 + }
  27 +
  28 +}
... ...
app/src/main/java/com/shunzhi/parent/model/mine/MineModel.java 0 → 100644
... ... @@ -0,0 +1,14 @@
  1 +package com.shunzhi.parent.model.mine;
  2 +
  3 +import com.share.mvpsdk.base.BaseModel;
  4 +import com.shunzhi.parent.contract.mine.MineContract;
  5 +
  6 +/**
  7 + * Created by Administrator on 2018/3/8 0008.
  8 + */
  9 +
  10 +public class MineModel extends BaseModel implements MineContract.IMineModel {
  11 + public static MineModel newInstance() {
  12 + return new MineModel();
  13 + }
  14 +}
... ...
app/src/main/java/com/shunzhi/parent/presenter/mine/MinePresenter.java 0 → 100644
... ... @@ -0,0 +1,20 @@
  1 +package com.shunzhi.parent.presenter.mine;
  2 +
  3 +import com.shunzhi.parent.contract.mine.MineContract;
  4 +import com.shunzhi.parent.model.mine.MineModel;
  5 +
  6 +/**
  7 + * Created by Administrator on 2018/3/8 0008.
  8 + */
  9 +
  10 +public class MinePresenter extends MineContract.MinePresenter {
  11 + @Override
  12 + public MineContract.IMineModel getModel() {
  13 + return MineModel.newInstance();
  14 + }
  15 +
  16 + @Override
  17 + public void onStart() {
  18 +
  19 + }
  20 +}
... ...
app/src/main/java/com/shunzhi/parent/ui/activity/MyChildActivity.java 0 → 100644
... ... @@ -0,0 +1,25 @@
  1 +package com.shunzhi.parent.ui.activity;
  2 +
  3 +import android.os.Bundle;
  4 +
  5 +import com.share.mvpsdk.base.activity.BaseCompatActivity;
  6 +import com.shunzhi.parent.R;
  7 +
  8 +/**
  9 + * Created by Administrator on 2018/3/8 0008.
  10 + */
  11 +
  12 +public class MyChildActivity extends BaseCompatActivity {
  13 +
  14 +
  15 +
  16 + @Override
  17 + protected void initView(Bundle savedInstanceState) {
  18 +
  19 + }
  20 +
  21 + @Override
  22 + protected int getLayoutId() {
  23 + return R.layout.activity_mychild;
  24 + }
  25 +}
... ...
app/src/main/java/com/shunzhi/parent/ui/fragment/MineFragment.java
1 1 package com.shunzhi.parent.ui.fragment;
2 2  
  3 +import android.content.Intent;
3 4 import android.os.Bundle;
4   -import android.support.v4.app.Fragment;
5   -import android.view.LayoutInflater;
  5 +import android.support.annotation.NonNull;
  6 +import android.support.annotation.Nullable;
6 7 import android.view.View;
7   -import android.view.ViewGroup;
  8 +import android.widget.LinearLayout;
8 9  
  10 +import com.share.mvpsdk.base.BasePresenter;
  11 +import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment;
9 12 import com.shunzhi.parent.R;
  13 +import com.shunzhi.parent.contract.loginandregister.LoginAndRegisterContract;
  14 +import com.shunzhi.parent.contract.mine.MineContract;
  15 +import com.shunzhi.parent.presenter.mine.MinePresenter;
  16 +import com.shunzhi.parent.ui.activity.MyChildActivity;
10 17  
11   -public class MineFragment extends Fragment {
  18 +public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract.LoginPresenter, LoginAndRegisterContract.ILoginModel>
  19 + implements MineContract.IMineView, View.OnClickListener {
  20 + LinearLayout childlayout;
12 21  
  22 + @NonNull
13 23 @Override
14   - public View onCreateView(LayoutInflater inflater, ViewGroup container,
15   - Bundle savedInstanceState) {
16   - // Inflate the layout for this fragment
17   - return inflater.inflate(R.layout.fragment_mine, container, false);
  24 + public BasePresenter initPresenter() {
  25 + return new MinePresenter();
18 26 }
19 27  
  28 + @Override
  29 + public int getLayoutId() {
  30 + return R.layout.activity_mychild;
  31 + }
  32 +
  33 + @Override
  34 + public void initUI(View view, @Nullable Bundle savedInstanceState) {
  35 + childlayout = view.findViewById(R.id.childlayout);
  36 + childlayout.setOnClickListener(this);
  37 +
  38 + }
  39 +
  40 +
  41 + @Override
  42 + public void onClick(View v) {
  43 + switch (v.getId()) {
  44 + case R.id.childlayout:
  45 + startActivity(new Intent().setClass(getActivity(), MyChildActivity.class));
  46 + break;
  47 + default:
  48 + break;
  49 + }
  50 +
  51 +
  52 + }
20 53 }
... ...
app/src/main/res/drawable-xhdpi/arrow_left.png 0 → 100644

578 Bytes

app/src/main/res/drawable-xhdpi/arrow_right.png

483 Bytes | W: | H:

506 Bytes | W: | H:

  • 2-up
  • Swipe
  • Onion skin
app/src/main/res/layout/activity_mychild.xml 0 → 100644
... ... @@ -0,0 +1,12 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout
  3 + xmlns:android="http://schemas.android.com/apk/res/android"
  4 + android:layout_width="match_parent"
  5 + android:layout_height="match_parent"
  6 + android:orientation="vertical"
  7 + >
  8 +
  9 + <include layout="@layout/top"/>
  10 +
  11 +
  12 +</LinearLayout>
0 13 \ No newline at end of file
... ...
app/src/main/res/layout/fragment_mine.xml
... ... @@ -186,6 +186,7 @@
186 186 android:layout_marginRight="15dp"
187 187 android:background="@color/bottomline" />
188 188 <LinearLayout
  189 + android:id="@+id/childlayout"
189 190 android:layout_width="match_parent"
190 191 android:layout_height="40dp"
191 192 android:gravity="center_vertical"
... ...
app/src/main/res/layout/top.xml 0 → 100644
... ... @@ -0,0 +1,28 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="80dp">
  5 +
  6 + <RelativeLayout
  7 + android:layout_width="match_parent"
  8 + android:layout_height="wrap_content"
  9 + android:background="@color/back_top"
  10 + android:paddingTop="20dp"
  11 + android:paddingBottom="10dp"
  12 + >
  13 + <TextView
  14 + android:layout_width="40dp"
  15 + android:layout_height="40dp"
  16 + android:layout_alignParentBottom="true"
  17 + android:background="@drawable/arrow_left" />
  18 +
  19 + <TextView
  20 + android:layout_width="wrap_content"
  21 + android:layout_height="wrap_content"
  22 + android:textSize="@dimen/txtsize_headline"
  23 + android:layout_centerHorizontal="true"
  24 + android:layout_alignParentBottom="true"
  25 + android:text="主题" />
  26 + </RelativeLayout>
  27 +
  28 +</LinearLayout>
0 29 \ No newline at end of file
... ...
app/src/main/res/values/colors.xml
... ... @@ -9,5 +9,6 @@
9 9 <color name="bottomline">#B8B8B9</color>
10 10 <color name="bg_main">#F0EFF5</color>
11 11 <color name="textRed">#FC5B6A</color>
  12 + <color name="back_top">#C6DAFF</color>
12 13  
13 14 </resources>
... ...