Commit 8729902d6bb36fb3ab25befb350ec1a9dfd0af66
Merge branch 'master' of bj.gitlab.cnlive.com:cnlive-team/CNLiveApp
Showing
46 changed files
with
651 additions
and
636 deletions
.idea/inspectionProfiles/Project_Default.xml
| @@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
| 2 | <profile version="1.0"> | 2 | <profile version="1.0"> |
| 3 | <option name="myName" value="Project Default" /> | 3 | <option name="myName" value="Project Default" /> |
| 4 | <inspection_tool class="AndroidLintNewApi" enabled="false" level="ERROR" enabled_by_default="false" /> | 4 | <inspection_tool class="AndroidLintNewApi" enabled="false" level="ERROR" enabled_by_default="false" /> |
| 5 | + <inspection_tool class="AndroidLintSetTextI18n" enabled="false" level="WARNING" enabled_by_default="false" /> | ||
| 5 | <inspection_tool class="LoggerInitializedWithForeignClass" enabled="false" level="WARNING" enabled_by_default="false"> | 6 | <inspection_tool class="LoggerInitializedWithForeignClass" enabled="false" level="WARNING" enabled_by_default="false"> |
| 6 | <option name="loggerClassName" value="org.apache.log4j.Logger,org.slf4j.LoggerFactory,org.apache.commons.logging.LogFactory,java.util.logging.Logger" /> | 7 | <option name="loggerClassName" value="org.apache.log4j.Logger,org.slf4j.LoggerFactory,org.apache.commons.logging.LogFactory,java.util.logging.Logger" /> |
| 7 | <option name="loggerFactoryMethodName" value="getLogger,getLogger,getLog,getLogger" /> | 8 | <option name="loggerFactoryMethodName" value="getLogger,getLogger,getLog,getLogger" /> |
.idea/markdown-navigator.xml deleted
100644 → 0
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | -<project version="4"> | ||
| 3 | - <component name="MarkdownProjectSettings"> | ||
| 4 | - <PreviewSettings splitEditorLayout="SPLIT" splitEditorPreview="PREVIEW" useGrayscaleRendering="false" zoomFactor="1.0" maxImageWidth="0" showGitHubPageIfSynced="false" allowBrowsingInPreview="false" synchronizePreviewPosition="true" highlightPreviewType="NONE" highlightFadeOut="5" highlightOnTyping="true" synchronizeSourcePosition="true" verticallyAlignSourceAndPreviewSyncPosition="true" showSearchHighlightsInPreview="true" showSelectionInPreview="true"> | ||
| 5 | - <PanelProvider> | ||
| 6 | - <provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.panel" providerName="Default - Swing" /> | ||
| 7 | - </PanelProvider> | ||
| 8 | - </PreviewSettings> | ||
| 9 | - <ParserSettings gitHubSyntaxChange="false"> | ||
| 10 | - <PegdownExtensions> | ||
| 11 | - <option name="ABBREVIATIONS" value="false" /> | ||
| 12 | - <option name="ANCHORLINKS" value="true" /> | ||
| 13 | - <option name="ASIDE" value="false" /> | ||
| 14 | - <option name="ATXHEADERSPACE" value="true" /> | ||
| 15 | - <option name="AUTOLINKS" value="true" /> | ||
| 16 | - <option name="DEFINITIONS" value="false" /> | ||
| 17 | - <option name="DEFINITION_BREAK_DOUBLE_BLANK_LINE" value="false" /> | ||
| 18 | - <option name="FENCED_CODE_BLOCKS" value="true" /> | ||
| 19 | - <option name="FOOTNOTES" value="false" /> | ||
| 20 | - <option name="HARDWRAPS" value="false" /> | ||
| 21 | - <option name="INSERTED" value="false" /> | ||
| 22 | - <option name="QUOTES" value="false" /> | ||
| 23 | - <option name="RELAXEDHRULES" value="true" /> | ||
| 24 | - <option name="SMARTS" value="false" /> | ||
| 25 | - <option name="STRIKETHROUGH" value="true" /> | ||
| 26 | - <option name="SUBSCRIPT" value="false" /> | ||
| 27 | - <option name="SUPERSCRIPT" value="false" /> | ||
| 28 | - <option name="SUPPRESS_HTML_BLOCKS" value="false" /> | ||
| 29 | - <option name="SUPPRESS_INLINE_HTML" value="false" /> | ||
| 30 | - <option name="TABLES" value="true" /> | ||
| 31 | - <option name="TASKLISTITEMS" value="true" /> | ||
| 32 | - <option name="TOC" value="false" /> | ||
| 33 | - <option name="WIKILINKS" value="true" /> | ||
| 34 | - </PegdownExtensions> | ||
| 35 | - <ParserOptions> | ||
| 36 | - <option name="COMMONMARK_LISTS" value="false" /> | ||
| 37 | - <option name="DUMMY" value="false" /> | ||
| 38 | - <option name="EMOJI_SHORTCUTS" value="true" /> | ||
| 39 | - <option name="FLEXMARK_FRONT_MATTER" value="false" /> | ||
| 40 | - <option name="GFM_LOOSE_BLANK_LINE_AFTER_ITEM_PARA" value="true" /> | ||
| 41 | - <option name="GFM_TABLE_RENDERING" value="true" /> | ||
| 42 | - <option name="GITBOOK_URL_ENCODING" value="false" /> | ||
| 43 | - <option name="GITHUB_EMOJI_URL" value="false" /> | ||
| 44 | - <option name="GITHUB_LISTS" value="true" /> | ||
| 45 | - <option name="GITHUB_WIKI_LINKS" value="true" /> | ||
| 46 | - <option name="JEKYLL_FRONT_MATTER" value="false" /> | ||
| 47 | - <option name="SIM_TOC_BLANK_LINE_SPACER" value="true" /> | ||
| 48 | - </ParserOptions> | ||
| 49 | - </ParserSettings> | ||
| 50 | - <HtmlSettings headerTopEnabled="false" headerBottomEnabled="false" bodyTopEnabled="false" bodyBottomEnabled="false" embedUrlContent="false" addPageHeader="true"> | ||
| 51 | - <GeneratorProvider> | ||
| 52 | - <provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.generator" providerName="Default Swing HTML Generator" /> | ||
| 53 | - </GeneratorProvider> | ||
| 54 | - <headerTop /> | ||
| 55 | - <headerBottom /> | ||
| 56 | - <bodyTop /> | ||
| 57 | - <bodyBottom /> | ||
| 58 | - </HtmlSettings> | ||
| 59 | - <CssSettings previewScheme="UI_SCHEME" cssUri="" isCssUriEnabled="false" isCssTextEnabled="false" isDynamicPageWidth="true"> | ||
| 60 | - <StylesheetProvider> | ||
| 61 | - <provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.css" providerName="Default Swing Stylesheet" /> | ||
| 62 | - </StylesheetProvider> | ||
| 63 | - <ScriptProviders /> | ||
| 64 | - <cssText /> | ||
| 65 | - </CssSettings> | ||
| 66 | - <HtmlExportSettings updateOnSave="false" parentDir="$ProjectFileDir$" targetDir="$ProjectFileDir$" cssDir="" scriptDir="" plainHtml="false" imageDir="" copyLinkedImages="false" imageUniquifyType="0" targetExt="" useTargetExt="false" noCssNoScripts="false" linkToExportedHtml="true" exportOnSettingsChange="true" regenerateOnProjectOpen="false" /> | ||
| 67 | - <LinkMapSettings> | ||
| 68 | - <textMaps /> | ||
| 69 | - </LinkMapSettings> | ||
| 70 | - </component> | ||
| 71 | -</project> | ||
| 72 | \ No newline at end of file | 0 | \ No newline at end of file |
.idea/markdown-navigator/profiles_settings.xml deleted
100644 → 0
.idea/vcs.xml
| 1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <project version="4"> | 2 | <project version="4"> |
| 3 | <component name="VcsDirectoryMappings"> | 3 | <component name="VcsDirectoryMappings"> |
| 4 | - <mapping directory="$PROJECT_DIR$" vcs="Git" /> | 4 | + <mapping directory="" vcs="Git" /> |
| 5 | </component> | 5 | </component> |
| 6 | </project> | 6 | </project> |
| 7 | \ No newline at end of file | 7 | \ No newline at end of file |
app/src/main/AndroidManifest.xml
| @@ -86,7 +86,6 @@ | @@ -86,7 +86,6 @@ | ||
| 86 | <activity | 86 | <activity |
| 87 | android:name=".user.activity.UserPersonalActivity" | 87 | android:name=".user.activity.UserPersonalActivity" |
| 88 | android:configChanges="orientation|keyboardHidden|screenSize" | 88 | android:configChanges="orientation|keyboardHidden|screenSize" |
| 89 | - android:launchMode="singleTop" | ||
| 90 | android:screenOrientation="portrait" | 89 | android:screenOrientation="portrait" |
| 91 | android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> | 90 | android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> |
| 92 | </application> | 91 | </application> |
app/src/main/java/com/cnlive/gundam/main/ui/activity/BackBaseActivity.java
0 → 100644
| 1 | +package com.cnlive.gundam.main.ui.activity; | ||
| 2 | + | ||
| 3 | +import android.support.v7.app.AppCompatActivity; | ||
| 4 | +import android.support.v7.widget.Toolbar; | ||
| 5 | +import android.view.MenuItem; | ||
| 6 | +import android.view.View; | ||
| 7 | +import android.widget.TextView; | ||
| 8 | + | ||
| 9 | +import com.cnlive.gundam.R; | ||
| 10 | + | ||
| 11 | +/** | ||
| 12 | + * Created by gujun on 2017/5/31. | ||
| 13 | + */ | ||
| 14 | + | ||
| 15 | +public class BackBaseActivity extends AppCompatActivity { | ||
| 16 | + | ||
| 17 | + private Toolbar toolbar; | ||
| 18 | + | ||
| 19 | + protected void setupToolBar(String title) { | ||
| 20 | + toolbar = (Toolbar) findViewById(R.id.toolbar); | ||
| 21 | + toolbar.setTitle(""); | ||
| 22 | + TextView toolbarTitle = (TextView) findViewById(R.id.toolbarTitle); | ||
| 23 | + toolbarTitle.setText(title); | ||
| 24 | + toolbar.setVisibility(View.VISIBLE); | ||
| 25 | + toolbar.setNavigationIcon(R.drawable.btn_cancel); | ||
| 26 | + setSupportActionBar(toolbar); | ||
| 27 | + | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + public void setToolBarVisible(boolean show) { | ||
| 31 | + if (toolbar == null) return; | ||
| 32 | + toolbar.setVisibility(show ? View.VISIBLE : View.GONE); | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + @Override | ||
| 36 | + public boolean onOptionsItemSelected(MenuItem item) { | ||
| 37 | + if (item.getItemId() == android.R.id.home) { | ||
| 38 | + this.onBackPressed(); | ||
| 39 | + } | ||
| 40 | + return super.onOptionsItemSelected(item); | ||
| 41 | + } | ||
| 42 | +} |
app/src/main/java/com/cnlive/gundam/main/ui/adapter/DataBindingAdapter.java
| @@ -17,11 +17,11 @@ import com.cnlive.gundam.main.ui.adapter.holder.DataBindingViewHolder; | @@ -17,11 +17,11 @@ import com.cnlive.gundam.main.ui.adapter.holder.DataBindingViewHolder; | ||
| 17 | 17 | ||
| 18 | public class DataBindingAdapter<T> extends BaseRecyclerAdapter<T> { | 18 | public class DataBindingAdapter<T> extends BaseRecyclerAdapter<T> { |
| 19 | private int layoutId; | 19 | private int layoutId; |
| 20 | - private int itemBRId; | 20 | + protected int itemBRId; |
| 21 | private int imageHeightBRId = -1; | 21 | private int imageHeightBRId = -1; |
| 22 | private int imageHeight; | 22 | private int imageHeight; |
| 23 | 23 | ||
| 24 | - private OnAdapterViewClickListener<T> l; | 24 | + protected OnAdapterViewClickListener<T> l; |
| 25 | private OnAdapterViewLoadMoreListener loadMoreListener; | 25 | private OnAdapterViewLoadMoreListener loadMoreListener; |
| 26 | 26 | ||
| 27 | public DataBindingAdapter(Context context, int layoutId, int itemBRId) { | 27 | public DataBindingAdapter(Context context, int layoutId, int itemBRId) { |
app/src/main/java/com/cnlive/gundam/main/ui/fragment/ConfigFragment.java
| @@ -57,10 +57,15 @@ public class ConfigFragment extends Fragment implements View.OnClickListener { | @@ -57,10 +57,15 @@ public class ConfigFragment extends Fragment implements View.OnClickListener { | ||
| 57 | switch (view.getId()) { | 57 | switch (view.getId()) { |
| 58 | case R.id.config_header: | 58 | case R.id.config_header: |
| 59 | int uid = UserService.getInstance(getActivity()).getActiveAccountInfo().getUid(); | 59 | int uid = UserService.getInstance(getActivity()).getActiveAccountInfo().getUid(); |
| 60 | - if (uid != 0) | ||
| 61 | - startActivity(new Intent(getActivity(), UserPersonalActivity.class)); | ||
| 62 | - else | 60 | + if (uid != 0) { |
| 61 | + //进入个人中心页面 | ||
| 62 | + Intent intent = new Intent(getActivity(), UserPersonalActivity.class); | ||
| 63 | + intent.putExtra("isEdit",false); | ||
| 64 | + startActivity(intent); | ||
| 65 | + } else { | ||
| 66 | + //进入登录页面 | ||
| 63 | startActivity(new Intent(getActivity(), LoginActivity.class)); | 67 | startActivity(new Intent(getActivity(), LoginActivity.class)); |
| 68 | + } | ||
| 64 | break; | 69 | break; |
| 65 | 70 | ||
| 66 | case R.id.message: | 71 | case R.id.message: |
| @@ -74,8 +79,7 @@ public class ConfigFragment extends Fragment implements View.OnClickListener { | @@ -74,8 +79,7 @@ public class ConfigFragment extends Fragment implements View.OnClickListener { | ||
| 74 | @Override | 79 | @Override |
| 75 | public void onResume() { | 80 | public void onResume() { |
| 76 | super.onResume(); | 81 | super.onResume(); |
| 77 | - notifyUI(); | ||
| 78 | - | 82 | + if (UserService.getInstance(getActivity()).getActiveAccountInfo().getUid() != 0) notifyUI(); |
| 79 | } | 83 | } |
| 80 | 84 | ||
| 81 | private void notifyUI() { | 85 | private void notifyUI() { |
app/src/main/java/com/cnlive/gundam/user/activity/LoginActivity.java
| @@ -34,9 +34,7 @@ public class LoginActivity extends AppCompatActivity { | @@ -34,9 +34,7 @@ public class LoginActivity extends AppCompatActivity { | ||
| 34 | // TODO Auto-generated method stub | 34 | // TODO Auto-generated method stub |
| 35 | if(ev.getAction()== MotionEvent.ACTION_DOWN){ | 35 | if(ev.getAction()== MotionEvent.ACTION_DOWN){ |
| 36 | 36 | ||
| 37 | - // 获得当前得到焦点的View,一般情况下就是EditText(特殊情况就是轨迹求或者实体案件会移动焦点) | ||
| 38 | View v=getCurrentFocus(); | 37 | View v=getCurrentFocus(); |
| 39 | - | ||
| 40 | if(DevilUtil.isShouldHideInput(v,ev)){ | 38 | if(DevilUtil.isShouldHideInput(v,ev)){ |
| 41 | InputMethodManager im=(InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); | 39 | InputMethodManager im=(InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); |
| 42 | DevilUtil.hideSoftInput(v.getWindowToken(),im); | 40 | DevilUtil.hideSoftInput(v.getWindowToken(),im); |
app/src/main/java/com/cnlive/gundam/user/activity/UserPersonalActivity.java
| 1 | package com.cnlive.gundam.user.activity; | 1 | package com.cnlive.gundam.user.activity; |
| 2 | 2 | ||
| 3 | +import android.content.Intent; | ||
| 3 | import android.databinding.DataBindingUtil; | 4 | import android.databinding.DataBindingUtil; |
| 4 | import android.os.Bundle; | 5 | import android.os.Bundle; |
| 5 | import android.support.annotation.Nullable; | 6 | import android.support.annotation.Nullable; |
| 6 | -import android.support.v7.app.AppCompatActivity; | ||
| 7 | 7 | ||
| 8 | import com.cnlive.gundam.R; | 8 | import com.cnlive.gundam.R; |
| 9 | +import com.cnlive.gundam.main.ui.activity.BackBaseActivity; | ||
| 10 | +import com.cnlive.gundam.user.fragment.UserPersonalEditFragment; | ||
| 9 | import com.cnlive.gundam.user.fragment.UserPersonalFragment; | 11 | import com.cnlive.gundam.user.fragment.UserPersonalFragment; |
| 10 | 12 | ||
| 11 | /** | 13 | /** |
| @@ -13,11 +15,24 @@ import com.cnlive.gundam.user.fragment.UserPersonalFragment; | @@ -13,11 +15,24 @@ import com.cnlive.gundam.user.fragment.UserPersonalFragment; | ||
| 13 | * @time 2017/6/28 12:56 | 15 | * @time 2017/6/28 12:56 |
| 14 | * @desc ${TODD} | 16 | * @desc ${TODD} |
| 15 | */ | 17 | */ |
| 16 | -public class UserPersonalActivity extends AppCompatActivity { | 18 | +public class UserPersonalActivity extends BackBaseActivity { |
| 17 | @Override | 19 | @Override |
| 18 | protected void onCreate(@Nullable Bundle savedInstanceState) { | 20 | protected void onCreate(@Nullable Bundle savedInstanceState) { |
| 19 | super.onCreate(savedInstanceState); | 21 | super.onCreate(savedInstanceState); |
| 20 | - DataBindingUtil.setContentView(this, R.layout.activity_setting); | ||
| 21 | - getSupportFragmentManager().beginTransaction().replace(R.id.setting_fragment, UserPersonalFragment.newInstance()).commit(); | 22 | + DataBindingUtil.setContentView(this, R.layout.activity_user_personal); |
| 23 | + addFragment(getIntent()); | ||
| 24 | + } | ||
| 25 | + | ||
| 26 | + private void addFragment(Intent intent ){ | ||
| 27 | + if (intent.hasExtra("isEdit")) { | ||
| 28 | + getSupportFragmentManager().beginTransaction().replace(R.id.contentLayout, | ||
| 29 | + intent.getBooleanExtra("isEdit",false) ? | ||
| 30 | + UserPersonalEditFragment.newInstance(intent.getIntExtra("type", 0)) : | ||
| 31 | + UserPersonalFragment.newInstance()).commit(); | ||
| 32 | + } | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + public void setTitle(String title){ | ||
| 36 | + setupToolBar(title); | ||
| 22 | } | 37 | } |
| 23 | } | 38 | } |
app/src/main/java/com/cnlive/gundam/user/adapter/PersonalAdapter.java
0 → 100644
| 1 | +package com.cnlive.gundam.user.adapter; | ||
| 2 | + | ||
| 3 | +import android.content.Context; | ||
| 4 | +import android.databinding.DataBindingUtil; | ||
| 5 | +import android.databinding.ViewDataBinding; | ||
| 6 | +import android.support.v7.widget.RecyclerView; | ||
| 7 | +import android.view.LayoutInflater; | ||
| 8 | +import android.view.ViewGroup; | ||
| 9 | + | ||
| 10 | +import com.cnlive.gundam.BR; | ||
| 11 | +import com.cnlive.gundam.R; | ||
| 12 | +import com.cnlive.gundam.main.ui.adapter.DataBindingAdapter; | ||
| 13 | +import com.cnlive.gundam.main.ui.adapter.holder.DataBindingViewHolder; | ||
| 14 | +import com.cnlive.gundam.user.model.PersonalData; | ||
| 15 | + | ||
| 16 | +/** | ||
| 17 | + * Created by gujun on 2017/6/28. | ||
| 18 | + */ | ||
| 19 | + | ||
| 20 | +public class PersonalAdapter extends DataBindingAdapter<PersonalData>{ | ||
| 21 | + | ||
| 22 | + public PersonalAdapter(Context context, int layoutId, int itemBRId) { | ||
| 23 | + super(context, layoutId, itemBRId); | ||
| 24 | + } | ||
| 25 | + | ||
| 26 | + @Override | ||
| 27 | + public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { | ||
| 28 | + if(viewType == PersonalData.TYPE_HEADER){ | ||
| 29 | + ViewDataBinding binding = DataBindingUtil.inflate(LayoutInflater.from(mContext), R.layout.layout_personal_header_item, parent, false); | ||
| 30 | + DataBindingViewHolder viewHolder = new DataBindingViewHolder(binding.getRoot()); | ||
| 31 | + viewHolder.setBinding(binding); | ||
| 32 | + return viewHolder; | ||
| 33 | + }else{ | ||
| 34 | + return super.onCreateViewHolder(parent, viewType); | ||
| 35 | + } | ||
| 36 | + } | ||
| 37 | + | ||
| 38 | + @Override | ||
| 39 | + public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { | ||
| 40 | + if(getItem(position).getItemType() == PersonalData.TYPE_HEADER){ | ||
| 41 | + DataBindingViewHolder videoListViewHolder = (DataBindingViewHolder) holder; | ||
| 42 | + videoListViewHolder.getBinding().setVariable(itemBRId, getItem(position)); | ||
| 43 | + if (l != null) | ||
| 44 | + videoListViewHolder.getBinding().setVariable(BR.viewClickListner, l); | ||
| 45 | + videoListViewHolder.getBinding().executePendingBindings(); | ||
| 46 | + }else{ | ||
| 47 | + super.onBindViewHolder(holder, position); | ||
| 48 | + } | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + @Override | ||
| 52 | + public int getItemViewType(int position) { | ||
| 53 | + return getItem(position).getItemType(); | ||
| 54 | + } | ||
| 55 | +} |
app/src/main/java/com/cnlive/gundam/user/fragment/LoginFragment.java
| @@ -34,7 +34,6 @@ public class LoginFragment extends Fragment implements View.OnClickListener { | @@ -34,7 +34,6 @@ public class LoginFragment extends Fragment implements View.OnClickListener { | ||
| 34 | public static DataEntity data; | 34 | public static DataEntity data; |
| 35 | 35 | ||
| 36 | private Account account;//密码登录的account | 36 | private Account account;//密码登录的account |
| 37 | - private Account account1;//第三方登录的account | ||
| 38 | 37 | ||
| 39 | //跳转页面的对话框 | 38 | //跳转页面的对话框 |
| 40 | private ProgressDialog dialog; | 39 | private ProgressDialog dialog; |
| @@ -157,7 +156,7 @@ public class LoginFragment extends Fragment implements View.OnClickListener { | @@ -157,7 +156,7 @@ public class LoginFragment extends Fragment implements View.OnClickListener { | ||
| 157 | data = userData.getData(); | 156 | data = userData.getData(); |
| 158 | 157 | ||
| 159 | UserService userService = UserService.getInstance(getActivity()); | 158 | UserService userService = UserService.getInstance(getActivity()); |
| 160 | - userService.setUserInfo(account, data); | 159 | + userService.setUserInfo(account,data); |
| 161 | //userService.isAutoLogin(); | 160 | //userService.isAutoLogin(); |
| 162 | userService.autoLogin(binding.edtLoginNumber.toString(), binding.edtInputPassward.getText().toString(), data); | 161 | userService.autoLogin(binding.edtLoginNumber.toString(), binding.edtInputPassward.getText().toString(), data); |
| 163 | 162 |
app/src/main/java/com/cnlive/gundam/user/fragment/UserPersonalEditFragment.java
0 → 100644
| 1 | +package com.cnlive.gundam.user.fragment; | ||
| 2 | + | ||
| 3 | +import android.databinding.DataBindingUtil; | ||
| 4 | +import android.os.Bundle; | ||
| 5 | +import android.support.annotation.Nullable; | ||
| 6 | +import android.support.v4.app.Fragment; | ||
| 7 | +import android.view.LayoutInflater; | ||
| 8 | +import android.view.View; | ||
| 9 | +import android.view.ViewGroup; | ||
| 10 | +import android.widget.Toast; | ||
| 11 | + | ||
| 12 | +import com.cnlive.gundam.R; | ||
| 13 | +import com.cnlive.gundam.databinding.FragmentPersonalEditBinding; | ||
| 14 | +import com.cnlive.gundam.user.activity.UserPersonalActivity; | ||
| 15 | +import com.cnlive.gundam.user.auth.UserService; | ||
| 16 | +import com.cnlive.gundam.user.model.User; | ||
| 17 | +import com.cnlive.libs.user.IUserService; | ||
| 18 | +import com.cnlive.libs.user.UserUtil; | ||
| 19 | +import com.cnlive.libs.util.data.network.Callback; | ||
| 20 | + | ||
| 21 | +/** | ||
| 22 | + * Created by gujun on 2017/6/28. | ||
| 23 | + */ | ||
| 24 | + | ||
| 25 | +public class UserPersonalEditFragment extends Fragment implements Callback, View.OnClickListener { | ||
| 26 | + | ||
| 27 | + public static final int TYPE_NICK = 0x1001; | ||
| 28 | + public static final int TYPE_MOBILE = 0x1002; | ||
| 29 | + public static final int TYPE_EMAIL = 0x1003; | ||
| 30 | + public static final int TYPE_ADDRESS = 0x1004; | ||
| 31 | + | ||
| 32 | + private FragmentPersonalEditBinding binding; | ||
| 33 | + private int type; | ||
| 34 | + private User user; | ||
| 35 | + | ||
| 36 | + public static UserPersonalEditFragment newInstance(int type) { | ||
| 37 | + | ||
| 38 | + Bundle args = new Bundle(); | ||
| 39 | + args.putInt("type", type); | ||
| 40 | + UserPersonalEditFragment fragment = new UserPersonalEditFragment(); | ||
| 41 | + fragment.setArguments(args); | ||
| 42 | + return fragment; | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + @Nullable | ||
| 46 | + @Override | ||
| 47 | + public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { | ||
| 48 | + binding = DataBindingUtil.inflate(inflater, R.layout.fragment_personal_edit, container, false); | ||
| 49 | + return binding.getRoot(); | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + @Override | ||
| 53 | + public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { | ||
| 54 | + super.onViewCreated(view, savedInstanceState); | ||
| 55 | + init(); | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | + private void init() { | ||
| 59 | + binding.setUserPersonalEditFragment(this); | ||
| 60 | + type = getArguments().getInt("type"); | ||
| 61 | + UserService userService = UserService.getInstance(getActivity()); | ||
| 62 | + user = userService.getActiveAccountInfo(); | ||
| 63 | + String title = ""; | ||
| 64 | + switch (type) { | ||
| 65 | + case TYPE_NICK: | ||
| 66 | + binding.editText.setText(user.getNickname()); | ||
| 67 | + binding.editText.setVisibility(View.VISIBLE); | ||
| 68 | + binding.includeMobileLayout.mobileKeycodeLayout.setVisibility(View.GONE); | ||
| 69 | + title = "修改昵称"; | ||
| 70 | + break; | ||
| 71 | + case TYPE_MOBILE: | ||
| 72 | + binding.editText.setVisibility(View.GONE); | ||
| 73 | + binding.includeMobileLayout.mobileKeycodeLayout.setVisibility(View.VISIBLE); | ||
| 74 | + binding.includeMobileLayout.edtLoginNumber.setText(user.getMobile()); | ||
| 75 | + binding.includeMobileLayout.getVerify.setOnClickListener(this); | ||
| 76 | + title = "修改手机号"; | ||
| 77 | + break; | ||
| 78 | + case TYPE_EMAIL: | ||
| 79 | + binding.editText.setText(user.getEmail()); | ||
| 80 | + binding.editText.setVisibility(View.VISIBLE); | ||
| 81 | + binding.includeMobileLayout.mobileKeycodeLayout.setVisibility(View.GONE); | ||
| 82 | + title = "修改邮箱"; | ||
| 83 | + break; | ||
| 84 | + case TYPE_ADDRESS: | ||
| 85 | + binding.editText.setText(user.getLocation()); | ||
| 86 | + binding.editText.setVisibility(View.VISIBLE); | ||
| 87 | + binding.includeMobileLayout.mobileKeycodeLayout.setVisibility(View.GONE); | ||
| 88 | + title = "修改地址"; | ||
| 89 | + break; | ||
| 90 | + } | ||
| 91 | + ((UserPersonalActivity)getActivity()).setTitle(title); | ||
| 92 | + } | ||
| 93 | + | ||
| 94 | + @Override | ||
| 95 | + public void onClick(View v) { | ||
| 96 | + if (v.getId() == R.id.submit) { | ||
| 97 | + switch (type) { | ||
| 98 | + case TYPE_NICK: | ||
| 99 | + UserUtil.modifyUserInfo(String.valueOf(user.getUid()), "nickName", binding.editText.getText().toString(), this); | ||
| 100 | + break; | ||
| 101 | + case TYPE_MOBILE: | ||
| 102 | + UserUtil.updateMobile(String.valueOf(user.getUid()), binding.includeMobileLayout.edtLoginNumber.getText().toString(), binding.includeMobileLayout.edtVerify.getText().toString(), this); | ||
| 103 | + break; | ||
| 104 | + case TYPE_EMAIL: | ||
| 105 | + UserUtil.modifyUserInfo(String.valueOf(user.getUid()), "email", binding.editText.getText().toString(), this); | ||
| 106 | + break; | ||
| 107 | + case TYPE_ADDRESS: | ||
| 108 | + UserUtil.modifyUserInfo(String.valueOf(user.getUid()), "location", binding.editText.getText().toString(), this); | ||
| 109 | + break; | ||
| 110 | + } | ||
| 111 | + } else if (v.getId() == R.id.get_verify) { | ||
| 112 | + //TODO 获取验证码 | ||
| 113 | + UserUtil.sendMessage(IUserService.REGISTER_OR_MODIFY_MOBILE, binding.includeMobileLayout.edtLoginNumber.getText().toString(), new Callback() { | ||
| 114 | + @Override | ||
| 115 | + public void onState(int i, String s, Object o) { | ||
| 116 | + if (i == IUserService.SUCCESS) { | ||
| 117 | + Toast.makeText(getActivity(), "验证码已发送", Toast.LENGTH_LONG).show(); | ||
| 118 | + } else { | ||
| 119 | + Toast.makeText(getActivity(), "获取验证码失败" + s, Toast.LENGTH_LONG).show(); | ||
| 120 | + } | ||
| 121 | + | ||
| 122 | + } | ||
| 123 | + }); | ||
| 124 | + } | ||
| 125 | + } | ||
| 126 | + | ||
| 127 | + @Override | ||
| 128 | + public void onState(int i, String s, Object o) { | ||
| 129 | + if (i == IUserService.SUCCESS) { | ||
| 130 | + Toast.makeText(getActivity(), "提交成功", Toast.LENGTH_LONG).show(); | ||
| 131 | + } else { | ||
| 132 | + Toast.makeText(getActivity(), "提交失败" + s, Toast.LENGTH_LONG).show(); | ||
| 133 | + } | ||
| 134 | + | ||
| 135 | + //TODO 更新一下本地数据 | ||
| 136 | + } | ||
| 137 | +} |
app/src/main/java/com/cnlive/gundam/user/fragment/UserPersonalFragment.java
| 1 | package com.cnlive.gundam.user.fragment; | 1 | package com.cnlive.gundam.user.fragment; |
| 2 | 2 | ||
| 3 | +import android.content.Intent; | ||
| 3 | import android.databinding.DataBindingUtil; | 4 | import android.databinding.DataBindingUtil; |
| 4 | import android.os.Bundle; | 5 | import android.os.Bundle; |
| 5 | import android.support.annotation.Nullable; | 6 | import android.support.annotation.Nullable; |
| 6 | import android.support.v4.app.Fragment; | 7 | import android.support.v4.app.Fragment; |
| 8 | +import android.support.v7.widget.LinearLayoutManager; | ||
| 7 | import android.view.LayoutInflater; | 9 | import android.view.LayoutInflater; |
| 8 | import android.view.View; | 10 | import android.view.View; |
| 9 | import android.view.ViewGroup; | 11 | import android.view.ViewGroup; |
| 12 | +import android.widget.Toast; | ||
| 10 | 13 | ||
| 14 | +import com.cnlive.gundam.BR; | ||
| 11 | import com.cnlive.gundam.R; | 15 | import com.cnlive.gundam.R; |
| 12 | import com.cnlive.gundam.databinding.FragmentUserPersonalBinding; | 16 | import com.cnlive.gundam.databinding.FragmentUserPersonalBinding; |
| 17 | +import com.cnlive.gundam.main.ui.adapter.DataBindingAdapter; | ||
| 18 | +import com.cnlive.gundam.user.activity.UserPersonalActivity; | ||
| 19 | +import com.cnlive.gundam.user.adapter.PersonalAdapter; | ||
| 20 | +import com.cnlive.gundam.user.auth.UserService; | ||
| 21 | +import com.cnlive.gundam.user.model.PersonalData; | ||
| 22 | +import com.cnlive.gundam.user.model.User; | ||
| 13 | 23 | ||
| 24 | +import java.util.ArrayList; | ||
| 25 | +import java.util.List; | ||
| 14 | 26 | ||
| 15 | 27 | ||
| 16 | /** | 28 | /** |
| @@ -18,38 +30,93 @@ import com.cnlive.gundam.databinding.FragmentUserPersonalBinding; | @@ -18,38 +30,93 @@ import com.cnlive.gundam.databinding.FragmentUserPersonalBinding; | ||
| 18 | * @time 2017/6/28 13:06 | 30 | * @time 2017/6/28 13:06 |
| 19 | * @desc ${TODD} | 31 | * @desc ${TODD} |
| 20 | */ | 32 | */ |
| 21 | -public class UserPersonalFragment extends Fragment{ | 33 | +public class UserPersonalFragment extends Fragment implements DataBindingAdapter.OnAdapterViewClickListener<PersonalData> { |
| 22 | 34 | ||
| 23 | private FragmentUserPersonalBinding binding; | 35 | private FragmentUserPersonalBinding binding; |
| 24 | 36 | ||
| 37 | + private PersonalAdapter adapter; | ||
| 25 | 38 | ||
| 26 | - @Nullable | ||
| 27 | - @Override | ||
| 28 | - public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | ||
| 29 | - binding = DataBindingUtil.inflate(inflater, R.layout.fragment_user_personal, container, false); | ||
| 30 | - return binding.getRoot(); | ||
| 31 | - } | 39 | + private List<PersonalData> personalData; |
| 32 | 40 | ||
| 33 | public static UserPersonalFragment newInstance() { | 41 | public static UserPersonalFragment newInstance() { |
| 42 | + | ||
| 43 | + Bundle args = new Bundle(); | ||
| 44 | + | ||
| 34 | UserPersonalFragment fragment = new UserPersonalFragment(); | 45 | UserPersonalFragment fragment = new UserPersonalFragment(); |
| 46 | + fragment.setArguments(args); | ||
| 35 | return fragment; | 47 | return fragment; |
| 36 | } | 48 | } |
| 37 | 49 | ||
| 50 | + @Nullable | ||
| 38 | @Override | 51 | @Override |
| 39 | - public void onActivityCreated(Bundle savedInstanceState) { | ||
| 40 | - super.onActivityCreated(savedInstanceState); | ||
| 41 | - initToolBar(); | ||
| 42 | - /*init(); | ||
| 43 | - PersonalHeadItem.getContent(getActivity()); | ||
| 44 | - PersonalItem.getContent(getActivity());*/ | ||
| 45 | - } | ||
| 46 | - private void initToolBar() { | ||
| 47 | - binding.personalIncludeLayout.toolbarTitle.setText("个人资料"); | 52 | + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { |
| 53 | + binding = DataBindingUtil.inflate(inflater, R.layout.fragment_user_personal, container, false); | ||
| 54 | + return binding.getRoot(); | ||
| 48 | } | 55 | } |
| 49 | 56 | ||
| 57 | + @Override | ||
| 58 | + public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { | ||
| 59 | + super.onViewCreated(view, savedInstanceState); | ||
| 60 | + initData(); | ||
| 61 | + init(); | ||
| 62 | + } | ||
| 50 | 63 | ||
| 64 | + private void initData() { | ||
| 65 | + UserService userService = UserService.getInstance(getActivity()); | ||
| 66 | + User user = userService.getActiveAccountInfo(); | ||
| 67 | + personalData = new ArrayList<>(); | ||
| 68 | + personalData.add(new PersonalData("头像", user.getFaceurl(), PersonalData.TYPE_HEADER)); | ||
| 69 | + personalData.add(new PersonalData("昵称", user.getNickname(), PersonalData.TYPE_NICK)); | ||
| 70 | + personalData.add(new PersonalData("性别", user.getGender(), PersonalData.TYPE_GENDER)); | ||
| 71 | + personalData.add(new PersonalData("手机号", user.getMobile(), PersonalData.TYPE_MOBILE)); | ||
| 72 | + personalData.add(new PersonalData("邮箱", user.getEmail(), PersonalData.TYPE_EMAIL)); | ||
| 73 | + personalData.add(new PersonalData("联系地址", user.getLocation(), PersonalData.TYPE_ADDRESS)); | ||
| 74 | + } | ||
| 51 | 75 | ||
| 76 | + private void init() { | ||
| 77 | + ((UserPersonalActivity)getActivity()).setTitle("个人资料"); | ||
| 78 | + binding.setListAdapter(adapter = new PersonalAdapter(getActivity(), R.layout.layout_personal_item, BR.data)); | ||
| 79 | + binding.setLayoutManager(new LinearLayoutManager(getActivity())); | ||
| 80 | + adapter.updateItems(personalData); | ||
| 81 | + adapter.setOnViewClickListener(this); | ||
| 82 | + } | ||
| 52 | 83 | ||
| 53 | - | ||
| 54 | - | 84 | + @Override |
| 85 | + public void onViewClick(View v, PersonalData program) { | ||
| 86 | + if (v.getId() == R.id.itemLayout) { | ||
| 87 | + Intent intent = null; | ||
| 88 | + switch (program.getItemType()) { | ||
| 89 | + case PersonalData.TYPE_HEADER: | ||
| 90 | + Toast.makeText(getActivity(), "头像点击", Toast.LENGTH_LONG).show(); | ||
| 91 | + break; | ||
| 92 | + case PersonalData.TYPE_NICK: | ||
| 93 | + intent = new Intent(getActivity(), UserPersonalActivity.class); | ||
| 94 | + intent.putExtra("isEdit",true); | ||
| 95 | + intent.putExtra("type", UserPersonalEditFragment.TYPE_NICK); | ||
| 96 | + startActivity(intent); | ||
| 97 | + break; | ||
| 98 | + case PersonalData.TYPE_GENDER: | ||
| 99 | + Toast.makeText(getActivity(), "性别点击", Toast.LENGTH_LONG).show(); | ||
| 100 | + break; | ||
| 101 | + case PersonalData.TYPE_MOBILE: | ||
| 102 | + intent = new Intent(getActivity(), UserPersonalActivity.class); | ||
| 103 | + intent.putExtra("isEdit",true); | ||
| 104 | + intent.putExtra("type", UserPersonalEditFragment.TYPE_MOBILE); | ||
| 105 | + startActivity(intent); | ||
| 106 | + break; | ||
| 107 | + case PersonalData.TYPE_EMAIL: | ||
| 108 | + intent = new Intent(getActivity(), UserPersonalActivity.class); | ||
| 109 | + intent.putExtra("isEdit",true); | ||
| 110 | + intent.putExtra("type", UserPersonalEditFragment.TYPE_EMAIL); | ||
| 111 | + startActivity(intent); | ||
| 112 | + break; | ||
| 113 | + case PersonalData.TYPE_ADDRESS: | ||
| 114 | + intent = new Intent(getActivity(), UserPersonalActivity.class); | ||
| 115 | + intent.putExtra("isEdit",true); | ||
| 116 | + intent.putExtra("type", UserPersonalEditFragment.TYPE_ADDRESS); | ||
| 117 | + startActivity(intent); | ||
| 118 | + break; | ||
| 119 | + } | ||
| 120 | + } | ||
| 121 | + } | ||
| 55 | } | 122 | } |
app/src/main/java/com/cnlive/gundam/user/model/ActiveInfo.java deleted
100644 → 0
| 1 | -package com.cnlive.gundam.user.model; | ||
| 2 | - | ||
| 3 | - | ||
| 4 | -import java.io.Serializable; | ||
| 5 | - | ||
| 6 | -/** | ||
| 7 | - * Created by Lynn on 5/25/2017. | ||
| 8 | - */ | ||
| 9 | - | ||
| 10 | -public class ActiveInfo implements Serializable { | ||
| 11 | - private int totalCount; | ||
| 12 | - private int nextCursor; | ||
| 13 | - private int preCursor; | ||
| 14 | - private String activityId; | ||
| 15 | - private String activityName; | ||
| 16 | - private int activityStatus; | ||
| 17 | - private int isHorizontalScreen; | ||
| 18 | - private String channelId; | ||
| 19 | - private String createTime; | ||
| 20 | - private String startTime; | ||
| 21 | - private String endTime; | ||
| 22 | - private String coverImgUrl; | ||
| 23 | - private String activityCategory; | ||
| 24 | - private Object extensions; | ||
| 25 | - private String rates; | ||
| 26 | - | ||
| 27 | - public ActiveInfo() { | ||
| 28 | - } | ||
| 29 | - | ||
| 30 | - public ActiveInfo(int totalCount, int nextCursor, int preCursor, String activityId, String activityName, int activityStatus, int isHorizontalScreen, String channelId, String createTime, String startTime, String endTime, String coverImgUrl, String activityCategory, Object extensions, String rates) { | ||
| 31 | - this.totalCount = totalCount; | ||
| 32 | - this.nextCursor = nextCursor; | ||
| 33 | - this.preCursor = preCursor; | ||
| 34 | - this.activityId = activityId; | ||
| 35 | - this.activityName = activityName; | ||
| 36 | - this.activityStatus = activityStatus; | ||
| 37 | - this.isHorizontalScreen = isHorizontalScreen; | ||
| 38 | - this.channelId = channelId; | ||
| 39 | - this.createTime = createTime; | ||
| 40 | - this.startTime = startTime; | ||
| 41 | - this.endTime = endTime; | ||
| 42 | - this.coverImgUrl = coverImgUrl; | ||
| 43 | - this.activityCategory = activityCategory; | ||
| 44 | - this.extensions = extensions; | ||
| 45 | - this.rates = rates; | ||
| 46 | - } | ||
| 47 | - | ||
| 48 | - public int getTotalCount() { | ||
| 49 | - return totalCount; | ||
| 50 | - } | ||
| 51 | - | ||
| 52 | - public void setTotalCount(int totalCount) { | ||
| 53 | - this.totalCount = totalCount; | ||
| 54 | - } | ||
| 55 | - | ||
| 56 | - public int getNextCursor() { | ||
| 57 | - return nextCursor; | ||
| 58 | - } | ||
| 59 | - | ||
| 60 | - public void setNextCursor(int nextCursor) { | ||
| 61 | - this.nextCursor = nextCursor; | ||
| 62 | - } | ||
| 63 | - | ||
| 64 | - public int getPreCursor() { | ||
| 65 | - return preCursor; | ||
| 66 | - } | ||
| 67 | - | ||
| 68 | - public void setPreCursor(int preCursor) { | ||
| 69 | - this.preCursor = preCursor; | ||
| 70 | - } | ||
| 71 | - | ||
| 72 | - public String getActivityId() { | ||
| 73 | - return activityId; | ||
| 74 | - } | ||
| 75 | - | ||
| 76 | - public void setActivityId(String activityId) { | ||
| 77 | - this.activityId = activityId; | ||
| 78 | - } | ||
| 79 | - | ||
| 80 | - public String getActivityName() { | ||
| 81 | - return activityName; | ||
| 82 | - } | ||
| 83 | - | ||
| 84 | - public void setActivityName(String activityName) { | ||
| 85 | - this.activityName = activityName; | ||
| 86 | - } | ||
| 87 | - | ||
| 88 | - public int getActivityStatus() { | ||
| 89 | - return activityStatus; | ||
| 90 | - } | ||
| 91 | - | ||
| 92 | - public void setActivityStatus(int activityStatus) { | ||
| 93 | - this.activityStatus = activityStatus; | ||
| 94 | - } | ||
| 95 | - | ||
| 96 | - public int getIsHorizontalScreen() { | ||
| 97 | - return isHorizontalScreen; | ||
| 98 | - } | ||
| 99 | - | ||
| 100 | - public void setIsHorizontalScreen(int isHorizontalScreen) { | ||
| 101 | - this.isHorizontalScreen = isHorizontalScreen; | ||
| 102 | - } | ||
| 103 | - | ||
| 104 | - public String getChannelId() { | ||
| 105 | - return channelId; | ||
| 106 | - } | ||
| 107 | - | ||
| 108 | - public void setChannelId(String channelId) { | ||
| 109 | - this.channelId = channelId; | ||
| 110 | - } | ||
| 111 | - | ||
| 112 | - public String getCreateTime() { | ||
| 113 | - return createTime; | ||
| 114 | - } | ||
| 115 | - | ||
| 116 | - public void setCreateTime(String createTime) { | ||
| 117 | - this.createTime = createTime; | ||
| 118 | - } | ||
| 119 | - | ||
| 120 | - public String getStartTime() { | ||
| 121 | - return startTime; | ||
| 122 | - } | ||
| 123 | - | ||
| 124 | - public void setStartTime(String startTime) { | ||
| 125 | - this.startTime = startTime; | ||
| 126 | - } | ||
| 127 | - | ||
| 128 | - public String getEndTime() { | ||
| 129 | - return endTime; | ||
| 130 | - } | ||
| 131 | - | ||
| 132 | - public void setEndTime(String endTime) { | ||
| 133 | - this.endTime = endTime; | ||
| 134 | - } | ||
| 135 | - | ||
| 136 | - public String getCoverImgUrl() { | ||
| 137 | - return coverImgUrl; | ||
| 138 | - } | ||
| 139 | - | ||
| 140 | - public void setCoverImgUrl(String coverImgUrl) { | ||
| 141 | - this.coverImgUrl = coverImgUrl; | ||
| 142 | - } | ||
| 143 | - | ||
| 144 | - public String getActivityCategory() { | ||
| 145 | - return activityCategory; | ||
| 146 | - } | ||
| 147 | - | ||
| 148 | - public void setActivityCategory(String activityCategory) { | ||
| 149 | - this.activityCategory = activityCategory; | ||
| 150 | - } | ||
| 151 | - | ||
| 152 | - public Object getExtensions() { | ||
| 153 | - return extensions; | ||
| 154 | - } | ||
| 155 | - | ||
| 156 | - public void setExtensions(Object extensions) { | ||
| 157 | - this.extensions = extensions; | ||
| 158 | - } | ||
| 159 | - | ||
| 160 | - public String getRates() { | ||
| 161 | - return rates; | ||
| 162 | - } | ||
| 163 | - | ||
| 164 | - public void setRates(String rates) { | ||
| 165 | - this.rates = rates; | ||
| 166 | - } | ||
| 167 | - | ||
| 168 | - @Override | ||
| 169 | - public String toString() { | ||
| 170 | - return "ActiveInfo{" + | ||
| 171 | - "totalCount=" + totalCount + | ||
| 172 | - ", nextCursor=" + nextCursor + | ||
| 173 | - ", preCursor=" + preCursor + | ||
| 174 | - ", activityId='" + activityId + '\'' + | ||
| 175 | - ", activityName='" + activityName + '\'' + | ||
| 176 | - ", activityStatus=" + activityStatus + | ||
| 177 | - ", isHorizontalScreen=" + isHorizontalScreen + | ||
| 178 | - ", channelId='" + channelId + '\'' + | ||
| 179 | - ", createTime='" + createTime + '\'' + | ||
| 180 | - ", startTime='" + startTime + '\'' + | ||
| 181 | - ", endTime='" + endTime + '\'' + | ||
| 182 | - ", coverImgUrl='" + coverImgUrl + '\'' + | ||
| 183 | - ", activityCategory='" + activityCategory + '\'' + | ||
| 184 | - ", extensions='" + extensions + '\'' + | ||
| 185 | - ", rates='" + rates + '\'' + | ||
| 186 | - '}'; | ||
| 187 | - } | ||
| 188 | -} |
app/src/main/java/com/cnlive/gundam/user/model/ChannelInfoModel.java deleted
100644 → 0
| 1 | -package com.cnlive.gundam.user.model; | ||
| 2 | - | ||
| 3 | - | ||
| 4 | -import com.cnlive.gundam.user.model.base.ErrorMessage; | ||
| 5 | - | ||
| 6 | -import java.io.Serializable; | ||
| 7 | - | ||
| 8 | -/** | ||
| 9 | - * Created by Lynn on 5/26/2017. | ||
| 10 | - */ | ||
| 11 | - | ||
| 12 | -public class ChannelInfoModel extends ErrorMessage { | ||
| 13 | - private ChannelInfo data; | ||
| 14 | - | ||
| 15 | - public ChannelInfoModel() { | ||
| 16 | - } | ||
| 17 | - | ||
| 18 | - public ChannelInfoModel(ChannelInfo data) { | ||
| 19 | - this.data = data; | ||
| 20 | - } | ||
| 21 | - | ||
| 22 | - public ChannelInfo getData() { | ||
| 23 | - return data; | ||
| 24 | - } | ||
| 25 | - | ||
| 26 | - public void setData(ChannelInfo data) { | ||
| 27 | - this.data = data; | ||
| 28 | - } | ||
| 29 | - | ||
| 30 | - public class ChannelInfo implements Serializable { | ||
| 31 | - private String coverImgUrl; | ||
| 32 | - private String channelId; | ||
| 33 | - private String channelName; | ||
| 34 | - private int status; | ||
| 35 | - | ||
| 36 | - public ChannelInfo() { | ||
| 37 | - } | ||
| 38 | - | ||
| 39 | - public ChannelInfo(String coverImgUrl, String channelId, String channelName, int status) { | ||
| 40 | - this.coverImgUrl = coverImgUrl; | ||
| 41 | - this.channelId = channelId; | ||
| 42 | - this.channelName = channelName; | ||
| 43 | - this.status = status; | ||
| 44 | - } | ||
| 45 | - | ||
| 46 | - public String getCoverImgUrl() { | ||
| 47 | - return coverImgUrl; | ||
| 48 | - } | ||
| 49 | - | ||
| 50 | - public void setCoverImgUrl(String coverImgUrl) { | ||
| 51 | - this.coverImgUrl = coverImgUrl; | ||
| 52 | - } | ||
| 53 | - | ||
| 54 | - public String getChannelId() { | ||
| 55 | - return channelId; | ||
| 56 | - } | ||
| 57 | - | ||
| 58 | - public void setChannelId(String channelId) { | ||
| 59 | - this.channelId = channelId; | ||
| 60 | - } | ||
| 61 | - | ||
| 62 | - public String getChannelName() { | ||
| 63 | - return channelName; | ||
| 64 | - } | ||
| 65 | - | ||
| 66 | - public void setChannelName(String channelName) { | ||
| 67 | - this.channelName = channelName; | ||
| 68 | - } | ||
| 69 | - | ||
| 70 | - public int getStatus() { | ||
| 71 | - return status; | ||
| 72 | - } | ||
| 73 | - | ||
| 74 | - public void setStatus(int status) { | ||
| 75 | - this.status = status; | ||
| 76 | - } | ||
| 77 | - | ||
| 78 | - @Override | ||
| 79 | - public String toString() { | ||
| 80 | - return "ChannelInfo{" + | ||
| 81 | - "coverImgUrl='" + coverImgUrl + '\'' + | ||
| 82 | - ", channelId='" + channelId + '\'' + | ||
| 83 | - ", channelName='" + channelName + '\'' + | ||
| 84 | - ", status=" + status + | ||
| 85 | - '}'; | ||
| 86 | - } | ||
| 87 | - } | ||
| 88 | - | ||
| 89 | - @Override | ||
| 90 | - public String toString() { | ||
| 91 | - return "ChannelInfoModel{" + | ||
| 92 | - "data=" + data + | ||
| 93 | - '}'; | ||
| 94 | - } | ||
| 95 | -} |
app/src/main/java/com/cnlive/gundam/user/model/PersonalDate.java renamed to app/src/main/java/com/cnlive/gundam/user/model/PersonalData.java
| @@ -5,7 +5,25 @@ package com.cnlive.gundam.user.model; | @@ -5,7 +5,25 @@ package com.cnlive.gundam.user.model; | ||
| 5 | * @time 2017/6/28 13:55 | 5 | * @time 2017/6/28 13:55 |
| 6 | * @desc ${TODD} | 6 | * @desc ${TODD} |
| 7 | */ | 7 | */ |
| 8 | -public class PersonalDate { | 8 | +public class PersonalData { |
| 9 | + | ||
| 10 | + private String itemName; | ||
| 11 | + private String itemMessage; | ||
| 12 | + private int itemType; | ||
| 13 | + | ||
| 14 | + public static final int TYPE_HEADER = 0x1001; | ||
| 15 | + public static final int TYPE_NICK = 0x1002; | ||
| 16 | + public static final int TYPE_GENDER = 0x1003; | ||
| 17 | + public static final int TYPE_MOBILE = 0x1004; | ||
| 18 | + public static final int TYPE_EMAIL = 0x1005; | ||
| 19 | + public static final int TYPE_ADDRESS = 0x1006; | ||
| 20 | + | ||
| 21 | + public PersonalData(String itemName, String itemMessage, int itemType) { | ||
| 22 | + this.itemName = itemName; | ||
| 23 | + this.itemMessage = itemMessage; | ||
| 24 | + this.itemType = itemType; | ||
| 25 | + } | ||
| 26 | + | ||
| 9 | public String getItemName() { | 27 | public String getItemName() { |
| 10 | return itemName; | 28 | return itemName; |
| 11 | } | 29 | } |
| @@ -14,8 +32,6 @@ public class PersonalDate { | @@ -14,8 +32,6 @@ public class PersonalDate { | ||
| 14 | this.itemName = itemName; | 32 | this.itemName = itemName; |
| 15 | } | 33 | } |
| 16 | 34 | ||
| 17 | - private String itemName; | ||
| 18 | - | ||
| 19 | public String getItemMessage() { | 35 | public String getItemMessage() { |
| 20 | return itemMessage; | 36 | return itemMessage; |
| 21 | } | 37 | } |
| @@ -24,18 +40,11 @@ public class PersonalDate { | @@ -24,18 +40,11 @@ public class PersonalDate { | ||
| 24 | this.itemMessage = itemMessage; | 40 | this.itemMessage = itemMessage; |
| 25 | } | 41 | } |
| 26 | 42 | ||
| 27 | - private String itemMessage; | ||
| 28 | - | ||
| 29 | - | ||
| 30 | - | ||
| 31 | - public PersonalDate(String itemName, String itemMessage) { | ||
| 32 | - this.itemName = itemName; | ||
| 33 | - this.itemMessage = itemMessage; | 43 | + public int getItemType() { |
| 44 | + return itemType; | ||
| 34 | } | 45 | } |
| 35 | 46 | ||
| 36 | - | ||
| 37 | - | ||
| 38 | - | ||
| 39 | - | ||
| 40 | - | 47 | + public void setItemType(int itemType) { |
| 48 | + this.itemType = itemType; | ||
| 49 | + } | ||
| 41 | } | 50 | } |
app/src/main/java/com/cnlive/gundam/video/test.java deleted
100644 → 0
app/src/main/res/layout/activity_user_personal.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<layout xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| 3 | + | ||
| 4 | + <data> | ||
| 5 | + | ||
| 6 | + </data> | ||
| 7 | + | ||
| 8 | + <LinearLayout | ||
| 9 | + android:layout_width="match_parent" | ||
| 10 | + android:layout_height="match_parent" | ||
| 11 | + android:orientation="vertical"> | ||
| 12 | + | ||
| 13 | + <include | ||
| 14 | + layout="@layout/layout_actionbar_back"/> | ||
| 15 | + | ||
| 16 | + <RelativeLayout | ||
| 17 | + android:id="@+id/contentLayout" | ||
| 18 | + android:layout_width="match_parent" | ||
| 19 | + android:layout_height="match_parent"/> | ||
| 20 | + | ||
| 21 | + </LinearLayout> | ||
| 22 | + | ||
| 23 | +</layout> | ||
| 0 | \ No newline at end of file | 24 | \ No newline at end of file |
app/src/main/res/layout/fragment_login.xml
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <layout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <layout xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | > | 3 | > |
| 4 | - <ScrollView | ||
| 5 | - android:id="@+id/detail_view" | ||
| 6 | - android:layout_width="match_parent" | ||
| 7 | - android:layout_height="match_parent"> | ||
| 8 | 4 | ||
| 9 | <RelativeLayout | 5 | <RelativeLayout |
| 10 | android:layout_width="match_parent" | 6 | android:layout_width="match_parent" |
| @@ -27,6 +23,7 @@ | @@ -27,6 +23,7 @@ | ||
| 27 | <LinearLayout | 23 | <LinearLayout |
| 28 | android:layout_width="match_parent" | 24 | android:layout_width="match_parent" |
| 29 | android:layout_height="wrap_content" | 25 | android:layout_height="wrap_content" |
| 26 | + android:layout_marginTop="@dimen/_30px" | ||
| 30 | android:background="@android:color/white" | 27 | android:background="@android:color/white" |
| 31 | android:orientation="vertical"> | 28 | android:orientation="vertical"> |
| 32 | 29 | ||
| @@ -90,7 +87,7 @@ | @@ -90,7 +87,7 @@ | ||
| 90 | <RelativeLayout | 87 | <RelativeLayout |
| 91 | android:layout_width="match_parent" | 88 | android:layout_width="match_parent" |
| 92 | android:layout_height="wrap_content" | 89 | android:layout_height="wrap_content" |
| 93 | - android:layout_marginTop="24dp" | 90 | + android:layout_marginTop="40dp" |
| 94 | android:orientation="horizontal" | 91 | android:orientation="horizontal" |
| 95 | android:paddingLeft="10dp" | 92 | android:paddingLeft="10dp" |
| 96 | android:paddingRight="10dp"> | 93 | android:paddingRight="10dp"> |
| @@ -121,111 +118,21 @@ | @@ -121,111 +118,21 @@ | ||
| 121 | android:textSize="15sp" /> | 118 | android:textSize="15sp" /> |
| 122 | </RelativeLayout> | 119 | </RelativeLayout> |
| 123 | 120 | ||
| 124 | - <Button | ||
| 125 | - android:id="@+id/btn_login" | ||
| 126 | - style="@style/LoginButtonStyle" | ||
| 127 | - android:layout_width="match_parent" | ||
| 128 | - android:layout_height="wrap_content" | ||
| 129 | - android:layout_marginTop="59dp" | ||
| 130 | - android:background="@drawable/user_btn_login" | ||
| 131 | - android:gravity="center" | ||
| 132 | - android:onClick="onClick" | ||
| 133 | - android:text="@string/user_login" /> | ||
| 134 | - | ||
| 135 | - | ||
| 136 | - <TextView | ||
| 137 | - android:id="@+id/login_text" | ||
| 138 | - android:layout_width="match_parent" | ||
| 139 | - android:layout_height="wrap_content" | ||
| 140 | - android:layout_marginTop="100dp" | ||
| 141 | - android:gravity="center_horizontal" | ||
| 142 | - android:text="@string/user_login_third_part_login" | ||
| 143 | - android:textColor="@color/text_hint_color" | ||
| 144 | - android:textSize="15sp" /> | ||
| 145 | - | ||
| 146 | - <LinearLayout | ||
| 147 | - android:layout_width="match_parent" | ||
| 148 | - android:layout_height="wrap_content" | ||
| 149 | - android:layout_marginBottom="37dp" | ||
| 150 | - android:layout_marginTop="15dp" | ||
| 151 | - android:orientation="horizontal"> | ||
| 152 | - | ||
| 153 | - <LinearLayout | ||
| 154 | - android:layout_width="0dp" | ||
| 155 | - android:layout_height="wrap_content" | ||
| 156 | - android:layout_weight="1" | ||
| 157 | - android:gravity="center" | ||
| 158 | - android:orientation="vertical"> | ||
| 159 | - | ||
| 160 | - <ImageView | ||
| 161 | - android:id="@+id/rbtn_login_wechat" | ||
| 162 | - android:layout_width="50dp" | ||
| 163 | - android:layout_height="50dp" | ||
| 164 | - android:src="@drawable/share_btn_weixin" | ||
| 165 | - android:onClick="onClick" | ||
| 166 | - android:layout_marginBottom="4dp"/> | ||
| 167 | - | ||
| 168 | - <TextView | ||
| 169 | - android:layout_width="wrap_content" | ||
| 170 | - android:layout_height="wrap_content" | ||
| 171 | - android:text="@string/third_login_weixin" | ||
| 172 | - android:textColor="@color/text_hint_color" | ||
| 173 | - android:textSize="12sp" /> | ||
| 174 | - | ||
| 175 | - </LinearLayout> | ||
| 176 | - | ||
| 177 | - <LinearLayout | ||
| 178 | - android:layout_width="0dp" | ||
| 179 | - android:layout_height="wrap_content" | ||
| 180 | - android:layout_weight="1" | ||
| 181 | - android:gravity="center" | ||
| 182 | - android:orientation="vertical"> | ||
| 183 | - | ||
| 184 | - <ImageView | ||
| 185 | - android:id="@+id/rbtn_login_qq" | ||
| 186 | - android:layout_width="50dp" | ||
| 187 | - android:layout_height="50dp" | ||
| 188 | - android:src="@drawable/share_btn_tencent" | ||
| 189 | - android:onClick="onClick" | ||
| 190 | - android:layout_marginBottom="4dp"/> | ||
| 191 | - | ||
| 192 | - <TextView | ||
| 193 | - android:layout_width="wrap_content" | ||
| 194 | - android:layout_height="wrap_content" | ||
| 195 | - android:text="@string/third_login_qq" | ||
| 196 | - android:textColor="@color/text_hint_color" | ||
| 197 | - android:textSize="12sp" /> | ||
| 198 | - | ||
| 199 | - </LinearLayout> | ||
| 200 | - | ||
| 201 | - <LinearLayout | ||
| 202 | - android:layout_width="0dp" | ||
| 203 | - android:layout_height="wrap_content" | ||
| 204 | - android:layout_weight="1" | ||
| 205 | - android:gravity="center" | ||
| 206 | - android:orientation="vertical"> | ||
| 207 | - | ||
| 208 | - <ImageView | ||
| 209 | - android:id="@+id/rbtn_login_micro_blog" | ||
| 210 | - android:layout_width="50dp" | ||
| 211 | - android:layout_height="50dp" | ||
| 212 | - android:src="@drawable/share_btn_sina" | ||
| 213 | - android:onClick="onClick" | ||
| 214 | - android:layout_marginBottom="4dp"/> | ||
| 215 | - | ||
| 216 | - <TextView | ||
| 217 | - android:layout_width="wrap_content" | ||
| 218 | - android:layout_height="wrap_content" | ||
| 219 | - android:text="@string/third_login_sina" | ||
| 220 | - android:textColor="@color/text_hint_color" | ||
| 221 | - android:textSize="12sp" /> | ||
| 222 | - | ||
| 223 | - </LinearLayout> | ||
| 224 | - | ||
| 225 | - </LinearLayout> | ||
| 226 | 121 | ||
| 227 | </LinearLayout> | 122 | </LinearLayout> |
| 228 | 123 | ||
| 124 | + <Button | ||
| 125 | + android:id="@+id/btn_login" | ||
| 126 | + style="@style/LoginButtonStyle" | ||
| 127 | + android:layout_width="match_parent" | ||
| 128 | + android:layout_height="wrap_content" | ||
| 129 | + android:layout_marginBottom="200dp" | ||
| 130 | + android:layout_alignParentBottom="true" | ||
| 131 | + android:background="@drawable/user_btn_login" | ||
| 132 | + android:gravity="center" | ||
| 133 | + android:onClick="onClick" | ||
| 134 | + android:text="@string/user_login" /> | ||
| 135 | + | ||
| 229 | <ImageView | 136 | <ImageView |
| 230 | android:id="@+id/back_selector" | 137 | android:id="@+id/back_selector" |
| 231 | android:layout_width="30dp" | 138 | android:layout_width="30dp" |
| @@ -249,6 +156,6 @@ | @@ -249,6 +156,6 @@ | ||
| 249 | 156 | ||
| 250 | </RelativeLayout> | 157 | </RelativeLayout> |
| 251 | 158 | ||
| 252 | - </ScrollView> | 159 | + |
| 253 | 160 | ||
| 254 | </layout> | 161 | </layout> |
| 255 | \ No newline at end of file | 162 | \ No newline at end of file |
app/src/main/res/layout/fragment_personal_edit.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<layout xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| 3 | + | ||
| 4 | + <data> | ||
| 5 | + | ||
| 6 | + <import type="com.cnlive.gundam.user.fragment.UserPersonalEditFragment" /> | ||
| 7 | + | ||
| 8 | + <variable | ||
| 9 | + name="userPersonalEditFragment" | ||
| 10 | + type="UserPersonalEditFragment" /> | ||
| 11 | + | ||
| 12 | + </data> | ||
| 13 | + | ||
| 14 | + <RelativeLayout | ||
| 15 | + android:layout_width="match_parent" | ||
| 16 | + android:layout_height="match_parent"> | ||
| 17 | + | ||
| 18 | + <EditText | ||
| 19 | + android:id="@+id/editText" | ||
| 20 | + android:layout_width="match_parent" | ||
| 21 | + android:layout_height="50dp" | ||
| 22 | + android:visibility="gone"/> | ||
| 23 | + | ||
| 24 | + <include | ||
| 25 | + android:id="@+id/includeMobileLayout" | ||
| 26 | + layout="@layout/mobile_keycode_layout"/> | ||
| 27 | + | ||
| 28 | + <Button | ||
| 29 | + android:id="@+id/submit" | ||
| 30 | + android:layout_width="match_parent" | ||
| 31 | + android:layout_height="50dp" | ||
| 32 | + android:layout_alignParentBottom="true" | ||
| 33 | + android:layout_marginBottom="200dp" | ||
| 34 | + android:onClick="@{userPersonalEditFragment.onClick}" | ||
| 35 | + android:text="提交" /> | ||
| 36 | + | ||
| 37 | + </RelativeLayout> | ||
| 38 | + | ||
| 39 | +</layout> | ||
| 0 | \ No newline at end of file | 40 | \ No newline at end of file |
app/src/main/res/layout/fragment_user_personal.xml
| @@ -2,47 +2,34 @@ | @@ -2,47 +2,34 @@ | ||
| 2 | <layout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <layout xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | xmlns:app="http://schemas.android.com/apk/res-auto"> | 3 | xmlns:app="http://schemas.android.com/apk/res-auto"> |
| 4 | 4 | ||
| 5 | - <!--<data> | 5 | + <data> |
| 6 | + | ||
| 7 | + <import type="com.cnlive.gundam.main.ui.adapter.DataBindingAdapter"/> | ||
| 8 | + <import type="android.support.v7.widget.LinearLayoutManager"/> | ||
| 9 | + | ||
| 10 | + <variable | ||
| 11 | + name="listAdapter" | ||
| 12 | + type="DataBindingAdapter"/> | ||
| 6 | 13 | ||
| 7 | <variable | 14 | <variable |
| 8 | - name="liLayoutManager" | ||
| 9 | - type="android.support.v7.widget.LinearLayoutManager" /> | 15 | + name="layoutManager" |
| 16 | + type="LinearLayoutManager"/> | ||
| 10 | </data> | 17 | </data> |
| 11 | ---> | 18 | + |
| 12 | <RelativeLayout | 19 | <RelativeLayout |
| 13 | - android:id="@+id/main_view" | ||
| 14 | android:layout_width="match_parent" | 20 | android:layout_width="match_parent" |
| 15 | android:layout_height="match_parent"> | 21 | android:layout_height="match_parent"> |
| 16 | 22 | ||
| 17 | - <LinearLayout | ||
| 18 | - android:id="@+id/persion_layout" | 23 | + <android.support.v7.widget.RecyclerView |
| 24 | + android:id="@+id/recyclerView" | ||
| 19 | android:layout_width="match_parent" | 25 | android:layout_width="match_parent" |
| 20 | android:layout_height="match_parent" | 26 | android:layout_height="match_parent" |
| 21 | - android:orientation="vertical"> | ||
| 22 | - | ||
| 23 | - <include | ||
| 24 | - android:id="@+id/personalIncludeLayout" | ||
| 25 | - layout="@layout/user_toolbar_title" /> | ||
| 26 | - | ||
| 27 | - | ||
| 28 | - <android.support.v7.widget.RecyclerView | ||
| 29 | - android:id="@+id/lv_personal" | ||
| 30 | - android:layout_width="match_parent" | ||
| 31 | - android:layout_height="match_parent" | ||
| 32 | - android:divider="@null" | ||
| 33 | - android:fastScrollEnabled="true" | ||
| 34 | - android:scrollbars="none" | ||
| 35 | - /> | ||
| 36 | - | ||
| 37 | - </LinearLayout> | ||
| 38 | - | ||
| 39 | - <ImageView | ||
| 40 | - android:id="@+id/back_selector" | ||
| 41 | - android:layout_width="30dp" | ||
| 42 | - android:layout_height="30dp" | ||
| 43 | - android:layout_marginLeft="@dimen/_20px" | ||
| 44 | - android:layout_marginTop="@dimen/_28px" | ||
| 45 | - android:src="@drawable/btn_return" /> | 27 | + android:clipToPadding="true" |
| 28 | + android:clipChildren="true" | ||
| 29 | + android:paddingTop="5dp" | ||
| 30 | + android:background="@color/list_divider" | ||
| 31 | + app:adapter="@{listAdapter}" | ||
| 32 | + app:layoutManager="@{layoutManager}"/> | ||
| 46 | 33 | ||
| 47 | </RelativeLayout> | 34 | </RelativeLayout> |
| 48 | </layout> | 35 | </layout> |
| 49 | \ No newline at end of file | 36 | \ No newline at end of file |
app/src/main/res/layout/layout_actionbar_back.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | + | ||
| 3 | +<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 4 | + android:id="@+id/toolbar" | ||
| 5 | + xmlns:app="http://schemas.android.com/apk/res-auto" | ||
| 6 | + xmlns:tools="http://schemas.android.com/tools" | ||
| 7 | + android:layout_width="match_parent" | ||
| 8 | + android:layout_height="?attr/actionBarSize" | ||
| 9 | + android:theme="@style/ThemeOverlay.AppCompat.Light" | ||
| 10 | + app:contentInsetEnd="?attr/actionBarSize" | ||
| 11 | + android:visibility="gone" | ||
| 12 | + tools:visibility="visible"> | ||
| 13 | + | ||
| 14 | + | ||
| 15 | + <TextView | ||
| 16 | + android:id="@+id/toolbarTitle" | ||
| 17 | + style="@style/ActionbarTitleStyle" | ||
| 18 | + android:layout_width="wrap_content" | ||
| 19 | + android:layout_height="wrap_content" | ||
| 20 | + android:layout_gravity="center" | ||
| 21 | + android:lines="1" | ||
| 22 | + tools:text="here is title"/> | ||
| 23 | + | ||
| 24 | +</android.support.v7.widget.Toolbar> | ||
| 0 | \ No newline at end of file | 25 | \ No newline at end of file |
app/src/main/res/layout/layout_personal_header_item.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<layout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + xmlns:tools="http://schemas.android.com/tools" | ||
| 4 | + xmlns:app="http://schemas.android.com/apk/res-auto"> | ||
| 5 | + | ||
| 6 | + <data> | ||
| 7 | + | ||
| 8 | + <import type="com.cnlive.gundam.user.model.PersonalData" /> | ||
| 9 | + <import type="com.cnlive.gundam.main.ui.adapter.DataBindingAdapter.OnAdapterViewClickListener"/> | ||
| 10 | + | ||
| 11 | + <variable | ||
| 12 | + name="data" | ||
| 13 | + type="PersonalData" /> | ||
| 14 | + | ||
| 15 | + <variable | ||
| 16 | + name="viewClickListner" | ||
| 17 | + type="OnAdapterViewClickListener<PersonalData>"/> | ||
| 18 | + | ||
| 19 | + </data> | ||
| 20 | + | ||
| 21 | + <RelativeLayout | ||
| 22 | + android:id="@+id/itemLayout" | ||
| 23 | + android:layout_width="match_parent" | ||
| 24 | + android:layout_height="80dp" | ||
| 25 | + android:onClick="@{(view)->viewClickListner.onViewClick(view,data)}"> | ||
| 26 | + | ||
| 27 | + <RelativeLayout | ||
| 28 | + android:layout_width="match_parent" | ||
| 29 | + android:layout_height="match_parent" | ||
| 30 | + android:layout_above="@+id/divider" | ||
| 31 | + android:background="@android:color/white"> | ||
| 32 | + | ||
| 33 | + <TextView | ||
| 34 | + android:id="@+id/itemName" | ||
| 35 | + android:layout_width="wrap_content" | ||
| 36 | + android:layout_height="match_parent" | ||
| 37 | + android:gravity="center_vertical" | ||
| 38 | + android:text="@{data.getItemName()}" | ||
| 39 | + android:textColor="@color/black" | ||
| 40 | + android:textSize="18sp" | ||
| 41 | + tools:text="nick" /> | ||
| 42 | + | ||
| 43 | + <ImageView | ||
| 44 | + android:layout_width="50dp" | ||
| 45 | + android:layout_height="50dp" | ||
| 46 | + android:layout_marginRight="50dp" | ||
| 47 | + android:layout_alignParentRight="true" | ||
| 48 | + android:layout_centerVertical="true" | ||
| 49 | + android:scaleType="centerCrop" | ||
| 50 | + app:error="@{@drawable/image_error}" | ||
| 51 | + app:imageUrl="@{data.getItemMessage()}"/> | ||
| 52 | + | ||
| 53 | + <ImageView | ||
| 54 | + android:layout_width="wrap_content" | ||
| 55 | + android:layout_height="wrap_content" | ||
| 56 | + android:layout_alignParentRight="true" | ||
| 57 | + android:layout_centerVertical="true"/> | ||
| 58 | + | ||
| 59 | + </RelativeLayout> | ||
| 60 | + | ||
| 61 | + <View | ||
| 62 | + android:id="@+id/divider" | ||
| 63 | + android:layout_width="match_parent" | ||
| 64 | + android:layout_height="5dp" | ||
| 65 | + android:layout_alignParentBottom="true"/> | ||
| 66 | + | ||
| 67 | + </RelativeLayout> | ||
| 68 | + | ||
| 69 | +</layout> | ||
| 0 | \ No newline at end of file | 70 | \ No newline at end of file |
app/src/main/res/layout/layout_personal_item.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<layout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + xmlns:tools="http://schemas.android.com/tools"> | ||
| 4 | + | ||
| 5 | + <data> | ||
| 6 | + | ||
| 7 | + <import type="com.cnlive.gundam.user.model.PersonalData" /> | ||
| 8 | + <import type="com.cnlive.gundam.main.ui.adapter.DataBindingAdapter.OnAdapterViewClickListener"/> | ||
| 9 | + | ||
| 10 | + <variable | ||
| 11 | + name="data" | ||
| 12 | + type="PersonalData" /> | ||
| 13 | + | ||
| 14 | + <variable | ||
| 15 | + name="viewClickListner" | ||
| 16 | + type="OnAdapterViewClickListener<PersonalData>"/> | ||
| 17 | + | ||
| 18 | + </data> | ||
| 19 | + | ||
| 20 | + <RelativeLayout | ||
| 21 | + android:id="@+id/itemLayout" | ||
| 22 | + android:layout_width="match_parent" | ||
| 23 | + android:layout_height="60dp" | ||
| 24 | + android:onClick="@{(view)->viewClickListner.onViewClick(view,data)}"> | ||
| 25 | + | ||
| 26 | + <RelativeLayout | ||
| 27 | + android:layout_width="match_parent" | ||
| 28 | + android:layout_height="match_parent" | ||
| 29 | + android:layout_above="@+id/divider" | ||
| 30 | + android:background="@android:color/white"> | ||
| 31 | + | ||
| 32 | + <TextView | ||
| 33 | + android:id="@+id/itemName" | ||
| 34 | + android:layout_width="wrap_content" | ||
| 35 | + android:layout_height="match_parent" | ||
| 36 | + android:gravity="center_vertical" | ||
| 37 | + android:text="@{data.getItemName()}" | ||
| 38 | + android:textColor="@color/black" | ||
| 39 | + android:textSize="18sp" | ||
| 40 | + tools:text="nick" /> | ||
| 41 | + | ||
| 42 | + <TextView | ||
| 43 | + android:id="@+id/itemMsg" | ||
| 44 | + android:layout_width="wrap_content" | ||
| 45 | + android:layout_height="match_parent" | ||
| 46 | + android:layout_alignParentRight="true" | ||
| 47 | + android:layout_marginRight="50dp" | ||
| 48 | + android:layout_toRightOf="@+id/itemName" | ||
| 49 | + android:gravity="center_vertical|right" | ||
| 50 | + android:text="@{data.getItemMessage()}" | ||
| 51 | + android:textColor="@color/black" | ||
| 52 | + android:textSize="18sp" | ||
| 53 | + tools:text="haha" /> | ||
| 54 | + | ||
| 55 | + <ImageView | ||
| 56 | + android:layout_width="wrap_content" | ||
| 57 | + android:layout_height="wrap_content" | ||
| 58 | + android:layout_alignParentRight="true" | ||
| 59 | + android:layout_centerVertical="true"/> | ||
| 60 | + | ||
| 61 | + </RelativeLayout> | ||
| 62 | + | ||
| 63 | + <View | ||
| 64 | + android:id="@+id/divider" | ||
| 65 | + android:layout_width="match_parent" | ||
| 66 | + android:layout_height="5dp" | ||
| 67 | + android:layout_alignParentBottom="true"/> | ||
| 68 | + | ||
| 69 | + </RelativeLayout> | ||
| 70 | + | ||
| 71 | +</layout> | ||
| 0 | \ No newline at end of file | 72 | \ No newline at end of file |
app/src/main/res/layout/mobile_keycode_layout.xml
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | -<layout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | - > | 2 | +<layout xmlns:android="http://schemas.android.com/apk/res/android"> |
| 3 | + | ||
| 4 | + <data> | ||
| 5 | + | ||
| 6 | + </data> | ||
| 7 | + | ||
| 4 | <LinearLayout | 8 | <LinearLayout |
| 5 | android:id="@+id/mobile_keycode_layout" | 9 | android:id="@+id/mobile_keycode_layout" |
| 6 | android:layout_width="match_parent" | 10 | android:layout_width="match_parent" |
app/src/main/res/layout/user_fragment.xml
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | 2 | ||
| 3 | -<layout xmlns:android="http://schemas.android.com/apk/res/android"> | 3 | +<layout xmlns:android="http://schemas.android.com/apk/res/android" |
| 4 | + xmlns:cn="http://schemas.android.com/apk/res-auto" | ||
| 5 | + > | ||
| 4 | 6 | ||
| 5 | <LinearLayout | 7 | <LinearLayout |
| 6 | android:layout_width="match_parent" | 8 | android:layout_width="match_parent" |
| @@ -44,6 +46,7 @@ | @@ -44,6 +46,7 @@ | ||
| 44 | android:layout_centerVertical="true" | 46 | android:layout_centerVertical="true" |
| 45 | android:layout_marginLeft="11dp" | 47 | android:layout_marginLeft="11dp" |
| 46 | android:layout_marginRight="16dp" | 48 | android:layout_marginRight="16dp" |
| 49 | + cn:border_color="@android:color/transparent" | ||
| 47 | android:src="@drawable/cnlive_user_header" /> | 50 | android:src="@drawable/cnlive_user_header" /> |
| 48 | 51 | ||
| 49 | <LinearLayout | 52 | <LinearLayout |
user/src/main/res/drawable-xhdpi/list_item_image_load_fail.png deleted
100644 → 0
1.68 KB
user/src/main/res/drawable-xxhdpi/btn_share_sina_nor.png deleted
100644 → 0
5.04 KB
user/src/main/res/drawable-xxhdpi/btn_share_sina_sel.png deleted
100644 → 0
5.21 KB
user/src/main/res/drawable-xxhdpi/btn_share_tengxun_nor.png deleted
100644 → 0
4.84 KB
user/src/main/res/drawable-xxhdpi/btn_share_tengxun_sel.png deleted
100644 → 0
5.22 KB
user/src/main/res/drawable-xxhdpi/btn_share_weixin_nor.png deleted
100644 → 0
4.54 KB
user/src/main/res/drawable-xxhdpi/btn_share_weixin_sel.png deleted
100644 → 0
4.6 KB
user/src/main/res/drawable-xxhdpi/ic_config_history.png deleted
100644 → 0
1.89 KB
user/src/main/res/drawable-xxhdpi/ic_config_setting.png deleted
100644 → 0
2.21 KB
user/src/main/res/drawable-xxhdpi/share_btn_qq_nor.png deleted
100644 → 0
3.72 KB
user/src/main/res/drawable-xxhdpi/share_btn_qq_sel.png deleted
100644 → 0
4.57 KB
user/src/main/res/drawable/share_btn_sina.xml deleted
100644 → 0
| 1 | -<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | - | ||
| 3 | -<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| 4 | - <item android:state_pressed="true" android:drawable="@drawable/btn_share_sina_sel" /> | ||
| 5 | - <item android:state_pressed="false" android:drawable="@drawable/btn_share_sina_nor" /> | ||
| 6 | -</selector> | ||
| 7 | \ No newline at end of file | 0 | \ No newline at end of file |
user/src/main/res/drawable/share_btn_tencent.xml deleted
100644 → 0
| 1 | -<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | - | ||
| 3 | -<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| 4 | - <item android:drawable="@drawable/share_btn_qq_sel" android:state_pressed="true" /> | ||
| 5 | - <item android:drawable="@drawable/share_btn_qq_nor" android:state_pressed="false" /> | ||
| 6 | -</selector> | ||
| 7 | \ No newline at end of file | 0 | \ No newline at end of file |
user/src/main/res/drawable/share_btn_weixin.xml deleted
100644 → 0
| 1 | -<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | - | ||
| 3 | -<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| 4 | - <item android:state_pressed="true" android:drawable="@drawable/btn_share_weixin_sel" /> | ||
| 5 | - <item android:state_pressed="false" android:drawable="@drawable/btn_share_weixin_nor" /> | ||
| 6 | -</selector> | ||
| 7 | \ No newline at end of file | 0 | \ No newline at end of file |
user/src/main/res/drawable/user_btn_logout.xml deleted
100644 → 0
| 1 | -<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | -<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| 3 | - | ||
| 4 | - <item android:state_selected="true" android:drawable="@drawable/user_btn_logout_sel" /> | ||
| 5 | - <item android:state_pressed="true" android:drawable="@drawable/user_btn_logout_sel" /> | ||
| 6 | - <item android:state_focused="true" android:drawable="@drawable/user_btn_logout_sel" /> | ||
| 7 | - <item android:state_checked="false" android:drawable="@drawable/user_btn_logout_nor" /> | ||
| 8 | - | ||
| 9 | -</selector> | ||
| 10 | \ No newline at end of file | 0 | \ No newline at end of file |
user/src/main/res/drawable/user_btn_logout_sel.xml deleted
100644 → 0
| 1 | -<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | -<shape | ||
| 3 | - xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 4 | - android:shape="rectangle" | ||
| 5 | - android:useLevel="false"> | ||
| 6 | - <solid android:color="#6e6e6e" /> | ||
| 7 | - | ||
| 8 | - <size | ||
| 9 | - android:height="40dp" /> | ||
| 10 | - | ||
| 11 | - <corners | ||
| 12 | - android:bottomLeftRadius="20dp" | ||
| 13 | - android:bottomRightRadius="20dp" | ||
| 14 | - android:topLeftRadius="20dp" | ||
| 15 | - android:topRightRadius="20dp" /> <!-- 设置四个角的半径 --> | ||
| 16 | - | ||
| 17 | -</shape> | ||
| 18 | \ No newline at end of file | 0 | \ No newline at end of file |
user/src/main/res/values/colors.xml
| @@ -15,8 +15,5 @@ | @@ -15,8 +15,5 @@ | ||
| 15 | //注册页面 | 15 | //注册页面 |
| 16 | <color name="text_white_color">#FFFFFF</color> | 16 | <color name="text_white_color">#FFFFFF</color> |
| 17 | 17 | ||
| 18 | - //关于我们页面 | ||
| 19 | - <color name="star_name_color">#323333</color> | ||
| 20 | - <color name="about_us_btn_text_color">#177bdf</color> | ||
| 21 | - <color name="about_us_company_name_color">#969797</color> | 18 | + |
| 22 | </resources> | 19 | </resources> |
user/src/main/res/values/dimens.xml
| @@ -21,10 +21,7 @@ | @@ -21,10 +21,7 @@ | ||
| 21 | <dimen name="personal_text_size_14">14sp</dimen> | 21 | <dimen name="personal_text_size_14">14sp</dimen> |
| 22 | <dimen name="personal_text_size_18">18sp</dimen> | 22 | <dimen name="personal_text_size_18">18sp</dimen> |
| 23 | 23 | ||
| 24 | - //关于我们 | ||
| 25 | - <dimen name="about_us_text_size">17sp</dimen> | ||
| 26 | - <dimen name="about_us_btn_size">13sp</dimen> | ||
| 27 | - <dimen name="about_us_company_name_size">12sp</dimen> | 24 | + |
| 28 | 25 | ||
| 29 | //反馈意见 | 26 | //反馈意见 |
| 30 | <dimen name="text_size_15">15sp</dimen> | 27 | <dimen name="text_size_15">15sp</dimen> |
user/src/main/res/values/strings.xml
| @@ -20,9 +20,7 @@ | @@ -20,9 +20,7 @@ | ||
| 20 | <string name="string_fast_access">短信验证登录</string> | 20 | <string name="string_fast_access">短信验证登录</string> |
| 21 | <string name="user_login">登录</string> | 21 | <string name="user_login">登录</string> |
| 22 | <string name="user_login_third_part_login">第三方账号登录</string> | 22 | <string name="user_login_third_part_login">第三方账号登录</string> |
| 23 | - <string name="third_login_sina">微博</string> | ||
| 24 | - <string name="third_login_qq">QQ</string> | ||
| 25 | - <string name="third_login_weixin">微信</string> | 23 | + |
| 26 | 24 | ||
| 27 | //注册页面 | 25 | //注册页面 |
| 28 | <string name="register_mobile_hint">请输入您的手机号</string> | 26 | <string name="register_mobile_hint">请输入您的手机号</string> |
| @@ -38,34 +36,13 @@ | @@ -38,34 +36,13 @@ | ||
| 38 | <string name="find_password_hint">请确认密码:6–20位字母或数字</string> | 36 | <string name="find_password_hint">请确认密码:6–20位字母或数字</string> |
| 39 | <string name="save_btn">保存</string> | 37 | <string name="save_btn">保存</string> |
| 40 | 38 | ||
| 41 | - //昵称修改页面 | ||
| 42 | - <string name="user_input_nickname">请输入昵称</string> | 39 | + <string name="ACCOUNT_TYPE">com.cnlive.libs.AccountType</string> |
| 40 | + <string name="ACCOUNT_LABEL">@string/app_name</string> | ||
| 43 | 41 | ||
| 44 | - //手机号修改页面 | ||
| 45 | - <string name="register_mobile">手机号:</string> | ||
| 46 | - <string name="user_personal_telephone_hint">手机号码</string> | ||
| 47 | - <string name="register_mobile_keycode">验证码:</string> | ||
| 48 | - <string name="hint_6_numbers_code">6位数字验证码</string> | ||
| 49 | 42 | ||
| 50 | - //邮箱修改页面 | ||
| 51 | - <string name="email_notify">修改后,您输入的邮箱将会收到确认邮件,请按邮件中的说明去完成验证,谢谢!</string> | ||
| 52 | 43 | ||
| 53 | - //关于我们页面 | ||
| 54 | - <string name="about_us_visit">访问视讯中国官网</string> | ||
| 55 | - <string name="about_us_call_phone">拨打客服电话</string> | ||
| 56 | - <string name="about_us_disclaimer">免责声明</string> | ||
| 57 | - <string name="about_us_company_name">北京中投视讯文化传媒股份有限公司</string> | ||
| 58 | 44 | ||
| 59 | - //分享 | ||
| 60 | - <string name="toast_msg_share_success">分享成功!</string> | ||
| 61 | - <string name="toast_msg_share_fail">分享失败,请再试一次</string> | ||
| 62 | - <string name="toast_msg_share_cancel">取消分享</string> | ||
| 63 | - <string name="share_program_download_targetUrl"> http://www.cnlive.com/web/guide.jsp</string> | ||
| 64 | 45 | ||
| 65 | - //AccountManager用户管理 | ||
| 66 | - <string name="ACCOUNT_TYPE">com.cnlive.libs.AccountType</string> | ||
| 67 | - <string name="ACCOUNT_LABEL">@string/app_name</string> | ||
| 68 | 46 | ||
| 69 | - <string name="verified_url" formatted="false">https://mobile.cnlive.com/CnliveMobile/web/review/review.jsp?sid=%s&plat=a&appId=%s </string> | ||
| 70 | 47 | ||
| 71 | </resources> | 48 | </resources> |