Commit 02a17a88 authored by linfeng's avatar linfeng

bug修改

parent 5ec63cb4
......@@ -52,6 +52,7 @@
<dimen name="size_240">240dp</dimen>
<dimen name="size_245">245dp</dimen>
<dimen name="size_250">250dp</dimen>
<dimen name="size_410">410dp</dimen>
<dimen name="size_420">420dp</dimen>
<dimen name="size_440">440dp</dimen>
<dimen name="size_500">500dp</dimen>
......
package com.rv.component.utils;
import android.content.Context;
import android.text.Editable;
import android.text.Selection;
import android.text.TextWatcher;
import android.util.Log;
import android.widget.EditText;
import android.widget.Toast;
public class MyTextWatcher implements TextWatcher {
private Context context;
private EditText editText;
private int len; //允许输入的字节长度(一个中文占3个字节)
public MyTextWatcher(Context context, EditText editText, int len) {
this.context = context;
this.editText = editText;
this.len = len;
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable editable) {
String inputStr = editable.toString().trim();
byte[] bytes = inputStr.getBytes();
if (bytes.length > len) {
Toast.makeText(context, "超过规定字符数", Toast.LENGTH_SHORT).show();
Log.i("str", inputStr);
//取前15个字节
byte[] newBytes = new byte[len];
for (int i = 0; i < len; i++) {
newBytes[i] = bytes[i];
}
String newStr = new String(newBytes);
editText.setText(newStr);
//将光标定位到最后
Selection.setSelection(editText.getEditableText(), newStr.length());
}
}
}
......@@ -368,43 +368,43 @@ public class PostPatActivity extends BaseStatusActivity<DiscoveryPresenter> {
// 多张图片压缩 相册
private void album(ArrayList<String> stringArrayListExtra, boolean isOriginal) {
if (isOriginal) {// 原图发送,不压缩
Log.e("zq", "原图上传,不压缩,选择原文件路径");
for (int i = 0; i < stringArrayListExtra.size(); i++) {
mPhotoList.add(stringArrayListExtra.get(i));
mAdapter.notifyDataSetInvalidated();
}
return;
}
List<File> fileList = new ArrayList<>();
for (int i = 0; i < stringArrayListExtra.size(); i++) {
// Luban只处理特定后缀的图片,不满足的不处理也不走回调,
// 只能挑出来不压缩,
List<String> lubanSupportFormatList = Arrays.asList("jpg", "jpeg", "png", "webp", "gif");
boolean support = false;
for (int j = 0; j < lubanSupportFormatList.size(); j++) {
if (stringArrayListExtra.get(i).endsWith(lubanSupportFormatList.get(j))) {
support = true;
break;
}
}
if (!support) {
fileList.add(new File(stringArrayListExtra.get(i)));
stringArrayListExtra.remove(i);
}
}
if (fileList.size() > 0) {
for (File file : fileList) {// 不压缩的部分,直接发送
mPhotoList.add(file.getPath());
mAdapter.notifyDataSetInvalidated();
}
}
// if (isOriginal) {// 原图发送,不压缩
// Log.e("zq", "原图上传,不压缩,选择原文件路径");
// for (int i = 0; i < stringArrayListExtra.size(); i++) {
// mPhotoList.add(stringArrayListExtra.get(i));
// mAdapter.notifyDataSetInvalidated();
// }
// return;
// }
// List<File> fileList = new ArrayList<>();
// for (int i = 0; i < stringArrayListExtra.size(); i++) {
// // Luban只处理特定后缀的图片,不满足的不处理也不走回调,
// // 只能挑出来不压缩,
// List<String> lubanSupportFormatList = Arrays.asList("jpg", "jpeg", "png", "webp", "gif");
// boolean support = false;
// for (int j = 0; j < lubanSupportFormatList.size(); j++) {
// if (stringArrayListExtra.get(i).endsWith(lubanSupportFormatList.get(j))) {
// support = true;
// break;
// }
// }
// if (!support) {
// fileList.add(new File(stringArrayListExtra.get(i)));
// stringArrayListExtra.remove(i);
// }
// }
//
// if (fileList.size() > 0) {
// for (File file : fileList) {// 不压缩的部分,直接发送
// mPhotoList.add(file.getPath());
// mAdapter.notifyDataSetInvalidated();
// }
// }
Luban.with(this)
.load(stringArrayListExtra)
.ignoreBy(100)// 原图小于100kb 不压缩
.ignoreBy(70)// 原图小于70kb 不压缩
.setCompressListener(new OnCompressListener() {
@Override
public void onStart() {
......@@ -413,6 +413,7 @@ public class PostPatActivity extends BaseStatusActivity<DiscoveryPresenter> {
@Override
public void onSuccess(File file) {
Log.e("zq", "压缩成功,压缩后图片位置:" + file.getPath() + "压缩后图片大小:" + file.length() / 1024 + "KB");
mPhotoList.add(file.getPath());
mAdapter.notifyDataSetInvalidated();
}
......@@ -431,7 +432,7 @@ public class PostPatActivity extends BaseStatusActivity<DiscoveryPresenter> {
// 拍照出来的图片Luban一定支持,
Luban.with(this)
.load(file)
.ignoreBy(100) // 原图小于100kb 不压缩
.ignoreBy(70) // 原图小于70kb 不压缩
// .putGear(2) // 设定压缩档次,默认三挡
// .setTargetDir() // 指定压缩后的图片路径
.setCompressListener(new OnCompressListener() { //设置回调
......
......@@ -45,13 +45,19 @@ public class HotCarTypeAdapter extends BaseQuickAdapter<HomeHotGoodListBean.Data
.apply(RequestOptions.bitmapTransform(new RoundedCorners(12)).override(image.getWidth(), image.getHeight()))
.into(utils);
helper.setText(R.id.tv_name,bean.getName());
helper.setText(R.id.tv_content,bean.getName1());
helper.setText(R.id.tv_name, bean.getName());
helper.setText(R.id.tv_content, bean.getName1());
if (!TextUtil.isEmpty(bean.getPrice())) {
helper.setText(R.id.tv_price, String.format("¥%1$s%2$s", bean.getPrice(), getUnit()));
} else {
helper.setText(R.id.tv_price, "");
}
if ("2".equals(hotType) || "4".equals(hotType)) {
helper.setGone(R.id.tv_content, false);
} else {
helper.setGone(R.id.tv_content, true);
}
}
public void setType(String hotType) {
......@@ -75,7 +81,7 @@ public class HotCarTypeAdapter extends BaseQuickAdapter<HomeHotGoodListBean.Data
}
// @Override
// @Override
// public int getItemCount() {
// return 4;
// }
......
......@@ -556,11 +556,11 @@
</LinearLayout>
</android.support.v7.widget.CardView>
</RelativeLayout>
<!---->
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView_home_content"
android:layout_width="match_parent"
android:layout_height="@dimen/size_440"
android:layout_height="@dimen/size_410"
android:layout_marginTop="@dimen/size_10"
android:paddingLeft="@dimen/size_10"
android:paddingRight="@dimen/size_10" />
......
......@@ -29,6 +29,7 @@ import com.ruiwenliu.wrapper.util.permission.RxPermission;
import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.component.dialog.PickerDialog;
import com.rv.component.utils.IsAppInstall;
import com.rv.component.utils.MyTextWatcher;
import com.rv.home.rv.module.ApiConfig;
import com.rv.home.rv.module.ui.main.home.bean.ImageUploadBean;
import com.rv.rvmine.R;
......@@ -96,7 +97,7 @@ public class PersonalInformationActivity extends BaseStatusActivity<PickerPresen
private String mUnionid;
private String mHeadImg;
private String birthday;
private String birthday = "";
public static Intent getIntent(Context context, UserInfoBean.UserInfo info) {
return new Intent(context, PersonalInformationActivity.class)
......@@ -112,6 +113,8 @@ public class PersonalInformationActivity extends BaseStatusActivity<PickerPresen
protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
titleView.setTitle("个人资料");
titleView.setText(R.id.tv_title_right, "保存");
etNickname.addTextChangedListener(new MyTextWatcher(this, etNickname, 32));
titleView.setChildClickListener(R.id.tv_title_right, new View.OnClickListener() {
@Override
public void onClick(View v) {
......@@ -130,11 +133,7 @@ public class PersonalInformationActivity extends BaseStatusActivity<PickerPresen
if (info.getNickname() != null) {
etNickname.setText(info.getNickname());
if (!TextUtils.isEmpty(info.getNickname())) {
if (info.getNickname().length() <= 10) {
etNickname.setSelection(info.getNickname().length());
} else {
etNickname.setSelection(10);
}
}
}
if (info.getRealname() != null) {
......@@ -387,7 +386,7 @@ public class PersonalInformationActivity extends BaseStatusActivity<PickerPresen
return;
}
if (TextUtil.isEmpty(birthday)) {
if (birthday != null && TextUtil.isEmpty(birthday)) {
showToast("生日不为空!");
return;
}
......
......@@ -59,7 +59,6 @@
android:background="@null"
android:gravity="right|center_vertical"
android:hint="请输入昵称"
android:maxLength="10"
android:maxLines="1"
android:textColor="@color/colorMain"
android:textColorHint="@color/colorGray"
......
......@@ -236,10 +236,12 @@ public class TravelDetailsActivity extends BaseStatusActivity<TourismPresenter>
if (travelBookingDialog == null) {
travelBookingDialog = new TravelBookingDialog(mActivity);
}
if (travelBookingDialog != null) {
travelBookingDialog.setNewData(DetailsData);
travelBookingDialog.show();
}
}
if (travelBookingDialog != null) {
travelBookingDialog.setOnDayClickListener(new TravelBookingDialog.OnOKClickListener() {
@Override
public void onClickData(BeanOrderParam data) {
......@@ -247,6 +249,7 @@ public class TravelDetailsActivity extends BaseStatusActivity<TourismPresenter>
}
});
}
}
private void cancelCollect() {
Map<String, Object> headMap = new LinkedHashMap<>();
......
......@@ -120,7 +120,8 @@ public class PosterActivity extends BaseStatusActivity<CommonPresenter> {
}
} else {
GlideManager.getInstance(mActivity).loadCircleImage("https://mgmt.dfangche.com/image/app/default_avatar.png", ringHeader);
tvName.setText("滴房车");
// tvName.setText("滴房车");
tvName.setText("哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈");
}
}
......
......@@ -60,7 +60,7 @@
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_5"
android:layout_marginLeft="@dimen/size_10"
android:layout_weight="1"
android:orientation="vertical">
......@@ -69,8 +69,11 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="false"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_18" />
android:maxLines="2"
android:ellipsize="end"
android:text=""
android:textColor="@color/textGray"
android:textSize="@dimen/text_15" />
</LinearLayout>
......
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