Commit de33d9af by 倪力烽

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

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