Commit f0b62a35 by 郑娜伟

common 1.1.3

parent 333b2c7d
......@@ -34,8 +34,8 @@ dependencies {
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation project(':sobot_common')
// implementation project(':sobot_widget')
implementation 'com.sobot.library:widget:0.2'
implementation project(':sobot_widget')
// implementation 'com.sobot.library:widget:0.3'
// api 'com.sobot.library:sobotcommon:1.0'
// api 'com.sobot.library:sobotcommon_x:1.0'
......
......@@ -3,6 +3,7 @@ package com.sobot.moduletest;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.widget.ImageView;
......@@ -11,14 +12,18 @@ import com.sobot.common.ui.base.SobotBaseActivity;
import com.sobot.common.ui.toast.SobotToastUtil;
import com.sobot.common.utils.SobotCommonApi;
import com.sobot.common.utils.SobotImageUtils;
import com.sobot.network.http.HttpUtils;
import com.sobot.network.http.db.SobotDownloadManager;
import com.sobot.pictureframe.SobotBitmapUtil;
import com.sobot.utils.SobotLogUtils;
import com.sobot.utils.SobotSDCardUtils;
import com.sobot.widget.image.photoview.SobotPhotoView;
import com.sobot.widget.loading.SobotLoadingLayout;
import com.sobot.widget.refresh.layout.api.RefreshLayout;
import com.sobot.widget.refresh.layout.footer.ClassicsFooter;
import com.sobot.widget.refresh.layout.header.ClassicsHeader;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
......@@ -27,9 +32,10 @@ import static com.sobot.common.ui.SobotBaseConstant.REQUEST_CODE_PICTURE;
public class MainActivity extends SobotBaseActivity {
private ImageView img;
private ImageView img2;
private SobotPhotoView img2;
private SobotLoadingLayout loadinglayout ;
@Override
protected int getContentViewResId() {
return R.layout.activity_main;
......@@ -44,7 +50,27 @@ public class MainActivity extends SobotBaseActivity {
img = findViewById(R.id.img);
SobotBitmapUtil.display(this, "https://img.sobot.com/console/common/face/admin.png", img, R.mipmap.ic_launcher, R.mipmap.ic_launcher);
img2 = findViewById(R.id.img2);
SobotBitmapUtil.display(this, R.mipmap.ic_launcher, img2);
// img2.setScaleType(ImageView.ScaleType.FIT_XY);
// SobotBitmapUtil.display(this,"https://img.sobot.com/chatres/75574e5fa29a48458d1f57ab5489a4c5/msg/20220421/34a466420d78fa1172bc0acd85166745/9410b53be86b4d589c61c60f6aee2461.jpeg",img2);
File save=new File(SobotSDCardUtils.getSDCardRootPath(MainActivity.this)+"/9410b53be86b4d589c61c60f6aee2461.jpeg");
HttpUtils.getInstance().download("https://img.sobot.com/chatres/75574e5fa29a48458d1f57ab5489a4c5/msg/20220421/34a466420d78fa1172bc0acd85166745/9410b53be86b4d589c61c60f6aee2461.jpeg", save, new HttpUtils.FileCallBack() {
@Override
public void onResponse(File result) {
Bitmap bitmap= SobotBitmapUtil.compress(result.getPath(),MainActivity.this,true);
img2.setImageBitmap(bitmap);
}
@Override
public void onError(Exception e, String msg, int responseCode) {
SobotLogUtils.i("下载失败:"+msg);
}
@Override
public void inProgress(int progress) {
SobotLogUtils.i("下载进度:"+progress);
}
});
SobotDownloadManager.getInstance().get("sdfsdfds");
......
......@@ -14,10 +14,10 @@
android:layout_width="60dp"
android:layout_height="60dp" />
<ImageView
<com.sobot.widget.image.photoview.SobotPhotoView
android:id="@+id/img2"
android:layout_width="60dp"
android:layout_height="60dp" />
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView
android:layout_width="wrap_content"
......@@ -32,8 +32,7 @@
<com.sobot.widget.loading.SobotLoadingLayout
android:id="@+id/loadinglayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:llEmptyImage="@drawable/ic_launcher_background">
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
......
......@@ -13,7 +13,7 @@ ext {
PUBLISH_GROUP_ID = "com.sobot.library" //项目包名
PUBLISH_ARTIFACT_ID = 'sobotcommon' //项目名
// PUBLISH_ARTIFACT_ID = 'sobotcommon_x' //项目名
PUBLISH_VERSION = '1.1.2' //版本号
PUBLISH_VERSION = '1.1.3' //版本号
}
......
......@@ -217,10 +217,10 @@ public abstract class SobotBaseActivity extends FragmentActivity {
* @param textId
* @param isShow
*/
protected void showRightMenu(int resourceId, String textId, boolean isShow) {
protected TextView showRightMenu(int resourceId, String textId, boolean isShow, View.OnClickListener clickListener) {
View tmpMenu = getRightMenu();
if (tmpMenu == null || !(tmpMenu instanceof TextView)) {
return;
return null;
}
TextView rightMenu = (TextView) tmpMenu;
if (!TextUtils.isEmpty(textId)) {
......@@ -242,6 +242,10 @@ public abstract class SobotBaseActivity extends FragmentActivity {
} else {
rightMenu.setVisibility(View.GONE);
}
if (clickListener != null) {
rightMenu.setOnClickListener(clickListener);
}
return rightMenu;
}
/**
......@@ -249,10 +253,10 @@ public abstract class SobotBaseActivity extends FragmentActivity {
* @param textId
* @param isShow
*/
protected void showLeftMenu(int resourceId, String textId, boolean isShow) {
protected TextView showLeftMenu(int resourceId, String textId, boolean isShow, View.OnClickListener clickListener) {
View tmpMenu = getLeftMenu();
if (tmpMenu == null || !(tmpMenu instanceof TextView)) {
return;
return null;
}
TextView leftMenu = (TextView) tmpMenu;
if (!TextUtils.isEmpty(textId)) {
......@@ -274,6 +278,10 @@ public abstract class SobotBaseActivity extends FragmentActivity {
} else {
leftMenu.setVisibility(View.GONE);
}
if (clickListener != null) {
leftMenu.setOnClickListener(clickListener);
}
return leftMenu;
}
@Override
......
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