Skip to content

Commit

Permalink
Merge pull request #120 from TejNote/master
Browse files Browse the repository at this point in the history
glide 4.11.0 issue
  • Loading branch information
chinalwb authored Aug 23, 2020
2 parents dc64ff7 + c97d1c3 commit ddcf471
Show file tree
Hide file tree
Showing 48 changed files with 124 additions and 168 deletions.
12 changes: 5 additions & 7 deletions ARE/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 26
compileSdkVersion 29
defaultConfig {
applicationId "com.chinalwb.are.demo"
minSdkVersion 15
targetSdkVersion 26
targetSdkVersion 29
}

buildTypes {
Expand All @@ -19,11 +19,9 @@ android {
}

dependencies {
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:27.1.1'
// implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.2.0'
implementation project(':are')
implementation 'com.github.bumptech.glide:glide:4.9.0'
// implementation 'com.github.chinalwb:are:0.1.6'
implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
8 changes: 1 addition & 7 deletions ARE/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.chinalwb.are.demo"
android:versionCode="1"
android:versionName="1.0">

<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="21" />
package="com.chinalwb.are.demo">

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
Expand Down Expand Up @@ -217,6 +217,7 @@ public boolean onOptionsItemSelected(MenuItem item) {

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
mToolbar.onActivityResult(requestCode, resultCode, data);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;

import com.chinalwb.are.AREditor;
import com.chinalwb.are.strategies.VideoStrategy;
Expand Down Expand Up @@ -62,6 +58,7 @@ private void initView() {

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
this.arEditor.onActivityResult(requestCode, resultCode, data);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
Expand Down Expand Up @@ -56,6 +56,7 @@ private void initView() {

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
this.arEditor.onActivityResult(requestCode, resultCode, data);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
Expand Down Expand Up @@ -55,6 +55,7 @@ private void initView() {

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
this.arEditor.onActivityResult(requestCode, resultCode, data);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
Expand Down Expand Up @@ -72,6 +72,7 @@ public void onClick(View v) {

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
this.arEditor.onActivityResult(requestCode, resultCode, data);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
Expand Down Expand Up @@ -55,6 +55,7 @@ private void initView() {

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
this.arEditor.onActivityResult(requestCode, resultCode, data);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.chinalwb.are.demo

import android.content.Intent
import android.support.v7.app.AppCompatActivity
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.chinalwb.are.AREditor
import kotlinx.android.synthetic.main.activity_are__multi_instance.*
Expand All @@ -26,6 +26,8 @@ class ARE_MultiInstanceActivity : AppCompatActivity() {
}

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)

this.activeARE?.onActivityResult(requestCode, resultCode, data)
}
}
8 changes: 4 additions & 4 deletions ARE/app/src/main/java/com/chinalwb/are/demo/AtActivity.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.chinalwb.are.demo;

import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.view.View;

public class AtActivity extends AppCompatActivity {
Expand Down
2 changes: 1 addition & 1 deletion ARE/app/src/main/java/com/chinalwb/are/demo/DemoUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Environment;
import android.support.v4.app.ActivityCompat;
import androidx.core.app.ActivityCompat;

import com.chinalwb.are.styles.toolbar.ARE_Toolbar;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.chinalwb.are.demo;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

import com.chinalwb.are.glidesupport.GlideApp;
import com.bumptech.glide.Glide;

public class IndexActivity extends AppCompatActivity {

Expand All @@ -20,7 +20,7 @@ protected void onCreate(Bundle savedInstanceState) {

ImageView imageView = (ImageView) findViewById(R.id.image);

GlideApp.with(this).load("http://a.hiphotos.baidu.com/image/h%3D300/sign=b18b23079522720e64cee4fa4bca0a3a/4a36acaf2edda3ccc4a53e450ce93901213f9216.jpg").into(imageView);
Glide.with(this).load("http://a.hiphotos.baidu.com/image/h%3D300/sign=b18b23079522720e64cee4fa4bca0a3a/4a36acaf2edda3ccc4a53e450ce93901213f9216.jpg").into(imageView);
}

private void initViews() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
Expand Down Expand Up @@ -289,6 +289,7 @@ private int getLayoutId() {

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == REQ_WRITE_EXTERNAL_STORAGE) {
String html = this.arEditor.getHtml();
DemoUtil.saveHtml(this, html);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
package com.chinalwb.are.demo;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.chinalwb.are.render.AreTextView;
import com.chinalwb.are.spans.ARE_Clickable_Span;
import com.chinalwb.are.spans.AreAtSpan;
import com.chinalwb.are.spans.AreImageSpan;
import com.chinalwb.are.spans.AreVideoSpan;
import com.chinalwb.are.strategies.AreClickStrategy;

/**
* @author dlink
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
package com.chinalwb.are.demo.toolitems

import android.content.Context
import android.graphics.Bitmap
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Color.TRANSPARENT
import android.graphics.Paint
import android.text.style.ReplacementSpan
import com.bumptech.glide.load.engine.GlideException
import com.bumptech.glide.request.RequestListener
import com.bumptech.glide.request.RequestOptions
import com.chinalwb.are.glidesupport.GlideApp
import com.chinalwb.are.spans.ARE_Clickable_Span
import com.chinalwb.are.spans.ARE_Span

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ package com.chinalwb.are.demo.toolitems
import android.app.Activity
import android.graphics.Bitmap
import android.graphics.Color
import android.support.v7.app.AlertDialog
import androidx.appcompat.app.AlertDialog
import android.text.Editable
import android.text.Spanned
import android.text.TextUtils
import android.widget.EditText
import android.widget.ImageView
import com.bumptech.glide.Glide
import com.bumptech.glide.load.engine.GlideException
import com.bumptech.glide.request.RequestListener
import com.bumptech.glide.request.RequestOptions
import com.chinalwb.are.AREditText
import com.chinalwb.are.demo.R
import com.chinalwb.are.glidesupport.GlideApp
import com.chinalwb.are.styles.ARE_ABS_FreeStyle

class ARE_Style_Youtube(editText: AREditText, imageView: ImageView) : ARE_ABS_FreeStyle(editText.context) {
Expand Down Expand Up @@ -79,7 +79,7 @@ class ARE_Style_Youtube(editText: AREditText, imageView: ImageView) : ARE_ABS_Fr
editable.insert(start, title)
end = start + title.length
}
GlideApp.with(mImageView.context).asBitmap().load(com.chinalwb.are.demo.R.drawable.youtube)
Glide.with(mImageView.context).asBitmap().load(com.chinalwb.are.demo.R.drawable.youtube)
.apply(RequestOptions().override(50, 50))
.listener(object : RequestListener<Bitmap> {
override fun onLoadFailed(e: GlideException?, model: Any?, target: com.bumptech.glide.request.target.Target<Bitmap>?, isFirstResource: Boolean): Boolean {
Expand Down
4 changes: 2 additions & 2 deletions ARE/app/src/main/res/layout/activity_are__demo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
android:orientation="vertical"
android:background="#f8f8f8">

<android.support.design.widget.TabLayout
<com.google.android.material.tabs.TabLayout
android:id="@+id/tabLayout"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@android:color/white"
app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget"
app:tabMode="scrollable" />

<android.support.v4.view.ViewPager
<androidx.viewpager.widget.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
Expand Down
4 changes: 2 additions & 2 deletions ARE/app/src/main/res/layout/activity_are__multi_instance.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:are="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
Expand Down Expand Up @@ -116,4 +116,4 @@

</LinearLayout>

</android.support.v4.widget.NestedScrollView>
</androidx.core.widget.NestedScrollView>
12 changes: 6 additions & 6 deletions ARE/app/src/main/res/layout/activity_at.xml
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".AtActivity">

<android.support.design.widget.AppBarLayout
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">

<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />

</android.support.design.widget.AppBarLayout>
</com.google.android.material.appbar.AppBarLayout>

<include layout="@layout/content_at" />

<android.support.design.widget.FloatingActionButton
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
app:srcCompat="@android:drawable/ic_dialog_email" />

</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
Loading

0 comments on commit ddcf471

Please sign in to comment.