Skip to content

Commit

Permalink
version 1.5.0
Browse files Browse the repository at this point in the history
* load images with glide
* migrate to androidX
  • Loading branch information
abbasalim committed Feb 5, 2020
1 parent caed9c1 commit cdb3fc4
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 33 deletions.
12 changes: 7 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
compileSdkVersion 29
buildToolsVersion '29.0.2'

defaultConfig {
applicationId "com.dimorinny.sample"
minSdkVersion 15
targetSdkVersion 27
targetSdkVersion 29
versionCode 1
versionName "1.0"
}
Expand All @@ -29,6 +29,8 @@ dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.12'
implementation project(':library')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'


}
9 changes: 5 additions & 4 deletions app/src/main/java/ir/esfandune/sample/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
import android.Manifest;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Toast;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;

import com.esfandune.sample.R;

import java.io.File;
Expand Down
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@ subprojects {

buildscript {
repositories {
mavenCentral()
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
}

allprojects {
repositories {
mavenCentral()
jcenter()
google()
}
Expand Down
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# org.gradle.parallel=true
android.enableJetifier=true
android.useAndroidX=true
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Sep 10 18:39:45 IRDT 2018
#Wed Feb 05 11:37:31 IRST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
23 changes: 15 additions & 8 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ ext {
}

android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
compileSdkVersion 29
buildToolsVersion '29.0.2'

defaultConfig {
minSdkVersion 15
targetSdkVersion 27
versionCode 14
versionName "1.3"
targetSdkVersion 29
versionCode 15
versionName "1.5"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
Expand All @@ -48,9 +49,15 @@ dependencies {

// androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'

implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
implementation "androidx.fragment:fragment:1.2.0"


implementation 'com.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
}

apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
package ir.esfandune.filepickerDialog.ui;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.recyclerview.widget.RecyclerView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.nbsp.materialfilepicker.R;

import java.io.File;
import java.util.List;

import ir.esfandune.filepickerDialog.utils.FileTypeUtils;

import static ir.esfandune.filepickerDialog.utils.FileTypeUtils.FileType.IMAGE;

/**
* Created by Dimorinny on 24.10.15.
*/
Expand Down Expand Up @@ -59,10 +64,13 @@ public void onBindViewHolder(DirectoryViewHolder holder, int position) {
holder.mFileTitle.setText(R.string.back);
} else {
FileTypeUtils.FileType fileType = FileTypeUtils.getFileType(currentFile);
holder.mFileImage.setImageResource(fileType.getIcon());
holder.mFileSubtitle.setText(fileType.getDescription());
holder.mFileTitle.setText(currentFile.getName());

if (fileType == IMAGE)
Glide.with(holder.itemView).load(currentFile).apply(new RequestOptions().placeholder(fileType.getIcon())).into(holder.mFileImage);
else
holder.mFileImage.setImageResource(fileType.getIcon());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@
import android.content.Context;
import android.os.Bundle;
import android.os.Environment;
import android.support.annotation.Nullable;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AnimationUtils;
import android.view.animation.LayoutAnimationController;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.DialogFragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.nbsp.materialfilepicker.R;

import java.io.File;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package ir.esfandune.filepickerDialog.widget;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.View;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;

import ir.esfandune.filepickerDialog.ui.DirectoryAdapter;

public class EmptyRecyclerView extends RecyclerView {
Expand Down
4 changes: 2 additions & 2 deletions library/src/main/res/layout/item_file.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
android:layout_width="48dp"
android:layout_height="48dp"
android:src="@drawable/ic_folder_48dp"
android:layout_margin="16dp"
android:alpha="0.6"/>
android:layout_margin="16dp" />

<LinearLayout
android:orientation="vertical"
Expand All @@ -30,6 +29,7 @@
android:layout_height="wrap_content"
style="@style/TextAppearance.AppCompat.Medium"
android:textStyle="bold"
android:textColor="#000000"

android:ellipsize="marquee"
android:focusable="true"
Expand Down

0 comments on commit cdb3fc4

Please sign in to comment.