Commit de33d9af by 倪力烽

1. 修改了模糊搜索框焦点的变化情况

parent 7fc3e508
......@@ -51,6 +51,7 @@ public class SearchParkActivity extends BaseActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout_search_park);
et_search = (ClearEditText) findViewById(R.id.et_input_parkname);
et_search.setText(getIntent().getStringExtra(Common.SEARCH_TEXT));
user_list = (ListView) findViewById(R.id.user_list);
mCancelTv = (TextView) findViewById(R.id.tv_cancel);
searchParkAdapter= new SearchParkAdapter(SearchParkActivity.this,mDatas);
......
......@@ -16,4 +16,5 @@ public class Common {
public static final String USER_TOKEN_SHAREDPREFERENCE = "token";
public static final String USER_CHECKBOX_SELECTED_SHAREDPREFERENCE = "checkBox";
public static final String PARKING_INFO = "parking_info";
public static final String SEARCH_TEXT = "search";
}
......@@ -11,6 +11,7 @@ public class CommonUrl {
public static final String LOGIN_URL = "http://10.200.2.109:9051/auth";
/** 修改密码接口 */
public static final String MODIFY_PASSWORD_URL = "http://10.200.2.109:9051/challenger/app/user/updatePass";
public static final String GET_USER_INFO_BY_USERNAME = "http://10.200.2.109:9011/challenger/user/get/";
/** 获取用户信息接口 */
public static final String GET_USER_INFO_URL = "http://10.200.2.109:9011/challenger/app/user/me/";
/** 根据车架号获取车辆编号以及停车点编号的接口 */
......
......@@ -95,17 +95,30 @@ public class DispatchInFragment extends Fragment implements IDispatchFragment{
mAdapter = new DispatchInAdapter(getActivity(),mList);
recyclerView.setAdapter(mAdapter);
presenter = new DispatchInPresenterImpl(this);
searchText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
// searchText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
//
// @Override
// public void onFocusChange(View v, boolean hasFocus) {
// if (hasFocus) {
// Intent intent = new Intent();
// intent.setClass(getActivity(), SearchParkActivity.class);
// startActivityForResult(intent, Activity.RESULT_FIRST_USER);
// }
//
// }
// });
searchText.setOnClickListener(new View.OnClickListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (hasFocus) {
public void onClick(View v) {
searchText.setFocusable(true);//设置输入框可聚集
searchText.setFocusableInTouchMode(true);//设置触摸聚焦
searchText.requestFocus();//请求焦点
searchText.findFocus();//获取焦点
Intent intent = new Intent();
intent.putExtra(Common.SEARCH_TEXT,searchText.getText().toString());
intent.setClass(getActivity(), SearchParkActivity.class);
startActivityForResult(intent, Activity.RESULT_FIRST_USER);
}
}
});
}
......@@ -149,12 +162,12 @@ public class DispatchInFragment extends Fragment implements IDispatchFragment{
WindowManager.LayoutParams lp = dialogWindow.getAttributes();
lp.width = (int) (d.getWidth() * 0.64);
lp.height = (int) (d.getHeight() * 0.25);
//// lp.y = 20;
dialogWindow.setAttributes(lp);
dialog.show();
mList.clear();
mAdapter.notifyDataSetChanged();
shellList.clear();
searchText.setText(null);
}
@Override
......@@ -233,6 +246,7 @@ public class DispatchInFragment extends Fragment implements IDispatchFragment{
searchText.setText(parkingName);
mLimitNumTv.setText(String.valueOf(totalCarDigit));
mMaxNumTv.setText(String.valueOf(max));
searchText.setFocusable(false);//设置输入框不可聚焦,即失去焦点和光标
}
public void submit(String token) {
......
......@@ -21,10 +21,7 @@ import org.json.JSONObject;
*/
public class LoginModelImpl implements LoginModel {
private LoginApi loginApi;
private static final String TAG = LoginModel.class.getSimpleName();
// private RequestBody bean;
private LoginBean bean = new LoginBean();
private LoginUser loginUser = new LoginUser();
@Override
public void login(final String userName, final String passWord, final LoginCallback mCallback) {
......@@ -45,8 +42,6 @@ public class LoginModelImpl implements LoginModel {
public void HttpCallbackResult(int code, JSONObject response) {
// TODO Auto-generated method stub
if(code==200) {
// saveInfo(userName,passWord,response.getString("token"));
try {
loginUser.setUserName(userName);
loginUser.setPassWord(passWord);
......
......@@ -67,7 +67,7 @@ public class UserInfoModelImpl extends BasePresenterImpl implements UserInfoMode
*/
@Override
public void getUserIdByUserName(String userName, final UserInfoCallback callback) {
StringBuilder url = new StringBuilder().append("http://10.200.2.109:9011/challenger/user/get/");
StringBuilder url = new StringBuilder().append(CommonUrl.GET_USER_INFO_BY_USERNAME);
url.append(userName);
AsyncHttp http = new AsyncHttp(MyApplication.getContext());
http.GetHttpClient(url.toString(), new HttpCallback() {
......
......@@ -43,7 +43,6 @@
android:layout_height="wrap_content"
android:textSize="@dimen/toolbar_submit_size"
android:textColor="@color/tab_tv_normal"
android:text="10"
/>
<TextView
android:layout_marginLeft="60dp"
......@@ -61,15 +60,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/toolbar_submit_size"
android:textColor="@color/tab_tv_normal"
android:text="12"/>
android:textColor="@color/tab_tv_normal" />
</RelativeLayout>
<!--<FrameLayout-->
<!---->
<!--android:paddingTop="10dp"-->
<!--android:background="@drawable/recyclerview"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content">-->
<android.support.v7.widget.RecyclerView
android:layout_below="@+id/rl_text"
......@@ -80,7 +73,6 @@
android:id="@+id/recycleView_dispatch_in"
android:layout_width="match_parent"
android:layout_height="wrap_content"></android.support.v7.widget.RecyclerView>
<!--</FrameLayout>-->
<Button
android:layout_centerInParent="true"
......
......@@ -42,6 +42,8 @@
<!--android:textSize="@dimen/toolbar_submit_size" />-->
</android.support.v7.widget.Toolbar>
<!-- 此处放logo -->
<ImageView
android:layout_width="match_parent"
android:layout_height="150dp"
......
......@@ -7,7 +7,7 @@
android:background="@color/login_background"
tools:context=".LoginActivity">
<!-- Login progress -->
<!-- 此处放logo -->
<ImageView
android:layout_width="match_parent"
android:layout_height="150dp"
......
......@@ -13,10 +13,12 @@
/>
<TextView
android:layout_marginTop="3dp"
android:id="@+id/tv_tab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textSize="13sp"
android:textColor="@drawable/tv_tab_selector"
/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment