| @ -0,0 +1,90 @@ | |||||
| package com.qhclh.ytzh.me; | |||||
| import android.content.Intent; | |||||
| import android.os.Bundle; | |||||
| import android.support.annotation.Nullable; | |||||
| import android.support.v7.widget.Toolbar; | |||||
| import android.view.View; | |||||
| import android.widget.Button; | |||||
| import android.widget.EditText; | |||||
| import com.qhclh.ytzh.R; | |||||
| import com.qhclh.ytzh.base.BaseActivity; | |||||
| import com.qhclh.ytzh.home.RpcUrl; | |||||
| import com.qhclh.ytzh.login.LoginActivity; | |||||
| import com.qhclh.ytzh.tasks.ViewOnClickTask; | |||||
| import org.forks.jsonrpc.JsonRpcResult; | |||||
| import org.forks.jsonrpc.RpcFacade; | |||||
| import butterknife.BindView; | |||||
| import butterknife.ButterKnife; | |||||
| import butterknife.OnClick; | |||||
| /** | |||||
| * Created by 青花瓷 on 2017/8/28. | |||||
| */ | |||||
| public class XiugaiMimaActivity extends BaseActivity { | |||||
| @BindView(R.id.toolbar) | |||||
| Toolbar mToolbar; | |||||
| @BindView(R.id.edit_jiumima) | |||||
| EditText edit_jiumima; | |||||
| @BindView(R.id.edit_xinmima) | |||||
| EditText edit_xinmima; | |||||
| @BindView(R.id.xiugaimima_sure) | |||||
| Button xiugaimima_sure; | |||||
| private String jiumima, xinmima; | |||||
| @Override | |||||
| protected int setLayoutId() { | |||||
| return R.layout.act_xiugaimima; | |||||
| } | |||||
| @Override | |||||
| protected void initView() { | |||||
| initToolbar(mToolbar, getString(R.string.xiugaimima), new View.OnClickListener() { | |||||
| @Override | |||||
| public void onClick(View v) { | |||||
| finish(); | |||||
| } | |||||
| }); | |||||
| } | |||||
| @Override | |||||
| protected void initData() { | |||||
| } | |||||
| @Override | |||||
| protected void initOper() { | |||||
| } | |||||
| @OnClick(R.id.xiugaimima_sure) | |||||
| public void OnClick(View view) { | |||||
| jiumima = edit_jiumima.getText().toString().trim(); | |||||
| xinmima = edit_xinmima.getText().toString().trim(); | |||||
| if (xinmima.length()<6){ | |||||
| showToast("请设置6位以上密码"); | |||||
| return; | |||||
| } | |||||
| ViewOnClickTask xiugaiTask = new ViewOnClickTask(this, "加载中...") { | |||||
| @Override | |||||
| protected void successUI() { | |||||
| showToast("修改成功"); | |||||
| startActivity(new Intent(XiugaiMimaActivity.this, LoginActivity.class)); | |||||
| finishAll(); | |||||
| } | |||||
| @Override | |||||
| public Object call() throws Exception { | |||||
| JsonRpcResult rpcObj = RpcFacade.rpcCall(RpcUrl.ChangePassword, jiumima, xinmima); | |||||
| return null; | |||||
| } | |||||
| }; | |||||
| xiugaiTask.execute(); | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,10 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <shape xmlns:android="http://schemas.android.com/apk/res/android"> | |||||
| <solid android:color="@color/greene60b9343"/> | |||||
| <corners android:radius="@dimen/px_8"/> | |||||
| <stroke | |||||
| android:width="@dimen/dp_1" | |||||
| android:color="@color/greene60b9343"/> | |||||
| </shape> | |||||
| @ -0,0 +1,10 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <shape xmlns:android="http://schemas.android.com/apk/res/android"> | |||||
| <solid android:color="@color/colorPrimary"/> | |||||
| <corners android:radius="@dimen/px_8"/> | |||||
| <stroke | |||||
| android:width="@dimen/dp_1" | |||||
| android:color="@color/colorPrimary"/> | |||||
| </shape> | |||||
| @ -0,0 +1,5 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <selector xmlns:android="http://schemas.android.com/apk/res/android"> | |||||
| <item android:state_pressed="true" android:drawable="@drawable/bg_green_btn_pressed"/> | |||||
| <item android:state_pressed="false" android:drawable="@drawable/bg_green_btn_normal"/> | |||||
| </selector> | |||||
| @ -0,0 +1,74 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="match_parent" | |||||
| android:background="@color/greyeee" | |||||
| android:orientation="vertical"> | |||||
| <include layout="@layout/include_tool_bar"></include> | |||||
| <LinearLayout | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:background="@color/white" | |||||
| android:orientation="horizontal" | |||||
| android:padding="10dp"> | |||||
| <TextView | |||||
| android:layout_width="0dp" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_weight="1" | |||||
| android:text="@string/jiumima" /> | |||||
| <EditText | |||||
| android:id="@+id/edit_jiumima" | |||||
| android:layout_width="0dp" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_weight="3" | |||||
| android:digits="@string/filter_vcode" | |||||
| android:inputType="number" | |||||
| android:maxLength="12" | |||||
| android:maxLines="1" /> | |||||
| </LinearLayout> | |||||
| <LinearLayout | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:background="@color/white" | |||||
| android:orientation="horizontal" | |||||
| android:padding="10dp"> | |||||
| <TextView | |||||
| android:layout_width="0dp" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_weight="1" | |||||
| android:text="@string/xinmima" /> | |||||
| <EditText | |||||
| android:id="@+id/edit_xinmima" | |||||
| android:layout_width="0dp" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_weight="3" | |||||
| android:digits="@string/filter_vcode" | |||||
| android:inputType="number" | |||||
| android:maxLength="12" | |||||
| android:maxLines="1" /> | |||||
| </LinearLayout> | |||||
| <View | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="0dp" | |||||
| android:layout_weight="1" /> | |||||
| <Button | |||||
| android:id="@+id/xiugaimima_sure" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="@dimen/dp_50" | |||||
| android:layout_margin="@dimen/dp_10" | |||||
| android:background="@drawable/bg_red_bt_selector" | |||||
| android:text="@string/xiugai" | |||||
| android:textColor="@color/white" | |||||
| android:textSize="@dimen/text_size_20" /> | |||||
| </LinearLayout> | |||||