-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1b486cd
commit a59da17
Showing
16 changed files
with
205 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.liyi.example; | ||
|
||
import android.app.Activity; | ||
import android.graphics.Bitmap; | ||
import android.os.Bundle; | ||
import android.support.annotation.Nullable; | ||
import android.widget.ImageView; | ||
|
||
import com.liyi.sutils.utils.app.DensityUtil; | ||
import com.liyi.sutils.utils.graphic.ImageUtil; | ||
import com.liyi.sutils.utils.other.QRCodeUtil; | ||
|
||
/** | ||
* 二维码页面 | ||
*/ | ||
|
||
public class QRImageActivity extends Activity { | ||
private ImageView iv_qr; | ||
|
||
@Override | ||
protected void onCreate(@Nullable Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_qrimage); | ||
iv_qr = (ImageView) findViewById(R.id.iv_qicode); | ||
Bitmap qrImg = QRCodeUtil.generateQRImage("liyi", DensityUtil.dp2px(this,400), DensityUtil.dp2px(this,400)); | ||
Bitmap qrLogo=QRCodeUtil.addLogo(qrImg, ImageUtil.drawable2Bitmap(this, R.drawable.img_isooqi_holder)); | ||
iv_qr.setImageBitmap(qrLogo); | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?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:gravity="center" | ||
android:background="#ffffff" | ||
android:orientation="vertical"> | ||
|
||
<ImageView | ||
android:id="@+id/iv_qicode" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" /> | ||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 5 additions & 1 deletion
6
...raphic/glide/transform/blur/FastBlur.java → ...i/sutils/utils/graphic/blur/FastBlur.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
sutils/src/main/java/com/liyi/sutils/utils/graphic/glide/CusGlideModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.liyi.sutils.utils.graphic.glide; | ||
|
||
import android.content.Context; | ||
|
||
import com.bumptech.glide.Glide; | ||
import com.bumptech.glide.GlideBuilder; | ||
import com.bumptech.glide.Registry; | ||
import com.bumptech.glide.annotation.GlideModule; | ||
import com.bumptech.glide.module.AppGlideModule; | ||
|
||
|
||
/** | ||
* 应用程序会使用和AppGlideMoudle同一个包下的GlideApp类 | ||
*/ | ||
@GlideModule | ||
public class CusGlideModule extends AppGlideModule { | ||
|
||
} |
38 changes: 0 additions & 38 deletions
38
sutils/src/main/java/com/liyi/sutils/utils/graphic/glide/DisplayOptions.java
This file was deleted.
Oops, something went wrong.
67 changes: 67 additions & 0 deletions
67
sutils/src/main/java/com/liyi/sutils/utils/graphic/glide/GlideManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package com.liyi.sutils.utils.graphic.glide; | ||
|
||
|
||
import android.app.Activity; | ||
import android.content.Context; | ||
import android.support.annotation.NonNull; | ||
import android.support.v4.app.FragmentActivity; | ||
import android.view.View; | ||
|
||
import com.liyi.sutils.utils.log.LogUtil; | ||
|
||
/** | ||
* glide的管理工具类 | ||
*/ | ||
public class GlideManager { | ||
|
||
public static GlideRequests getRequests(@NonNull Object obj) { | ||
GlideRequests requests = null; | ||
if (obj instanceof Activity) { | ||
requests = GlideApp.with((Activity) obj); | ||
} else if (obj instanceof FragmentActivity) { | ||
requests = GlideApp.with((FragmentActivity) obj); | ||
} else if (obj instanceof android.app.Fragment) { | ||
requests = GlideApp.with((android.app.Fragment) obj); | ||
} else if (obj instanceof android.support.v4.app.Fragment) { | ||
requests = GlideApp.with((android.support.v4.app.Fragment) obj); | ||
} else if (obj instanceof Context) { | ||
requests = GlideApp.with((Context) obj); | ||
} else if (obj instanceof View) { | ||
requests = GlideApp.with((View) obj); | ||
} else { | ||
LogUtil.e("GlideManager", "Glide中引入的上下文对象格式错误"); | ||
} | ||
return requests; | ||
} | ||
|
||
/** | ||
* 恢复请求,一般在停止滚动的时候 | ||
*/ | ||
public static void resumeRequests(Context context) { | ||
GlideApp.with(context).resumeRequests(); | ||
} | ||
|
||
/** | ||
* 暂停请求 正在滚动的时候 | ||
*/ | ||
public static void pauseRequests(Context context) { | ||
GlideApp.with(context).pauseRequests(); | ||
} | ||
|
||
/** | ||
* 清除磁盘缓存 | ||
* 注:需要在子线程中进行 | ||
*/ | ||
public static void clearDiskCache(final Context context) { | ||
// 清理磁盘缓存 需要在子线程中执行 | ||
GlideApp.get(context).clearDiskCache(); | ||
} | ||
|
||
/** | ||
* 清除内存缓存 | ||
*/ | ||
public static void clearMemory(Context context) { | ||
// 清理内存缓存 可以在UI主线程中进行 | ||
GlideApp.get(context).clearMemory(); | ||
} | ||
} |
Oops, something went wrong.