Commit 275628dee94595551984df4a74ab39bc5090faa8
1 parent
f1c906bc
登录模块
Showing
7 changed files
with
74 additions
and
6 deletions
app/src/main/AndroidManifest.xml
| @@ -64,6 +64,7 @@ | @@ -64,6 +64,7 @@ | ||
| 64 | android:launchMode="singleTop" | 64 | android:launchMode="singleTop" |
| 65 | android:screenOrientation="portrait" | 65 | android:screenOrientation="portrait" |
| 66 | android:windowSoftInputMode="adjustResize" /> | 66 | android:windowSoftInputMode="adjustResize" /> |
| 67 | + <activity android:name=".user.activity.LoginActivity"/> | ||
| 67 | 68 | ||
| 68 | <receiver | 69 | <receiver |
| 69 | android:name=".video.utils.NetworkChangeReceive"> | 70 | android:name=".video.utils.NetworkChangeReceive"> |
app/src/main/java/com/cnlive/gundam/main/application/CNLiveApplication.java
| @@ -13,6 +13,6 @@ public class CNLiveApplication extends Application { | @@ -13,6 +13,6 @@ public class CNLiveApplication extends Application { | ||
| 13 | @Override | 13 | @Override |
| 14 | public void onCreate() { | 14 | public void onCreate() { |
| 15 | super.onCreate(); | 15 | super.onCreate(); |
| 16 | - Config.init(getApplicationContext(), "60_j4fc7dsm83", "4c8658abc5d66f270f9bf5dcd1ef11e3597fab4c4e0af9", true); | 16 | + Config.init(getApplicationContext(), "60_j4fc7dsm83", "4c8658abc5d66f270f9bf5dcd1ef11e3597fab4c4e0af9"); |
| 17 | } | 17 | } |
| 18 | } | 18 | } |
app/src/main/java/com/cnlive/gundam/main/ui/fragment/ConfigFragment.java
| @@ -5,6 +5,7 @@ import android.databinding.DataBindingUtil; | @@ -5,6 +5,7 @@ import android.databinding.DataBindingUtil; | ||
| 5 | import android.os.Bundle; | 5 | import android.os.Bundle; |
| 6 | import android.support.annotation.Nullable; | 6 | import android.support.annotation.Nullable; |
| 7 | import android.support.v4.app.Fragment; | 7 | import android.support.v4.app.Fragment; |
| 8 | +import android.util.Log; | ||
| 8 | import android.view.LayoutInflater; | 9 | import android.view.LayoutInflater; |
| 9 | import android.view.View; | 10 | import android.view.View; |
| 10 | import android.view.ViewGroup; | 11 | import android.view.ViewGroup; |
| @@ -29,9 +30,14 @@ public class ConfigFragment extends Fragment implements View.OnClickListener { | @@ -29,9 +30,14 @@ public class ConfigFragment extends Fragment implements View.OnClickListener { | ||
| 29 | return binding.getRoot(); | 30 | return binding.getRoot(); |
| 30 | } | 31 | } |
| 31 | 32 | ||
| 33 | + @Override | ||
| 34 | + public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { | ||
| 35 | + super.onViewCreated(view, savedInstanceState); | ||
| 36 | + initUI(); | ||
| 37 | + } | ||
| 32 | 38 | ||
| 33 | 39 | ||
| 34 | - /* public static Fragment newInstance() { | 40 | + /* public static Fragment newInstance() { |
| 35 | UserFragment fragment = new UserFragment(); | 41 | UserFragment fragment = new UserFragment(); |
| 36 | return fragment; | 42 | return fragment; |
| 37 | }*/ | 43 | }*/ |
| @@ -39,7 +45,7 @@ public class ConfigFragment extends Fragment implements View.OnClickListener { | @@ -39,7 +45,7 @@ public class ConfigFragment extends Fragment implements View.OnClickListener { | ||
| 39 | @Override | 45 | @Override |
| 40 | public void onActivityCreated(Bundle savedInstanceState) { | 46 | public void onActivityCreated(Bundle savedInstanceState) { |
| 41 | super.onActivityCreated(savedInstanceState); | 47 | super.onActivityCreated(savedInstanceState); |
| 42 | - initUI(); | 48 | + |
| 43 | 49 | ||
| 44 | /*initToolBar(); | 50 | /*initToolBar(); |
| 45 | init(); | 51 | init(); |
| @@ -56,6 +62,8 @@ public class ConfigFragment extends Fragment implements View.OnClickListener { | @@ -56,6 +62,8 @@ public class ConfigFragment extends Fragment implements View.OnClickListener { | ||
| 56 | @Override | 62 | @Override |
| 57 | public void onClick(View view) { | 63 | public void onClick(View view) { |
| 58 | switch (view.getId()) { | 64 | switch (view.getId()) { |
| 65 | + | ||
| 66 | + | ||
| 59 | case R.id.config_header: | 67 | case R.id.config_header: |
| 60 | int uid = UserService.getInstance(getActivity()).getActiveAccountInfo().getUid(); | 68 | int uid = UserService.getInstance(getActivity()).getActiveAccountInfo().getUid(); |
| 61 | if (uid != 0) { | 69 | if (uid != 0) { |
app/src/main/java/com/cnlive/gundam/user/fragment/LoginFragment.java
| @@ -148,6 +148,7 @@ public class LoginFragment extends Fragment implements View.OnClickListener { | @@ -148,6 +148,7 @@ public class LoginFragment extends Fragment implements View.OnClickListener { | ||
| 148 | private class UserDataCall implements Callback { | 148 | private class UserDataCall implements Callback { |
| 149 | @Override | 149 | @Override |
| 150 | public void onState(int what, String extra, Object obj) { | 150 | public void onState(int what, String extra, Object obj) { |
| 151 | + Log.v("onState",extra); | ||
| 151 | switch (what) { | 152 | switch (what) { |
| 152 | case IUserService.SUCCESS: | 153 | case IUserService.SUCCESS: |
| 153 | ToastUtil.show(getActivity(), "密码登录成功"); | 154 | ToastUtil.show(getActivity(), "密码登录成功"); |
app/src/main/java/com/cnlive/gundam/user/fragment/QuickLoginFragment.java
| @@ -6,6 +6,7 @@ import android.databinding.DataBindingUtil; | @@ -6,6 +6,7 @@ import android.databinding.DataBindingUtil; | ||
| 6 | import android.os.Bundle; | 6 | import android.os.Bundle; |
| 7 | import android.support.annotation.Nullable; | 7 | import android.support.annotation.Nullable; |
| 8 | import android.support.v4.app.Fragment; | 8 | import android.support.v4.app.Fragment; |
| 9 | +import android.util.Log; | ||
| 9 | import android.view.LayoutInflater; | 10 | import android.view.LayoutInflater; |
| 10 | import android.view.View; | 11 | import android.view.View; |
| 11 | import android.view.ViewGroup; | 12 | import android.view.ViewGroup; |
| @@ -132,6 +133,7 @@ public class QuickLoginFragment extends Fragment implements View.OnClickListener | @@ -132,6 +133,7 @@ public class QuickLoginFragment extends Fragment implements View.OnClickListener | ||
| 132 | private class MobileCall implements Callback { | 133 | private class MobileCall implements Callback { |
| 133 | @Override | 134 | @Override |
| 134 | public void onState(int what, String extra, Object obj) { | 135 | public void onState(int what, String extra, Object obj) { |
| 136 | + Log.v("MobileCall",extra); | ||
| 135 | switch (what){ | 137 | switch (what){ |
| 136 | case IUserService.SUCCESS: | 138 | case IUserService.SUCCESS: |
| 137 | ToastUtil.show(getActivity(), "验证码已发送"); | 139 | ToastUtil.show(getActivity(), "验证码已发送"); |
app/src/main/res/layout/list_item_config_header.xml
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | android:orientation="vertical" android:layout_width="match_parent" | 3 | android:orientation="vertical" android:layout_width="match_parent" |
| 4 | - android:layout_height="match_parent"> | 4 | + android:layout_height="85dp"> |
| 5 | 5 | ||
| 6 | <include layout="@layout/divider_head_line" /> | 6 | <include layout="@layout/divider_head_line" /> |
| 7 | 7 |
app/src/main/res/layout/user_fragment.xml
| @@ -27,8 +27,64 @@ | @@ -27,8 +27,64 @@ | ||
| 27 | android:layout_height="1px" | 27 | android:layout_height="1px" |
| 28 | android:background="@color/gray_line_color" /> | 28 | android:background="@color/gray_line_color" /> |
| 29 | 29 | ||
| 30 | - <include layout="@layout/list_item_config_header" | ||
| 31 | - android:id="@+id/config_header"/> | 30 | + |
| 31 | + <RelativeLayout | ||
| 32 | + android:id="@+id/config_header" | ||
| 33 | + android:layout_width="fill_parent" | ||
| 34 | + android:layout_height="85dp" | ||
| 35 | + android:gravity="center_vertical" | ||
| 36 | + style="@style/list_item_style"> | ||
| 37 | + | ||
| 38 | + <ImageView | ||
| 39 | + android:id="@+id/head_img" | ||
| 40 | + android:layout_width="55dip" | ||
| 41 | + android:layout_height="55dip" | ||
| 42 | + android:layout_centerVertical="true" | ||
| 43 | + android:layout_marginLeft="11dp" | ||
| 44 | + android:layout_marginRight="16dp" /> | ||
| 45 | + | ||
| 46 | + <LinearLayout | ||
| 47 | + android:layout_width="wrap_content" | ||
| 48 | + android:layout_height="wrap_content" | ||
| 49 | + android:layout_centerVertical="true" | ||
| 50 | + android:layout_toRightOf="@+id/head_img" | ||
| 51 | + android:orientation="vertical" | ||
| 52 | + android:layout_toLeftOf="@+id/next"> | ||
| 53 | + | ||
| 54 | + <TextView | ||
| 55 | + android:id="@+id/tv_nickname" | ||
| 56 | + android:layout_width="wrap_content" | ||
| 57 | + android:layout_height="wrap_content" | ||
| 58 | + android:layout_margin="3dp" | ||
| 59 | + android:gravity="center_vertical" | ||
| 60 | + android:singleLine="true" | ||
| 61 | + android:text="@string/click_login" | ||
| 62 | + android:textColor="@color/config_black_color" | ||
| 63 | + android:textSize="17sp" /> | ||
| 64 | + <TextView | ||
| 65 | + android:id="@+id/point" | ||
| 66 | + android:layout_width="wrap_content" | ||
| 67 | + android:layout_height="wrap_content" | ||
| 68 | + android:layout_margin="3dp" | ||
| 69 | + android:text="@string/login_china_coin" | ||
| 70 | + android:textColor="@color/config_gray_color" | ||
| 71 | + android:textSize="12sp" /> | ||
| 72 | + </LinearLayout> | ||
| 73 | + | ||
| 74 | + <ImageView | ||
| 75 | + android:id="@+id/next" | ||
| 76 | + android:layout_width="@dimen/next_image_width" | ||
| 77 | + android:layout_height="@dimen/next_image_height" | ||
| 78 | + android:layout_alignParentRight="true" | ||
| 79 | + android:layout_centerVertical="true" | ||
| 80 | + android:layout_marginRight="@dimen/next_image_margin_right" | ||
| 81 | + android:contentDescription="@null" | ||
| 82 | + android:src="@drawable/btn_channel_more" /> | ||
| 83 | + </RelativeLayout> | ||
| 84 | + | ||
| 85 | + | ||
| 86 | + | ||
| 87 | + | ||
| 32 | 88 | ||
| 33 | <RelativeLayout | 89 | <RelativeLayout |
| 34 | android:layout_width="match_parent" | 90 | android:layout_width="match_parent" |